From 8030e05ed1f262a4d011802bc7c18daf30a5a95d Mon Sep 17 00:00:00 2001 From: "CORP\\franci11" Date: Wed, 30 Nov 2022 18:25:08 +0100 Subject: [PATCH] MT#56083 [CSC] PBX Configuration > Groups configuration should be displayed like Seats Change-Id: I19324c34d904b48c823de9689bb6ea93df701335 --- src/api/pbx-groups.js | 10 +- .../pages/PbxConfiguration/CscPbxGroup.vue | 412 ++-------------- .../pages/PbxConfiguration/CscPbxSeat.vue | 2 +- src/pages/CscPagePbxGroupDetails.vue | 441 ++++++++++++++++++ src/pages/CscPagePbxGroups.vue | 60 +-- src/router/routes.js | 13 + src/store/pbx-groups.js | 17 +- 7 files changed, 511 insertions(+), 444 deletions(-) create mode 100644 src/pages/CscPagePbxGroupDetails.vue diff --git a/src/api/pbx-groups.js b/src/api/pbx-groups.js index 4e7d69f9..b5f44175 100644 --- a/src/api/pbx-groups.js +++ b/src/api/pbx-groups.js @@ -232,7 +232,15 @@ export function setGroupNumbers (options) { assignedNumbers: options.assignedNumbers, unassignedNumbers: options.unassignedNumbers }).then((result) => { - resolve(result) + if (result.subscriber !== null && result.preferences !== null) { + return result + } + return getSubscriberAndPreferences(options.groupId) + }).then((result) => { + resolve({ + group: result.subscriber, + preferences: result.preferences + }) }).catch((err) => { reject(err) }) diff --git a/src/components/pages/PbxConfiguration/CscPbxGroup.vue b/src/components/pages/PbxConfiguration/CscPbxGroup.vue index 352c9ff2..2a2b985f 100644 --- a/src/components/pages/PbxConfiguration/CscPbxGroup.vue +++ b/src/components/pages/PbxConfiguration/CscPbxGroup.vue @@ -1,28 +1,30 @@ diff --git a/src/pages/CscPagePbxGroups.vue b/src/pages/CscPagePbxGroups.vue index 78a48b9e..96df5dc4 100644 --- a/src/pages/CscPagePbxGroups.vue +++ b/src/pages/CscPagePbxGroups.vue @@ -75,41 +75,31 @@ - --> + - + +
0 @@ -242,13 +221,6 @@ export default { showGlobalError(this.groupCreationError) } }, - groupUpdateState (state) { - if (state === RequestState.succeeded) { - showToast(this.getGroupUpdateToastMessage) - } else if (state === RequestState.failed) { - showGlobalError(this.groupUpdateError) - } - }, groupRemovalState (state) { if (state === RequestState.succeeded) { this.$scrollTo(this.$parent.$el) @@ -267,26 +239,14 @@ export default { ...mapActions('pbxGroups', [ 'loadGroupListItems', 'createGroup', - 'removeGroup', - 'setGroupName', - 'setGroupExtension', - 'setGroupHuntPolicy', - 'setGroupHuntTimeout', - 'setGroupSeats', - 'setGroupNumbers', - 'setGroupSoundSet' + 'removeGroup' ]), ...mapMutations('pbxGroups', [ 'enableGroupAddForm', 'disableGroupAddForm', - 'expandGroup', - 'collapseGroup', 'groupRemovalRequesting', 'groupRemovalCanceled' ]), - ...mapActions('pbxCallQueues', [ - 'jumpToCallQueue' - ]), loadGroups (page) { this.loadGroupListItems({ page: page, diff --git a/src/router/routes.js b/src/router/routes.js index 1f858858..7283e035 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -13,6 +13,7 @@ import CscPageCallRecording from 'src/pages/CscPageCallRecording' import CscPageReminder from 'src/pages/CscPageReminder' import CscPageSpeedDial from 'src/pages/CscPageSpeedDial' import CscPagePbxGroups from 'src/pages/CscPagePbxGroups' +import CscPagePbxGroupDetails from 'src/pages/CscPagePbxGroupDetails' import CscPagePbxSeats from 'src/pages/CscPagePbxSeats' import CscPagePbxSeatDetails from 'src/pages/CscPagePbxSeatDetails' import CscPagePbxDevices from 'src/pages/CscPagePbxDevices' @@ -178,6 +179,18 @@ export default function routes (app) { } } }, + { + path: 'pbx-configuration/group/:id', + component: CscPagePbxGroupDetails, + meta: { + get title () { + return i18n.t('PBX Configuration') + }, + get subtitle () { + return i18n.t('Groups') + } + } + }, { path: 'pbx-configuration/seats', component: CscPagePbxSeats, diff --git a/src/store/pbx-groups.js b/src/store/pbx-groups.js index 300f3f04..266da2c1 100644 --- a/src/store/pbx-groups.js +++ b/src/store/pbx-groups.js @@ -68,11 +68,6 @@ export default { isGroupUpdating (state) { return state.groupUpdateState === RequestState.requesting }, - isGroupExpanded (state) { - return (groupId) => { - return state.groupSelected !== null && state.groupSelected.id === groupId - } - }, isGroupLoading (state, getters) { return (groupId) => { return (getters.isGroupRemoving && state.groupRemoving.id === groupId) || @@ -245,10 +240,10 @@ export default { state.groupRemovalState = RequestState.failed state.groupRemovalError = err }, - expandGroup (state, groupId) { + selectGroup (state, groupId) { state.groupSelected = state.groupMapById[groupId] }, - collapseGroup (state) { + resetSelectedGroup (state) { state.groupSelected = null }, enableGroupAddForm (state) { @@ -380,14 +375,6 @@ export default { pilotId: context.rootGetters['pbx/pilot'].id, assignedNumbers: options.assignedNumbers, unassignedNumbers: options.unassignedNumbers - }).then((result) => { - if (options.assignedNumbers.length > 0) { - return context.dispatch('loadGroupListItems', { - clearList: false - }) - } else { - return Promise.resolve(result) - } }).then((result) => { context.commit('groupUpdateSucceeded', result) }).catch((err) => {