From 574559cb8304d9fa2f4a058dfee26fb3b958d8e9 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Mon, 26 Feb 2024 11:54:09 +0000 Subject: [PATCH] Entity Action: Adds the `execute` abstract method Also ensures the `execute` method is on the base interface for both `UmbEntityAction` and `UmbEntityBulkAction`. Resolves #1288 --- .../src/packages/core/entity-action/entity-action.ts | 10 ++++++++-- .../core/entity-bulk-action/entity-bulk-action.ts | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/entity-action.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/entity-action.ts index 8b2e890e32..fc4b4a9fee 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/entity-action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/entity-action.ts @@ -1,12 +1,16 @@ -import type { UmbAction} from '../action/index.js'; +import type { UmbAction } from '../action/index.js'; import { UmbActionBase } from '../action/index.js'; import type { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api'; export interface UmbEntityAction extends UmbAction { unique: string; + execute(): Promise; } -export class UmbEntityActionBase extends UmbActionBase { +export abstract class UmbEntityActionBase + extends UmbActionBase + implements UmbEntityAction +{ entityType: string; unique: string; repositoryAlias: string; @@ -17,4 +21,6 @@ export class UmbEntityActionBase extends UmbActionBase; } diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-bulk-action/entity-bulk-action.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-bulk-action/entity-bulk-action.ts index 20b2250b1c..dbd9e0c67a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-bulk-action/entity-bulk-action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-bulk-action/entity-bulk-action.ts @@ -5,6 +5,7 @@ import type { UmbControllerHostElement } from '@umbraco-cms/backoffice/controlle export interface UmbEntityBulkAction extends UmbAction { selection: Array; setSelection(selection: Array): void; + execute(): Promise; } export abstract class UmbEntityBulkActionBase