Skip to content

Commit f5789a3

Browse files
committed
🐛 Strips out sections[n].filteredItems (#1361)
1 parent 5b2c0e9 commit f5789a3

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/components/Configuration/JsonEditor.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ export default {
115115
},
116116
},
117117
mounted() {
118-
this.jsonData = this.config;
118+
const jsonData = { ...this.config };
119+
jsonData.sections = jsonData.sections.map(({ filteredItems, ...section }) => section);
120+
this.jsonData = jsonData;
119121
if (!this.allowWriteToDisk) this.saveMode = 'local';
120122
},
121123
methods: {

src/components/InteractiveEditor/EditAppConfig.vue

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ export default {
9494
const raw = rawAppConfig;
9595
const isEmptyObject = (obj) => (typeof obj === 'object' && Object.keys(obj).length === 0);
9696
const isEmpty = (value) => (value === undefined || isEmptyObject(value));
97+
9798
// Delete empty values
9899
Object.keys(raw).forEach(key => {
99100
if (isEmpty(raw[key])) delete raw[key];

src/mixins/ConfigSaving.js

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export default {
2424
const isSubPag = !!this.$store.state.currentConfigInfo;
2525
const jsonConfig = config;
2626
if (isSubPag) delete jsonConfig.appConfig;
27+
jsonConfig.sections = jsonConfig.sections.map(({ filteredItems, ...section }) => section);
28+
2729
// 2. Convert JSON into YAML
2830
const yamlOptions = {};
2931
const strjsonConfig = JSON.stringify(jsonConfig);

0 commit comments

Comments
 (0)