This is an automated email from the ASF dual-hosted git repository.

dahn pushed a commit to branch 4.19
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.19 by this push:
     new 97be6f2e5d1 ui: fix column filter for templates, isos (#10288)
97be6f2e5d1 is described below

commit 97be6f2e5d13c4fd2941f30522deebae0ab71827
Author: Abhishek Kumar <[email protected]>
AuthorDate: Fri Jan 31 14:53:26 2025 +0530

    ui: fix column filter for templates, isos (#10288)
    
    Signed-off-by: Abhishek Kumar <[email protected]>
---
 ui/src/components/view/ListView.vue | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/ui/src/components/view/ListView.vue 
b/ui/src/components/view/ListView.vue
index e67f1c4cc78..0c19ea8edab 100644
--- a/ui/src/components/view/ListView.vue
+++ b/ui/src/components/view/ListView.vue
@@ -32,7 +32,7 @@
         <a-menu>
           <a-menu-item v-for="(column, idx) in columnKeys" :key="idx" 
@click="updateSelectedColumns(column)">
             <a-checkbox :id="idx.toString()" 
:checked="selectedColumns.includes(getColumnKey(column))"/>
-            {{ $t('label.' + String(getColumTitle(column)).toLowerCase()) }}
+            {{ $t('label.' + String(getColumnTitle(column)).toLowerCase()) }}
           </a-menu-item>
         </a-menu>
       </div>
@@ -911,16 +911,16 @@ export default {
       return host.state
     },
     getColumnKey (name) {
-      if (typeof name === 'object') {
-        name = Object.keys(name).includes('field') ? name.field : 
name.customTitle
+      if (typeof name !== 'object' || name === null) {
+        return name
       }
-      return name
+      return name.field ?? name.customTitle ?? Object.keys(name)[0]
     },
-    getColumTitle (name) {
-      if (typeof name === 'object') {
-        name = Object.keys(name).includes('customTitle') ? name.customTitle : 
name.field
+    getColumnTitle (name) {
+      if (typeof name !== 'object' || name === null) {
+        return name
       }
-      return name
+      return name.customTitle ?? name.field ?? Object.keys(name)[0]
     },
     updateSelectedColumns (name) {
       this.$emit('update-selected-columns', name)

Reply via email to