MT#56307 PBX settings visible only if clir_intrapbx is enabled

The section should be visible if one of the following feature
are enabled in the profile:
 * clir_intrapbx
 * auto attendant
 * call queue
 * manager secretary

Additionally proper configure visibility of each above submenu
using profile information

Change-Id: Ibfb0446e4527913e32d00169be54dcb6a62e8b64
pull/20/head
Marco Capetta 2 years ago
parent d77283268c
commit 286721319f

@ -196,31 +196,31 @@ export default {
{ {
icon: 'settings', icon: 'settings',
label: this.$t('PBX Settings'), label: this.$t('PBX Settings'),
visible: this.isPbxEnabled && this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.pbxSettings), visible: this.isPbxEnabled && this.hasSubscriberProfileAttributes(PROFILE_ATTRIBUTES_MAP.pbxSettings),
children: [ children: [
{ {
to: '/user/pbx-settings/general', to: '/user/pbx-settings/general',
icon: 'settings', icon: 'settings',
label: this.$t('General'), label: this.$t('General'),
visible: true visible: this.isPbxEnabled && this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.clir_intrapbx)
}, },
{ {
to: '/user/pbx-settings/call-queues', to: '/user/pbx-settings/call-queues',
icon: 'filter_none', icon: 'filter_none',
label: this.$t('Call Queues'), label: this.$t('Call Queues'),
visible: true visible: this.isPbxEnabled && this.hasSubscriberProfileAttributes(PROFILE_ATTRIBUTES_MAP.pbxSettingsCallQueue)
}, },
{ {
to: '/user/pbx-settings/ms-configs', to: '/user/pbx-settings/ms-configs',
icon: 'arrow_forward', icon: 'arrow_forward',
label: this.$t('Manager Secretary'), label: this.$t('Manager Secretary'),
visible: true visible: this.isPbxEnabled && this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.manager_secretary)
}, },
{ {
to: '/user/pbx-settings/auto-attendant', to: '/user/pbx-settings/auto-attendant',
icon: 'dialpad', icon: 'dialpad',
label: this.$t('Auto-attendant'), label: this.$t('Auto-attendant'),
visible: true visible: this.isPbxEnabled && this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.auto_attendant)
} }
] ]
}, },

@ -12,12 +12,16 @@ export const PROFILE_ATTRIBUTE_MAP = {
voiceMail: 'voice_mail', voiceMail: 'voice_mail',
callBlockingPrivacy: 'clir', callBlockingPrivacy: 'clir',
faxServer: 'fax_server', faxServer: 'fax_server',
pbxSettings: 'clir_intrapbx', cscCalls: 'csc_calls',
cscCalls: 'csc_calls' clir_intrapbx: 'clir_intrapbx',
manager_secretary: 'manager_secretary',
auto_attendant: 'auto_attendant'
} }
export const PROFILE_ATTRIBUTES_MAP = { export const PROFILE_ATTRIBUTES_MAP = {
callBlockingIncoming: ['block_in_clir', 'block_in_mode', 'block_in_list'], callBlockingIncoming: ['block_in_clir', 'block_in_mode', 'block_in_list'],
callBlockingOutgoing: ['block_out_mode', 'block_out_list'], callBlockingOutgoing: ['block_out_mode', 'block_out_list'],
callSettings: ['music_on_hold', 'language'] callSettings: ['music_on_hold', 'language'],
pbxSettings: ['clir_intrapbx', 'auto_attendant', 'cloud_pbx_callqueue', 'max_queue_length', 'queue_wrap_up_time', 'manager_secretary'],
pbxSettingsCallQueue: ['cloud_pbx_callqueue', 'max_queue_length', 'queue_wrap_up_time']
} }

@ -343,7 +343,7 @@ export default function routes (app) {
get subtitle () { get subtitle () {
return i18n.t('Set your PBX settings') return i18n.t('Set your PBX settings')
}, },
profileAttribute: PROFILE_ATTRIBUTE_MAP.pbxSettings profileAttributes: PROFILE_ATTRIBUTE_MAP.clir_intrapbx
} }
}, },
{ {
@ -355,7 +355,8 @@ export default function routes (app) {
}, },
get subtitle () { get subtitle () {
return i18n.t('Call Queues') return i18n.t('Call Queues')
} },
profileAttributes: PROFILE_ATTRIBUTES_MAP.pbxSettingsCallQueue
} }
}, },
{ {
@ -367,7 +368,8 @@ export default function routes (app) {
}, },
get subtitle () { get subtitle () {
return i18n.t('Manager Secretary') return i18n.t('Manager Secretary')
} },
profileAttribute: PROFILE_ATTRIBUTE_MAP.manager_secretary
} }
}, },
{ {
@ -379,7 +381,8 @@ export default function routes (app) {
}, },
get subtitle () { get subtitle () {
return i18n.t('Auto-attendant') return i18n.t('Auto-attendant')
} },
profileAttribute: PROFILE_ATTRIBUTE_MAP.auto_attendant
} }
}, },
{ {

Loading…
Cancel
Save