MT#64519 Fix default value for Call Queue

Fix default value for CQ part:
If the subscriber has call queue activated, use their wrap-up time
as the default value; otherwise, set the default value to 10.

Change-Id: I1e11417690d4119ce396939721cbc96f6c5ef9b8
(cherry picked from commit 6e1140713d)
mr11.5
nidrissi-zouggari 3 months ago
parent fc06c96d27
commit 1c88d60911

@ -48,7 +48,7 @@
:error="v$.changes.max_queue_length.$errors.length > 0"
:error-message="queueMaxLengthErrorMessage"
@update:model-value="v$.changes.max_queue_length.$touch()"
@keyup.enter="save"
@keyup.enter="saveMaxQueueLength"
>
<template
v-if="hasMaxQueueLengthChanged"
@ -56,7 +56,7 @@
>
<csc-input-button-save
v-if="v$.changes.max_queue_length.$errors.length <= 0"
@click.stop="save"
@click.stop="saveMaxQueueLength"
/>
<csc-input-button-reset
@click.stop="resetMaxQueueLength"
@ -70,7 +70,7 @@
:error="v$.changes.queue_wrap_up_time.$errors.length > 0"
:error-message="queueWrapUpTimeErrorMessage"
@update:model-value="v$.changes.queue_wrap_up_time.$touch()"
@keyup.enter="save"
@keyup.enter="saveQueueWrapUpTime"
>
<template
v-if="hasQueueWrapUpTimeChanged"
@ -78,7 +78,7 @@
>
<csc-input-button-save
v-if="v$.changes.queue_wrap_up_time.$errors.length <= 0"
@click.stop="save"
@click.stop="saveQueueWrapUpTime"
/>
<csc-input-button-reset
@click.stop="resetQueueWrapUpTime"
@ -139,7 +139,7 @@ export default {
},
defaultQueueWrapUpTime: {
type: Number,
default: 300
default: 10
}
},
emits: ['save-queue-wrap-up-time', 'save-max-queue-length', 'expand', 'collapse', 'remove'],
@ -251,13 +251,15 @@ export default {
queue_wrap_up_time: this.callQueue.queue_wrap_up_time || this.defaultQueueWrapUpTime
}
},
save () {
saveMaxQueueLength () {
if (this.hasMaxQueueLengthChanged && this.v$.changes.max_queue_length.$errors.length <= 0) {
this.$emit('save-max-queue-length', {
callQueueId: this.callQueue.id,
maxQueueLength: this.changes.max_queue_length
})
}
},
saveQueueWrapUpTime () {
if (this.hasQueueWrapUpTimeChanged && this.v$.changes.queue_wrap_up_time.$errors.length <= 0) {
this.$emit('save-queue-wrap-up-time', {
callQueueId: this.callQueue.id,

@ -95,7 +95,7 @@ export default {
},
defaultQueueWrapUpTime: {
type: Number,
default: 300
default: 10
}
},
emits: ['submit', 'cancel', 'ready'],

@ -29,7 +29,7 @@
:options="getSubscriberOptions"
:subscriber-options-loading="isSubscribersRequesting"
:default-max-queue-length="defaultMaxQueueLength"
:default-wrap-up-time="defaultQueueWrapUpTime"
:default-queue-wrap-up-time="defaultQueueWrapUpTime"
@cancel="disableCallQueueAddForm"
@submit="createCallQueue"
@ready="loadSubscribers"
@ -86,6 +86,7 @@ import CscPbxCallQueueAddForm from 'components/pages/PbxConfiguration/CscPbxCall
import CscRemoveDialog from 'components/CscRemoveDialog'
import CscListSpinner from 'components/CscListSpinner'
import CscListActions from 'components/CscListActions'
import { getSubscriberId } from 'src/auth'
import {
mapState,
mapActions,
@ -177,7 +178,7 @@ export default {
}
},
mounted () {
this.loadCallQueueList()
this.loadCallQueueList({ subscriberId: getSubscriberId() })
},
methods: {
...mapActions('pbx', [

@ -14,6 +14,7 @@ import {
import {
i18n
} from 'src/boot/i18n'
import { getPreferences } from 'src/api/subscriber'
export default {
namespaced: true,
@ -192,28 +193,32 @@ export default {
},
collapseCallQueue (state) {
state.callQueueSelected = null
},
setDefaultQueueWrapUpTime (state, value) {
state.defaultQueueWrapUpTime = value
}
},
actions: {
loadCallQueueList (context, options) {
return new Promise((resolve) => {
const listVisible = _.get(options, 'listVisible', false)
const selectedId = _.get(options, 'selectedId', null)
context.commit('callQueueListRequesting', {
listVisible: listVisible
})
getCallQueueList().then((callQueueList) => {
context.commit('callQueueListSucceeded', callQueueList)
if (selectedId !== null) {
context.commit('expandCallQueue', callQueueList)
context.commit('highlightCallQueue', callQueueList)
}
resolve()
}).catch(() => {
resolve()
context.commit('callQueueListSucceeded')
})
})
async loadCallQueueList (context, options) {
const subscriberId = _.get(options, 'subscriberId', null)
const listVisible = _.get(options, 'listVisible', false)
const selectedId = _.get(options, 'selectedId', null)
context.commit('callQueueListRequesting', { listVisible })
try {
const callQueueList = await getCallQueueList()
context.commit('callQueueListSucceeded', callQueueList)
const subscriberPreferences = await getPreferences(subscriberId)
const wrapUpTime = _.get(subscriberPreferences, 'queue_wrap_up_time', 10)
context.commit('setDefaultQueueWrapUpTime', wrapUpTime)
if (selectedId !== null) {
context.commit('expandCallQueue', callQueueList)
context.commit('highlightCallQueue', callQueueList)
}
} catch (err) {
context.commit('callQueueListFailed', err.message)
}
},
createCallQueue (context, callQueueData) {
context.commit('callQueueCreationRequesting', callQueueData)

Loading…
Cancel
Save