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 4e72e67697)
mr12.5
Debora Crescenzo 2 months ago committed by Crescenzo Debora
parent 6c2102466e
commit 512bc6d4a7

@ -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'

@ -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

Loading…
Cancel
Save