From 964b3d0cfd18c93ef746c5e0f6ad7f0061757852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henry=20T=C3=A4schner?= <129834483+HenryT-CG@users.noreply.github.com> Date: Mon, 30 Dec 2024 19:55:24 +0100 Subject: [PATCH] fix: various things (#470) * fix: various things * fix: toggle-button in menu * fix: toggle-button in menu * fix: add role filter * fix: tests * fix: tuning menu layout * fix: tuning menu layout - colors * fix: tuning menu layout - opt * fix: tuning menu layout - switch buttons * fix: tuning menu layout - translations --- src/app/_ws-mixins.scss | 8 + src/app/shared/services/menu-item.service.ts | 19 +- .../workspace-create.component.html | 14 +- .../workspace-detail.component.spec.ts | 37 +- .../workspace-props.component.html | 12 +- .../workspace-roles.component.html | 6 +- .../workspace-roles.component.spec.ts | 15 +- .../workspace-roles.component.ts | 4 +- .../workspace-slots.component.spec.ts | 34 +- .../workspace-slots.component.ts | 6 +- .../preview/preview.component.html | 2 +- .../menu-detail/menu-detail.component.html | 12 +- .../menu-intern/menu-intern.component.html | 4 +- .../menu-preview/menu-preview.component.html | 4 +- .../menu-preview/menu-preview.component.ts | 3 +- .../workspace-menu/menu.component.html | 198 +++++----- .../workspace-menu/menu.component.scss | 47 ++- .../workspace-menu/menu.component.spec.ts | 351 ++++++++++-------- .../workspace-menu/menu.component.ts | 170 +++++---- .../services/menu-tree.service.ts | 1 + .../products.component.spec.ts | 44 ++- .../workspace-product/products.component.ts | 12 +- .../workspace-role-detail.component.html | 2 +- .../workspace-role-detail.component.spec.ts | 6 + .../workspace-role-detail.component.ts | 6 +- .../workspace-search.component.spec.ts | 49 ++- .../workspace-search.component.ts | 13 +- src/assets/i18n/de.json | 10 +- src/assets/i18n/en.json | 10 +- tsconfig.app.json | 2 +- 30 files changed, 641 insertions(+), 460 deletions(-) diff --git a/src/app/_ws-mixins.scss b/src/app/_ws-mixins.scss index 66c7bb94..5425e9e8 100644 --- a/src/app/_ws-mixins.scss +++ b/src/app/_ws-mixins.scss @@ -60,6 +60,14 @@ } } } +@mixin readable-disabled-components { + :host ::ng-deep { + .p-component:disabled, + .p-disabled { + opacity: unset; + } + } +} @mixin compact-dropdown-list-items { :host ::ng-deep { diff --git a/src/app/shared/services/menu-item.service.ts b/src/app/shared/services/menu-item.service.ts index cd13069d..22d31bd8 100644 --- a/src/app/shared/services/menu-item.service.ts +++ b/src/app/shared/services/menu-item.service.ts @@ -55,21 +55,20 @@ export class MenuItemService { } private expandCurrentMfeMenuItems(items: MenuItem[], currentMfePath: string): boolean { + let expanded = false for (const item of items) { - if (this.stripPath(item.routerLink) === currentMfePath) return true - else if (item.items && this.expandCurrentMfeMenuItems(item.items, currentMfePath)) { - item.expanded = true - return true - } + if (!expanded) + if (this.stripPath(item.routerLink) === currentMfePath) expanded = true + else if (item.items && this.expandCurrentMfeMenuItems(item.items, currentMfePath)) { + item.expanded = true + expanded = true + } } - return false + return expanded } private replaceUrlVariables(url: string | undefined): string | undefined { - if (!url) { - return - } - return url.replaceAll( + return url?.replaceAll( /\[\[(.+?)\]\]/g, //NOSONAR (_match, $1) => { return sessionStorage.getItem($1) ?? localStorage.getItem($1) ?? '' diff --git a/src/app/workspace/workspace-create/workspace-create.component.html b/src/app/workspace/workspace-create/workspace-create.component.html index 248d0e46..380e7c3a 100644 --- a/src/app/workspace/workspace-create/workspace-create.component.html +++ b/src/app/workspace/workspace-create/workspace-create.component.html @@ -25,7 +25,7 @@ tooltipPosition="top" tooltipEvent="hover" /> - + - + - + @@ -92,7 +92,7 @@ tooltipPosition="top" tooltipEvent="hover" /> - +