]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix table column pipe transform 59777/head
authorIvo Almeida <ialmeida@redhat.com>
Fri, 13 Sep 2024 10:34:40 +0000 (11:34 +0100)
committerIvo Almeida <ialmeida@redhat.com>
Fri, 13 Sep 2024 10:35:32 +0000 (11:35 +0100)
Fixes: https://tracker.ceph.com/issues/68062
Signed-off-by: Ivo Almeida <ialmeida@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts

index 97bcee3dfe34836dc02352d3ed37c63a2b93e472..db54c9e386c878e13635a0171df8bcc808cc806b 100644 (file)
@@ -418,12 +418,15 @@ export class TableComponent implements AfterViewInit, OnInit, OnChanges, OnDestr
         next: (values) => {
           const datasets: TableItem[][] = values.map((val) => {
             return this.tableColumns.map((column: CdTableColumn, colIndex: number) => {
-              const rowValue = _.get(val, column.prop);
+              const rowValue = _.get(val, column?.prop);
+
+              const pipeTransform = () =>
+                column?.prop ? column.pipe.transform(rowValue) : column.pipe.transform(val);
 
               let tableItem = new TableItem({
                 selected: val,
                 data: {
-                  value: column.pipe ? column.pipe.transform(rowValue) : rowValue,
+                  value: column.pipe ? pipeTransform() : rowValue,
                   row: val,
                   column: { ...column, ...val }
                 }