From 4e72e67697a6ff162be49bb001eaf54cf8ba4d28 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 --- 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 43456ebd..c840b643 100644 --- a/src/pages/CscPagePbxGroupDetails.vue +++ b/src/pages/CscPagePbxGroupDetails.vue @@ -386,7 +386,8 @@ export default { 'isGroupLoading', 'getHuntCancelModeOptions', 'getAnnouncementCfu', - 'getAnnouncementCallSetup' + 'getAnnouncementCallSetup', + 'isGroupMapByIdEmpty' ]), ...mapGetters('callForwarding', [ 'groups' @@ -466,7 +467,10 @@ export default { } } }, - async mounted () { + async mounted () { + if (this.isGroupMapByIdEmpty) { + await this.loadGroupListItems() + } this.selectGroup(this.id) await this.loadMappingsFull(this.id) }, @@ -493,7 +497,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 0799ce5e..c14c47f0 100644 --- a/src/store/pbx-groups.js +++ b/src/store/pbx-groups.js @@ -52,6 +52,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