mirror of
https://github.com/Lissy93/dashy.git
synced 2024-11-27 00:28:09 +03:00
🐛 Strips out sections[n].filteredItems (#1361)
This commit is contained in:
parent
5b2c0e970f
commit
f5789a3a25
@ -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: {
|
||||
|
@ -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];
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user