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

@ -26,7 +26,7 @@ export const PROFILE_ATTRIBUTE_MAP = {
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', 'ncos', 'ncos_set'],
callBlockingPrivacy: ['clir', 'clir_intrapbx'], callBlockingPrivacy: ['clir', 'clir_intrapbx'],
callSettings: ['music_on_hold', 'language'], callSettings: ['music_on_hold', 'language'],
pbxSettings: ['auto_attendant', 'cloud_pbx_callqueue', 'max_queue_length', 'queue_wrap_up_time', 'manager_secretary'], pbxSettings: ['auto_attendant', 'cloud_pbx_callqueue', 'max_queue_length', 'queue_wrap_up_time', 'manager_secretary'],

Loading…
Cancel
Save