From 97ebb7c191f36d6e8723c7b64b72e5f69b589d96 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 10 Feb 2020 20:24:50 +0000 Subject: [PATCH] --- ayanova/src/api/enums.js | 93 +++++++++++++++++++++++++++++++++++++++- ayanova/src/store.js | 2 +- 2 files changed, 93 insertions(+), 2 deletions(-) diff --git a/ayanova/src/api/enums.js b/ayanova/src/api/enums.js index 5f65afd9..69d30331 100644 --- a/ayanova/src/api/enums.js +++ b/ayanova/src/api/enums.js @@ -17,6 +17,7 @@ //big object so maybe it's own thing, not part of locale at all or locale fronts for it?? */ export default { + //enums.AuthorizationRoles[0] getEnumDisplay(enumKey, enumValue) { // debugger; enumKey = enumKey.toLowerCase(); @@ -43,7 +44,24 @@ export default { await that.fetch(enumKey).then(res => { //massage the data as necessary debugger; - console.log(res); + // console.log(res); + /** + Turn this: [ + { + "id": 0, + "name": "No role" + }, + { + "id": 1, + "name": "Business administration - limited" + }, + + Into this: + {0:"No role",1:"Business..."} + + + */ + //stuff the data into the store // window.$gz.store.commit("setEnum", item); return window.$gz.store.state.enums[enumKey]; @@ -63,3 +81,76 @@ export default { }); } }; +/** + * + * /** */ + { + "id": 2, + "name": "Business administration - full" + }, + { + "id": 4, + "name": "Dispatch - limited" + }, + { + "id": 8, + "name": "Dispatch - full" + }, + { + "id": 16, + "name": "Inventory - limited" + }, + { + "id": 32, + "name": "Inventory - full" + }, + { + "id": 64, + "name": "Accounting" + }, + { + "id": 128, + "name": "Service technician - limited" + }, + { + "id": 256, + "name": "Service technician - full" + }, + { + "id": 512, + "name": "Subcontractor - limited" + }, + { + "id": 1024, + "name": "Subcontractor - full" + }, + { + "id": 2048, + "name": "Customer user - limited" + }, + { + "id": 4096, + "name": "Customer user - full" + }, + { + "id": 8192, + "name": "System operations - limited" + }, + { + "id": 16384, + "name": "System operations - full" + }, + { + "id": 65536, + "name": "Sales - limited" + }, + { + "id": 32768, + "name": "Sales - full" + }, + { + "id": 131071, + "name": "All roles" + } +] + */ \ No newline at end of file diff --git a/ayanova/src/store.js b/ayanova/src/store.js index 969e7242..51f15c41 100644 --- a/ayanova/src/store.js +++ b/ayanova/src/store.js @@ -20,7 +20,7 @@ export default new Vuex.Store({ userType: 0, homePage: undefined, localeText: {}, - enums: {}, //all enum values with localized text to match stored as key e.g. enums:{AuthorizationRoles:[{0:"no role"},{1:"Limited role"}],UserTypes:[{0:"Technician"},{1:"Client user"}]} + enums: {}, //all enum values with localized text to match stored as key e.g. enums:={AuthorizationRoles:{0:"no role",1:"Limited role"},UserTypes:{0:"Technician",1:"Client user"}} locale: { languageOverride: "en-US", timeZoneOverride: "America/New_York",