Adds store value to determine which view being edited

This commit is contained in:
Alicia Sykes 2022-04-24 16:05:05 +01:00
parent 7706041d61
commit dd49ad77a5
2 changed files with 7 additions and 1 deletions

View File

@ -18,6 +18,7 @@ const {
INITIALIZE_MULTI_PAGE_CONFIG,
SET_CONFIG,
SET_REMOTE_CONFIG,
SET_CURRENT_SUB_PAGE,
SET_MODAL_OPEN,
SET_LANGUAGE,
SET_ITEM_LAYOUT,
@ -42,10 +43,11 @@ const {
const store = new Vuex.Store({
state: {
config: {},
config: {}, // The current config, rendered to the UI
remoteConfig: {}, // The configuration stored on the server
editMode: false, // While true, the user can drag and edit items + sections
modalOpen: false, // KB shortcut functionality will be disabled when modal is open
currentConfigInfo: undefined, // For multi-page support, will store info about config file
navigateConfToTab: undefined, // Used to switch active tab in config modal
},
getters: {
@ -280,6 +282,9 @@ const store = new Vuex.Store({
[CONF_MENU_INDEX](state, index) {
state.navigateConfToTab = index;
},
[SET_CURRENT_SUB_PAGE](state, subPageObject) {
state.currentConfigInfo = subPageObject;
},
[USE_MAIN_CONFIG](state) {
if (state.remoteConfig) {
state.config = state.remoteConfig;

View File

@ -4,6 +4,7 @@ const KEY_NAMES = [
'INITIALIZE_MULTI_PAGE_CONFIG',
'SET_CONFIG',
'SET_REMOTE_CONFIG',
'SET_CURRENT_SUB_PAGE',
'SET_MODAL_OPEN',
'SET_LANGUAGE',
'SET_EDIT_MODE',