Fixed navigation to single dfg project from person projects
LocationBasedServices/smartguide/pipeline/head This commit looks good

This commit is contained in:
Mats Paul Tončik
2026-06-19 10:48:17 +02:00
parent e7cf85116d
commit 000b68758d
4 changed files with 15 additions and 33 deletions
@@ -17,7 +17,6 @@ import {
SortDirection,
} from '@angular/material/sort';
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
import { Router } from '@angular/router';
export interface BaseColumn<T> {
id: string;
@@ -58,8 +57,6 @@ export class DataTableComponent<T> implements AfterViewInit {
activeSortKey = input<string>('');
sortDirection = input<SortDirection>('');
navigatePrefix=input<string>('');
navigateField=input<string>('');
sortChange = output<Sort>();
displayedColumns = computed(() => this.columns().map((col) => col.id));
@@ -67,7 +64,7 @@ export class DataTableComponent<T> implements AfterViewInit {
sort = viewChild.required(MatSort);
constructor(private router:Router) {
constructor() {
effect(() => {
const currentData = this.data();
@@ -112,16 +109,6 @@ export class DataTableComponent<T> implements AfterViewInit {
this.sortChange.emit(sort);
}
navigateToDataField(row: any): void {
if (!this.navigatePrefix() || !this.navigateField()) {
return;
}
const value = row[this.navigateField()];
if (value != null) {
this.router.navigate([this.navigatePrefix(), value]);
}
}
toggleRow(row: T): void {
if (!this.detailTemplate()) return;
this.expandedElement.update((current) => (current === row ? null : row));