From 2069ad4386a2451ce0d3bed12326315631c028f0 Mon Sep 17 00:00:00 2001 From: Debora Crescenzo Date: Wed, 18 Dec 2024 14:19:49 +0000 Subject: [PATCH] MT#61635 CF bugfixes This commit fixes the following bugs: * On refresh The PBX Seat Page crashes because the seat id in the state goes back to null. * PBX Seats and Groups pages' reactivity is not working, in fact the components are not refreshed upon manually changing the group or seat id in the URL. * When user changes a destination that belonged to admin user the app was getting stuck in an infinite loop now we show the permission error. * When user deletes a CF previously set by the admin, or a mapping containing the above, the app was crashing. We now delete the mapping and show a warning informing the user if the associated destination set belongs to admin. * When seat user creates a new CF all CF previously created by admin were disappearing because only destinations filtered by csc users were retrieved after the creation fo a new mapping instead of all the available destinations. * Time set created in admin were visualised as "...". We now show the string "Custom time set" and show a formatted summary of the details on click. * Not all timesets were shown in call forward page because of the missing parameter "all: true" in the getList config. getList or pagination in csc needs proper reviewing. Change-Id: I06faa0a1fd0db003cb7ed81328147897386830ff (cherry picked from commit 12043c549db5d96e4a810de1077def0cc2478140) (cherry picked from commit b72dd8dab63ba4d80e311602f2153c7d15897dfc) --- src/api/call-forwarding.js | 6 +- .../CscCfConditionPopupCustom.vue | 33 ++++ .../CscCfGroupConditionCustom.vue | 50 +++++ .../CscCfGroupConditionDate.vue | 6 +- .../CscCfGroupConditionDateRange.vue | 6 +- .../CscCfGroupConditionOfficeHours.vue | 16 +- .../CscCfGroupConditionWeekdays.vue | 2 + .../call-forwarding/CscCfGroupItem.vue | 9 +- .../call-forwarding/CscCfGroupTitle.vue | 20 +- .../CallForward/CscCallForwardDetails.vue | 6 +- src/filters/time-set.js | 84 +++++++- src/helpers/kamailio-timesets-converter.js | 38 +++- src/i18n/de.json | 16 ++ src/i18n/en.json | 16 ++ src/i18n/es.json | 16 ++ src/i18n/fr.json | 16 ++ src/i18n/it.json | 24 ++- src/pages/CscPageCf.vue | 6 +- src/pages/CscPagePbxGroupDetails.vue | 12 +- src/pages/CscPagePbxSeatDetails.vue | 23 ++- src/store/call-forwarding/actions.js | 185 ++++++++++++------ src/store/call-forwarding/mutations.js | 1 + src/store/pbx-seats.js | 3 + test/jest/utils/index.js | 12 +- 24 files changed, 496 insertions(+), 110 deletions(-) create mode 100644 src/components/call-forwarding/CscCfConditionPopupCustom.vue create mode 100644 src/components/call-forwarding/CscCfGroupConditionCustom.vue diff --git a/src/api/call-forwarding.js b/src/api/call-forwarding.js index c1feebbb..9dc960b4 100644 --- a/src/api/call-forwarding.js +++ b/src/api/call-forwarding.js @@ -41,14 +41,16 @@ export async function cfGetMostRecentDestinationSetByName (params) { export async function cfLoadSourceSets (subscriberId) { return getList({ resource: 'cfsourcesets', - params: (subscriberId) ? { subscriber_id: subscriberId } : {} + params: (subscriberId) ? { subscriber_id: subscriberId } : {}, + all: true }) } export async function cfLoadTimeSets (subscriberId) { return getList({ resource: 'cftimesets', - params: (subscriberId) ? { subscriber_id: subscriberId } : {} + params: (subscriberId) ? { subscriber_id: subscriberId } : {}, + all: true }) } diff --git a/src/components/call-forwarding/CscCfConditionPopupCustom.vue b/src/components/call-forwarding/CscCfConditionPopupCustom.vue new file mode 100644 index 00000000..71e4d956 --- /dev/null +++ b/src/components/call-forwarding/CscCfConditionPopupCustom.vue @@ -0,0 +1,33 @@ + + + diff --git a/src/components/call-forwarding/CscCfGroupConditionCustom.vue b/src/components/call-forwarding/CscCfGroupConditionCustom.vue new file mode 100644 index 00000000..eb24731e --- /dev/null +++ b/src/components/call-forwarding/CscCfGroupConditionCustom.vue @@ -0,0 +1,50 @@ + + + diff --git a/src/components/call-forwarding/CscCfGroupConditionDate.vue b/src/components/call-forwarding/CscCfGroupConditionDate.vue index 73796168..c31b78be 100644 --- a/src/components/call-forwarding/CscCfGroupConditionDate.vue +++ b/src/components/call-forwarding/CscCfGroupConditionDate.vue @@ -23,7 +23,7 @@ flat color="negative" icon="delete" - @click="deleteSourceSetEvent" + @click="deleteTimeSetEvent" /> { this.$wait.start(this.waitIdentifier) if (this.destinationSet.destinations.length > 1) { - await this.removeDestination(payload) + await this.triggerRemoveDestination(payload) this.setAnnouncement() } else { this.$emit('delete-last', payload) @@ -273,6 +273,13 @@ export default { this.$wait.end(this.waitIdentifier) }) }, + async triggerRemoveDestination (payload) { + try { + await this.removeDestination(payload) + } catch (e) { + showGlobalError(e.message) + } + }, async updateDestinationTimeoutEvent (payload) { this.$wait.start(this.waitIdentifier) await this.updateDestinationTimeout(payload) diff --git a/src/components/call-forwarding/CscCfGroupTitle.vue b/src/components/call-forwarding/CscCfGroupTitle.vue index 50292d48..a19910d4 100644 --- a/src/components/call-forwarding/CscCfGroupTitle.vue +++ b/src/components/call-forwarding/CscCfGroupTitle.vue @@ -144,7 +144,6 @@ > {{ $t('office hours are') }} - - {{ $filters.timeSetTimes(timeSet.times) }} - +