MT#57577 Make ncos and ncos_set visibile accordingly to profile

ncos and ncos_set setup should be visible in the 'Block Outgoing'
section only if:
 * profile is not assigned or profile is assigned and contains
the ncos and/or the ncos_set attribute
 * the user is a PBX subscriber's admin
 * the user is subscriber (admin or not) in a NOT PBX customer

Change-Id: I27e7061e8cec055eddfe487f21052a4df0399373
mr12.0
Marco Capetta 2 years ago
parent e02805eb7c
commit f81267ebbe

@ -1,6 +1,7 @@
<template>
<div
v-if="pageType === 'typeoutgoing'"
class="q-mb-lg"
>
<q-item
class="col col-xs-12 col-md-6"
@ -12,6 +13,7 @@
no-wrap
>
<q-select
v-if="hasSubscriberProfileAttribute('ncos') && (this.isPbxAdmin || ! this.isPbxEnabled)"
v-model="ncosLevel"
use-chips
radio
@ -34,7 +36,8 @@
</template>
</q-select>
<q-select
v-model="ncosSet"
v-if="hasSubscriberProfileAttribute('ncos_set') && (this.isPbxAdmin || ! this.isPbxEnabled)"
v-model="ncosSet"
use-chips
radio
emit-value
@ -59,9 +62,11 @@
</q-item>
</div>
</template>
<script>
import {
mapActions
mapActions,
mapGetters
} from 'vuex'
import CscInputButtonSave from 'src/components/form/CscInputButtonSave'
import CscInputButtonReset from 'src/components/form/CscInputButtonReset'
@ -94,6 +99,11 @@ export default {
await this.getCurrentNcosSetsSubscriber();
},
computed: {
...mapGetters('user', [
'hasSubscriberProfileAttribute',
'isPbxAdmin',
'isPbxEnabled'
]),
hasNcosChanged () {
return this.ncosLevel !== this.originalNcosLevel
},

@ -26,7 +26,7 @@ export const PROFILE_ATTRIBUTE_MAP = {
export const PROFILE_ATTRIBUTES_MAP = {
callBlockingIncoming: ['block_in_clir', 'block_in_mode', 'block_in_list'],
callBlockingOutgoing: ['block_out_mode', 'block_out_list'],
callBlockingOutgoing: ['block_out_mode', 'block_out_list', 'ncos', 'ncos_set'],
callBlockingPrivacy: ['clir', 'clir_intrapbx'],
callSettings: ['music_on_hold', 'language'],
pbxSettings: ['auto_attendant', 'cloud_pbx_callqueue', 'max_queue_length', 'queue_wrap_up_time', 'manager_secretary'],

Loading…
Cancel
Save