Merge remote-tracking branch 'origin/dev' into ts-career-stage-backend
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/head This commit looks good
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
<div class="app-shell">
|
||||
<div class="container">
|
||||
<mat-drawer-container class="drawer-container">
|
||||
<mat-drawer-container
|
||||
class="drawer-container"
|
||||
[autosize]="!mediaQuery.matches">
|
||||
@if (
|
||||
(credentialService.authenticated | async) &&
|
||||
((credentialService.superadmin | async) ||
|
||||
@@ -8,10 +10,15 @@
|
||||
) {
|
||||
<mat-drawer
|
||||
class="drawer"
|
||||
[class.drawer--collapsed]="isSidebarCollapsed()"
|
||||
#drawer
|
||||
[mode]="mediaQuery.matches ? 'over' : 'side'"
|
||||
[(opened)]="sideNavOpen">
|
||||
<app-menu></app-menu>
|
||||
<app-menu
|
||||
[collapsed]="isSidebarCollapsed()"
|
||||
[canCollapse]="!mediaQuery.matches"
|
||||
(toggleCollapsed)="toggleSidebarCollapsed()">
|
||||
</app-menu>
|
||||
</mat-drawer>
|
||||
}
|
||||
<mat-drawer-content class="content-shell">
|
||||
@@ -52,6 +59,12 @@
|
||||
icon="person"
|
||||
[size]="200"
|
||||
[diameter]="200" />
|
||||
} @else if (resolverState.isResolvingFromOutside('/projects/')) {
|
||||
<app-loading
|
||||
text="Projektdaten werden geladen..."
|
||||
icon="article"
|
||||
[size]="200"
|
||||
[diameter]="200" />
|
||||
} @else {
|
||||
<ng-content></ng-content>
|
||||
}
|
||||
|
||||
@@ -84,6 +84,10 @@ mat-toolbar.main {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.drawer--collapsed {
|
||||
width: 76px;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -45,7 +45,10 @@ export class AppLayoutComponent implements OnInit, OnDestroy {
|
||||
protected resolverState = inject(ResolverStateService);
|
||||
mediaQueryListener: () => void;
|
||||
|
||||
private readonly sidebarCollapsedStorageKey = 'inse.sidebar.collapsed';
|
||||
sideNavOpen = false;
|
||||
sideNavCollapsed = this.readSidebarCollapsedState();
|
||||
|
||||
constructor(
|
||||
public credentialService: CredentialService,
|
||||
public router: Router,
|
||||
@@ -56,6 +59,11 @@ export class AppLayoutComponent implements OnInit, OnDestroy {
|
||||
this.mediaQuery = media.matchMedia('(max-width: 600px)');
|
||||
this.mediaQueryListener = () => {
|
||||
this.sideNavOpen = !this.mediaQuery.matches;
|
||||
|
||||
if (this.mediaQuery.matches) {
|
||||
this.sideNavCollapsed = false;
|
||||
}
|
||||
|
||||
changeDetector.detectChanges();
|
||||
};
|
||||
}
|
||||
@@ -66,6 +74,26 @@ export class AppLayoutComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
private readSidebarCollapsedState(): boolean {
|
||||
return localStorage.getItem(this.sidebarCollapsedStorageKey) === 'true';
|
||||
}
|
||||
|
||||
isSidebarCollapsed(): boolean {
|
||||
return this.sideNavCollapsed && !this.mediaQuery.matches;
|
||||
}
|
||||
|
||||
toggleSidebarCollapsed(): void {
|
||||
if (this.mediaQuery.matches) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.sideNavCollapsed = !this.sideNavCollapsed;
|
||||
localStorage.setItem(
|
||||
this.sidebarCollapsedStorageKey,
|
||||
String(this.sideNavCollapsed),
|
||||
);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.sideNavOpen = !this.mediaQuery.matches;
|
||||
this.mediaQuery.addEventListener('change', this.mediaQueryListener);
|
||||
|
||||
@@ -1,30 +1,71 @@
|
||||
<aside class="sidebar">
|
||||
<a class="brand" routerLink="/dashboard" aria-label="Smartguide Startseite">
|
||||
<span class="brand-mark">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</span>
|
||||
<span class="brand-text">
|
||||
<strong>AIIS</strong>
|
||||
<small>AI Innovation<br />Intelligence System</small>
|
||||
</span>
|
||||
</a>
|
||||
<aside class="sidebar" [class.sidebar--collapsed]="collapsed()">
|
||||
<div class="brand-row">
|
||||
@if (!collapsed()) {
|
||||
<a
|
||||
class="brand"
|
||||
routerLink="/dashboard"
|
||||
aria-label="Smartguide Startseite">
|
||||
<span class="brand-mark">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</span>
|
||||
<span class="brand-text">
|
||||
<strong>AIIS</strong>
|
||||
<small>AI Innovation<br />Intelligence System</small>
|
||||
</span>
|
||||
</a>
|
||||
}
|
||||
|
||||
@if (canCollapse()) {
|
||||
<button
|
||||
mat-icon-button
|
||||
class="sidebar-collapse-button"
|
||||
type="button"
|
||||
(click)="toggleCollapsed.emit()"
|
||||
[attr.aria-label]="collapsed() ? 'Menü erweitern' : 'Menü einklappen'"
|
||||
[matTooltip]="collapsed() ? 'Menü erweitern' : 'Menü einklappen'"
|
||||
matTooltipPosition="right">
|
||||
<mat-icon>
|
||||
{{
|
||||
collapsed()
|
||||
? 'keyboard_double_arrow_right'
|
||||
: 'keyboard_double_arrow_left'
|
||||
}}
|
||||
</mat-icon>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
|
||||
<mat-nav-list class="nav-list">
|
||||
@for (item of navItems; track item.label) {
|
||||
<a
|
||||
mat-list-item
|
||||
[routerLink]="item.disabled ? null : item.route"
|
||||
[queryParams]="item.queryParams || null"
|
||||
routerLinkActive="active"
|
||||
[class.disabled]="item.disabled">
|
||||
<mat-icon matListItemIcon>{{ item.icon }}</mat-icon>
|
||||
<span matListItemTitle>{{ item.label }}</span>
|
||||
</a>
|
||||
@if (collapsed()) {
|
||||
<a
|
||||
mat-icon-button
|
||||
class="nav-icon-button"
|
||||
[routerLink]="item.disabled ? null : item.route"
|
||||
[queryParams]="item.queryParams || null"
|
||||
routerLinkActive="active"
|
||||
[class.disabled]="item.disabled"
|
||||
[matTooltip]="item.label"
|
||||
matTooltipPosition="right"
|
||||
[attr.aria-label]="item.label">
|
||||
<mat-icon>{{ item.icon }}</mat-icon>
|
||||
</a>
|
||||
} @else {
|
||||
<a
|
||||
mat-list-item
|
||||
[routerLink]="item.disabled ? null : item.route"
|
||||
[queryParams]="item.queryParams || null"
|
||||
routerLinkActive="active"
|
||||
[class.disabled]="item.disabled">
|
||||
<mat-icon matListItemIcon>{{ item.icon }}</mat-icon>
|
||||
<span matListItemTitle>{{ item.label }}</span>
|
||||
</a>
|
||||
}
|
||||
}
|
||||
</mat-nav-list>
|
||||
|
||||
@@ -36,22 +77,52 @@
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="account-card">
|
||||
<div class="avatar">{{ (credentialService.login | async)?.charAt(0) }}</div>
|
||||
<div>
|
||||
<strong>{{
|
||||
(credentialService.login | async) || 'Max Mustermann'
|
||||
}}</strong>
|
||||
<strong>{{ credentialService.organizationName | async }}</strong>
|
||||
<span>Startup Coach</span>
|
||||
@if (collapsed()) {
|
||||
<div
|
||||
class="account-icon"
|
||||
[matTooltip]="
|
||||
((credentialService.login | async) || 'user') +
|
||||
' · ' +
|
||||
((credentialService.organizationName | async) || '')
|
||||
"
|
||||
matTooltipPosition="right">
|
||||
<div class="avatar">
|
||||
{{ (credentialService.login | async)?.charAt(0) }}
|
||||
</div>
|
||||
</div>
|
||||
<mat-icon>expand_more</mat-icon>
|
||||
</div>
|
||||
} @else {
|
||||
<div class="account-card">
|
||||
<div class="avatar">
|
||||
{{ (credentialService.login | async)?.charAt(0) }}
|
||||
</div>
|
||||
<div>
|
||||
<strong>{{
|
||||
(credentialService.login | async) || 'Max Mustermann'
|
||||
}}</strong>
|
||||
<strong>{{ credentialService.organizationName | async }}</strong>
|
||||
<span>Startup Coach</span>
|
||||
</div>
|
||||
<mat-icon>expand_more</mat-icon>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="sidebar-actions">
|
||||
<button class="utility-link" type="button" (click)="onLogout()">
|
||||
<mat-icon>logout</mat-icon>
|
||||
<span>Abmelden</span>
|
||||
</button>
|
||||
@if (collapsed()) {
|
||||
<button
|
||||
mat-icon-button
|
||||
class="utility-icon-button"
|
||||
type="button"
|
||||
(click)="onLogout()"
|
||||
matTooltip="Abmelden"
|
||||
matTooltipPosition="right"
|
||||
aria-label="Abmelden">
|
||||
<mat-icon>logout</mat-icon>
|
||||
</button>
|
||||
} @else {
|
||||
<button class="utility-link" type="button" (click)="onLogout()">
|
||||
<mat-icon>logout</mat-icon>
|
||||
<span>Abmelden</span>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
@@ -9,6 +9,27 @@
|
||||
color: var(--sg-text);
|
||||
}
|
||||
|
||||
.sidebar--collapsed {
|
||||
align-items: center;
|
||||
padding: 18px 10px 20px;
|
||||
}
|
||||
|
||||
.brand-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
min-height: 58px;
|
||||
}
|
||||
|
||||
.sidebar--collapsed .brand-row {
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.sidebar-collapse-button {
|
||||
color: var(--sg-text-muted);
|
||||
}
|
||||
|
||||
.brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -98,6 +119,13 @@
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.sidebar--collapsed .nav-list {
|
||||
display: grid;
|
||||
justify-items: center;
|
||||
width: 100%;
|
||||
margin-top: 28px;
|
||||
}
|
||||
|
||||
.nav-list a {
|
||||
height: 46px;
|
||||
border-radius: var(--sg-radius-sm);
|
||||
@@ -124,6 +152,23 @@
|
||||
color: var(--sg-primary);
|
||||
}
|
||||
|
||||
.nav-icon-button {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: var(--sg-radius-sm);
|
||||
color: var(--sg-text-soft);
|
||||
}
|
||||
|
||||
.nav-icon-button.active {
|
||||
background: var(--sg-primary-soft);
|
||||
color: var(--sg-primary);
|
||||
}
|
||||
|
||||
.nav-icon-button.disabled {
|
||||
opacity: 0.72;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.sidebar-spacer {
|
||||
flex: 1;
|
||||
min-height: 28px;
|
||||
@@ -141,7 +186,15 @@
|
||||
background: var(--sg-surface);
|
||||
}
|
||||
|
||||
.account-card .avatar {
|
||||
.account-icon {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
.account-card .avatar,
|
||||
.account-icon .avatar {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 40px;
|
||||
@@ -178,6 +231,12 @@
|
||||
margin-top: 26px;
|
||||
}
|
||||
|
||||
.sidebar--collapsed .sidebar-actions {
|
||||
display: grid;
|
||||
justify-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.utility-link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -199,6 +258,13 @@
|
||||
background: var(--sg-surface-muted);
|
||||
}
|
||||
|
||||
.utility-icon-button {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: var(--sg-radius-sm);
|
||||
color: var(--sg-text-soft);
|
||||
}
|
||||
|
||||
.loading-indicator {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import { Component, computed, inject } from '@angular/core';
|
||||
import { Component, computed, inject, input, output } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { Router, RouterLink, RouterLinkActive } from '@angular/router';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatListModule } from '@angular/material/list';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
import { CredentialService } from '../../services/credential.service';
|
||||
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
@@ -17,12 +19,17 @@ import { ConfirmationDialogComponent } from '../confirmation-dialog/confirmation
|
||||
MatListModule,
|
||||
RouterLinkActive,
|
||||
MatProgressBarModule,
|
||||
MatButtonModule,
|
||||
MatTooltipModule,
|
||||
],
|
||||
templateUrl: './app-menu.component.html',
|
||||
styleUrl: './app-menu.component.scss',
|
||||
standalone: true,
|
||||
})
|
||||
export class AppMenuComponent {
|
||||
collapsed = input(false);
|
||||
canCollapse = input(false);
|
||||
toggleCollapsed = output<void>();
|
||||
navItems = [
|
||||
{
|
||||
label: 'Dashboard',
|
||||
@@ -52,6 +59,20 @@ export class AppMenuComponent {
|
||||
sorting_order: 'desc',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Projekte',
|
||||
icon: 'work',
|
||||
route: '/projects',
|
||||
disabled: false,
|
||||
queryParams: {
|
||||
search: '',
|
||||
page: 0,
|
||||
size: 10,
|
||||
selected_project_types: 'eu,bund,dfg',
|
||||
sort_by: 'title',
|
||||
sorting_order: 'asc',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -57,7 +57,6 @@ export class DataTableComponent<T> implements AfterViewInit {
|
||||
|
||||
activeSortKey = input<string>('');
|
||||
sortDirection = input<SortDirection>('');
|
||||
|
||||
sortChange = output<Sort>();
|
||||
|
||||
displayedColumns = computed(() => this.columns().map((col) => col.id));
|
||||
|
||||
Reference in New Issue
Block a user