Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class DatasetDetailDynamicComponent implements OnInit, OnDestroy {
private router: Router,
private snackBar: MatSnackBar,
) {
this.translateService.use("datasetCustom");
this.translateService.use("dataset");
}

ngOnInit() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class DatasetDetailComponent implements OnInit, OnDestroy {
private router: Router,
private fb: FormBuilder,
) {
this.translateService.use("datasetDefault");
this.translateService.use("dataset");
}

ngOnInit() {
Expand Down
23 changes: 21 additions & 2 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,7 @@
} 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";

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

View workflow job for this annotation

GitHub Actions / eslint

Replace `·BehaviorSubject,·Subscription,·forkJoin,·lastValueFrom,·map,·take·` with `⏎··BehaviorSubject,⏎··Subscription,⏎··forkJoin,⏎··lastValueFrom,⏎··map,⏎··take,⏎`
import { Store } from "@ngrx/store";
import {
clearSelectionAction,
Expand Down Expand Up @@ -64,6 +64,7 @@
import { actionMenu } from "shared/modules/dynamic-material-table/utilizes/default-table-settings";
import { TableConfigService } from "shared/services/table-config.service";
import { selectInstruments } from "state-management/selectors/instruments.selectors";
import { TranslateService } from "@ngx-translate/core";

export interface SortChangeEvent {
active: string;
Expand Down Expand Up @@ -155,7 +156,10 @@
private fileSize: FileSizePipe,
private titleCase: TitleCasePipe,
private tableConfigService: TableConfigService,
) {}
private translateService: TranslateService,

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

View workflow job for this annotation

GitHub Actions / eslint

Delete `····`
) {
this.translateService.use("dataset");
}

private getInstrumentName(row: OutputDatasetObsoleteDto): string {
const instrument = this.instrumentMap.get(row.instrumentId);
Expand Down Expand Up @@ -207,6 +211,21 @@
}

this.columns = currentColumnSetting;
const translated$ = forkJoin(
currentColumnSetting.map((i) =>
this.translateService.get(i.header || i.name).pipe(
map((translated) => ({
...i,
header: translated,
})

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

View workflow job for this annotation

GitHub Actions / eslint

Insert `),`
))

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

View workflow job for this annotation

GitHub Actions / eslint

Replace `)` with `,`
)

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

View workflow job for this annotation

GitHub Actions / eslint

Insert `,`
);

translated$.subscribe((result) => {
this.columns = result;
});

this.setting = settingConfig;
this.pagination = paginationConfig;
}
Expand Down
Loading