Removed visible IDs from network
LocationBasedServices/smartguide/pipeline/head This commit looks good

This commit is contained in:
Mats Paul Tončik
2026-06-06 17:13:37 +02:00
parent f76d63a76c
commit 9f3066dbc4
19 changed files with 121 additions and 38 deletions
+14
View File
@@ -82,6 +82,20 @@ export const routes: Routes = [
},
],
},
{
path: 'institution/:id',
canActivate: [userGuard],
loadComponent: () =>
import('./modules/institution/institution.component').then(
(mod) => mod.InstitutionComponent,
),
},
{
path: 'work/:id',
canActivate: [userGuard],
loadComponent: () =>
import('./modules/work/work.component').then((mod) => mod.WorkComponent),
},
{
path: '**',
redirectTo: 'login',
@@ -0,0 +1 @@
<p>institution works!</p>
@@ -0,0 +1,11 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-institution',
imports: [],
templateUrl: './institution.component.html',
styleUrl: './institution.component.scss',
})
export class InstitutionComponent {
}
@@ -1,9 +1,5 @@
<div class="table">
<table mat-table [dataSource]="dataSource" [trackBy]="trackBy" matSort>
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef mat-sort-header>ID</th>
<td mat-cell *matCellDef="let element">{{ element.id }}</td>
</ng-container>
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Name</th>
<td mat-cell *matCellDef="let element">
@@ -19,13 +15,13 @@
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element">
<button
<a
mat-icon-button
color="primary"
[routerLink]="['/person', element.id]"
>
<mat-icon>open_in_new</mat-icon>
</button>
</a>
</td>
</ng-container>
@@ -39,15 +35,18 @@
></tr>
</table>
</div>
@if (dataSource.filteredData.length === 0) {
<p>Keine Kollaborierenden gefunden.</p>
}
<ng-template #tpl let-element>
<div class="mat-row detail-row" [@detailExpand] style="overflow: hidden">
<ul>
@for (work of element.works; track $index) {
<li>
{{ work.title }}
(<a [routerLink]="['/work', work.id]">{{ work.id }}</a
>)
<a [routerLink]="['/work', work.id]" class="work-link">
{{ work.title }}
</a>
</li>
}
</ul>
@@ -27,3 +27,12 @@
.detail-row {
width: 100%;
}
.work-link {
color: var(--sg-primary);
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
@@ -43,7 +43,7 @@ export class PersonNetworkCollaboratorsComponent implements AfterViewInit {
collaborationNetwork = input.required<CollaborationNetwork>();
searchTerm = input.required<string>();
displayedColumns: string[] = ['id', 'name', 'count', 'actions'];
displayedColumns: string[] = ['name', 'count', 'actions'];
dataSource = new MatTableDataSource<Collaborator>();
@@ -1,17 +1,13 @@
form {
padding: 20px;
padding: 5px;
display: flex;
flex-direction: column;
gap: 20px;
}
.form-field-full {
width: 100%;
}
.toggle-group {
margin-bottom: 20px;
}
@@ -81,7 +81,7 @@ export class PersonNetworkGraphComponent {
author: 'Autor',
collaborator: 'Kollaborierender',
institution: 'Institution',
work: 'Arbeit',
work: 'Publikation',
};
onChartEvent(event: any, type: string) {
@@ -194,6 +194,7 @@ export class PersonNetworkGraphComponent {
friction: 0.9,
gravity: 0.2,
},
zoom: 0.1,
links: item.links.map((e) => {
return {
source: e[0] + '',
@@ -1,11 +1,7 @@
<div class="table">
<table mat-table [dataSource]="dataSource" [trackBy]="trackBy" matSort>
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef mat-sort-header>ID</th>
<td mat-cell *matCellDef="let element">{{ element.id }}</td>
</ng-container>
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Titel</th>
<th mat-header-cell *matHeaderCellDef mat-sort-header>Name</th>
<td mat-cell *matCellDef="let element">
{{ element.name }}
</td>
@@ -16,7 +12,19 @@
{{ element.collaborators.length }}
</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element">
<a
mat-icon-button
color="primary"
[routerLink]="['/institution', element.id]"
>
<mat-icon>open_in_new</mat-icon>
</a>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
<tr
mat-row
@@ -27,6 +35,9 @@
></tr>
</table>
</div>
@if (dataSource.filteredData.length === 0) {
<p>Keine Institutionen gefunden.</p>
}
<ng-template #tpl let-element>
<tr class="detail-row">
@@ -34,9 +45,11 @@
<ul>
@for (collaborator of element.collaborators; track $index) {
<li>
{{ collaborator.name }}
(<a [routerLink]="['/person', collaborator.id]">{{ collaborator.id }}</a
>)
<a
class="person-link"
[routerLink]="['/person', collaborator.id]"
>{{ collaborator.name }}</a
>
</li>
}
</ul>
@@ -27,3 +27,12 @@
.detail-row {
width: 100%;
}
.person-link {
color: var(--sg-primary);
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
@@ -41,7 +41,7 @@ export class PersonNetworkInstitutionsComponent implements AfterViewInit {
collaborationNetwork = input.required<CollaborationNetwork>();
searchTerm = input.required<string>();
displayedColumns: string[] = ['id', 'name', 'collaborators'];
displayedColumns: string[] = ['name', 'collaborators', 'actions'];
dataSource = new MatTableDataSource<Institution>();
@@ -1,9 +1,5 @@
<div class="table">
<table mat-table [dataSource]="dataSource" [trackBy]="trackBy" matSort>
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef mat-sort-header>ID</th>
<td mat-cell *matCellDef="let element">{{ element.id }}</td>
</ng-container>
<ng-container matColumnDef="title">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Titel</th>
<td mat-cell *matCellDef="let element">
@@ -16,6 +12,14 @@
{{ element.collaborators.length }}
</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element">
<a mat-icon-button color="primary" [routerLink]="['/work', element.id]">
<mat-icon>open_in_new</mat-icon>
</a>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
<tr
@@ -27,6 +31,9 @@
></tr>
</table>
</div>
@if (dataSource.filteredData.length === 0) {
<p>Keine Publikationen gefunden.</p>
}
<ng-template #tpl let-element>
<tr class="detail-row">
@@ -34,10 +41,9 @@
<ul>
@for (collaborator of element.collaborators; track $index) {
<li>
{{ collaborator.name }}
(<a [routerLink]="['/person', collaborator.id]">
{{ collaborator.id }} </a
>)
<a class="person-link" [routerLink]="['/person', collaborator.id]">
{{ collaborator.name }}
</a>
</li>
}
</ul>
@@ -27,3 +27,12 @@
.detail-row {
width: 100%;
}
.person-link {
color: var(--sg-primary);
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
@@ -43,7 +43,7 @@ export class PersonNetworkPublicationsComponent implements AfterViewInit {
collaborationNetwork = input.required<CollaborationNetwork>();
searchTerm = input.required<string>();
displayedColumns: string[] = ['id', 'title', 'contributors'];
displayedColumns: string[] = ['title', 'contributors', 'actions'];
dataSource = new MatTableDataSource<Work>();
@@ -94,11 +94,11 @@ export class PersonNetworkComponent implements OnInit {
const displayedTable = this.displayedTable();
switch (displayedTable) {
case 'collaborators':
return 'Suche Kollaborierende nach Name oder ID';
return 'Suche Kollaborierende nach Name';
case 'publications':
return 'Suche Publikationen nach Titel oder ID';
return 'Suche Publikationen nach Titel';
case 'institutions':
return 'Suche Institutionen nach Name oder ID';
return 'Suche Institutionen nach Name';
default:
return 'Suchbegriff';
}
@@ -120,6 +120,9 @@ export class PersonNetworkComponent implements OnInit {
}
this.latestNodeId.set(id);
if (category === 'author') {
return;
}
this.filterForm.patchValue({
displayedTable: this.categoryTableMap[category],
@@ -0,0 +1 @@
<p>work works!</p>
@@ -0,0 +1,11 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-work',
imports: [],
templateUrl: './work.component.html',
styleUrl: './work.component.scss',
})
export class WorkComponent {
}