Skip to content

Commit 17ec4fc

Browse files
UI: Fix duplicate quickview (for provider column) in backup repository (#11849)
* UI: Fix quickview (for provider column) in backup repository * Consolidated quickview checks with first column, column key * quickViewEnabled condition update
1 parent 30e6c22 commit 17ec4fc

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

ui/src/components/view/ListView.vue

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
</div>
5050
</template>
5151
<template #bodyCell="{ column, text, record }">
52-
<template v-if="['name', 'provider'].includes(column.key) ">
52+
<template v-if="['name', 'provider'].includes(column.key)">
5353
<span
5454
v-if="['vm', 'vnfapp'].includes($route.path.split('/')[1])"
5555
style="margin-right: 5px"
@@ -70,7 +70,7 @@
7070
style="margin-left: 5px"
7171
:actions="actions"
7272
:resource="record"
73-
:enabled="quickViewEnabled() && actions.length > 0 && columns && ['name', 'provider'].includes(columns[0].dataIndex)"
73+
:enabled="quickViewEnabled(actions, columns, column.key)"
7474
@exec-action="$parent.execAction"
7575
/>
7676
<span
@@ -257,7 +257,7 @@
257257
style="margin-right: 8px"
258258
:actions="actions"
259259
:resource="record"
260-
:enabled="quickViewEnabled() && actions.length > 0"
260+
:enabled="quickViewEnabled(actions, columns, column.key)"
261261
@exec-action="$parent.execAction"
262262
/>
263263
<span v-if="record.intervaltype===0">
@@ -282,7 +282,7 @@
282282
style="margin-left: 5px"
283283
:actions="actions"
284284
:resource="record"
285-
:enabled="quickViewEnabled() && actions.length > 0 && columns && columns[0].dataIndex === 'displayname' "
285+
:enabled="quickViewEnabled(actions, columns, column.key)"
286286
@exec-action="$parent.execAction"
287287
/>
288288
<router-link :to="{ path: $route.path + '/' + record.id }">{{ text }}</router-link>
@@ -436,7 +436,7 @@
436436
style="margin-left: 5px"
437437
:actions="actions"
438438
:resource="record"
439-
:enabled="quickViewEnabled() && actions.length > 0 && columns && columns[0].dataIndex === 'hypervisor' "
439+
:enabled="quickViewEnabled(actions, columns, column.key)"
440440
@exec-action="$parent.execAction"
441441
/>
442442
<router-link :to="{ path: $route.path + '/' + record.id }">{{ text }}</router-link>
@@ -845,7 +845,7 @@
845845
style="margin-left: 5px"
846846
:actions="actions"
847847
:resource="record"
848-
:enabled="quickViewEnabled() && actions.length > 0"
848+
:enabled="quickViewEnabled(actions, columns, column.key)"
849849
@exec-action="$parent.execAction"
850850
/>
851851
</template>
@@ -1208,17 +1208,19 @@ export default {
12081208
'/tungstenpolicyset', '/tungstenroutingpolicy', '/firewallrule', '/tungstenfirewallpolicy'].includes(this.$route.path)
12091209
},
12101210
createPathBasedOnVmType: createPathBasedOnVmType,
1211-
quickViewEnabled () {
1212-
return new RegExp(['/vm', '/kubernetes', '/ssh', '/userdata', '/vmgroup', '/affinitygroup', '/autoscalevmgroup',
1213-
'/volume', '/snapshot', '/vmsnapshot', '/backup',
1214-
'/guestnetwork', '/vpc', '/vpncustomergateway', '/vnfapp',
1215-
'/template', '/iso',
1216-
'/project', '/account', 'buckets', 'objectstore',
1217-
'/zone', '/pod', '/cluster', '/host', '/storagepool', '/imagestore', '/systemvm', '/router', '/ilbvm', '/annotation',
1218-
'/computeoffering', '/systemoffering', '/diskoffering', '/backupoffering', '/networkoffering', '/vpcoffering',
1219-
'/tungstenfabric', '/oauthsetting', '/guestos', '/guestoshypervisormapping', '/webhook', 'webhookdeliveries', 'webhookfilters', '/quotatariff', '/sharedfs',
1220-
'/ipv4subnets', '/managementserver', '/gpucard', '/gpudevices', '/vgpuprofile', '/extension', '/snapshotpolicy', '/backupschedule'].join('|'))
1221-
.test(this.$route.path)
1211+
quickViewEnabled (actions, columns, key) {
1212+
return actions.length > 0 &&
1213+
(columns && key === columns[0].dataIndex) &&
1214+
new RegExp(['/vm', '/kubernetes', '/ssh', '/userdata', '/vmgroup', '/affinitygroup', '/autoscalevmgroup',
1215+
'/volume', '/snapshot', '/vmsnapshot', '/backup',
1216+
'/guestnetwork', '/vpc', '/vpncustomergateway', '/vnfapp',
1217+
'/template', '/iso',
1218+
'/project', '/account', 'buckets', 'objectstore',
1219+
'/zone', '/pod', '/cluster', '/host', '/storagepool', '/imagestore', '/systemvm', '/router', '/ilbvm', '/annotation',
1220+
'/computeoffering', '/systemoffering', '/diskoffering', '/backupoffering', '/networkoffering', '/vpcoffering',
1221+
'/tungstenfabric', '/oauthsetting', '/guestos', '/guestoshypervisormapping', '/webhook', 'webhookdeliveries', 'webhookfilters', '/quotatariff', '/sharedfs',
1222+
'/ipv4subnets', '/managementserver', '/gpucard', '/gpudevices', '/vgpuprofile', '/extension', '/snapshotpolicy', '/backupschedule'].join('|'))
1223+
.test(this.$route.path)
12221224
},
12231225
enableGroupAction () {
12241226
return ['vm', 'alert', 'vmgroup', 'ssh', 'userdata', 'affinitygroup', 'autoscalevmgroup', 'volume', 'snapshot',

0 commit comments

Comments
 (0)