Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions src/app/datasets/dataset-table/dataset-table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,7 @@ export class DatasetTableComponent implements OnInit, OnDestroy {
if (event === TableEventType.SortChanged) {
const { active, direction } = sender as Sort;

let column = active;
if (column === "runNumber") {
column = "scientificMetadata.runNumber.value";
}
const column = active;

this.store.dispatch(sortByColumnAction({ column, direction }));
}
Expand Down Expand Up @@ -367,8 +364,7 @@ export class DatasetTableComponent implements OnInit, OnDestroy {

onSortChange(event: SortChangeEvent): void {
const { active, direction } = event;
let column = active.split("_")[1];
if (column === "runNumber") column = "scientificMetadata.runNumber.value";
const column = active.split("_")[1];
this.store.dispatch(sortByColumnAction({ column, direction }));
}

Expand All @@ -387,13 +383,6 @@ export class DatasetTableComponent implements OnInit, OnDestroy {
tooltip: column.tooltip,
};

if (column.name === "runNumber" && column.type !== "custom") {
// NOTE: This is for the saved columns in the database or the old config.
convertedColumn.customRender = (c, row) =>
lodashGet(row, "scientificMetadata.runNumber.value");
convertedColumn.toExport = (row) =>
lodashGet(row, "scientificMetadata.runNumber.value");
}
// NOTE: This is how we render the custom columns if new config is used.
if (column.type === "custom") {
convertedColumn.customRender = (c, row) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,6 @@ export class DynamicMatTableComponent<T extends TableRow>
if (column.customRender) {
return column.customRender(column, row);
}

return row[column.name];
}

Expand Down
Loading