From c9c3c0bc0f0683d396d94293966625e6bedde978 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 7 Nov 2021 21:07:12 +0000 Subject: [PATCH] :loud_sound: Updates log headings for json editor --- src/components/Configuration/JsonEditor.vue | 8 ++++---- src/utils/ErrorHandler.js | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/Configuration/JsonEditor.vue b/src/components/Configuration/JsonEditor.vue index 4e315b7c..1ec4cfd6 100644 --- a/src/components/Configuration/JsonEditor.vue +++ b/src/components/Configuration/JsonEditor.vue @@ -54,7 +54,7 @@ import axios from 'axios'; import ProgressBar from 'rsup-progress'; import VJsoneditor from 'v-jsoneditor'; import jsYaml from 'js-yaml'; -import ErrorHandler, { InfoHandler } from '@/utils/ErrorHandler'; +import ErrorHandler, { InfoHandler, InfoKeys } from '@/utils/ErrorHandler'; import configSchema from '@/utils/ConfigSchema.json'; import StoreKeys from '@/utils/StoreMutations'; import { localStorageKeys, serviceEndpoints, modalNames } from '@/utils/defaults'; @@ -122,7 +122,7 @@ export default { }, /* Applies changes to the local state, begins edit mode and closes modal */ startPreview() { - InfoHandler('Applying changes to local state...', 'Config Update'); + InfoHandler('Applying changes to local state...', InfoKeys.RAW_EDITOR); const data = this.jsonData; this.$store.commit(StoreKeys.SET_APP_CONFIG, data.appConfig); this.$store.commit(StoreKeys.SET_PAGE_INFO, data.pageInfo); @@ -152,7 +152,7 @@ export default { } else { this.showToast(this.$t('config-editor.error-msg-cannot-save'), false); } - InfoHandler('Config has been written to disk succesfully', 'Config Update'); + InfoHandler('Config has been written to disk succesfully', InfoKeys.RAW_EDITOR); this.$store.commit(StoreKeys.SET_CONFIG, this.jsonData); this.progress.end(); }) @@ -180,7 +180,7 @@ export default { if (data.appConfig.theme) { localStorage.setItem(localStorageKeys.THEME, data.appConfig.theme); } - InfoHandler('Config has succesfully been saved in browser storage', 'Config Update'); + InfoHandler('Config has succesfully been saved in browser storage', InfoKeys.RAW_EDITOR); this.showToast(this.$t('config-editor.success-msg-local'), true); }, /* Clears config from browser storage, only removing relevant items */ diff --git a/src/utils/ErrorHandler.js b/src/utils/ErrorHandler.js index a0624fab..e690e79a 100644 --- a/src/utils/ErrorHandler.js +++ b/src/utils/ErrorHandler.js @@ -41,6 +41,7 @@ export const WarningInfoHandler = (msg, title, log) => { /* Titles for info logging */ export const InfoKeys = { EDITOR: 'Interactive Editor', + RAW_EDITOR: 'Raw Config Editor', VISUAL: 'Layout & Styles', };