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

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


The following commit(s) were added to refs/heads/main by this push:
     new d22a3d517d8 ui: fix conflict/regression found in AutogenView
d22a3d517d8 is described below

commit d22a3d517d88d7dd49bb34a6455441303e516495
Author: Rohit Yadav <[email protected]>
AuthorDate: Fri Aug 11 16:38:52 2023 +0530

    ui: fix conflict/regression found in AutogenView
    
    After forward merged from 4.18->main, found a regression due to
    3c25a3542655f29543624bcb7b6940afdb20937e where any columns which are
    custom functions don't render. Such as metrics columns.
    
    Signed-off-by: Rohit Yadav <[email protected]>
---
 ui/src/views/AutogenView.vue | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue
index 3c476e168ae..ea448b449d4 100644
--- a/ui/src/views/AutogenView.vue
+++ b/ui/src/views/AutogenView.vue
@@ -835,6 +835,7 @@ export default {
         })
       }
 
+      const customRender = {}
       for (var columnKey of this.columnKeys) {
         let key = columnKey
         let title = columnKey === 'cidr' && 
this.columnKeys.includes('ip6cidr') ? 'ipv4.cidr' : columnKey
@@ -842,9 +843,11 @@ export default {
           if ('customTitle' in columnKey && 'field' in columnKey) {
             key = columnKey.field
             title = columnKey.customTitle
+            customRender[key] = columnKey[key]
           } else {
             key = Object.keys(columnKey)[0]
             title = Object.keys(columnKey)[0]
+            customRender[key] = columnKey[key]
           }
         }
         this.columns.push({
@@ -981,6 +984,12 @@ export default {
 
         for (let idx = 0; idx < this.items.length; idx++) {
           this.items[idx].key = idx
+          for (const key in customRender) {
+            const func = customRender[key]
+            if (func && typeof func === 'function') {
+              this.items[idx][key] = func(this.items[idx])
+            }
+          }
           if (this.$route.path.startsWith('/ldapsetting')) {
             this.items[idx].id = this.items[idx].hostname
           }

Reply via email to