Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
20 changes: 8 additions & 12 deletions src/app/datasets/dataset-table/dataset-table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@
} from "@angular/core";
import { TableColumn } from "state-management/models";
import { MatCheckboxChange } from "@angular/material/checkbox";
import { BehaviorSubject, Subscription, lastValueFrom, take } from "rxjs";
import {
BehaviorSubject,
Subscription,
forkJoin,
lastValueFrom,
map,
take,
} from "rxjs";
import { Store } from "@ngrx/store";
import {
clearSelectionAction,
Expand Down Expand Up @@ -271,10 +278,7 @@
if (event === TableEventType.SortChanged) {
const { active, direction } = sender as Sort;

let column = active;

Check failure on line 281 in src/app/datasets/dataset-table/dataset-table.component.ts

View workflow job for this annotation

GitHub Actions / eslint

'column' is never reassigned. Use 'const' instead
if (column === "runNumber") {
column = "scientificMetadata.runNumber.value";
}

this.store.dispatch(sortByColumnAction({ column, direction }));
}
Expand Down Expand Up @@ -367,8 +371,7 @@

onSortChange(event: SortChangeEvent): void {
const { active, direction } = event;
let column = active.split("_")[1];

Check failure on line 374 in src/app/datasets/dataset-table/dataset-table.component.ts

View workflow job for this annotation

GitHub Actions / eslint

'column' is never reassigned. Use 'const' instead
if (column === "runNumber") column = "scientificMetadata.runNumber.value";
this.store.dispatch(sortByColumnAction({ column, direction }));
}

Expand All @@ -387,13 +390,6 @@
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