From b59105e6959e96def3b0bfad4d295a16ee5bf1b7 Mon Sep 17 00:00:00 2001 From: Vishesh Date: Thu, 23 Jan 2025 12:40:28 +0530 Subject: [PATCH 1/2] UI: Fix domain view when opening details for a specific domainid --- ui/src/views/iam/DomainView.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/src/views/iam/DomainView.vue b/ui/src/views/iam/DomainView.vue index 997f900bbf7a..0cf680e13716 100644 --- a/ui/src/views/iam/DomainView.vue +++ b/ui/src/views/iam/DomainView.vue @@ -56,6 +56,7 @@ :loading="loading" :tabs="$route.meta.tabs" /> this.$route.params.id, + this.fetchData, + { immediate: true } + ) eventBus.on('refresh-domain-icon', () => { if (this.$showIcon()) { this.fetchData() From fcee7152bf87aedc37dcd7d2fde3133952f0cdd3 Mon Sep 17 00:00:00 2001 From: Vishesh Date: Thu, 23 Jan 2025 15:44:48 +0530 Subject: [PATCH 2/2] Fix 404 on back button --- ui/src/views/iam/DomainView.vue | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/ui/src/views/iam/DomainView.vue b/ui/src/views/iam/DomainView.vue index 0cf680e13716..ed875151a133 100644 --- a/ui/src/views/iam/DomainView.vue +++ b/ui/src/views/iam/DomainView.vue @@ -134,19 +134,22 @@ export default { }, created () { this.domainStore = store.getters.domainStore - // When the route changes from /domain/:id to /domain or vice versa, the component is not destroyed and created again - // So, we need to watch the route params to fetch the data again to update the component - this.$watch( - () => this.$route.params.id, - this.fetchData, - { immediate: true } - ) + this.fetchData() eventBus.on('refresh-domain-icon', () => { if (this.$showIcon()) { this.fetchData() } }) }, + watch: { + '$route' (to, from) { + // When the route changes from /domain/:id to /domain or vice versa, the component is not destroyed and created again + // So, we need to watch the route params to fetch the data again to update the component + if (to.path.startsWith('/domain') && from.params.id !== to.params.id) { + this.fetchData() + } + } + }, provide () { return { parentCloseAction: this.closeAction,