TT#47388 Remove call queue config item

What has been done:
- TT#47832, Implement UI for removal of CallQueueConfiguration items, incl
  loading spinner and confirm dialog
- TT#47833, Implement state handling for CallQueueConfiguration removal of item
- TT#47834, Create API method for removal of CallQueueConfiguration item

Change-Id: I0a8f7e2a4fa68b13276f5944410982febfc2e333
changes/90/25090/10
raxelsen 7 years ago committed by Hans-Peter Herzog
parent 2fbd048c76
commit cdbb7cabba

@ -20,7 +20,8 @@ import {
addNewCallQueueConfig, addNewCallQueueConfig,
setQueueLength, setQueueLength,
setWrapUpTime, setWrapUpTime,
getPreferences getPreferences,
removeCallQueueConfig
} from './subscriber'; } from './subscriber';
import uuid from 'uuid'; import uuid from 'uuid';
import { getList, get, patchReplace } from './common' import { getList, get, patchReplace } from './common'
@ -549,7 +550,7 @@ export function getCallQueueConfigurations() {
} }
export function addCallQueueConfig(id, config) { export function addCallQueueConfig(id, config) {
return new Promise((resolve, reject)=>{ return new Promise((resolve, reject) => {
addNewCallQueueConfig(id, config).then(() => { addNewCallQueueConfig(id, config).then(() => {
resolve(); resolve();
}).catch((err)=>{ }).catch((err)=>{
@ -559,9 +560,9 @@ export function addCallQueueConfig(id, config) {
} }
export function getConfig(id) { export function getConfig(id) {
return new Promise((resolve, reject)=>{ return new Promise((resolve, reject) => {
let $subscriber = {}; let $subscriber = {};
Promise.resolve().then(()=>{ Promise.resolve().then(() => {
return getSubscriber(id); return getSubscriber(id);
}).then((subscriber) => { }).then((subscriber) => {
$subscriber = subscriber; $subscriber = subscriber;
@ -580,6 +581,16 @@ export function getConfig(id) {
}); });
} }
export function removeCallQueue(subscriberId) {
return new Promise((resolve, reject) => {
removeCallQueueConfig(subscriberId).then(() => {
resolve();
}).catch((err)=>{
reject(err);
});
});
}
export function setQueueLengthConfig(id, queueLength) { export function setQueueLengthConfig(id, queueLength) {
return setQueueLength(id, queueLength); return setQueueLength(id, queueLength);
} }

@ -361,3 +361,8 @@ export function setQueueLength(id, queueLength) {
export function setWrapUpTime(id, wrapUpTime) { export function setWrapUpTime(id, wrapUpTime) {
return editCallQueuePreference(id, { queue_wrap_up_time: wrapUpTime }); return editCallQueuePreference(id, { queue_wrap_up_time: wrapUpTime });
} }
export function removeCallQueueConfig(subscriberId) {
let param = { cloud_pbx_callqueue: false };
return Vue.http.put('api/subscriberpreferences/' + subscriberId, param);
}

@ -98,6 +98,14 @@
class="csc-list-actions-pinned" class="csc-list-actions-pinned"
> >
<q-item-tile> <q-item-tile>
<q-btn
v-if="expanded"
icon="delete"
:big="isMobile"
color="negative"
flat
@click="remove()"
/>
<q-btn <q-btn
:icon="titleIcon" :icon="titleIcon"
:big="isMobile" :big="isMobile"
@ -129,12 +137,12 @@
QIcon, QIcon,
Platform, Platform,
QBtn, QBtn,
QInnerLoading,
QSpinnerMat,
QItem, QItem,
QItemSide, QItemSide,
QItemMain, QItemMain,
QItemTile, QItemTile
QInnerLoading,
QSpinnerMat
} from 'quasar-framework' } from 'quasar-framework'
export default { export default {
name: 'csc-pbx-call-queue', name: 'csc-pbx-call-queue',
@ -153,12 +161,12 @@
QInput, QInput,
QIcon, QIcon,
QBtn, QBtn,
QInnerLoading,
QSpinnerMat,
QItem, QItem,
QItemSide, QItemSide,
QItemMain, QItemMain,
QItemTile, QItemTile
QInnerLoading,
QSpinnerMat
}, },
validations: { validations: {
changes: { changes: {
@ -314,15 +322,15 @@
queueLengthHasChanged() { queueLengthHasChanged() {
return this.queueLength + "" !== this.changes.max_queue_length + ""; return this.queueLength + "" !== this.changes.max_queue_length + "";
}, },
isLoading() {
return this.loading;
},
configModel() { configModel() {
return { return {
id: this.subscriber.id, id: this.subscriber.id,
max_queue_length: this.changes.max_queue_length, max_queue_length: this.changes.max_queue_length,
queue_wrap_up_time: this.changes.queue_wrap_up_time queue_wrap_up_time: this.changes.queue_wrap_up_time
} }
},
isLoading() {
return this.loading;
} }
}, },
methods: { methods: {
@ -356,9 +364,16 @@
else { else {
this.$emit('save-queue-length', this.configModel); this.$emit('save-queue-length', this.configModel);
} }
},
remove() {
this.$emit('remove', this.subscriber);
} }
}, },
watch: { watch: {
subscriber() {
this.resetQueueLength();
this.resetWrapUpTime();
}
} }
} }
</script> </script>

@ -52,6 +52,7 @@
:loading="isItemLoading(subscriber.id)" :loading="isItemLoading(subscriber.id)"
@save-queue-length="setQueueLength" @save-queue-length="setQueueLength"
@save-wrap-up-time="setWrapUpTime" @save-wrap-up-time="setWrapUpTime"
@remove="removeConfigDialog"
/> />
</q-list> </q-list>
</div> </div>
@ -61,6 +62,12 @@
> >
{{ $t('pbxConfig.noCallQueues') }} {{ $t('pbxConfig.noCallQueues') }}
</div> </div>
<csc-remove-dialog
ref="removeDialog"
:title="$t('pbxConfig.removeConfigTitle')"
:message="removeDialogMessage"
@remove="removeConfig"
/>
</csc-page> </csc-page>
</template> </template>
@ -68,6 +75,7 @@
import CscPage from '../../CscPage' import CscPage from '../../CscPage'
import CscPbxCallQueue from './CscPbxCallQueue' import CscPbxCallQueue from './CscPbxCallQueue'
import CscPbxCallQueueAddForm from './CscPbxCallQueueAddForm' import CscPbxCallQueueAddForm from './CscPbxCallQueueAddForm'
import CscRemoveDialog from '../../CscRemoveDialog'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { import {
QField, QField,
@ -89,6 +97,7 @@
CscPage, CscPage,
CscPbxCallQueue, CscPbxCallQueue,
CscPbxCallQueueAddForm, CscPbxCallQueueAddForm,
CscRemoveDialog,
QField, QField,
QInput, QInput,
QIcon, QIcon,
@ -104,7 +113,8 @@
}, },
data () { data () {
return { return {
addFormEnabled: false addFormEnabled: false,
currentRemovingSubscriber: null
} }
}, },
mounted() { mounted() {
@ -120,10 +130,19 @@
'isAdding', 'isAdding',
'addState', 'addState',
'isUpdating', 'isUpdating',
'updateItemId' 'updateItemId',
'removeState',
'isRemoving'
]), ]),
isMobile() { isMobile() {
return Platform.is.mobile; return Platform.is.mobile;
},
removeDialogMessage() {
if (this.currentRemovingSubscriber !== null) {
return this.$t('pbxConfig.removeConfigText', {
subscriber: this.currentRemovingSubscriber.display_name
});
}
} }
}, },
methods: { methods: {
@ -155,7 +174,15 @@
this.$store.dispatch('pbxConfig/setWrapUpTime', subscriber); this.$store.dispatch('pbxConfig/setWrapUpTime', subscriber);
}, },
isItemLoading(subscriberId) { isItemLoading(subscriberId) {
return (this.isUpdating && this.updateItemId + "" === subscriberId + ""); return (this.isUpdating && this.updateItemId + "" === subscriberId + "") ||
(this.isRemoving && this.currentRemovingSubscriber.id + "" === subscriberId + "");
},
removeConfigDialog(subscriber) {
this.currentRemovingSubscriber = subscriber;
this.$refs.removeDialog.open();
},
removeConfig() {
this.$store.dispatch('pbxConfig/removeCallQueue', this.currentRemovingSubscriber)
} }
}, },
watch: { watch: {

@ -126,7 +126,7 @@
:profiles="profiles" :profiles="profiles"
:modelImages="modelImages" :modelImages="modelImages"
:loading="createDeviceRequesting" :loading="createDeviceRequesting"
@remove="removeDevice" @remove="removeDeviceDialog"
@modelSelectOpened="modelSelectOpened()" @modelSelectOpened="modelSelectOpened()"
@save="saveDevice" @save="saveDevice"
@cancelForm="cancelForm" @cancelForm="cancelForm"
@ -170,7 +170,7 @@
:subscribers="getGroupOrSeatById" :subscribers="getGroupOrSeatById"
:profiles="profiles" :profiles="profiles"
:modelImages="modelImages" :modelImages="modelImages"
@remove="removeDevice" @remove="removeDeviceDialog"
@loadGroupsAndSeats="loadGroupsAndSeats()" @loadGroupsAndSeats="loadGroupsAndSeats()"
@deviceKeysChanged="deviceKeysChanged" @deviceKeysChanged="deviceKeysChanged"
@save-station-name="setStationName" @save-station-name="setStationName"
@ -184,6 +184,12 @@
> >
{{ noDeviceMessage }} {{ noDeviceMessage }}
</div> </div>
<csc-remove-dialog
ref="removeDialog"
:title="$t('pbxConfig.removeDeviceTitle')"
:message="removeDialogMessage"
@remove="removeDevice"
/>
</csc-page> </csc-page>
</template> </template>
@ -194,12 +200,12 @@
import CscPbxDevice from './CscPbxDevice' import CscPbxDevice from './CscPbxDevice'
import CscPbxDeviceAddForm from './CscPbxDeviceAddForm' import CscPbxDeviceAddForm from './CscPbxDeviceAddForm'
import CscPbxModelSelect from './CscPbxModelSelect' import CscPbxModelSelect from './CscPbxModelSelect'
import CscRemoveDialog from '../../CscRemoveDialog'
import { showToast, showGlobalError } from '../../../helpers/ui' import { showToast, showGlobalError } from '../../../helpers/ui'
import { import {
QSpinnerDots, QSpinnerDots,
QPagination, QPagination,
QList, QList,
Dialog,
QItem, QItem,
QItemMain, QItemMain,
QBtn, QBtn,
@ -217,7 +223,8 @@
formEnabled: false, formEnabled: false,
filterEnabled: false, filterEnabled: false,
filterStationNameInput: '', filterStationNameInput: '',
filterMacAddressInput: '' filterMacAddressInput: '',
currentRemovingDevice: null
} }
}, },
mounted() { mounted() {
@ -229,6 +236,7 @@
CscPbxDevice, CscPbxDevice,
CscPbxDeviceAddForm, CscPbxDeviceAddForm,
CscPbxModelSelect, CscPbxModelSelect,
CscRemoveDialog,
QSpinnerDots, QSpinnerDots,
QPagination, QPagination,
QList, QList,
@ -363,6 +371,13 @@
} }
} }
]; ];
},
removeDialogMessage() {
if (this.currentRemovingDevice !== null) {
return this.$t('pbxConfig.removeDeviceText', {
device: this.currentRemovingDevice.station_name
});
}
} }
}, },
methods: { methods: {
@ -378,23 +393,8 @@
saveDevice(device) { saveDevice(device) {
this.$store.dispatch('pbxConfig/createDevice', device); this.$store.dispatch('pbxConfig/createDevice', device);
}, },
removeDevice(device) { removeDevice() {
var store = this.$store; this.$store.dispatch('pbxConfig/removeDevice', this.currentRemovingDevice);
var i18n = this.$i18n;
Dialog.create({
title: i18n.t('pbxConfig.removeDeviceTitle'),
message: i18n.t('pbxConfig.removeDeviceText', { device: device.station_name }),
buttons: [
'Cancel',
{
label: i18n.t('pbxConfig.removeDevice'),
color: 'negative',
handler () {
store.dispatch('pbxConfig/removeDevice', device);
}
}
]
});
}, },
loadGroupsAndSeats() { loadGroupsAndSeats() {
this.$store.dispatch('pbxConfig/getAllGroupsAndSeats'); this.$store.dispatch('pbxConfig/getAllGroupsAndSeats');
@ -466,6 +466,10 @@
}, },
resetFilters() { resetFilters() {
this.$store.dispatch('pbxConfig/resetDeviceFilters'); this.$store.dispatch('pbxConfig/resetDeviceFilters');
},
removeDeviceDialog(device) {
this.currentRemovingDevice = device;
this.$refs.removeDialog.open();
} }
}, },
watch: { watch: {

@ -62,7 +62,7 @@
:alias-number-options="aliasNumberOptions" :alias-number-options="aliasNumberOptions"
:seat-options="seatOptions" :seat-options="seatOptions"
:hunt-policy-options="huntPolicyOptions" :hunt-policy-options="huntPolicyOptions"
@remove="removeGroup" @remove="removeGroupDialog"
:loading="isItemLoading(group.id)" :loading="isItemLoading(group.id)"
@save-name="setGroupName" @save-name="setGroupName"
@save-extension="setGroupExtension" @save-extension="setGroupExtension"
@ -78,6 +78,12 @@
> >
{{ $t('pbxConfig.noGroups') }} {{ $t('pbxConfig.noGroups') }}
</div> </div>
<csc-remove-dialog
ref="removeDialog"
:title="$t('pbxConfig.removeGroupTitle')"
:message="removeDialogMessage"
@remove="removeGroup"
/>
</csc-page> </csc-page>
</template> </template>
@ -86,6 +92,7 @@
import CscPage from '../../CscPage' import CscPage from '../../CscPage'
import CscPbxGroup from './CscPbxGroup' import CscPbxGroup from './CscPbxGroup'
import CscPbxGroupAddForm from './CscPbxGroupAddForm' import CscPbxGroupAddForm from './CscPbxGroupAddForm'
import CscRemoveDialog from '../../CscRemoveDialog'
import aliasNumberOptions from '../../../mixins/alias-number-options' import aliasNumberOptions from '../../../mixins/alias-number-options'
import itemError from '../../../mixins/item-error' import itemError from '../../../mixins/item-error'
import { showToast } from '../../../helpers/ui' import { showToast } from '../../../helpers/ui'
@ -108,7 +115,6 @@
QInnerLoading, QInnerLoading,
QSpinnerDots, QSpinnerDots,
QSpinnerMat, QSpinnerMat,
Dialog,
QPagination, QPagination,
Platform Platform
} from 'quasar-framework' } from 'quasar-framework'
@ -119,6 +125,7 @@
CscPage, CscPage,
CscPbxGroup, CscPbxGroup,
CscPbxGroupAddForm, CscPbxGroupAddForm,
CscRemoveDialog,
QChip, QChip,
QCard, QCard,
QCardSeparator, QCardSeparator,
@ -147,7 +154,8 @@
data () { data () {
return { return {
addFormEnabled: false, addFormEnabled: false,
page: 1 page: 1,
currentRemovingGroup: null
} }
}, },
computed: { computed: {
@ -213,6 +221,13 @@
isMobile() { isMobile() {
return Platform.is.mobile; return Platform.is.mobile;
}, },
removeDialogMessage() {
if (this.currentRemovingGroup !== null) {
return this.$t('pbxConfig.removeGroupText', {
group: this.currentRemovingGroup.name
});
}
}
}, },
watch: { watch: {
addState(state) { addState(state) {
@ -263,23 +278,8 @@
addGroup(group) { addGroup(group) {
this.$store.dispatch('pbxConfig/addGroup', group); this.$store.dispatch('pbxConfig/addGroup', group);
}, },
removeGroup(group) { removeGroup() {
var store = this.$store; this.$store.dispatch('pbxConfig/removeGroup', this.currentRemovingGroup);
var i18n = this.$i18n;
Dialog.create({
title: i18n.t('pbxConfig.removeGroupTitle'),
message: i18n.t('pbxConfig.removeGroupText', { group: group.name }),
buttons: [
'Cancel',
{
label: i18n.t('pbxConfig.removeGroup'),
color: 'negative',
handler () {
store.dispatch('pbxConfig/removeGroup', group);
}
}
]
});
}, },
setGroupName(group) { setGroupName(group) {
this.$store.dispatch('pbxConfig/setGroupName', group); this.$store.dispatch('pbxConfig/setGroupName', group);
@ -303,6 +303,10 @@
this.$store.dispatch('pbxConfig/listGroups', { this.$store.dispatch('pbxConfig/listGroups', {
page: page page: page
}); });
},
removeGroupDialog(subscriber) {
this.currentRemovingGroup = subscriber;
this.$refs.removeDialog.open();
} }
} }
} }

@ -410,7 +410,7 @@
}, },
saveGroups() { saveGroups() {
this.$emit('save-groups', this.seatModel); this.$emit('save-groups', this.seatModel);
}, }
}, },
watch: { watch: {
seat() { seat() {

@ -61,7 +61,7 @@
:seat="seat" :seat="seat"
:alias-number-options="aliasNumberOptions" :alias-number-options="aliasNumberOptions"
:group-options="groupOptions" :group-options="groupOptions"
@remove="removeSeat" @remove="removeSeatDialog"
:loading="isItemLoading(seat.id)" :loading="isItemLoading(seat.id)"
@save-name="setSeatName" @save-name="setSeatName"
@save-extension="setSeatExtension" @save-extension="setSeatExtension"
@ -76,13 +76,20 @@
> >
{{ $t('pbxConfig.noSeats') }} {{ $t('pbxConfig.noSeats') }}
</div> </div>
<csc-remove-dialog
ref="removeDialog"
:title="$t('pbxConfig.removeSeatTitle')"
:message="removeDialogMessage"
@remove="removeSeat"
/>
</csc-page> </csc-page>
</template> </template>
<script> <script>
import CscPage from '../../CscPage' import CscPage from '../../CscPage'
import CscPbxSeatAddForm from './CscPbxSeatAddForm' import CscPbxSeatAddForm from './CscPbxSeatAddForm'
import CscPbxSeat from './CscPbxSeat' import CscPbxSeat from './CscPbxSeat'
import CscRemoveDialog from '../../CscRemoveDialog'
import aliasNumberOptions from '../../../mixins/alias-number-options' import aliasNumberOptions from '../../../mixins/alias-number-options'
import itemError from '../../../mixins/item-error' import itemError from '../../../mixins/item-error'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
@ -106,7 +113,6 @@
QInnerLoading, QInnerLoading,
QSpinnerDots, QSpinnerDots,
QSpinnerMat, QSpinnerMat,
Dialog,
QPagination, QPagination,
Platform Platform
} from 'quasar-framework' } from 'quasar-framework'
@ -120,13 +126,15 @@
}, },
data () { data () {
return { return {
addFormEnabled: false addFormEnabled: false,
currentRemovingSeat: null
} }
}, },
components: { components: {
CscPage, CscPage,
CscPbxSeat, CscPbxSeat,
CscPbxSeatAddForm, CscPbxSeatAddForm,
CscRemoveDialog,
QChip, QChip,
QCard, QCard,
QCardSeparator, QCardSeparator,
@ -188,6 +196,13 @@
}, },
isMobile() { isMobile() {
return Platform.is.mobile; return Platform.is.mobile;
},
removeDialogMessage() {
if (this.currentRemovingSeat !== null) {
return this.$t('pbxConfig.removeSeatText', {
seat: this.currentRemovingSeat.name
});
}
} }
}, },
watch: { watch: {
@ -239,23 +254,8 @@
addSeat(seat) { addSeat(seat) {
this.$store.dispatch('pbxConfig/addSeat', seat); this.$store.dispatch('pbxConfig/addSeat', seat);
}, },
removeSeat(seat) { removeSeat() {
var store = this.$store; this.$store.dispatch('pbxConfig/removeSeat', this.currentRemovingSeat);
var i18n = this.$i18n;
Dialog.create({
title: i18n.t('pbxConfig.removeSeatTitle'),
message: i18n.t('pbxConfig.removeSeatText', { seat: seat.name }),
buttons: [
'Cancel',
{
label: i18n.t('pbxConfig.removeSeat'),
color: 'negative',
handler () {
store.dispatch('pbxConfig/removeSeat', seat);
}
}
]
});
}, },
setSeatName(seat) { setSeatName(seat) {
this.$store.dispatch('pbxConfig/setSeatName', seat); this.$store.dispatch('pbxConfig/setSeatName', seat);
@ -273,6 +273,10 @@
this.$store.dispatch('pbxConfig/listSeats', { this.$store.dispatch('pbxConfig/listSeats', {
page: page page: page
}); });
},
removeSeatDialog(subscriber) {
this.currentRemovingSeat = subscriber;
this.$refs.removeDialog.open();
} }
} }
} }

@ -395,7 +395,9 @@
"wrapUpTime": "Wrap Up Time", "wrapUpTime": "Wrap Up Time",
"queueExtensionName": "Group/Seat/Pilot", "queueExtensionName": "Group/Seat/Pilot",
"addConfig": "Add Call Queue", "addConfig": "Add Call Queue",
"createConfig": "Create Call Queue" "createConfig": "Create Call Queue",
"removeConfigTitle": "Remove call queue",
"removeConfigText": "You are about to remove call queue for {subscriber}"
}, },
"callBlocking": { "callBlocking": {
"privacyEnabledToast": "Your number is hidden to the callee", "privacyEnabledToast": "Your number is hidden to the callee",

@ -35,7 +35,8 @@ import {
addCallQueueConfig, addCallQueueConfig,
setQueueLengthConfig, setQueueLengthConfig,
setWrapUpTimeConfig, setWrapUpTimeConfig,
getConfig getConfig,
removeCallQueue
} from '../../api/pbx-config' } from '../../api/pbx-config'
export default { export default {
@ -435,6 +436,12 @@ export default {
let config = Object.assign(data.config, { let config = Object.assign(data.config, {
cloud_pbx_callqueue: true cloud_pbx_callqueue: true
}); });
if (!_.isNull(config.max_queue_length) && config.max_queue_length.length === 0) {
config.max_queue_length = null;
}
if (!_.isNull(config.queue_wrap_up_time) && config.queue_wrap_up_time.length === 0) {
config.queue_wrap_up_time = null;
}
context.commit('addItemRequesting', config); context.commit('addItemRequesting', config);
addCallQueueConfig(data.id, config).then(() => { addCallQueueConfig(data.id, config).then(() => {
return context.dispatch('listCallQueueGroupsAndSeats', true); return context.dispatch('listCallQueueGroupsAndSeats', true);
@ -462,9 +469,14 @@ export default {
}); });
}, },
setQueueLength(context, subscriber) { setQueueLength(context, subscriber) {
context.commit('updateItemRequesting', subscriber); let updateItem = {
setQueueLengthConfig(subscriber.id, subscriber.max_queue_length).then(() => { id: subscriber.id,
return context.dispatch('reloadConfig', subscriber); max_queue_length: subscriber.max_queue_length || 5,
queue_wrap_up_time: subscriber.queue_wrap_up_time || 10
};
context.commit('updateItemRequesting', updateItem);
setQueueLengthConfig(updateItem.id, updateItem.max_queue_length).then(() => {
return context.dispatch('reloadConfig', updateItem);
}).then(()=>{ }).then(()=>{
context.commit('updateItemSucceeded'); context.commit('updateItemSucceeded');
}).catch((err) => { }).catch((err) => {
@ -472,13 +484,28 @@ export default {
}); });
}, },
setWrapUpTime(context, subscriber) { setWrapUpTime(context, subscriber) {
context.commit('updateItemRequesting', subscriber); let updateItem = {
setWrapUpTimeConfig(subscriber.id, subscriber.queue_wrap_up_time).then(() => { id: subscriber.id,
return context.dispatch('reloadConfig', subscriber); max_queue_length: subscriber.max_queue_length || 5,
queue_wrap_up_time: subscriber.queue_wrap_up_time || 10
};
context.commit('updateItemRequesting', updateItem);
setWrapUpTimeConfig(updateItem.id, updateItem.queue_wrap_up_time).then(() => {
return context.dispatch('reloadConfig', updateItem);
}).then(()=>{ }).then(()=>{
context.commit('updateItemSucceeded'); context.commit('updateItemSucceeded');
}).catch((err) => { }).catch((err) => {
context.commit('updateItemFailed', err.message); context.commit('updateItemFailed', err.message);
}); });
},
removeCallQueue(context, config) {
context.commit('removeItemRequesting', config);
removeCallQueue(config.id).then(()=>{
return context.dispatch('listCallQueueGroupsAndSeats', true);
}).then(()=>{
context.commit('removeItemSucceeded');
}).catch((err)=>{
context.commit('removeItemFailed', err.message);
});
} }
} }

@ -422,7 +422,7 @@ export default {
state.callQueueGroupsAndSeats[config.id] = config; state.callQueueGroupsAndSeats[config.id] = config;
state.callQueueGroupsAndSeatsOrdered.push(config); state.callQueueGroupsAndSeatsOrdered.push(config);
}); });
state.callQueueGroupsAndSeats = _.filter(state.callQueueGroupsAndSeats, (item) => { state.callQueueGroupsAndSeats = state.callQueueGroupsAndSeats.filter((item) => {
return (item !== (undefined || null || '')); return (item !== (undefined || null || ''));
}); });
}, },

@ -184,3 +184,8 @@
color $dark color $dark
.q-chip-side .q-chip-side
color $dark color $dark
.q-popover
.q-icon
color: $primary

@ -50,31 +50,4 @@ describe('PBX Configuration Store', () => {
assert.deepEqual(state.numbers, data.numbers); assert.deepEqual(state.numbers, data.numbers);
}); });
it('should list all group/seat/pilot call queue configs', function(){
let state = {
callQueueGroupsAndSeats: []
};
let data = {
items: [
{
display_name: "123",
id: 123,
is_pbx_group: false,
max_queue_length: "10",
queue_wrap_up_time: "5"
},
{
display_name: "456",
id: 456,
is_pbx_group: false,
max_queue_length: "5",
queue_wrap_up_time: "10"
}
]
};
PbxConfig.mutations.callQueueListSucceeded(state, data);
assert.deepEqual(state.callQueueGroupsAndSeats[0], data.items[0]);
assert.deepEqual(state.callQueueGroupsAndSeats[1], data.items[1]);
});
}); });

Loading…
Cancel
Save