From b7877ac27bb7794aa0986cedfb2aba73d93373c1 Mon Sep 17 00:00:00 2001 From: Sebastian Leidig Date: Tue, 2 Jul 2024 13:40:15 +0200 Subject: [PATCH] fix(Admin UI): correct route config for site-settings --- src/app/core/admin/admin.routing.ts | 6 +++--- .../entity-actions-menu.component.ts | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/app/core/admin/admin.routing.ts b/src/app/core/admin/admin.routing.ts index 268736a64c..9c3347933b 100644 --- a/src/app/core/admin/admin.routing.ts +++ b/src/app/core/admin/admin.routing.ts @@ -25,7 +25,7 @@ export const adminRoutes: Routes = [ component: RoutedViewComponent, data: { component: "AdminEntityTypes", - entity: "Config", + entityType: "Config", requiredPermissionOperation: "update", }, canActivate: [EntityPermissionGuard], @@ -35,7 +35,7 @@ export const adminRoutes: Routes = [ component: RoutedViewComponent, data: { component: "AdminEntity", - entity: "Config", + entityType: "Config", requiredPermissionOperation: "update", }, canActivate: [EntityPermissionGuard], @@ -47,7 +47,7 @@ export const adminRoutes: Routes = [ data: { component: "EntityDetails", config: { - entity: "SiteSettings", + entityType: "SiteSettings", id: "global", panels: [ { diff --git a/src/app/core/entity-details/entity-actions-menu/entity-actions-menu.component.ts b/src/app/core/entity-details/entity-actions-menu/entity-actions-menu.component.ts index 923fc6db27..a7512fa2cd 100644 --- a/src/app/core/entity-details/entity-actions-menu/entity-actions-menu.component.ts +++ b/src/app/core/entity-details/entity-actions-menu/entity-actions-menu.component.ts @@ -111,13 +111,15 @@ export class EntityActionsMenuComponent implements OnChanges { private filterAvailableActions() { this.actions = this.defaultActions.filter((action) => { + if (!this.entity) { + return false; + } + switch (action.action) { case "archive": - return this.entity?.isActive && !this.entity?.anonymized; + return this.entity.isActive && !this.entity.anonymized; case "anonymize": - return ( - !this.entity?.anonymized && this.entity?.getConstructor().hasPII - ); + return !this.entity.anonymized && this.entity.getConstructor().hasPII; default: return true; }