Implements UI editor form for appConfig

This commit is contained in:
Alicia Sykes
2021-10-23 19:28:08 +01:00
parent e6f3cae63d
commit 89737ffa5d
5 changed files with 156 additions and 6 deletions

View File

@@ -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 */