51 lines
1.8 KiB
TypeScript
51 lines
1.8 KiB
TypeScript
import { Component, computed, input } from '@angular/core';
|
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
import { DfgPersonSummaryPage, TopicPageV2 } from '../../../api';
|
|
import { DfgProjectPage } from '../../../api/model/dfgProjectPage';
|
|
import { DfgInstitutionSummaryPage } from '../../../api/model/dfgInstitutionSummaryPage';
|
|
import { MatCardModule } from '@angular/material/card';
|
|
import { MatTabsModule } from '@angular/material/tabs';
|
|
import { ProjectFilterComponent } from '../project-filters/project-filters.component';
|
|
import { DfgProjectTableComponent } from '../dfg-project-table/dfg-project-table.component';
|
|
import { dfgProjectQueryParamKeys } from '../../../resolvers/dfg-projects.resolver';
|
|
|
|
@Component({
|
|
selector: 'app-dfg-projects',
|
|
imports: [
|
|
MatCardModule,
|
|
MatTabsModule,
|
|
ProjectFilterComponent,
|
|
DfgProjectTableComponent,
|
|
],
|
|
templateUrl: './dfg-projects.component.html',
|
|
styleUrl: './dfg-projects.component.scss',
|
|
})
|
|
export class DfgProjectsComponent {
|
|
dfgProjectPage = input.required<DfgProjectPage>();
|
|
|
|
selectedDfgInstitutionsPage = input.required<DfgInstitutionSummaryPage>();
|
|
selectedDfgAuthorsPage = input.required<DfgPersonSummaryPage>();
|
|
|
|
selectedTopicsPage = input.required<TopicPageV2>();
|
|
|
|
readonly dfgQueryParamKeys = dfgProjectQueryParamKeys;
|
|
|
|
constructor(
|
|
private readonly router: Router,
|
|
private readonly activatedRoute: ActivatedRoute,
|
|
) {}
|
|
ngOnInit(): void {
|
|
console.log('DFG PROJECTS', this.dfgProjectPage());
|
|
}
|
|
queryParamMap = toSignal(this.activatedRoute.queryParamMap, {
|
|
initialValue: this.activatedRoute.snapshot.queryParamMap,
|
|
});
|
|
readonly topicFilterEnabled = computed(
|
|
() =>
|
|
// fuz
|
|
this.queryParamMap().get('fuzzy') === 'true' ||
|
|
this.queryParamMap().get('fuzzy') === null,
|
|
);
|
|
}
|