From 6ccaba532594508577296bc38ea88f17460dc693 Mon Sep 17 00:00:00 2001 From: Debora Crescenzo Date: Mon, 15 Sep 2025 16:15:44 +0100 Subject: [PATCH] MT#63384 Fix Group Details page crash upon refresh Fixed an issue where the component tried to access the `id` property of `this.groupSelected` when it was undefined. This happened because the state gets cleared on refresh, and the component didn't have a check to reload the necessary resources. - Added check to ensure resources are reloaded if state is cleared - Prevent accessing `id` of undefined in the component Change-Id: Ib6b669df87d255cf174254b32fa1c451d0901f73 (cherry picked from commit 4e72e67697a6ff162be49bb001eaf54cf8ba4d28) (cherry picked from commit 512bc6d4a706e8282dcf3607ecf7f8366eba3258) --- src/pages/CscPagePbxGroupDetails.vue | 11 ++++++++--- src/store/pbx-groups.js | 3 +++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/pages/CscPagePbxGroupDetails.vue b/src/pages/CscPagePbxGroupDetails.vue index 40000aa0..39f43171 100644 --- a/src/pages/CscPagePbxGroupDetails.vue +++ b/src/pages/CscPagePbxGroupDetails.vue @@ -399,7 +399,8 @@ export default { 'isGroupLoading', 'getHuntCancelModeOptions', 'getAnnouncementCfu', - 'getAnnouncementCallSetup' + 'getAnnouncementCallSetup', + 'isGroupMapByIdEmpty' ]), ...mapGetters('callForwarding', [ 'groups' @@ -480,7 +481,10 @@ export default { } } }, - async mounted () { + async mounted () { + if (this.isGroupMapByIdEmpty) { + await this.loadGroupListItems() + } this.selectGroup(this.id) await this.loadMappingsFull(this.id) }, @@ -507,7 +511,8 @@ export default { 'setGroupNumbers', 'setGroupSoundSet', 'setAnnouncementCallSetup', - 'setAnnouncementCfu' + 'setAnnouncementCfu', + 'loadGroupListItems' ]), ...mapActions('pbxCallQueues', [ 'jumpToCallQueue' diff --git a/src/store/pbx-groups.js b/src/store/pbx-groups.js index 79f8f614..648161e1 100644 --- a/src/store/pbx-groups.js +++ b/src/store/pbx-groups.js @@ -57,6 +57,9 @@ export default { getters.isGroupRemoving || getters.isGroupUpdating return !getters.isGroupListEmpty && requesting && state.groupListLastPage > 1 }, + isGroupMapByIdEmpty (state) { + return Object.keys(state.groupMapById).length === 0 + }, isGroupAddFormDisabled (state) { return state.groupCreationState === CreationState.initiated || state.groupCreationState === CreationState.created