diff --git a/src/components/InteractiveEditor/EditAppConfig.vue b/src/components/InteractiveEditor/EditAppConfig.vue new file mode 100644 index 00000000..91e9dbb4 --- /dev/null +++ b/src/components/InteractiveEditor/EditAppConfig.vue @@ -0,0 +1,134 @@ + + + + {{ $t('interactive-editor.edit-app-config-btn') }} + + Proceed with Caution + The following options are for advanded app configration. + If you are unsure about any of the fields, please reference the + documentation + to avoid unintended consequences. + + + {{ $t('interactive-editor.save-stage-btn') }} + + + + + {{ $t('interactive-editor.save-stage-btn') }} + + + + + + + + + diff --git a/src/components/InteractiveEditor/EditModeSaveMenu.vue b/src/components/InteractiveEditor/EditModeSaveMenu.vue index 8d031846..4e53cd0c 100644 --- a/src/components/InteractiveEditor/EditModeSaveMenu.vue +++ b/src/components/InteractiveEditor/EditModeSaveMenu.vue @@ -55,6 +55,7 @@ {{ $t('interactive-editor.edit-app-config-btn') }} @@ -63,6 +64,7 @@ + @@ -71,6 +73,7 @@ import Button from '@/components/FormElements/Button'; import StoreKeys from '@/utils/StoreMutations'; import { modalNames } from '@/utils/defaults'; import EditPageInfo from '@/components/InteractiveEditor/EditPageInfo'; +import EditAppConfig from '@/components/InteractiveEditor/EditAppConfig'; import SaveLocallyIcon from '@/assets/interface-icons/interactive-editor-save-locally.svg'; import SaveToDiskIcon from '@/assets/interface-icons/interactive-editor-save-disk.svg'; @@ -90,15 +93,13 @@ export default { CancelIcon, AppConfigIcon, PageInfoIcon, + EditAppConfig, }, methods: { reset() { this.$store.dispatch(StoreKeys.INITIALIZE_CONFIG); this.$store.commit(StoreKeys.SET_EDIT_MODE, false); }, - tooltip(content) { - return { content, trigger: 'hover focus', delay: 250 }; - }, openExportConfigMenu() { this.$modal.show(modalNames.EXPORT_CONFIG_MENU); this.$store.commit(StoreKeys.SET_MODAL_OPEN, true); @@ -107,6 +108,13 @@ export default { this.$modal.show(modalNames.EDIT_PAGE_INFO); this.$store.commit(StoreKeys.SET_MODAL_OPEN, true); }, + openEditAppConfig() { + this.$modal.show(modalNames.EDIT_APP_CONFIG); + this.$store.commit(StoreKeys.SET_MODAL_OPEN, true); + }, + tooltip(content) { + return { content, trigger: 'hover focus', delay: 250 }; + }, }, }; diff --git a/src/components/Settings/LanguageSwitcher.vue b/src/components/Settings/LanguageSwitcher.vue index 7705cef0..d9b18097 100644 --- a/src/components/Settings/LanguageSwitcher.vue +++ b/src/components/Settings/LanguageSwitcher.vue @@ -56,7 +56,7 @@ export default { /* The ISO code for the users language, synced with VueX store */ savedLanguage: { get() { - return this.getIsoFromLangObj(this.$store.state.lang); + return this.getIsoFromLangObj(this.$store.getters.appConfig.lang); }, set(newLang) { this.$store.commit(Keys.SET_LANGUAGE, newLang.code); diff --git a/src/store.js b/src/store.js index 51951d6d..c99d9da9 100644 --- a/src/store.js +++ b/src/store.js @@ -16,12 +16,12 @@ const { UPDATE_ITEM, SET_EDIT_MODE, UPDATE_PAGE_INFO, + UPDATE_APP_CONFIG, } = Keys; const store = new Vuex.Store({ state: { config: {}, - lang: '', // The users language, auto-detected or read from local storage / config editMode: false, // While true, the user can drag and edit items + sections modalOpen: false, // KB shortcut functionality will be disabled when modal is open }, @@ -58,7 +58,9 @@ const store = new Vuex.Store({ state.config = config; }, [SET_LANGUAGE](state, lang) { - state.lang = lang; + const newConfig = state.config; + newConfig.appConfig.language = lang; + state.config = newConfig; }, [SET_MODAL_OPEN](state, modalOpen) { state.modalOpen = modalOpen; @@ -83,6 +85,11 @@ const store = new Vuex.Store({ newConfig.pageInfo = newPageInfo; state.config = newConfig; }, + [UPDATE_APP_CONFIG](state, newAppConfig) { + const newConfig = state.config; + newConfig.appConfig = newAppConfig; + state.config = newConfig; + }, }, actions: { /* Called when app first loaded. Reads config and sets state */ diff --git a/src/utils/StoreMutations.js b/src/utils/StoreMutations.js index 50c017d9..9cb70861 100644 --- a/src/utils/StoreMutations.js +++ b/src/utils/StoreMutations.js @@ -7,6 +7,7 @@ const KEY_NAMES = [ 'SET_EDIT_MODE', 'UPDATE_ITEM', 'UPDATE_PAGE_INFO', + 'UPDATE_APP_CONFIG', ]; // Convert array of key names into an object, and export
Proceed with Caution