Skip to content

Commit 8ccb652

Browse files
authored
Merge pull request ceph#59777 from ivoalmeida/table-column-pipe-transform-fix
mgr/dashboard: fix table column pipe transform Reviewed-by: Afreen Misbah <[email protected]>
2 parents 1234ac5 + b61c761 commit 8ccb652

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,12 +436,15 @@ export class TableComponent implements AfterViewInit, OnInit, OnChanges, OnDestr
436436
next: (values) => {
437437
const datasets: TableItem[][] = values.map((val) => {
438438
return this.tableColumns.map((column: CdTableColumn, colIndex: number) => {
439-
const rowValue = _.get(val, column.prop);
439+
const rowValue = _.get(val, column?.prop);
440+
441+
const pipeTransform = () =>
442+
column?.prop ? column.pipe.transform(rowValue) : column.pipe.transform(val);
440443

441444
let tableItem = new TableItem({
442445
selected: val,
443446
data: {
444-
value: column.pipe ? column.pipe.transform(rowValue) : rowValue,
447+
value: column.pipe ? pipeTransform() : rowValue,
445448
row: val,
446449
column: { ...column, ...val }
447450
}

0 commit comments

Comments
 (0)