diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/entity-action.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/entity-action.element.ts
index 16d72680a9..c08b1b8b6a 100644
--- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/entity-action.element.ts
+++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/entity-action.element.ts
@@ -6,9 +6,24 @@ import { ManifestEntityAction } from 'libs/extensions-registry/entity-action.mod
@customElement('umb-entity-action')
class UmbEntityActionElement extends UmbLitElement {
+ private _unique?: string;
+ @property({ type: String })
+ public get unique() {
+ return this._unique;
+ }
+ public set unique(value: string | undefined) {
+ if (!value) return;
+ const oldValue = this._unique;
+ this._unique = value;
+ if (oldValue !== this._unique) {
+ this.#createApi();
+ this.requestUpdate('unique', oldValue);
+ }
+ }
+
private _manifest?: ManifestEntityAction;
@property({ type: Object, attribute: false })
- public get entityType() {
+ public get manifest() {
return this._manifest;
}
public set manifest(value: ManifestEntityAction | undefined) {
@@ -16,11 +31,16 @@ class UmbEntityActionElement extends UmbLitElement {
const oldValue = this._manifest;
this._manifest = value;
if (oldValue !== this._manifest) {
- this.#api = new this._manifest.meta.api(this);
+ this.#createApi();
this.requestUpdate('manifest', oldValue);
}
}
+ #createApi() {
+ if (!this._manifest?.meta.api) return;
+ this.#api = new this._manifest.meta.api(this, this.unique);
+ }
+
#api: any;
async #onClickLabel() {
diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-action-menu/workspace-action-menu.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-action-menu/workspace-action-menu.element.ts
index 3880305334..8963af3d1b 100644
--- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-action-menu/workspace-action-menu.element.ts
+++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-action-menu/workspace-action-menu.element.ts
@@ -28,6 +28,9 @@ export class UmbWorkspaceActionMenuElement extends UmbLitElement {
`,
];
+ @property({ type: String })
+ public unique?: string;
+
private _entityType = '';
@property({ type: String, attribute: 'entity-type' })
public get entityType() {
@@ -73,7 +76,9 @@ export class UmbWorkspaceActionMenuElement extends UmbLitElement {