TT#124277 SubscriberProfiles - Integrate cfu/cfb/cfna/cft

TT#124407 SubscriberProfiles - Show all features if no SubscriberProfile and no SubscriberProfileSet is set

Change-Id: Ibfa3ae28ec40fd1b0a7221ed77e903884d6907cd
mr9.5.2
Carlo Venusino 4 years ago committed by Hans-Peter Herzog
parent cd17075bfb
commit e16ccb6423

@ -186,7 +186,7 @@
> >
<csc-more-menu> <csc-more-menu>
<csc-popup-menu-item <csc-popup-menu-item
v-if="mapping.type === 'cfu'" v-if="mapping.type === 'cfu' && hasSubscriberProfileAttribute('cft')"
icon="ring_volume" icon="ring_volume"
:label="$t('Ring primary number')" :label="$t('Ring primary number')"
@click="ringPrimaryNumberEvent" @click="ringPrimaryNumberEvent"
@ -266,7 +266,7 @@
<script> <script>
import _ from 'lodash' import _ from 'lodash'
import { import {
mapActions mapActions, mapGetters
} from 'vuex' } from 'vuex'
import CscMoreMenu from 'components/CscMoreMenu' import CscMoreMenu from 'components/CscMoreMenu'
import CscPopupMenuItemDelete from 'components/CscPopupMenuItemDelete' import CscPopupMenuItemDelete from 'components/CscPopupMenuItemDelete'
@ -315,6 +315,9 @@ export default {
} }
}, },
computed: { computed: {
...mapGetters('user', [
'hasSubscriberProfileAttribute'
]),
clickableClasses () { clickableClasses () {
return ['cursor-pointer', 'text-weight-bold', 'text-primary'] return ['cursor-pointer', 'text-weight-bold', 'text-primary']
}, },

@ -4,6 +4,7 @@
class="q-pa-lg" class="q-pa-lg"
> >
<template <template
v-if="hasSubscriberProfileAttributes(['cfu', 'cfna', 'cfb'])"
v-slot:header v-slot:header
> >
<q-btn <q-btn
@ -16,16 +17,19 @@
> >
<csc-popup-menu> <csc-popup-menu>
<csc-popup-menu-item <csc-popup-menu-item
v-if="hasSubscriberProfileAttribute('cfu')"
color="primary" color="primary"
:label="$t('If available')" :label="$t('If available')"
@click="createMapping({ type: 'cfu'})" @click="createMapping({ type: 'cfu'})"
/> />
<csc-popup-menu-item <csc-popup-menu-item
v-if="hasSubscriberProfileAttribute('cfna')"
color="primary" color="primary"
:label="$t('If not available')" :label="$t('If not available')"
@click="createMapping({ type: 'cfna'})" @click="createMapping({ type: 'cfna'})"
/> />
<csc-popup-menu-item <csc-popup-menu-item
v-if="hasSubscriberProfileAttribute('cfb')"
color="primary" color="primary"
:label="$t('If busy')" :label="$t('If busy')"
@click="createMapping({ type: 'cfb'})" @click="createMapping({ type: 'cfb'})"
@ -111,6 +115,10 @@ export default {
]), ]),
...mapGetters('callForwarding', [ ...mapGetters('callForwarding', [
'groups' 'groups'
]),
...mapGetters('user', [
'hasSubscriberProfileAttribute',
'hasSubscriberProfileAttributes'
]) ])
}, },
async mounted () { async mounted () {

@ -186,7 +186,10 @@ export default {
return state.logoRequested return state.logoRequested
}, },
hasSubscriberProfileAttribute: (state) => (attribute) => { hasSubscriberProfileAttribute: (state) => (attribute) => {
return state.profile?.attributes.includes(attribute) || false return state.profile ? state.profile.attributes.includes(attribute) : true
},
hasSubscriberProfileAttributes: (state) => (attributes) => {
return state.profile ? state.profile.attributes.some(item => attributes.includes(item)) : true
} }
}, },
mutations: { mutations: {

Loading…
Cancel
Save