cleaned components due to new resolving logic and new DFG and EU components
This commit is contained in:
+18
-30
@@ -3,34 +3,22 @@
|
||||
<h5 style="font-weight: bold">Projekte</h5>
|
||||
<p>Übersicht der durchgeführten Projekte.</p>
|
||||
</div>
|
||||
<mat-card appearance="outlined">
|
||||
<mat-card-content>
|
||||
<mat-tab-group
|
||||
[selectedIndex]="selectedTabIndex()"
|
||||
(selectedIndexChange)="onTabChange($event)">
|
||||
<mat-tab label="DFG">
|
||||
<app-project-filters
|
||||
[selectedInstitutionsPage]="selectedDfgInstitutionsPage()"
|
||||
[selectedAuthorsPage]="selectedDfgAuthorsPage()"
|
||||
[selectedTopicsPage]="selectedTopicsPage()"
|
||||
[showFundingStartFilter]="true"
|
||||
[showTopicFilter]="fuzzySearch()"
|
||||
[showFundingEndFilter]="true"
|
||||
[showAuthorFilter]="true"
|
||||
[showInstitutionFilter]="true" />
|
||||
<app-dfg-project-table
|
||||
[page]="dfgProjectPage()"
|
||||
[authorFilterEnabled]="true"
|
||||
[topicFilterEnabled]="fuzzySearch()"
|
||||
[institutionFilterEnabled]="true" />
|
||||
</mat-tab>
|
||||
<mat-tab label="EU">
|
||||
<!-- <app-project-filters
|
||||
[selectedInstitutionsPage]="selectedEuInstitutionsPage()"
|
||||
[selectedAuthorsPage]="selectedEuAuthorsPage()" /> -->
|
||||
<app-eu-project-table [page]="personCordisEuProjectPage()" />
|
||||
</mat-tab>
|
||||
</mat-tab-group>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
<nav mat-tab-nav-bar [tabPanel]="resultTabPanel" class="result-nav">
|
||||
@for (route of childRoutes; track route.path) {
|
||||
<a
|
||||
matTabLink
|
||||
[routerLink]="[route.path]"
|
||||
queryParamsHandling="merge"
|
||||
routerLinkActive
|
||||
#rla="routerLinkActive"
|
||||
[active]="rla.isActive">
|
||||
{{ route.label }}
|
||||
</a>
|
||||
}
|
||||
</nav>
|
||||
|
||||
<mat-tab-nav-panel #resultTabPanel>
|
||||
<router-outlet />
|
||||
</mat-tab-nav-panel>
|
||||
</div>
|
||||
|
||||
+20
-48
@@ -1,73 +1,45 @@
|
||||
import { Component, computed, input, signal } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { toSignal } from '@angular/core/rxjs-interop';
|
||||
import { DfgInstitutionSummaryPage } from '../../../../api/model/dfgInstitutionSummaryPage';
|
||||
import {
|
||||
CordisEuProjectPage,
|
||||
DfgProjectPage,
|
||||
AuthorPage,
|
||||
InstitutionPageV2,
|
||||
DfgPersonSummaryPage,
|
||||
TopicPageV2,
|
||||
} from '../../../../api';
|
||||
import { Component } from '@angular/core';
|
||||
import { RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router';
|
||||
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatTabsModule } from '@angular/material/tabs';
|
||||
import { ProjectFilterComponent } from '../../../../shared/ui/project-filters/project-filters.component';
|
||||
import { DfgProjectTableComponent } from '../../../../shared/ui/dfg-project-table/dfg-project-table.component';
|
||||
import { EuProjectTableComponent } from '../../../../shared/ui/eu-project-table/eu-project-table.component';
|
||||
import { projectQueryParamKeys } from '../../../../resolvers/dfg-projects.resolver';
|
||||
import { euProjectQueryParamKeys } from '../../../../resolvers/person-cordis-eu-project-page.resolver';
|
||||
import { OnInit, computed } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { toSignal } from '@angular/core/rxjs-interop';
|
||||
|
||||
const PROJECT_TAB_QUERY_PARAM_KEY = 'project_type';
|
||||
|
||||
import { SearchResultsStateService } from '../search-results-state.service';
|
||||
@Component({
|
||||
selector: 'app-projects-results',
|
||||
imports: [
|
||||
MatCardModule,
|
||||
MatTabsModule,
|
||||
ProjectFilterComponent,
|
||||
DfgProjectTableComponent,
|
||||
EuProjectTableComponent,
|
||||
RouterLink,
|
||||
RouterLinkActive,
|
||||
RouterOutlet,
|
||||
],
|
||||
templateUrl: './projects-results.component.html',
|
||||
styleUrl: './projects-results.component.scss',
|
||||
})
|
||||
export class KeywordsToProjectsResultsComponent {
|
||||
dfgProjectPage = input.required<DfgProjectPage>();
|
||||
personCordisEuProjectPage = input.required<CordisEuProjectPage>();
|
||||
|
||||
selectedDfgInstitutionsPage = input.required<DfgInstitutionSummaryPage>();
|
||||
selectedDfgAuthorsPage = input.required<DfgPersonSummaryPage>();
|
||||
selectedTopicsPage = input.required<TopicPageV2>();
|
||||
|
||||
selectedEuInstitutionsPage = input.required<InstitutionPageV2>();
|
||||
selectedEuAuthorsPage = input.required<AuthorPage>();
|
||||
|
||||
readonly dfgQueryParamKeys = projectQueryParamKeys;
|
||||
readonly euQueryParamKeys = euProjectQueryParamKeys;
|
||||
|
||||
constructor(
|
||||
private readonly router: Router,
|
||||
private readonly activatedRoute: ActivatedRoute,
|
||||
) {}
|
||||
loading = signal<boolean>(false);
|
||||
|
||||
queryParamMap = toSignal(this.activatedRoute.queryParamMap, {
|
||||
initialValue: this.activatedRoute.snapshot.queryParamMap,
|
||||
});
|
||||
readonly fuzzySearch = computed(
|
||||
() => this.queryParamMap().get('fuzzy') === 'true',
|
||||
);
|
||||
selectedTabIndex = computed(() => {
|
||||
const type = this.queryParamMap().get(PROJECT_TAB_QUERY_PARAM_KEY);
|
||||
return type === 'eu' ? 1 : 0;
|
||||
});
|
||||
|
||||
onTabChange(index: number): void {
|
||||
const type = index === 1 ? 'eu' : 'dfg';
|
||||
this.router.navigate([], {
|
||||
queryParams: { [PROJECT_TAB_QUERY_PARAM_KEY]: type },
|
||||
queryParamsHandling: 'merge',
|
||||
});
|
||||
}
|
||||
readonly childRoutes = [
|
||||
{
|
||||
path: 'dfg',
|
||||
label: 'DFG-Projekte',
|
||||
},
|
||||
{
|
||||
path: 'eu',
|
||||
label: 'EU-Projekte',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@@ -3,34 +3,22 @@
|
||||
<h5 style="font-weight: bold">Projekte</h5>
|
||||
<p>Übersicht der durchgeführten Projekte.</p>
|
||||
</div>
|
||||
<mat-card appearance="outlined">
|
||||
<mat-card-content>
|
||||
<mat-tab-group
|
||||
[selectedIndex]="selectedTabIndex()"
|
||||
(selectedIndexChange)="onTabChange($event)">
|
||||
<mat-tab label="DFG">
|
||||
<app-project-filters
|
||||
[selectedInstitutionsPage]="selectedDfgInstitutionsPage()"
|
||||
[selectedAuthorsPage]="selectedDfgAuthorsPage()"
|
||||
[selectedTopicsPage]="selectedTopicsPage()"
|
||||
[showFundingStartFilter]="true"
|
||||
[showTopicFilter]="true"
|
||||
[showFundingEndFilter]="true"
|
||||
[showAuthorFilter]="true"
|
||||
[showInstitutionFilter]="true" />
|
||||
<app-dfg-project-table
|
||||
[page]="dfgProjectPage()"
|
||||
[authorFilterEnabled]="true"
|
||||
[topicFilterEnabled]="true"
|
||||
[institutionFilterEnabled]="true" />
|
||||
</mat-tab>
|
||||
<mat-tab label="EU">
|
||||
<!-- <app-project-filters
|
||||
[selectedInstitutionsPage]="selectedEuInstitutionsPage()"
|
||||
[selectedAuthorsPage]="selectedEuAuthorsPage()" /> -->
|
||||
<app-eu-project-table [page]="personCordisEuProjectPage()" />
|
||||
</mat-tab>
|
||||
</mat-tab-group>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
<nav mat-tab-nav-bar [tabPanel]="resultTabPanel" class="result-nav">
|
||||
@for (route of childRoutes; track route.path) {
|
||||
<a
|
||||
matTabLink
|
||||
[routerLink]="[route.path]"
|
||||
queryParamsHandling="merge"
|
||||
routerLinkActive
|
||||
#rla="routerLinkActive"
|
||||
[active]="rla.isActive">
|
||||
{{ route.label }}
|
||||
</a>
|
||||
}
|
||||
</nav>
|
||||
|
||||
<mat-tab-nav-panel #resultTabPanel>
|
||||
<router-outlet />
|
||||
</mat-tab-nav-panel>
|
||||
</div>
|
||||
|
||||
@@ -1,69 +1,31 @@
|
||||
import { Component, computed, input } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { toSignal } from '@angular/core/rxjs-interop';
|
||||
import { DfgInstitutionSummaryPage } from '../../api/model/dfgInstitutionSummaryPage';
|
||||
import {
|
||||
CordisEuProjectPage,
|
||||
DfgProjectPage,
|
||||
AuthorPage,
|
||||
InstitutionPageV2,
|
||||
TopicPageV2,
|
||||
DfgPersonSummaryPage,
|
||||
} from '../../api';
|
||||
import { Component } from '@angular/core';
|
||||
import { RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router';
|
||||
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatTabsModule } from '@angular/material/tabs';
|
||||
import { ProjectFilterComponent } from '../../shared/ui/project-filters/project-filters.component';
|
||||
import { DfgProjectTableComponent } from '../../shared/ui/dfg-project-table/dfg-project-table.component';
|
||||
import { EuProjectTableComponent } from '../../shared/ui/eu-project-table/eu-project-table.component';
|
||||
import { projectQueryParamKeys } from '../../resolvers/dfg-projects.resolver';
|
||||
import { euProjectQueryParamKeys } from '../../resolvers/person-cordis-eu-project-page.resolver';
|
||||
|
||||
const PROJECT_TAB_QUERY_PARAM_KEY = 'project_type';
|
||||
|
||||
@Component({
|
||||
selector: 'app-person-projects',
|
||||
standalone: true,
|
||||
imports: [
|
||||
MatCardModule,
|
||||
MatTabsModule,
|
||||
ProjectFilterComponent,
|
||||
DfgProjectTableComponent,
|
||||
EuProjectTableComponent,
|
||||
RouterOutlet,
|
||||
RouterLink,
|
||||
RouterLinkActive,
|
||||
],
|
||||
templateUrl: './person-projects.component.html',
|
||||
styleUrl: './person-projects.component.scss',
|
||||
})
|
||||
export class PersonProjectsComponent {
|
||||
dfgProjectPage = input.required<DfgProjectPage>();
|
||||
personCordisEuProjectPage = input.required<CordisEuProjectPage>();
|
||||
|
||||
selectedDfgInstitutionsPage = input.required<DfgInstitutionSummaryPage>();
|
||||
selectedDfgAuthorsPage = input.required<DfgPersonSummaryPage>();
|
||||
selectedEuInstitutionsPage = input.required<InstitutionPageV2>();
|
||||
selectedEuAuthorsPage = input.required<AuthorPage>();
|
||||
selectedTopicsPage = input.required<TopicPageV2>();
|
||||
|
||||
readonly dfgQueryParamKeys = projectQueryParamKeys;
|
||||
readonly euQueryParamKeys = euProjectQueryParamKeys;
|
||||
|
||||
constructor(
|
||||
private readonly router: Router,
|
||||
private readonly activatedRoute: ActivatedRoute,
|
||||
) {}
|
||||
|
||||
queryParamMap = toSignal(this.activatedRoute.queryParamMap, {
|
||||
initialValue: this.activatedRoute.snapshot.queryParamMap,
|
||||
});
|
||||
|
||||
selectedTabIndex = computed(() => {
|
||||
const type = this.queryParamMap().get(PROJECT_TAB_QUERY_PARAM_KEY);
|
||||
return type === 'eu' ? 1 : 0;
|
||||
});
|
||||
|
||||
onTabChange(index: number): void {
|
||||
const type = index === 1 ? 'eu' : 'dfg';
|
||||
this.router.navigate([], {
|
||||
queryParams: { [PROJECT_TAB_QUERY_PARAM_KEY]: type },
|
||||
queryParamsHandling: 'merge',
|
||||
});
|
||||
}
|
||||
readonly childRoutes = [
|
||||
{
|
||||
path: 'dfg',
|
||||
label: 'DFG-Projekte',
|
||||
},
|
||||
{
|
||||
path: 'eu',
|
||||
label: 'EU-Projekte',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user