Skip to content

Commit b61c761

Browse files
committed
mgr/dashboard: fix table column pipe transform
Fixes: https://tracker.ceph.com/issues/68062 Signed-off-by: Ivo Almeida <[email protected]>
1 parent a278231 commit b61c761

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
@@ -418,12 +418,15 @@ export class TableComponent implements AfterViewInit, OnInit, OnChanges, OnDestr
418418
next: (values) => {
419419
const datasets: TableItem[][] = values.map((val) => {
420420
return this.tableColumns.map((column: CdTableColumn, colIndex: number) => {
421-
const rowValue = _.get(val, column.prop);
421+
const rowValue = _.get(val, column?.prop);
422+
423+
const pipeTransform = () =>
424+
column?.prop ? column.pipe.transform(rowValue) : column.pipe.transform(val);
422425

423426
let tableItem = new TableItem({
424427
selected: val,
425428
data: {
426-
value: column.pipe ? column.pipe.transform(rowValue) : rowValue,
429+
value: column.pipe ? pipeTransform() : rowValue,
427430
row: val,
428431
column: { ...column, ...val }
429432
}

0 commit comments

Comments
 (0)