Skip to content

Commit 97be6f2

Browse files
authored
ui: fix column filter for templates, isos (#10288)
Signed-off-by: Abhishek Kumar <[email protected]>
1 parent a335fea commit 97be6f2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ui/src/components/view/ListView.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<a-menu>
3333
<a-menu-item v-for="(column, idx) in columnKeys" :key="idx" @click="updateSelectedColumns(column)">
3434
<a-checkbox :id="idx.toString()" :checked="selectedColumns.includes(getColumnKey(column))"/>
35-
{{ $t('label.' + String(getColumTitle(column)).toLowerCase()) }}
35+
{{ $t('label.' + String(getColumnTitle(column)).toLowerCase()) }}
3636
</a-menu-item>
3737
</a-menu>
3838
</div>
@@ -911,16 +911,16 @@ export default {
911911
return host.state
912912
},
913913
getColumnKey (name) {
914-
if (typeof name === 'object') {
915-
name = Object.keys(name).includes('field') ? name.field : name.customTitle
914+
if (typeof name !== 'object' || name === null) {
915+
return name
916916
}
917-
return name
917+
return name.field ?? name.customTitle ?? Object.keys(name)[0]
918918
},
919-
getColumTitle (name) {
920-
if (typeof name === 'object') {
921-
name = Object.keys(name).includes('customTitle') ? name.customTitle : name.field
919+
getColumnTitle (name) {
920+
if (typeof name !== 'object' || name === null) {
921+
return name
922922
}
923-
return name
923+
return name.customTitle ?? name.field ?? Object.keys(name)[0]
924924
},
925925
updateSelectedColumns (name) {
926926
this.$emit('update-selected-columns', name)

0 commit comments

Comments
 (0)