Merge branch 'dev' of nes.uni-due.de:lbs/smartguide into feature/keywords-analysis
This commit is contained in:
@@ -1,27 +1,15 @@
|
||||
<div class="content">
|
||||
<h1>{{ institution().display_name }}</h1>
|
||||
<mat-card appearance="outlined">
|
||||
<mat-card-content>
|
||||
<p>{{ institution().homepage_url }}</p>
|
||||
<p>{{ institution().display_name_alternatives }}</p>
|
||||
<p>And many more useful details...</p>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
<nav mat-tab-nav-bar [tabPanel]="tabPanel">
|
||||
@for (link of _links(); track link.path) {
|
||||
<a
|
||||
mat-tab-link
|
||||
[routerLink]="link.path"
|
||||
[queryParams]="link.queryParams"
|
||||
routerLinkActive
|
||||
#rla="routerLinkActive"
|
||||
[active]="rla.isActive"
|
||||
[disabled]="link.disabled">
|
||||
{{ link.label }}
|
||||
</a>
|
||||
}
|
||||
</nav>
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
<h1>{{ institution().display_name }}</h1>
|
||||
<mat-card appearance="outlined">
|
||||
<mat-card-content>
|
||||
<p>{{ institution().homepage_url }}</p>
|
||||
<p>{{ institution().display_name_alternatives }}</p>
|
||||
<p>And many more useful details...</p>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
<app-link-tab-nav-bar [links]="_links()" [tabPanel]="tabPanel" />
|
||||
</div>
|
||||
<mat-tab-nav-panel #tabPanel>
|
||||
<router-outlet />
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
.content {
|
||||
padding: 16px;
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
margin: 0 1rem;
|
||||
}
|
||||
|
||||
@@ -1,25 +1,21 @@
|
||||
import { Component, computed, input } from '@angular/core';
|
||||
import { RouterLink, RouterOutlet, RouterLinkActive } from '@angular/router';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { Institution } from '../../api';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatTabsModule } from '@angular/material/tabs';
|
||||
|
||||
type TabLink = {
|
||||
label: string;
|
||||
path: string;
|
||||
disabled: boolean;
|
||||
queryParams?: Record<string, any>;
|
||||
};
|
||||
import {
|
||||
LinkTabNavBarComponent,
|
||||
LinkTabNavBarItem,
|
||||
} from '../../shared/ui/link-tab-nav-bar/link-tab-nav-bar.component';
|
||||
import {
|
||||
PATENT_ICON,
|
||||
PROJECT_ICON,
|
||||
PUBLICATION_ICON,
|
||||
} from '../../shared/ui/icons';
|
||||
|
||||
@Component({
|
||||
selector: 'app-institution',
|
||||
imports: [
|
||||
MatCardModule,
|
||||
MatTabsModule,
|
||||
RouterLink,
|
||||
RouterOutlet,
|
||||
RouterLinkActive,
|
||||
],
|
||||
imports: [MatCardModule, MatTabsModule, RouterModule, LinkTabNavBarComponent],
|
||||
templateUrl: './institution.component.html',
|
||||
styleUrl: './institution.component.scss',
|
||||
})
|
||||
@@ -27,14 +23,20 @@ export class InstitutionComponent {
|
||||
institution = input.required<Institution>();
|
||||
canFetchGdprRelevantData = input.required<boolean>();
|
||||
|
||||
_links = computed<TabLink[]>(() => {
|
||||
const links: TabLink[] = [
|
||||
{ label: 'Publikationen', path: 'publications', disabled: false },
|
||||
_links = computed<LinkTabNavBarItem[]>(() => {
|
||||
const links: LinkTabNavBarItem[] = [
|
||||
{
|
||||
label: 'Publikationen',
|
||||
icon: PUBLICATION_ICON,
|
||||
path: 'publications',
|
||||
disabled: false,
|
||||
},
|
||||
];
|
||||
if (this.canFetchGdprRelevantData()) {
|
||||
links.push(
|
||||
{
|
||||
label: 'Projekte',
|
||||
icon: PROJECT_ICON,
|
||||
path: 'projects',
|
||||
disabled: false,
|
||||
queryParams: {
|
||||
@@ -46,7 +48,12 @@ export class InstitutionComponent {
|
||||
sort_direction: 'asc',
|
||||
},
|
||||
},
|
||||
{ label: 'Patente', path: 'patents', disabled: false },
|
||||
{
|
||||
label: 'Patente',
|
||||
icon: PATENT_ICON,
|
||||
path: 'patents',
|
||||
disabled: false,
|
||||
},
|
||||
);
|
||||
}
|
||||
return links;
|
||||
|
||||
@@ -132,20 +132,12 @@
|
||||
[loading]="isTopicsLoading()"
|
||||
(tagClick)="onInterestingTagClick($event)"></app-person-interesting>
|
||||
</section>
|
||||
<nav class="person-tabs sg-tab-nav" mat-tab-nav-bar [tabPanel]="tabPanel">
|
||||
@for (link of links(); track link.path) {
|
||||
<a
|
||||
mat-tab-link
|
||||
[routerLink]="link.path"
|
||||
[queryParams]="link.queryParams"
|
||||
routerLinkActive
|
||||
#rla="routerLinkActive"
|
||||
[active]="rla.isActive"
|
||||
[disabled]="link.disabled">
|
||||
{{ link.label }}
|
||||
</a>
|
||||
}
|
||||
</nav>
|
||||
@if (this.links()) {
|
||||
<app-link-tab-nav-bar
|
||||
#navBar
|
||||
[links]="links()"
|
||||
[tabPanel]="tabPanel"></app-link-tab-nav-bar>
|
||||
}
|
||||
} @else {
|
||||
<app-loading
|
||||
text="Person wird geladen..."
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
signal,
|
||||
DestroyRef,
|
||||
input,
|
||||
viewChild,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
toSignal,
|
||||
@@ -33,14 +34,20 @@ import { PersonDataResolved } from '../../resolvers/person.resolver';
|
||||
import { BookmarkService } from '../../shared/services/bookmark.service';
|
||||
import { collaborationGraphQueryParamKeys } from '../../resolvers/collaboration-graph.resolver';
|
||||
import { workQueryParamKeys } from '../../resolvers/work-page.resolver';
|
||||
|
||||
type PersonLink = {
|
||||
label: string;
|
||||
description?: string;
|
||||
path: string;
|
||||
queryParams?: Record<string, any>;
|
||||
disabled: boolean;
|
||||
};
|
||||
import {
|
||||
LinkTabNavBarComponent,
|
||||
LinkTabNavBarItem,
|
||||
} from '../../shared/ui/link-tab-nav-bar/link-tab-nav-bar.component';
|
||||
import {
|
||||
COMPANY_CONNECTION_ICON,
|
||||
FUNDING_ICON,
|
||||
NETWORK_ICON,
|
||||
NEWS_ICON,
|
||||
OVERVIEW_ICON,
|
||||
PATENT_ICON,
|
||||
PROJECT_ICON,
|
||||
PUBLICATION_ICON,
|
||||
} from '../../shared/ui/icons';
|
||||
|
||||
@Component({
|
||||
selector: 'app-person',
|
||||
@@ -55,6 +62,7 @@ type PersonLink = {
|
||||
LoadingComponent,
|
||||
CountryFlagComponent,
|
||||
CareerStageChipComponent,
|
||||
LinkTabNavBarComponent,
|
||||
],
|
||||
templateUrl: './person.component.html',
|
||||
styleUrl: './person.component.scss',
|
||||
@@ -69,6 +77,11 @@ export class PersonComponent {
|
||||
|
||||
canFetchGdprRelevantData = input.required<boolean>();
|
||||
|
||||
protected readonly navBar = viewChild<LinkTabNavBarComponent>('navBar');
|
||||
protected readonly activeLink = computed(
|
||||
() => this.navBar()?.activeLink() ?? null,
|
||||
);
|
||||
|
||||
constructor() {
|
||||
this.bookmarkService
|
||||
.load()
|
||||
@@ -236,11 +249,12 @@ export class PersonComponent {
|
||||
{ initialValue: [] },
|
||||
);
|
||||
|
||||
readonly links = computed<PersonLink[]>(() => {
|
||||
readonly links = computed<LinkTabNavBarItem[]>(() => {
|
||||
const links = [
|
||||
{
|
||||
label: 'Übersicht',
|
||||
description: 'Übersicht über die Person',
|
||||
icon: OVERVIEW_ICON,
|
||||
path: 'overview',
|
||||
disabled: false,
|
||||
},
|
||||
@@ -249,6 +263,7 @@ export class PersonComponent {
|
||||
{
|
||||
label: 'Projekte',
|
||||
description: 'Übersicht der durchgeführten Projekte der Person',
|
||||
icon: PROJECT_ICON,
|
||||
path: 'projects',
|
||||
queryParams: {
|
||||
page: 0,
|
||||
@@ -264,12 +279,13 @@ export class PersonComponent {
|
||||
{
|
||||
label: 'Publikationen',
|
||||
description: 'Übersicht der Publikationen der Person',
|
||||
icon: PUBLICATION_ICON,
|
||||
path: 'publications',
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
label: 'Netzwerk',
|
||||
description: 'Kooperationsnetzwerk der Person',
|
||||
icon: NETWORK_ICON,
|
||||
path: 'network',
|
||||
disabled: false,
|
||||
queryParams: {
|
||||
@@ -284,6 +300,7 @@ export class PersonComponent {
|
||||
{
|
||||
label: 'Unternehmen',
|
||||
description: 'Unternehmen, mit denen die Person verbunden ist',
|
||||
icon: COMPANY_CONNECTION_ICON,
|
||||
path: 'company-connections',
|
||||
disabled: false,
|
||||
},
|
||||
@@ -292,18 +309,21 @@ export class PersonComponent {
|
||||
{
|
||||
label: 'Förderungen',
|
||||
description: 'Übersicht der Förderungen der Person',
|
||||
icon: FUNDING_ICON,
|
||||
path: 'funding',
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
label: 'Nachrichten',
|
||||
description: 'Nachrichten über die Person',
|
||||
icon: NEWS_ICON,
|
||||
path: 'news',
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
label: 'Patente',
|
||||
description: 'Patente der Person',
|
||||
icon: PATENT_ICON,
|
||||
path: 'patents',
|
||||
disabled: false,
|
||||
},
|
||||
@@ -311,25 +331,25 @@ export class PersonComponent {
|
||||
return links;
|
||||
});
|
||||
|
||||
readonly activeLink = computed<PersonLink | null>(() => {
|
||||
const currentUrl = this.currentUrl();
|
||||
if (!currentUrl) {
|
||||
return null;
|
||||
}
|
||||
// readonly activeLink = computed<LinkTabNavBarItem | null>(() => {
|
||||
// const currentUrl = this.currentUrl();
|
||||
// if (!currentUrl) {
|
||||
// return null;
|
||||
// }
|
||||
|
||||
for (const link of this.links()) {
|
||||
const linkUrl = this.router
|
||||
.createUrlTree([link.path], {
|
||||
relativeTo: this.activatedRoute,
|
||||
})
|
||||
.toString();
|
||||
// for (const link of this.links()) {
|
||||
// const linkUrl = this.router
|
||||
// .createUrlTree([link.path], {
|
||||
// relativeTo: this.activatedRoute,
|
||||
// })
|
||||
// .toString();
|
||||
|
||||
if (linkUrl.startsWith(currentUrl) || currentUrl.startsWith(linkUrl)) {
|
||||
return link;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
});
|
||||
// if (linkUrl.startsWith(currentUrl) || currentUrl.startsWith(linkUrl)) {
|
||||
// return link;
|
||||
// }
|
||||
// }
|
||||
// return null;
|
||||
// });
|
||||
|
||||
onInterestingTagClick(selection: {
|
||||
id: string;
|
||||
|
||||
@@ -31,21 +31,8 @@
|
||||
</div>
|
||||
|
||||
<mat-divider />
|
||||
<app-link-tab-nav-bar [links]="links" [tabPanel]="tabPanel" />
|
||||
<mat-tab-nav-panel #tabPanel>
|
||||
<nav mat-tab-nav-bar [tabPanel]="tabPanel">
|
||||
@for (link of links; track link.path) {
|
||||
<a
|
||||
mat-tab-link
|
||||
[routerLink]="link.path"
|
||||
[queryParams]="link.queryParams"
|
||||
routerLinkActive
|
||||
#rla="routerLinkActive"
|
||||
[active]="rla.isActive"
|
||||
[disabled]="link.disabled">
|
||||
{{ link.label }}
|
||||
</a>
|
||||
}
|
||||
</nav>
|
||||
<div class="outlet-container">
|
||||
<router-outlet />
|
||||
</div>
|
||||
|
||||
@@ -6,6 +6,11 @@ import { MatDividerModule } from '@angular/material/divider';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { DecimalPipe } from '@angular/common';
|
||||
import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
|
||||
import { PUBLICATION_ICON } from '../../shared/ui/icons';
|
||||
import {
|
||||
LinkTabNavBarComponent,
|
||||
LinkTabNavBarItem,
|
||||
} from '../../shared/ui/link-tab-nav-bar/link-tab-nav-bar.component';
|
||||
|
||||
@Component({
|
||||
host: {
|
||||
@@ -18,6 +23,7 @@ import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
|
||||
MatDividerModule,
|
||||
MatIconModule,
|
||||
DecimalPipe,
|
||||
LinkTabNavBarComponent,
|
||||
],
|
||||
templateUrl: './topic.component.html',
|
||||
styleUrl: './topic.component.scss',
|
||||
@@ -25,9 +31,10 @@ import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
|
||||
export class TopicComponent {
|
||||
topic = input.required<Topic>();
|
||||
|
||||
links = [
|
||||
links: LinkTabNavBarItem[] = [
|
||||
{
|
||||
label: 'Publikationen',
|
||||
icon: PUBLICATION_ICON,
|
||||
path: 'publications',
|
||||
disabled: false,
|
||||
queryParams: {
|
||||
|
||||
Reference in New Issue
Block a user