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
pull/27/merge
Marco Capetta 3 years ago
parent f30a83023d
commit 45d9967f24

@ -74,7 +74,7 @@ export default {
icon: 'question_answer', icon: 'question_answer',
label: this.$t('Conversations'), label: this.$t('Conversations'),
sublabel: this.$t('Calls, Faxes, VoiceMails'), sublabel: this.$t('Calls, Faxes, VoiceMails'),
visible: true visible: this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.conversations)
}, },
{ {
icon: 'settings_phone', icon: 'settings_phone',
@ -133,7 +133,7 @@ export default {
to: '/user/recordings', to: '/user/recordings',
icon: 'play_circle', icon: 'play_circle',
label: this.$t('Recordings'), label: this.$t('Recordings'),
visible: true visible: this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.recordings)
} }
] ]
}, },
@ -159,13 +159,13 @@ export default {
to: '/user/pbx-configuration/groups', to: '/user/pbx-configuration/groups',
icon: 'group', icon: 'group',
label: this.$t('Groups'), label: this.$t('Groups'),
visible: true visible: this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.huntGroups)
}, },
{ {
to: '/user/pbx-configuration/devices', to: '/user/pbx-configuration/devices',
icon: 'fas fa-fax', icon: 'fas fa-fax',
label: this.$t('Devices'), label: this.$t('Devices'),
visible: true visible: this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.deviceProvisioning)
}, },
{ {
to: '/user/pbx-configuration/call-queues', to: '/user/pbx-configuration/call-queues',
@ -177,7 +177,7 @@ export default {
to: '/user/pbx-configuration/sound-sets', to: '/user/pbx-configuration/sound-sets',
icon: 'queue_music', icon: 'queue_music',
label: this.$t('Sound Sets'), label: this.$t('Sound Sets'),
visible: true visible: this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.soundSet)
}, },
{ {
to: '/user/pbx-configuration/ms-configs', to: '/user/pbx-configuration/ms-configs',
@ -228,7 +228,7 @@ export default {
to: '/user/registered-devices', to: '/user/registered-devices',
icon: 'devices', icon: 'devices',
label: this.$t('Registered Devices'), label: this.$t('Registered Devices'),
visible: true visible: this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.registeredDevices)
}, },
{ {
to: '/customer/' + this.getCustomerId + '/details', to: '/customer/' + this.getCustomerId + '/details',

@ -15,7 +15,13 @@ export const PROFILE_ATTRIBUTE_MAP = {
cscCalls: 'csc_calls', cscCalls: 'csc_calls',
clir_intrapbx: 'clir_intrapbx', clir_intrapbx: 'clir_intrapbx',
manager_secretary: 'manager_secretary', 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 = { export const PROFILE_ATTRIBUTES_MAP = {

@ -4,6 +4,7 @@
class="row justify-center" class="row justify-center"
> >
<csc-card-dashboard <csc-card-dashboard
v-if= "showConvList"
:title="$t('Voicebox Messages')" :title="$t('Voicebox Messages')"
:count="voicemailsCount" :count="voicemailsCount"
:count-title="$t('Messages')" :count-title="$t('Messages')"
@ -17,6 +18,7 @@
@action="downloadVoicemail" @action="downloadVoicemail"
/> />
<csc-card-dashboard <csc-card-dashboard
v-if= "showConvList"
:title="$t('Call List')" :title="$t('Call List')"
:count="callsCount" :count="callsCount"
:count-title="$t('Calls')" :count-title="$t('Calls')"
@ -39,6 +41,7 @@
</template> </template>
</csc-card-dashboard> </csc-card-dashboard>
<csc-card-dashboard <csc-card-dashboard
v-if= "showRegDevices"
:title="$t('Registered Devices')" :title="$t('Registered Devices')"
:count="registeredDevicesCount" :count="registeredDevicesCount"
:count-title="$t('Registered Devices')" :count-title="$t('Registered Devices')"
@ -61,6 +64,9 @@ import { mapWaitingActions } from 'vue-wait'
import { import {
showGlobalError showGlobalError
} from 'src/helpers/ui' } from 'src/helpers/ui'
import {
mapGetters
} from 'vuex'
import { import {
date date
} from 'quasar' } from 'quasar'
@ -70,6 +76,7 @@ import {
callIcon callIcon
} from 'src/helpers/call-utils' } from 'src/helpers/call-utils'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import { PROFILE_ATTRIBUTE_MAP } from 'src/constants'
export default { export default {
name: 'CscPageDashboard', name: 'CscPageDashboard',
components: { components: {
@ -93,7 +100,16 @@ export default {
computed: { computed: {
...mapState('call', [ ...mapState('call', [
'callEnabled' 'callEnabled'
]) ]),
...mapGetters('user', [
'hasSubscriberProfileAttribute'
]),
showConvList () {
return this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.conversations)
},
showRegDevices () {
return this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.registeredDevices)
},
}, },
watch: { watch: {
async callEnabled () { async callEnabled () {

@ -78,7 +78,8 @@ export default function routes (app) {
}, },
get subtitle () { get subtitle () {
return i18n.t('Calls, Faxes, VoiceMails') return i18n.t('Calls, Faxes, VoiceMails')
} },
profileAttribute: PROFILE_ATTRIBUTE_MAP.conversations
} }
}, },
{ {
@ -138,7 +139,8 @@ export default function routes (app) {
}, },
get subtitle () { get subtitle () {
return i18n.t('Call recordings') return i18n.t('Call recordings')
} },
profileAttribute: PROFILE_ATTRIBUTE_MAP.recordings
} }
}, },
{ {
@ -176,7 +178,8 @@ export default function routes (app) {
}, },
get subtitle () { get subtitle () {
return i18n.t('Groups') return i18n.t('Groups')
} },
profileAttribute: PROFILE_ATTRIBUTE_MAP.huntGroups
} }
}, },
{ {
@ -224,7 +227,8 @@ export default function routes (app) {
}, },
get subtitle () { get subtitle () {
return i18n.t('Devices') return i18n.t('Devices')
} },
profileAttribute: PROFILE_ATTRIBUTE_MAP.deviceProvisioning
} }
}, },
{ {
@ -249,7 +253,8 @@ export default function routes (app) {
}, },
get subtitle () { get subtitle () {
return i18n.t('Sound Sets') return i18n.t('Sound Sets')
} },
profileAttribute: PROFILE_ATTRIBUTE_MAP.soundSet
} }
}, },
{ {
@ -398,7 +403,8 @@ export default function routes (app) {
}, },
get subtitle () { get subtitle () {
return i18n.t('List of registered devices for the subscriber') return i18n.t('List of registered devices for the subscriber')
} },
profileAttribute: PROFILE_ATTRIBUTE_MAP.registeredDevices
} }
}, },
{ {

Loading…
Cancel
Save