From 45d9967f249d25f6847b7504d82f1ec9375235f6 Mon Sep 17 00:00:00 2001 From: Marco Capetta Date: Thu, 2 Mar 2023 18:16:27 +0100 Subject: [PATCH] MT#56403 Add new internal preferences to show/hide CSC menus Preferences imported to be used as selectors: * contract_sound_set * record_call Totally new ad hoc preferences: * csc_registered_devices * csc_conversations * csc_device_provisioning * csc_hunt_groups Change-Id: I90686e8874fc0c95f0929481f53680dffe0d7cee --- src/components/CscMainMenuTop.vue | 12 ++++++------ src/constants.js | 8 +++++++- src/pages/CscPageDashboard.vue | 18 +++++++++++++++++- src/router/routes.js | 18 ++++++++++++------ 4 files changed, 42 insertions(+), 14 deletions(-) diff --git a/src/components/CscMainMenuTop.vue b/src/components/CscMainMenuTop.vue index 55410127..22bf6742 100644 --- a/src/components/CscMainMenuTop.vue +++ b/src/components/CscMainMenuTop.vue @@ -74,7 +74,7 @@ export default { icon: 'question_answer', label: this.$t('Conversations'), sublabel: this.$t('Calls, Faxes, VoiceMails'), - visible: true + visible: this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.conversations) }, { icon: 'settings_phone', @@ -133,7 +133,7 @@ export default { to: '/user/recordings', icon: 'play_circle', label: this.$t('Recordings'), - visible: true + visible: this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.recordings) } ] }, @@ -159,13 +159,13 @@ export default { to: '/user/pbx-configuration/groups', icon: 'group', label: this.$t('Groups'), - visible: true + visible: this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.huntGroups) }, { to: '/user/pbx-configuration/devices', icon: 'fas fa-fax', label: this.$t('Devices'), - visible: true + visible: this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.deviceProvisioning) }, { to: '/user/pbx-configuration/call-queues', @@ -177,7 +177,7 @@ export default { to: '/user/pbx-configuration/sound-sets', icon: 'queue_music', label: this.$t('Sound Sets'), - visible: true + visible: this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.soundSet) }, { to: '/user/pbx-configuration/ms-configs', @@ -228,7 +228,7 @@ export default { to: '/user/registered-devices', icon: 'devices', label: this.$t('Registered Devices'), - visible: true + visible: this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.registeredDevices) }, { to: '/customer/' + this.getCustomerId + '/details', diff --git a/src/constants.js b/src/constants.js index 4c2947f3..3a43238b 100644 --- a/src/constants.js +++ b/src/constants.js @@ -15,7 +15,13 @@ export const PROFILE_ATTRIBUTE_MAP = { cscCalls: 'csc_calls', clir_intrapbx: 'clir_intrapbx', manager_secretary: 'manager_secretary', - auto_attendant: 'auto_attendant' + auto_attendant: 'auto_attendant', + soundSet: 'contract_sound_set', + deviceProvisioning: 'csc_device_provisioning', + conversations: 'csc_conversations', + registeredDevices: 'csc_registered_devices', + recordings: 'record_call', + huntGroups: 'csc_hunt_groups' } export const PROFILE_ATTRIBUTES_MAP = { diff --git a/src/pages/CscPageDashboard.vue b/src/pages/CscPageDashboard.vue index 7542d83d..70a3f70e 100644 --- a/src/pages/CscPageDashboard.vue +++ b/src/pages/CscPageDashboard.vue @@ -4,6 +4,7 @@ class="row justify-center" >