|
|
|
@ -139,7 +139,6 @@ export class GfActivitiesTableComponent implements AfterViewInit, OnInit { |
|
|
|
@ViewChild(MatPaginator) paginator: MatPaginator; |
|
|
|
@ViewChild(MatSort) sort: MatSort; |
|
|
|
|
|
|
|
public activityTypesTranslationMap = new Map<ActivityType, string>(); |
|
|
|
public hasDrafts = false; |
|
|
|
public hasErrors = false; |
|
|
|
public isDraftActivity = isDraftActivity; |
|
|
|
@ -147,6 +146,7 @@ export class GfActivitiesTableComponent implements AfterViewInit, OnInit { |
|
|
|
public selectedRows = new SelectionModel<Activity>(true, []); |
|
|
|
public typesFilter = new FormControl<string[]>([]); |
|
|
|
|
|
|
|
public readonly activityTypes = input<ActivityType[]>([]); |
|
|
|
public readonly dataSource = input.required< |
|
|
|
MatTableDataSource<Activity> | undefined |
|
|
|
>(); |
|
|
|
@ -173,6 +173,16 @@ export class GfActivitiesTableComponent implements AfterViewInit, OnInit { |
|
|
|
return routerLinks; |
|
|
|
}); |
|
|
|
|
|
|
|
protected readonly activityTypesTranslationMap = computed(() => { |
|
|
|
const translationMap = new Map<ActivityType, string>(); |
|
|
|
|
|
|
|
for (const activityType of this.activityTypes()) { |
|
|
|
translationMap.set(activityType, translate(activityType)); |
|
|
|
} |
|
|
|
|
|
|
|
return translationMap; |
|
|
|
}); |
|
|
|
|
|
|
|
protected readonly displayedColumns = computed(() => { |
|
|
|
let columns = [ |
|
|
|
'select', |
|
|
|
@ -220,13 +230,6 @@ export class GfActivitiesTableComponent implements AfterViewInit, OnInit { |
|
|
|
private readonly notificationService = inject(NotificationService); |
|
|
|
|
|
|
|
public constructor(private destroyRef: DestroyRef) { |
|
|
|
for (const type of Object.keys(ActivityType) as ActivityType[]) { |
|
|
|
this.activityTypesTranslationMap.set( |
|
|
|
ActivityType[type], |
|
|
|
translate(ActivityType[type]) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
addIcons({ |
|
|
|
alertCircleOutline, |
|
|
|
calendarClearOutline, |
|
|
|
|