MT#62713 Added missing announce preferences for Groups Menu in CSC

Two switch buttons added to group details as for seats.
These buttons update play_announce_before_call_setup and play_announce_before_cf preferences.

Change-Id: I230b9a8d62b34a2e013a326ad4d50403b82d824a
(cherry picked from commit 6e70eb898b)
(cherry picked from commit 435d76b47b)
mr12.5.1
Hugo Zigha 7 months ago committed by Hugo Zigha
parent 82922482f8
commit 3bf98b89c5

@ -10,7 +10,9 @@ import {
setPbxHuntPolicy, setPbxHuntPolicy,
setPbxHuntTimeout, setSubscriberNumbers, setPbxHuntTimeout, setSubscriberNumbers,
setPbxHuntCancelMode, setPbxHuntCancelMode,
generateGeneralPassword generateGeneralPassword,
setPreferenceAnnouncementCallSetup,
setPreferenceAnnouncementCfu
} from './subscriber' } from './subscriber'
import { import {
getAllSoundSets, getAllSoundSets,
@ -20,6 +22,7 @@ import {
PBX_CONFIG_ORDER_DIRECTION, PBX_CONFIG_ORDER_DIRECTION,
setSubscriberSoundSet setSubscriberSoundSet
} from './pbx-config' } from './pbx-config'
import { import {
assignNumbers, assignNumbers,
getNumbers getNumbers
@ -306,6 +309,22 @@ export function setGroupSoundSet (options) {
}) })
} }
/**
* @param groupId
* @param announcementCfu
*/
export function setGroupAnnouncementCfu (groupId, announcementCfu) {
return setPreferenceAnnouncementCfu(groupId, announcementCfu)
}
/**
* @param groupId
* @param announcementCallSetup
*/
export function setGroupAnnouncementCallSetup (groupId, announcementCallSetup) {
return setPreferenceAnnouncementCallSetup(groupId, announcementCallSetup)
}
// This mirrors the logic we use in ngcp-admin to handle the pbx groups creation // This mirrors the logic we use in ngcp-admin to handle the pbx groups creation
// If you change the logic below make sure you make the same changes in ngcp-admin too // If you change the logic below make sure you make the same changes in ngcp-admin too
function createUsername (name) { function createUsername (name) {

@ -237,6 +237,28 @@
@click="jumpToCallQueueInternal" @click="jumpToCallQueueInternal"
/> />
</q-list> </q-list>
<q-list
v-if="changes"
class="column"
side
top
no-wrap
>
<q-toggle
v-model="changes.announcementCfu"
class="q-pa-sm"
:label="$t('Play announcement before routing to CFU/CFNA')"
:disable="isLoading"
@update:model-value="changeAnnouncementCfu"
/>
<q-toggle
v-model="changes.announcementCallSetup"
class="q-pa-sm"
:label="$t('Play announcement before call setup')"
:disable="isLoading"
@update:model-value="changeAnnouncementCallSetup"
/>
</q-list>
</q-item> </q-item>
<csc-call-forward-details <csc-call-forward-details
@ -362,7 +384,9 @@ export default {
'getGroupUpdateToastMessage', 'getGroupUpdateToastMessage',
'getSoundSetByGroupId', 'getSoundSetByGroupId',
'isGroupLoading', 'isGroupLoading',
'getHuntCancelModeOptions' 'getHuntCancelModeOptions',
'getAnnouncementCfu',
'getAnnouncementCallSetup'
]), ]),
...mapGetters('callForwarding', [ ...mapGetters('callForwarding', [
'groups' 'groups'
@ -454,7 +478,9 @@ export default {
'setGroupHuntCancelMode', 'setGroupHuntCancelMode',
'setGroupSeats', 'setGroupSeats',
'setGroupNumbers', 'setGroupNumbers',
'setGroupSoundSet' 'setGroupSoundSet',
'setAnnouncementCallSetup',
'setAnnouncementCfu'
]), ]),
...mapActions('pbxCallQueues', [ ...mapActions('pbxCallQueues', [
'jumpToCallQueue' 'jumpToCallQueue'
@ -478,7 +504,9 @@ export default {
huntCancelMode: this.groupSelected.pbx_hunt_cancel_mode, huntCancelMode: this.groupSelected.pbx_hunt_cancel_mode,
aliasNumbers: this.getAliasNumberIds(), aliasNumbers: this.getAliasNumberIds(),
seats: this.getSeatIds(), seats: this.getSeatIds(),
soundSet: this.getSoundSetId() soundSet: this.getSoundSetId(),
announcementCallSetup: this.getAnnouncementCallSetup(this.groupSelected.id),
announcementCfu: this.getAnnouncementCfu(this.groupSelected.id)
} }
: null : null
}, },
@ -584,6 +612,18 @@ export default {
}, },
forceTabReload (tabName) { forceTabReload (tabName) {
this.selectedTab = tabName this.selectedTab = tabName
},
changeAnnouncementCfu () {
this.setAnnouncementCfu({
groupId: this.groupSelected.id,
announcementCfu: this.changes.announcementCfu
})
},
changeAnnouncementCallSetup () {
this.setAnnouncementCallSetup({
groupId: this.groupSelected.id,
announcementCallSetup: this.changes.announcementCallSetup
})
} }
} }
} }

@ -8,6 +8,8 @@ import {
createGroup, createGroup,
removeGroup, removeGroup,
setGroupName, setGroupName,
setGroupAnnouncementCallSetup,
setGroupAnnouncementCfu,
setGroupExtension, setGroupExtension,
setGroupHuntPolicy, setGroupHuntPolicy,
setGroupHuntTimeout, setGroupHuntTimeout,
@ -162,6 +164,18 @@ export default {
value: 'bye' value: 'bye'
} }
] ]
},
getAnnouncementCfu (state) {
return (id) => {
const groupPreferences = state.preferenceMapById[id]
return groupPreferences && groupPreferences.play_announce_before_cf ? state.preferenceMapById[id].play_announce_before_cf : false
}
},
getAnnouncementCallSetup (state) {
return (id) => {
const groupPreferences = state.preferenceMapById[id]
return groupPreferences && groupPreferences.play_announce_before_call_setup ? state.preferenceMapById[id].play_announce_before_call_setup : false
}
} }
}, },
mutations: { mutations: {
@ -434,6 +448,30 @@ export default {
}).catch((err) => { }).catch((err) => {
context.commit('groupUpdateFailed', err.message) context.commit('groupUpdateFailed', err.message)
}) })
},
async setAnnouncementCfu (context, options) {
context.commit('groupUpdateRequesting', {
groupId: options.groupId,
groupField: options.message || i18n.global.t('the playback announcement as early media before Call Forward Unconditional or Unavailable')
})
try {
const result = await setGroupAnnouncementCfu(options.groupId, options.announcementCfu)
context.commit('groupUpdateSucceeded', result)
} catch (err) {
context.commit('groupUpdateFailed', err.message)
}
},
async setAnnouncementCallSetup (context, options) {
context.commit('groupUpdateRequesting', {
groupId: options.groupId,
groupField: options.message || i18n.global.t('the playback announcement as early media before send the call to callee')
})
try {
const result = await setGroupAnnouncementCallSetup(options.groupId, options.announcementCallSetup)
context.commit('groupUpdateSucceeded', result)
} catch (err) {
context.commit('groupUpdateFailed', err.message)
}
} }
} }
} }

Loading…
Cancel
Save