From 4302802840a9eeaef7329d91ec4a0123e95673af Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 21 Jun 2024 10:41:12 +0200 Subject: [PATCH] Don't display divider on empty block --- .../shared-main/buttons/action-dropdown.component.html | 2 +- .../shared-main/buttons/action-dropdown.component.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/client/src/app/shared/shared-main/buttons/action-dropdown.component.html b/client/src/app/shared/shared-main/buttons/action-dropdown.component.html index f2ea57e61..f4c58f6c6 100644 --- a/client/src/app/shared/shared-main/buttons/action-dropdown.component.html +++ b/client/src/app/shared/shared-main/buttons/action-dropdown.component.html @@ -13,7 +13,7 @@ -
+
diff --git a/client/src/app/shared/shared-main/buttons/action-dropdown.component.ts b/client/src/app/shared/shared-main/buttons/action-dropdown.component.ts index ff707c43d..4206288d6 100644 --- a/client/src/app/shared/shared-main/buttons/action-dropdown.component.ts +++ b/client/src/app/shared/shared-main/buttons/action-dropdown.component.ts @@ -80,4 +80,11 @@ export class ActionDropdownComponent { return a.isHeader !== true && (a.isDisplayed === undefined || a.isDisplayed(entry)) }) } + + isBlockDisplayed (allActions: (DropdownAction | DropdownAction[])[], action: DropdownAction, entry: T) { + // Do not display only the header + if (action.isHeader && !this.areActionsDisplayed(allActions, entry)) return false + + return action.isDisplayed === undefined || action.isDisplayed(entry) === true + } }