diff --git a/src/store/getters.js b/src/store/getters.js index 4c4263c5a..f095f6bc6 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -7,6 +7,7 @@ const getters = { consoleOrgs: state => state.users.consoleOrgs, auditOrgs: state => state.users.auditOrgs, workbenchOrgs: state => state.users.workbenchOrgs, + notRootWorkbenchOrgs: state => state.users.notRootWorkbenchOrgs, usingOrgs: state => state.users.usingOrgs, currentOrg: state => state.users.currentOrg, currentOrgIsDefault: state => state.users.currentOrg['is_default'], diff --git a/src/store/modules/users.js b/src/store/modules/users.js index ac764789a..3878a3e32 100644 --- a/src/store/modules/users.js +++ b/src/store/modules/users.js @@ -17,6 +17,7 @@ const getDefaultState = () => { auditOrgs: [], consoleOrgs: [], workbenchOrgs: [], + notRootWorkbenchOrgs: [], usingOrgs: [], perms: [], MFAVerifyAt: null, @@ -42,6 +43,9 @@ const mutations = { state.perms = profile.perms state.consoleOrgs = profile['console_orgs'] state.workbenchOrgs = profile['workbench_orgs'] + state.notRootWorkbenchOrgs = profile['workbench_orgs'].filter(item => { + return item.id !== '00000000-0000-0000-0000-000000000000' + }) state.auditOrgs = profile['audit_orgs'] state.currentOrg = getCurrentOrgLocal(profile.username) }, diff --git a/src/views/tickets/RequestApplicationPerm/CreateUpdate.vue b/src/views/tickets/RequestApplicationPerm/CreateUpdate.vue index ac0d829f8..6e95ba83d 100644 --- a/src/views/tickets/RequestApplicationPerm/CreateUpdate.vue +++ b/src/views/tickets/RequestApplicationPerm/CreateUpdate.vue @@ -127,9 +127,7 @@ export default { component: Select2, el: { multiple: false, - options: this.$store.state.users.workbenchOrgs.filter(item => { - return item.id !== '00000000-0000-0000-0000-000000000000' - })?.map((item) => { + options: this.$store.state.users.notRootWorkbenchOrgs?.map((item) => { return { label: item.name, value: item.id } }) }, @@ -163,9 +161,7 @@ export default { }, computed: { ...mapState({ - workbenchOrgs: state => state.users.workbenchOrgs.filter(item => { - return item.id !== '00000000-0000-0000-0000-000000000000' - }) + workbenchOrgs: state => state.users.notRootWorkbenchOrgs }), ...mapGetters(['currentOrg']) }, diff --git a/src/views/tickets/RequestAssetPerm/CreateUpdate.vue b/src/views/tickets/RequestAssetPerm/CreateUpdate.vue index d44e1320c..e50244dc4 100644 --- a/src/views/tickets/RequestAssetPerm/CreateUpdate.vue +++ b/src/views/tickets/RequestAssetPerm/CreateUpdate.vue @@ -105,9 +105,7 @@ export default { component: Select2, el: { multiple: false, - options: this.$store.state.users.workbenchOrgs.filter(item => { - return item.id !== '00000000-0000-0000-0000-000000000000' - })?.map((item) => { + options: this.$store.state.users.notRootWorkbenchOrgs?.map((item) => { return { label: item.name, value: item.id } }) }, @@ -137,9 +135,7 @@ export default { }, computed: { ...mapState({ - workbenchOrgs: state => state.users.workbenchOrgs.filter(item => { - return item.id !== '00000000-0000-0000-0000-000000000000' - }) + workbenchOrgs: state => state.users.notRootWorkbenchOrgs }), ...mapGetters(['currentOrg']) },