fix(frontend/person): made tab labels and descriptions uniform
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/head This commit looks good
This commit is contained in:
@@ -1,117 +1,110 @@
|
||||
<div class="content">
|
||||
<div class="description-container">
|
||||
<h5 style="font-weight: bold">Netzwerk</h5>
|
||||
<p>Zusammenarbeit und Verbindungen im wissenschaftlichen Netzwerk.</p>
|
||||
</div>
|
||||
@if (this.isPending()) {
|
||||
<app-loading
|
||||
text="Das Netzwerk wird gebaut, kleinen Moment..."
|
||||
icon="graph_3"
|
||||
[size]="150"
|
||||
[diameter]="150" />
|
||||
} @else if (this.isFailed()) {
|
||||
<div class="error">
|
||||
<mat-icon>error</mat-icon>
|
||||
<span class="error-message">{{
|
||||
this.collaborationGraphError()
|
||||
? this.collaborationGraphError()
|
||||
: 'Fehler beim Laden des Netzwerks. Bitte versuchen Sie es später erneut.'
|
||||
}}</span>
|
||||
|
||||
@if (this.isPending()) {
|
||||
<app-loading
|
||||
text="Das Netzwerk wird gebaut, kleinen Moment..."
|
||||
icon="graph_3"
|
||||
[size]="150"
|
||||
[diameter]="150" />
|
||||
} @else if (this.isFailed()) {
|
||||
<div class="error">
|
||||
<mat-icon>error</mat-icon>
|
||||
<span class="error-message">{{
|
||||
this.collaborationGraphError()
|
||||
? this.collaborationGraphError()
|
||||
: 'Fehler beim Laden des Netzwerks. Bitte versuchen Sie es später erneut.'
|
||||
}}</span>
|
||||
<app-selected-filters [observers]="observers" />
|
||||
<button matButton="outlined" type="button" (click)="openFilterDialog()">
|
||||
<mat-icon>filter_alt</mat-icon>
|
||||
Filter
|
||||
</button>
|
||||
</div>
|
||||
} @else {
|
||||
<div class="grid">
|
||||
<div class="cell">
|
||||
<mat-card appearance="outlined" style="height: 100%">
|
||||
<mat-card-content>
|
||||
<app-collaboration-graph
|
||||
[collaborationGraph]="collaborationGraph()!"
|
||||
(handleNodeClick)="handleNodeClick($event)" />
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="toggle-group">
|
||||
<mat-button-toggle-group
|
||||
class="mat-button-toggle-group"
|
||||
aria-label="Select view"
|
||||
(change)="onToggleChange($event)"
|
||||
[value]="displayedTable()"
|
||||
style="width: 100%">
|
||||
<mat-button-toggle value="collaborator">
|
||||
Kollaborierende
|
||||
</mat-button-toggle>
|
||||
<mat-button-toggle value="publication"
|
||||
>Publikationen</mat-button-toggle
|
||||
>
|
||||
<mat-button-toggle value="institution">
|
||||
Institutionen
|
||||
</mat-button-toggle>
|
||||
</mat-button-toggle-group>
|
||||
<button
|
||||
class="filter-button"
|
||||
mat-stroked-button
|
||||
type="button"
|
||||
(click)="openFilterDialog()">
|
||||
<mat-icon>filter_alt</mat-icon>
|
||||
Filter
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<app-query-param-input
|
||||
style="width: 100%"
|
||||
queryParamKey="search_term"
|
||||
[label]="this.searchTermLabel()" />
|
||||
|
||||
<app-selected-filters [observers]="observers" />
|
||||
<button matButton="outlined" type="button" (click)="openFilterDialog()">
|
||||
<mat-icon>filter_alt</mat-icon>
|
||||
Filter
|
||||
</button>
|
||||
</div>
|
||||
} @else {
|
||||
<div class="grid">
|
||||
<div class="cell">
|
||||
<mat-card appearance="outlined" style="height: 100%">
|
||||
<mat-card-content>
|
||||
<app-collaboration-graph
|
||||
[collaborationGraph]="collaborationGraph()!"
|
||||
(handleNodeClick)="handleNodeClick($event)" />
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="toggle-group">
|
||||
<mat-button-toggle-group
|
||||
class="mat-button-toggle-group"
|
||||
aria-label="Select view"
|
||||
(change)="onToggleChange($event)"
|
||||
[value]="displayedTable()"
|
||||
style="width: 100%">
|
||||
<mat-button-toggle value="collaborator">
|
||||
Kollaborierende
|
||||
</mat-button-toggle>
|
||||
<mat-button-toggle value="publication"
|
||||
>Publikationen</mat-button-toggle
|
||||
>
|
||||
<mat-button-toggle value="institution">
|
||||
Institutionen
|
||||
</mat-button-toggle>
|
||||
</mat-button-toggle-group>
|
||||
<button
|
||||
class="filter-button"
|
||||
mat-stroked-button
|
||||
type="button"
|
||||
(click)="openFilterDialog()">
|
||||
<mat-icon>filter_alt</mat-icon>
|
||||
Filter
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<app-query-param-input
|
||||
style="width: 100%"
|
||||
queryParamKey="search_term"
|
||||
[label]="this.searchTermLabel()" />
|
||||
|
||||
<app-selected-filters [observers]="observers" />
|
||||
|
||||
<mat-card appearance="outlined">
|
||||
<mat-card-content class="scroll-viewport-container">
|
||||
@if (this.displayedTable() === 'collaborator') {
|
||||
<app-data-table
|
||||
[columns]="collaboratorsColumns"
|
||||
[data]="collaboratorsData()"
|
||||
[filterTerm]="searchTerm()"
|
||||
[detailTemplate]="collaboratorsDetailRow"
|
||||
[maxHeight]="'100%'" />
|
||||
} @else if (this.displayedTable() === 'publication') {
|
||||
<app-data-table
|
||||
[columns]="publicationsColumns"
|
||||
[data]="publicationsData()"
|
||||
[filterTerm]="searchTerm()"
|
||||
[detailTemplate]="publicationsDetailRow"
|
||||
[maxHeight]="'100%'" />
|
||||
} @else if (this.displayedTable() === 'institution') {
|
||||
<app-data-table
|
||||
[columns]="institutionsColumns"
|
||||
[data]="institutionsData()"
|
||||
[filterTerm]="searchTerm()"
|
||||
[detailTemplate]="institutionsDetailRow"
|
||||
[maxHeight]="'100%'" />
|
||||
}
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
|
||||
<div class="cell full-width">
|
||||
<div class="summary-container">
|
||||
@for (summary of this.summaryCards(); track $index) {
|
||||
<app-info-card
|
||||
[icon]="summary.icon"
|
||||
[value]="summary.value.toString()"
|
||||
[description]="summary.description" />
|
||||
<mat-card appearance="outlined">
|
||||
<mat-card-content class="scroll-viewport-container">
|
||||
@if (this.displayedTable() === 'collaborator') {
|
||||
<app-data-table
|
||||
[columns]="collaboratorsColumns"
|
||||
[data]="collaboratorsData()"
|
||||
[filterTerm]="searchTerm()"
|
||||
[detailTemplate]="collaboratorsDetailRow"
|
||||
[maxHeight]="'100%'" />
|
||||
} @else if (this.displayedTable() === 'publication') {
|
||||
<app-data-table
|
||||
[columns]="publicationsColumns"
|
||||
[data]="publicationsData()"
|
||||
[filterTerm]="searchTerm()"
|
||||
[detailTemplate]="publicationsDetailRow"
|
||||
[maxHeight]="'100%'" />
|
||||
} @else if (this.displayedTable() === 'institution') {
|
||||
<app-data-table
|
||||
[columns]="institutionsColumns"
|
||||
[data]="institutionsData()"
|
||||
[filterTerm]="searchTerm()"
|
||||
[detailTemplate]="institutionsDetailRow"
|
||||
[maxHeight]="'100%'" />
|
||||
}
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
|
||||
<div class="cell full-width">
|
||||
<div class="summary-container">
|
||||
@for (summary of this.summaryCards(); track $index) {
|
||||
<app-info-card
|
||||
[icon]="summary.icon"
|
||||
[value]="summary.value.toString()"
|
||||
[description]="summary.description" />
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<ng-template #collaboratorsActionTmp let-element>
|
||||
<a
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
<div class="page">
|
||||
<div>
|
||||
<h6>Nachrichten</h6>
|
||||
<p>Aktuelle Nachrichten zu dieser Person.</p>
|
||||
</div>
|
||||
|
||||
<ng-template #cardTmp let-article>
|
||||
<app-news-card [article]="article" />
|
||||
</ng-template>
|
||||
|
||||
<app-card-search
|
||||
[page]="page()"
|
||||
[loading]="loading"
|
||||
@@ -17,3 +8,7 @@
|
||||
sortingDirectionLabel="Sortierung"
|
||||
searchLabel="Nachrichten durchsuchen" />
|
||||
</div>
|
||||
|
||||
<ng-template #cardTmp let-article>
|
||||
<app-news-card [article]="article" />
|
||||
</ng-template>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
.page {
|
||||
padding: 28px 32px 42px;
|
||||
max-width: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
.person-overview {
|
||||
width: 100%;
|
||||
display: block;
|
||||
padding: 1.5rem 1.5rem 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
<div class="person-projects">
|
||||
<div class="description-container">
|
||||
<h5 style="font-weight: bold">Projekte</h5>
|
||||
<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
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
.person-projects {
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
.description-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
mat-card,
|
||||
mat-paginator {
|
||||
background-color: var(--sg-background);
|
||||
|
||||
@@ -1,33 +1,27 @@
|
||||
<div class="page">
|
||||
<div>
|
||||
<h6>Publikationen</h6>
|
||||
<p>Übersicht der wissenschaftlichen Veröffentlichungen.</p>
|
||||
</div>
|
||||
@if (canViewClassificationChart()) {
|
||||
<mat-accordion multi>
|
||||
<mat-expansion-panel class="mat-elevation-z1">
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>Forschungszwecke</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
<app-primary-category-year-aggregation-chart
|
||||
[page]="primaryCategoryYearAggregationPage()" />
|
||||
</mat-expansion-panel>
|
||||
@if (canViewClassificationChart()) {
|
||||
<mat-accordion multi>
|
||||
<mat-expansion-panel class="mat-elevation-z1">
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>Forschungszwecke</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
<app-primary-category-year-aggregation-chart
|
||||
[page]="primaryCategoryYearAggregationPage()" />
|
||||
</mat-expansion-panel>
|
||||
|
||||
<mat-expansion-panel class="mat-elevation-z1" [expanded]="true">
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>Publikationsliste</mat-panel-title>
|
||||
<mat-panel-description
|
||||
>{{ total() >= 10000 ? 'mehr als' : '' }}
|
||||
{{ total() }} Publikationen</mat-panel-description
|
||||
>
|
||||
</mat-expansion-panel-header>
|
||||
<ng-container *ngTemplateOutlet="filterTableAndPaginator" />
|
||||
</mat-expansion-panel>
|
||||
</mat-accordion>
|
||||
} @else {
|
||||
<ng-container *ngTemplateOutlet="filterTableAndPaginator" />
|
||||
}
|
||||
</div>
|
||||
<mat-expansion-panel class="mat-elevation-z1" [expanded]="true">
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>Publikationsliste</mat-panel-title>
|
||||
<mat-panel-description
|
||||
>{{ total() >= 10000 ? 'mehr als' : '' }}
|
||||
{{ total() }} Publikationen</mat-panel-description
|
||||
>
|
||||
</mat-expansion-panel-header>
|
||||
<ng-container *ngTemplateOutlet="filterTableAndPaginator" />
|
||||
</mat-expansion-panel>
|
||||
</mat-accordion>
|
||||
} @else {
|
||||
<ng-container *ngTemplateOutlet="filterTableAndPaginator" />
|
||||
}
|
||||
|
||||
<ng-template #filterTableAndPaginator>
|
||||
<app-publication-filter
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
.page {
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
mat-expansion-panel {
|
||||
border: 1px solid var(--sg-border);
|
||||
border-radius: var(--sg-radius-sm);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component, computed, inject, input, OnInit } from '@angular/core';
|
||||
import { Component, computed, inject, input } from '@angular/core';
|
||||
|
||||
import {
|
||||
WorkPageV2,
|
||||
|
||||
@@ -170,5 +170,18 @@
|
||||
[diameter]="150"></app-loading>
|
||||
}
|
||||
<mat-tab-nav-panel #tabPanel class="person-panel">
|
||||
<router-outlet></router-outlet>
|
||||
@let activeLink = this.activeLink();
|
||||
@if (activeLink) {
|
||||
<div class="description-container">
|
||||
@if (activeLink.label) {
|
||||
<h5>{{ activeLink.label }}</h5>
|
||||
}
|
||||
@if (activeLink.description) {
|
||||
<span class="description">{{ activeLink.description }}</span>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
<div class="content">
|
||||
<router-outlet></router-outlet>
|
||||
</div>
|
||||
</mat-tab-nav-panel>
|
||||
|
||||
@@ -372,3 +372,24 @@
|
||||
opacity: 0.7;
|
||||
}
|
||||
}
|
||||
|
||||
.description-container {
|
||||
margin: 3rem 3rem 2rem 3rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
|
||||
h5 {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.description {
|
||||
color: var(--sg-text-muted);
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin: 1rem 4rem;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,14 @@ import { PersonDataResolved } from '../../resolvers/person.resolver';
|
||||
import { BookmarkService } from '../../shared/services/bookmark.service';
|
||||
import { collaborationGraphQueryParamKeys } from '../../resolvers/collaboration-graph.resolver';
|
||||
|
||||
type PersonLink = {
|
||||
label: string;
|
||||
description?: string;
|
||||
path: string;
|
||||
queryParams?: Record<string, any>;
|
||||
disabled: boolean;
|
||||
};
|
||||
|
||||
@Component({
|
||||
selector: 'app-person',
|
||||
imports: [
|
||||
@@ -57,7 +65,9 @@ export class PersonComponent {
|
||||
readonly params = toSignal(this.activatedRoute.paramMap);
|
||||
readonly routerEvents = toSignal(this.router.events);
|
||||
|
||||
readonly currentUrl = computed(() => this.router.url);
|
||||
readonly currentUrl = toSignal(
|
||||
this.router.events.pipe(switchMap(() => of(this.router.url))),
|
||||
);
|
||||
|
||||
// derive authorID directly from route
|
||||
private readonly authorId = toSignal(
|
||||
@@ -233,10 +243,16 @@ export class PersonComponent {
|
||||
{ initialValue: [] },
|
||||
);
|
||||
|
||||
readonly links = computed(() => [
|
||||
{ label: 'Übersicht', path: 'overview', disabled: false },
|
||||
readonly links = computed<PersonLink[]>(() => [
|
||||
{
|
||||
label: 'Übersicht',
|
||||
description: 'Übersicht über die Person',
|
||||
path: 'overview',
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
label: 'Projekte',
|
||||
description: 'Übersicht der durchgeführten Projekte der Person',
|
||||
path: 'projects',
|
||||
queryParams: {
|
||||
page: 0,
|
||||
@@ -247,9 +263,15 @@ export class PersonComponent {
|
||||
},
|
||||
disabled: false,
|
||||
},
|
||||
{ label: 'Publikationen', path: 'publications', disabled: false },
|
||||
{
|
||||
label: 'Publikationen',
|
||||
description: 'Übersicht der Publikationen der Person',
|
||||
path: 'publications',
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
label: 'Netzwerk',
|
||||
description: 'Kooperationsnetzwerk der Person',
|
||||
path: 'network',
|
||||
disabled: false,
|
||||
queryParams: {
|
||||
@@ -263,16 +285,52 @@ export class PersonComponent {
|
||||
? [
|
||||
{
|
||||
label: 'Unternehmen',
|
||||
description: 'Unternehmen, mit denen die Person verbunden ist',
|
||||
path: 'company-connections',
|
||||
disabled: false,
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{ label: 'Förderungen', path: 'funding', disabled: false },
|
||||
{ label: 'Nachrichten', path: 'news', disabled: false },
|
||||
{ label: 'Patente', path: 'patents', disabled: false },
|
||||
{
|
||||
label: 'Förderungen',
|
||||
description: 'Übersicht der Förderungen der Person',
|
||||
path: 'funding',
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
label: 'Nachrichten',
|
||||
description: 'Nachrichten über die Person',
|
||||
path: 'news',
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
label: 'Patente',
|
||||
description: 'Patente der Person',
|
||||
path: 'patents',
|
||||
disabled: false,
|
||||
},
|
||||
]);
|
||||
|
||||
readonly activeLink = computed<PersonLink | 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();
|
||||
|
||||
if (linkUrl.startsWith(currentUrl) || currentUrl.startsWith(linkUrl)) {
|
||||
return link;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
onInterestingTagClick(selection: {
|
||||
id: string;
|
||||
name: string;
|
||||
|
||||
Reference in New Issue
Block a user