From 052a34c1fb97bfb532ffde2bb8c3c5af6f7eafec Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Wed, 17 Aug 2022 15:47:31 +0530 Subject: [PATCH] ui: fix resource tags visibility in infocard (#6650) Fixes #6649 Signed-off-by: Abhishek Kumar --- ui/src/components/view/InfoCard.vue | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/ui/src/components/view/InfoCard.vue b/ui/src/components/view/InfoCard.vue index aca442688b6..02385ff174a 100644 --- a/ui/src/components/view/InfoCard.vue +++ b/ui/src/components/view/InfoCard.vue @@ -772,21 +772,13 @@ export default { handler (newData, oldData) { if (newData === oldData) return this.newResource = newData - this.resourceType = this.$route.meta.resourceType this.showKeys = false this.setData() - if (this.tagsSupportingResourceTypes.includes(this.resourceType)) { - if ('tags' in this.resource) { - this.tags = this.resource.tags - } else if (this.resourceType) { - this.getTags() - } - } if ('apikey' in this.resource) { this.getUserKeys() } - this.getIcons() + this.updateResourceAdditionalData() } }, async templateIcon () { @@ -798,7 +790,7 @@ export default { eventBus.on('handle-close', (showModal) => { this.showUploadModal(showModal) }) - this.getIcons() + this.updateResourceAdditionalData() }, computed: { tagsSupportingResourceTypes () { @@ -834,6 +826,18 @@ export default { } }, methods: { + updateResourceAdditionalData () { + if (!this.resource) return + this.resourceType = this.$route.meta.resourceType + if (this.tagsSupportingResourceTypes.includes(this.resourceType)) { + if ('tags' in this.resource) { + this.tags = this.resource.tags + } else if (this.resourceType) { + this.getTags() + } + } + this.getIcons() + }, showUploadModal (show) { if (show) { if (this.$showIcon()) {