Skip to content

Commit

Permalink
🐛 Strips out sections[n].filteredItems (#1361)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lissy93 committed Feb 27, 2024
1 parent 5b2c0e9 commit f5789a3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Configuration/JsonEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ export default {
},
},
mounted() {
this.jsonData = this.config;
const jsonData = { ...this.config };
jsonData.sections = jsonData.sections.map(({ filteredItems, ...section }) => section);
this.jsonData = jsonData;
if (!this.allowWriteToDisk) this.saveMode = 'local';
},
methods: {
Expand Down
1 change: 1 addition & 0 deletions src/components/InteractiveEditor/EditAppConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export default {
const raw = rawAppConfig;
const isEmptyObject = (obj) => (typeof obj === 'object' && Object.keys(obj).length === 0);
const isEmpty = (value) => (value === undefined || isEmptyObject(value));
// Delete empty values
Object.keys(raw).forEach(key => {
if (isEmpty(raw[key])) delete raw[key];
Expand Down
2 changes: 2 additions & 0 deletions src/mixins/ConfigSaving.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export default {
const isSubPag = !!this.$store.state.currentConfigInfo;
const jsonConfig = config;
if (isSubPag) delete jsonConfig.appConfig;
jsonConfig.sections = jsonConfig.sections.map(({ filteredItems, ...section }) => section);

// 2. Convert JSON into YAML
const yamlOptions = {};
const strjsonConfig = JSON.stringify(jsonConfig);
Expand Down

1 comment on commit f5789a3

@CrazyWolf13
Copy link
Collaborator

@CrazyWolf13 CrazyWolf13 commented on f5789a3 Feb 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! ❤️
Wanted to add this as well, but coulnd't get it working realiably.

Please sign in to comment.