Initial person page structure
aiis/pipeline/head This commit looks good

This commit is contained in:
Mats Paul Tončik
2026-05-26 12:27:37 +02:00
parent bd575a2d78
commit 93ffe5c10b
22 changed files with 497 additions and 362 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ plugins {
node {
download = true
version = "20.15.1"
version = "26.2.0"
npmVersion = "10.7.0"
}
+293 -294
View File
File diff suppressed because it is too large Load Diff
+5 -3
View File
@@ -18,8 +18,10 @@
"@angular/forms": "^21.2.14",
"@angular/material": "^21.2.12",
"@angular/platform-browser": "^21.2.14",
"@angular/platform-browser-dynamic": "^20.3.21",
"@angular/router": "^20.3.21",
"@angular/platform-browser-dynamic": "^21.2.14",
"@angular/router": "^21.2.14",
"echarts": "^6.1.0",
"ngx-echarts": "^21.0.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.15.1"
@@ -37,4 +39,4 @@
"karma-jasmine-html-reporter": "~2.1.0",
"typescript": "~5.9.3"
}
}
}
@@ -1,40 +1,70 @@
<div style="display: flex; flex-direction: column; height: 100svh; overflow: hidden;">
<mat-toolbar class="main">
<div>
<ng-content select="[indicator]"></ng-content>
</div>
<div style="flex: 1;" class="menu">
@if(mediaQuery.matches && (credentialService.authenticated | async)) {
<button mat-icon-button (click)="toggle()"><mat-icon>menu</mat-icon></button>
}
@else {
<a href="/inse-webapp/" style="color: white; text-decoration: none; font-weight: 600; font-size: 18px; letter-spacing: 0.03em;">My App</a>
}
</div>
<div style="display: flex; flex-direction: row;" class="menu">
<ng-content select="[menu]"></ng-content>
@if(credentialService.authenticated | async) {
<button mat-icon-button (click)="logout()" matTooltip="Abmelden"><mat-icon>logout</mat-icon></button>
}
@else {
<button mat-icon-button routerLink="/login" matTooltip="Anmelden"><mat-icon>login</mat-icon></button>
}
</div>
</mat-toolbar>
<div class="container">
<mat-drawer-container style="width: 100%; height: 100%;">
@if((credentialService.authenticated | async) && ((credentialService.superadmin | async) || (credentialService.universityadmin | async))) {
<mat-drawer class="drawer" #drawer [mode]="mediaQuery.matches ? 'over' : 'side'" [(opened)]="sideNavOpen">
<app-menu></app-menu>
</mat-drawer>
}
<mat-drawer-content>
<ng-content></ng-content>
</mat-drawer-content>
<div
style="
display: flex;
flex-direction: column;
height: 100svh;
overflow: hidden;
"
>
<mat-toolbar class="main">
<div>
<ng-content select="[indicator]"></ng-content>
</div>
<div style="flex: 1" class="menu">
@if (mediaQuery.matches && (credentialService.authenticated | async)) {
<button mat-icon-button (click)="toggle()">
<mat-icon>menu</mat-icon>
</button>
} @else {
<a
href="/inse-webapp/"
style="
color: white;
text-decoration: none;
font-weight: 600;
font-size: 18px;
letter-spacing: 0.03em;
"
>Smartguide</a
>
}
</div>
<div style="display: flex; flex-direction: row" class="menu">
<ng-content select="[menu]"></ng-content>
@if (credentialService.authenticated | async) {
<button mat-icon-button (click)="logout()" matTooltip="Abmelden">
<mat-icon>logout</mat-icon>
</button>
} @else {
<button mat-icon-button routerLink="/login" matTooltip="Anmelden">
<mat-icon>login</mat-icon>
</button>
}
</div>
</mat-toolbar>
<div class="container">
<mat-drawer-container style="width: 100%; height: 100%">
@if (
(credentialService.authenticated | async) &&
((credentialService.superadmin | async) ||
(credentialService.universityadmin | async))
) {
<mat-drawer
class="drawer"
#drawer
[mode]="mediaQuery.matches ? 'over' : 'side'"
[(opened)]="sideNavOpen"
>
<app-menu></app-menu>
</mat-drawer>
}
<mat-drawer-content>
<ng-content></ng-content>
</mat-drawer-content>
</mat-drawer-container>
</div>
<div class="footer-container" >
<div class="footer large">&copy; 2024 My App</div>
<div class="footer small">&copy; 2024 My App</div>
</div>
</div>
<div class="footer-container">
<div class="footer large">&copy; 2026 Smartguide</div>
<div class="footer small">&copy; 2026 Smartguide</div>
</div>
</div>
@@ -14,7 +14,8 @@ import { CredentialService } from '../services/credential.service';
selector: 'app-layout',
imports: [CommonModule, MatToolbarModule, MatSidenavModule, MatButtonModule, MatIconModule, RouterLink, AppMenuComponent, MatTooltipModule],
templateUrl: './app-layout.component.html',
styleUrl: './app-layout.component.scss'
styleUrl: './app-layout.component.scss',
standalone: true,
})
export class AppLayoutComponent implements OnInit, OnDestroy {
@@ -14,7 +14,8 @@ import { Router } from '@angular/router';
selector: 'app-app-login',
imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, MatButtonModule, MatIconModule, MatSnackBarModule],
templateUrl: './app-login.component.html',
styleUrl: './app-login.component.scss'
styleUrl: './app-login.component.scss',
standalone: true,
})
export class AppLoginComponent implements OnInit, OnDestroy {
@@ -1,7 +1,11 @@
<mat-nav-list style="width: 199px; padding: 10px;">
<div matSubheader>Navigation</div>
<mat-list-item routerLink="/items" routerLinkActive="active">
<mat-icon matListItemIcon>list</mat-icon>
<div matListItemTitle>Elemente</div>
</mat-list-item>
<mat-nav-list style="width: 199px; padding: 10px">
<div matSubheader>Navigation</div>
<mat-list-item routerLink="/items" routerLinkActive="active">
<mat-icon matListItemIcon>list</mat-icon>
<div matListItemTitle>Elemente</div>
</mat-list-item>
<mat-list-item routerLink="/person/0">
<mat-icon matListItemIcon>person</mat-icon>
<div matListItemTitle>Person 0</div>
</mat-list-item>
</mat-nav-list>
@@ -9,7 +9,8 @@ import { CredentialService } from '../services/credential.service';
selector: 'app-menu',
imports: [RouterLink, MatIconModule, MatListModule, RouterLinkActive],
templateUrl: './app-menu.component.html',
styleUrl: './app-menu.component.scss'
styleUrl: './app-menu.component.scss',
standalone: true,
})
export class AppMenuComponent {
+2 -1
View File
@@ -6,7 +6,8 @@ import { AppLayoutComponent } from './app-layout/app-layout.component';
selector: 'app-root',
imports: [RouterOutlet, AppLayoutComponent],
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
styleUrls: ['./app.component.scss'],
standalone: true,
})
export class AppComponent {
+46 -13
View File
@@ -2,17 +2,50 @@ import { Routes } from '@angular/router';
import { userGuard } from './guards/user.guard';
export const routes: Routes = [
{
path: 'login',
loadComponent: () => import('./app-login/app-login.component').then(mod => mod.AppLoginComponent),
},
{
path: 'items',
canActivate: [ userGuard ],
loadComponent: () => import('./list-item/list-item.component').then(mod => mod.ListItemComponent),
},
{
path: '**',
redirectTo: 'login'
}
{
path: 'login',
loadComponent: () =>
import('./app-login/app-login.component').then(
(mod) => mod.AppLoginComponent,
),
},
{
path: 'items',
canActivate: [userGuard],
loadComponent: () =>
import('./list-item/list-item.component').then(
(mod) => mod.ListItemComponent,
),
},
{
path: 'person/:id',
canActivate: [userGuard],
loadComponent: () =>
import('./person/person.component').then((mod) => mod.PersonComponent),
children: [
{
path: '',
pathMatch: 'full',
redirectTo: 'overview',
},
{
path: 'overview',
loadComponent: () =>
import('./person-overview/person-overview.component').then(
(mod) => mod.PersonOverviewComponent,
),
},
{
path: 'network',
loadComponent: () =>
import('./person-network/person-network.component').then(
(mod) => mod.PersonNetworkComponent,
),
},
],
},
{
path: '**',
redirectTo: 'login',
},
];
@@ -12,7 +12,8 @@ import { MatButtonModule } from '@angular/material/button';
selector: 'app-confirmation-dialog',
imports: [MatDialogActions, MatDialogClose, MatDialogContent, MatDialogTitle, MatButtonModule],
templateUrl: './confirmation-dialog.component.html',
styleUrl: './confirmation-dialog.component.scss'
styleUrl: './confirmation-dialog.component.scss',
standalone: true,
})
export class ConfirmationDialogComponent {
@@ -28,7 +28,8 @@ import { createLoadError } from '../utils/errorHandler';
ReactiveFormsModule
],
templateUrl: './list-item.component.html',
styleUrl: './list-item.component.scss'
styleUrl: './list-item.component.scss',
standalone: true,
})
export class ListItemComponent implements OnInit {
@@ -0,0 +1 @@
<p>person-network works!</p>
@@ -0,0 +1,11 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-person-network',
imports: [],
templateUrl: './person-network.component.html',
styleUrl: './person-network.component.scss',
})
export class PersonNetworkComponent {
}
@@ -0,0 +1 @@
<p>person-overview works!</p>
@@ -0,0 +1,11 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-person-overview',
imports: [],
templateUrl: './person-overview.component.html',
styleUrl: './person-overview.component.scss',
})
export class PersonOverviewComponent {
}
@@ -0,0 +1,18 @@
<p>person works!</p>
<nav mat-tab-nav-bar [tabPanel]="tabPanel">
@for (link of links; track $index) {
<a
mat-tab-link
[routerLink]="link.path"
routerLinkActive
#rla="routerLinkActive"
[active]="rla.isActive"
[disabled]="link.disabled"
>
{{ link.label }}
</a>
}
</nav>
<mat-tab-nav-panel #tabPanel></mat-tab-nav-panel>
<router-outlet></router-outlet>
+19
View File
@@ -0,0 +1,19 @@
import { Component } from '@angular/core';
import { MatTabsModule } from '@angular/material/tabs';
import { RouterModule, RouterOutlet } from '@angular/router';
@Component({
selector: 'app-person',
imports: [MatTabsModule, RouterOutlet, RouterModule],
templateUrl: './person.component.html',
styleUrl: './person.component.scss',
})
export class PersonComponent {
links = [
{ label: 'Übersicht', path: 'overview', disabled: false },
{ label: 'Projekte', path: 'projects', disabled: true },
{ label: 'Publikationen', path: 'publications', disabled: true },
{ label: 'Netzwerk', path: 'network', disabled: false },
{ label: 'Gründungen', path: 'foundings', disabled: true },
];
}
+1 -1
View File
@@ -7,7 +7,7 @@ export function createLoadError(snackBar: MatSnackBar, retry: (()=>void)|undefin
if (error instanceof HttpErrorResponse) {
code = error.status;
}
var message = msg;
let message = msg;
if (code) {
message += ' (Fehlercode: ' + code + ')';
}