Skip to content

Commit d13057a

Browse files
authored
ui: show tags only for supported resources (#5798)
* ui: prevent incorrect tags displa for primary storage Tags in info card of the UI are related to tags functionality(create/delete/lsitTags API) UI was incorrectly showing storage tags as these tags in the UI. Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com> * remove logging Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com> * ui: show tags only for supported resources Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent 6728b69 commit d13057a

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

ui/src/components/view/InfoCard.vue

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@
651651
</div>
652652
</div>
653653

654-
<div class="account-center-tags" v-if="!isStatic && resourceType && 'listTags' in $store.getters.apis">
654+
<div class="account-center-tags" v-if="!isStatic && resourceType && tagsSupportingResourceTypes.includes(this.resourceType) && 'listTags' in $store.getters.apis">
655655
<a-divider/>
656656
<a-spin :spinning="loadingTags">
657657
<div class="title">{{ $t('label.tags') }}</div>
@@ -772,10 +772,12 @@ export default {
772772
this.showKeys = false
773773
this.setData()
774774
775-
if ('tags' in this.resource) {
776-
this.tags = this.resource.tags
777-
} else if (this.resourceType) {
778-
this.getTags()
775+
if (this.tagsSupportingResourceTypes.includes(this.resourceType)) {
776+
if ('tags' in this.resource) {
777+
this.tags = this.resource.tags
778+
} else if (this.resourceType) {
779+
this.getTags()
780+
}
779781
}
780782
if ('apikey' in this.resource) {
781783
this.getUserKeys()
@@ -794,6 +796,12 @@ export default {
794796
await this.getIcons()
795797
},
796798
computed: {
799+
tagsSupportingResourceTypes () {
800+
return ['UserVm', 'Template', 'ISO', 'Volume', 'Snapshot', 'Backup', 'Network',
801+
'LoadBalancer', 'PortForwardingRule', 'FirewallRule', 'SecurityGroup', 'SecurityGroupRule',
802+
'PublicIpAddress', 'Project', 'Account', 'Vpc', 'NetworkACL', 'StaticRoute', 'VMSnapshot',
803+
'RemoteAccessVpn', 'User', 'SnapshotPolicy', 'VpcOffering']
804+
},
797805
name () {
798806
return this.resource.displayname || this.resource.displaytext || this.resource.name || this.resource.username ||
799807
this.resource.ipaddress || this.resource.virtualmachinename || this.resource.templatetype

0 commit comments

Comments
 (0)