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)
mr14.1
nidrissi-zouggari 3 months ago committed by Nouhaila Idrissi-Zouggari
parent 274b4625ea
commit 04d06101ea

@ -49,7 +49,7 @@
:error-message="queueMaxLengthErrorMessage"
:disable="disableMaxQueueLength"
@update:model-value="v$.changes.max_queue_length.$touch()"
@keyup.enter="save"
@keyup.enter="saveMaxQueueLength"
>
<template
v-if="hasMaxQueueLengthChanged"
@ -57,7 +57,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"
@ -72,7 +72,7 @@
:error-message="queueWrapUpTimeErrorMessage"
:disable="disableQueueWrapUpTime"
@update:model-value="v$.changes.queue_wrap_up_time.$touch()"
@keyup.enter="save"
@keyup.enter="saveQueueWrapUpTime"
>
<template
v-if="hasQueueWrapUpTimeChanged"
@ -80,7 +80,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"
@ -144,7 +144,7 @@ export default {
},
defaultQueueWrapUpTime: {
type: Number,
default: 300
default: 10
}
},
emits: ['save-queue-wrap-up-time', 'save-max-queue-length', 'expand', 'collapse', 'remove'],
@ -263,13 +263,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,

@ -96,7 +96,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"
@ -89,6 +89,7 @@ import CscRemoveDialog from 'components/CscRemoveDialog'
import CscPbxCallQueue from 'components/pages/PbxConfiguration/CscPbxCallQueue'
import CscPbxCallQueueAddForm from 'components/pages/PbxConfiguration/CscPbxCallQueueAddForm'
import CscFade from 'components/transitions/CscFade'
import { getSubscriberId } from 'src/auth'
import {
showGlobalError,
showToast
@ -194,7 +195,7 @@ export default {
}
},
mounted () {
this.loadCallQueueList()
this.loadCallQueueList({ subscriberId: getSubscriberId() })
},
methods: {
...mapActions('pbx', [

@ -87,7 +87,7 @@ export default {
return {
callQueue: null,
changes: null,
cloud_pbx_callqueue: null,
cloud_pbx_callqueue: false,
v$: useValidate()
}
},

@ -7,6 +7,7 @@ import {
setCallQueueMaxLength,
setCallQueueWrapUpTime
} from 'src/api/pbx-callqueues'
import { getPreferences } from 'src/api/subscriber'
import { CreationState, RequestState } from 'src/store/common'
export default {
@ -191,16 +192,25 @@ export default {
},
collapseCallQueue (state) {
state.callQueueSelected = null
},
setDefaultQueueWrapUpTime (state, value) {
state.defaultQueueWrapUpTime = value
}
},
actions: {
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)

Loading…
Cancel
Save