Skip to content

Commit 3af10f7

Browse files
shwstpprdhslove
authored andcommitted
ui: fix column filter for templates, isos (apache#10288)
Signed-off-by: Abhishek Kumar <[email protected]>
1 parent 1ab5c7f commit 3af10f7

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
@@ -33,7 +33,7 @@
3333
<a-menu>
3434
<a-menu-item v-for="(column, idx) in columnKeys" :key="idx" @click="updateSelectedColumns(column)">
3535
<a-checkbox :id="idx.toString()" :checked="selectedColumns.includes(getColumnKey(column))"/>
36-
{{ $t('label.' + String(getColumTitle(column)).toLowerCase()) }}
36+
{{ $t('label.' + String(getColumnTitle(column)).toLowerCase()) }}
3737
</a-menu-item>
3838
</a-menu>
3939
</div>
@@ -1031,16 +1031,16 @@ export default {
10311031
return host.state
10321032
},
10331033
getColumnKey (name) {
1034-
if (typeof name === 'object') {
1035-
name = Object.keys(name).includes('field') ? name.field : name.customTitle
1034+
if (typeof name !== 'object' || name === null) {
1035+
return name
10361036
}
1037-
return name
1037+
return name.field ?? name.customTitle ?? Object.keys(name)[0]
10381038
},
1039-
getColumTitle (name) {
1040-
if (typeof name === 'object') {
1041-
name = Object.keys(name).includes('customTitle') ? name.customTitle : name.field
1039+
getColumnTitle (name) {
1040+
if (typeof name !== 'object' || name === null) {
1041+
return name
10421042
}
1043-
return name
1043+
return name.customTitle ?? name.field ?? Object.keys(name)[0]
10441044
},
10451045
handleResizeColumn (w, col) {
10461046
col.width = w

0 commit comments

Comments
 (0)