replaced projects navs with generic navbar
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/head This commit looks good
This commit is contained in:
@@ -58,24 +58,11 @@
|
||||
</mat-expansion-panel-header>
|
||||
|
||||
<div class="person-projects">
|
||||
<nav mat-tab-nav-bar [tabPanel]="resultTabPanel" class="result-nav">
|
||||
@for (route of childRoutes; track route.path) {
|
||||
<a
|
||||
matTabLink
|
||||
[routerLink]="[route.path]"
|
||||
[queryParams]="{
|
||||
authorId: null,
|
||||
institutionId: null,
|
||||
agency: null,
|
||||
}"
|
||||
queryParamsHandling="merge"
|
||||
routerLinkActive
|
||||
#rla="routerLinkActive"
|
||||
[active]="rla.isActive">
|
||||
{{ route.label }}
|
||||
</a>
|
||||
}
|
||||
</nav>
|
||||
@if (resultTabPanel) {
|
||||
<app-link-tab-nav-bar
|
||||
[links]="_links()"
|
||||
[tabPanel]="resultTabPanel" />
|
||||
}
|
||||
|
||||
<mat-tab-nav-panel #resultTabPanel>
|
||||
<router-outlet />
|
||||
|
||||
@@ -28,7 +28,10 @@ import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { InstitutionProjectsFundingGraphComponent } from '../institution-projects-funding-graph/institution-projects-funding-graph.component';
|
||||
import { AppInfoCardComponent } from '../../shared/ui/app-info-card/app-info-card.component';
|
||||
|
||||
import {
|
||||
LinkTabNavBarComponent,
|
||||
LinkTabNavBarItem,
|
||||
} from '../../shared/ui/link-tab-nav-bar/link-tab-nav-bar.component';
|
||||
type BundProjectRow = {
|
||||
id: string;
|
||||
topic: string;
|
||||
@@ -61,6 +64,7 @@ type EuProjectRow = {
|
||||
MatButtonModule,
|
||||
InstitutionProjectsFundingGraphComponent,
|
||||
AppInfoCardComponent,
|
||||
LinkTabNavBarComponent,
|
||||
RouterModule,
|
||||
],
|
||||
templateUrl: './institution-projects.component.html',
|
||||
@@ -124,6 +128,27 @@ export class InstitutionProjectsComponent implements OnInit {
|
||||
label: 'BUND-Projekte',
|
||||
},
|
||||
];
|
||||
|
||||
_links = computed<LinkTabNavBarItem[]>(() => {
|
||||
const links: LinkTabNavBarItem[] = [
|
||||
{
|
||||
label: 'DFG-Projekte',
|
||||
path: 'dfg',
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
label: 'EU-Projekte',
|
||||
path: 'eu',
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
label: 'BUND-Projekte',
|
||||
path: 'bund',
|
||||
disabled: false,
|
||||
},
|
||||
];
|
||||
return links;
|
||||
});
|
||||
constructor(
|
||||
private readonly activatedRoute: ActivatedRoute,
|
||||
private readonly router: Router,
|
||||
|
||||
+3
-18
@@ -4,24 +4,9 @@
|
||||
<p>Übersicht der durchgeführten Projekte.</p>
|
||||
</div>
|
||||
|
||||
<nav mat-tab-nav-bar [tabPanel]="resultTabPanel" class="result-nav">
|
||||
@for (route of childRoutes; track route.path) {
|
||||
<a
|
||||
matTabLink
|
||||
[routerLink]="[route.path]"
|
||||
[queryParams]="{
|
||||
authorId: null,
|
||||
institutionId: null,
|
||||
agency: null,
|
||||
}"
|
||||
queryParamsHandling="merge"
|
||||
routerLinkActive
|
||||
#rla="routerLinkActive"
|
||||
[active]="rla.isActive">
|
||||
{{ route.label }}
|
||||
</a>
|
||||
}
|
||||
</nav>
|
||||
@if (resultTabPanel) {
|
||||
<app-link-tab-nav-bar [links]="_links()" [tabPanel]="resultTabPanel" />
|
||||
}
|
||||
|
||||
<mat-tab-nav-panel #resultTabPanel>
|
||||
<router-outlet />
|
||||
|
||||
+31
-22
@@ -6,16 +6,13 @@ import { MatTabsModule } from '@angular/material/tabs';
|
||||
import { OnInit, computed } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { toSignal } from '@angular/core/rxjs-interop';
|
||||
|
||||
import {
|
||||
LinkTabNavBarComponent,
|
||||
LinkTabNavBarItem,
|
||||
} from '../../../../shared/ui/link-tab-nav-bar/link-tab-nav-bar.component';
|
||||
@Component({
|
||||
selector: 'app-projects-results',
|
||||
imports: [
|
||||
MatCardModule,
|
||||
MatTabsModule,
|
||||
RouterLink,
|
||||
RouterLinkActive,
|
||||
RouterOutlet,
|
||||
],
|
||||
imports: [MatCardModule, MatTabsModule, RouterOutlet, LinkTabNavBarComponent],
|
||||
templateUrl: './projects-results.component.html',
|
||||
styleUrl: './projects-results.component.scss',
|
||||
})
|
||||
@@ -32,18 +29,30 @@ export class KeywordsToProjectsResultsComponent {
|
||||
() => this.queryParamMap().get('fuzzy') === 'true',
|
||||
);
|
||||
|
||||
readonly childRoutes = [
|
||||
{
|
||||
path: 'dfg',
|
||||
label: 'DFG-Projekte',
|
||||
},
|
||||
{
|
||||
path: 'eu',
|
||||
label: 'EU-Projekte',
|
||||
},
|
||||
{
|
||||
path: 'bund',
|
||||
label: 'BUND-Projekte',
|
||||
},
|
||||
];
|
||||
_links = computed<LinkTabNavBarItem[]>(() => {
|
||||
const links: LinkTabNavBarItem[] = [
|
||||
{
|
||||
label: 'DFG-Projekte',
|
||||
path: 'dfg',
|
||||
queryParams: { authorId: null, institutionId: null, agency: null },
|
||||
queryParamsHandling: 'merge',
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
label: 'EU-Projekte',
|
||||
path: 'eu',
|
||||
queryParams: { authorId: null, institutionId: null, agency: null },
|
||||
queryParamsHandling: 'merge',
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
label: 'BUND-Projekte',
|
||||
path: 'bund',
|
||||
queryParams: { authorId: null, institutionId: null, agency: null },
|
||||
queryParamsHandling: 'merge',
|
||||
disabled: false,
|
||||
},
|
||||
];
|
||||
return links;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,22 +1,7 @@
|
||||
<div class="person-projects">
|
||||
<nav mat-tab-nav-bar [tabPanel]="resultTabPanel" class="result-nav">
|
||||
@for (route of childRoutes; track route.path) {
|
||||
<a
|
||||
matTabLink
|
||||
[routerLink]="[route.path]"
|
||||
[queryParams]="{
|
||||
authorId: null,
|
||||
institutionId: null,
|
||||
agency: null,
|
||||
}"
|
||||
queryParamsHandling="merge"
|
||||
routerLinkActive
|
||||
#rla="routerLinkActive"
|
||||
[active]="rla.isActive">
|
||||
{{ route.label }}
|
||||
</a>
|
||||
}
|
||||
</nav>
|
||||
@if (resultTabPanel) {
|
||||
<app-link-tab-nav-bar [links]="_links()" [tabPanel]="resultTabPanel" />
|
||||
}
|
||||
|
||||
<mat-tab-nav-panel #resultTabPanel>
|
||||
<router-outlet />
|
||||
|
||||
@@ -1,31 +1,33 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Component, computed } from '@angular/core';
|
||||
import { RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router';
|
||||
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatTabsModule } from '@angular/material/tabs';
|
||||
|
||||
import {
|
||||
LinkTabNavBarComponent,
|
||||
LinkTabNavBarItem,
|
||||
} from '../../shared/ui/link-tab-nav-bar/link-tab-nav-bar.component';
|
||||
@Component({
|
||||
selector: 'app-person-projects',
|
||||
standalone: true,
|
||||
imports: [
|
||||
MatCardModule,
|
||||
MatTabsModule,
|
||||
RouterOutlet,
|
||||
RouterLink,
|
||||
RouterLinkActive,
|
||||
],
|
||||
imports: [MatCardModule, MatTabsModule, RouterOutlet, LinkTabNavBarComponent],
|
||||
templateUrl: './person-projects.component.html',
|
||||
styleUrl: './person-projects.component.scss',
|
||||
})
|
||||
export class PersonProjectsComponent {
|
||||
readonly childRoutes = [
|
||||
{
|
||||
path: 'dfg',
|
||||
label: 'DFG-Projekte',
|
||||
},
|
||||
{
|
||||
path: 'eu',
|
||||
label: 'EU-Projekte',
|
||||
},
|
||||
];
|
||||
_links = computed<LinkTabNavBarItem[]>(() => {
|
||||
const links: LinkTabNavBarItem[] = [
|
||||
{
|
||||
label: 'DFG-Projekte',
|
||||
path: 'dfg',
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
label: 'EU-Projekte',
|
||||
path: 'eu',
|
||||
disabled: false,
|
||||
},
|
||||
];
|
||||
return links;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user