Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

πŸ› Strips out sections[n].filteredItems (#1361)

Alicia Sykesf5789a3a25db
diff --git a/src/components/Configuration/JsonEditor.vue b/src/components/Configuration/JsonEditor.vue
index 8c5cfbf7..65c21556 100644
--- a/src/components/Configuration/JsonEditor.vue
+++ b/src/components/Configuration/JsonEditor.vue
@@ -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: {
diff --git a/src/components/InteractiveEditor/EditAppConfig.vue b/src/components/InteractiveEditor/EditAppConfig.vue
index 74f424b7..d9cc08b9 100644
--- a/src/components/InteractiveEditor/EditAppConfig.vue
+++ b/src/components/InteractiveEditor/EditAppConfig.vue
@@ -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];
diff --git a/src/mixins/ConfigSaving.js b/src/mixins/ConfigSaving.js
index 968624a6..50c41fac 100644
--- a/src/mixins/ConfigSaving.js
+++ b/src/mixins/ConfigSaving.js
@@ -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);