From 9be350ff6490bc499a7cb25f7224643406f979f3 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Wed, 28 Feb 2024 11:00:05 +0100 Subject: [PATCH 1/3] rename the workspace action menu it is now called "workspace-entity-action-menu" which is more befitting for its placement and also allows us to re-use the name "workspace-action-menu" for the upcoming popover menu on workspace actions --- .../src/packages/core/workspace/components/index.ts | 2 +- .../components/workspace-action-menu/index.ts | 1 - .../components/workspace-entity-action-menu/index.ts | 1 + .../workspace-entity-action-menu.element.ts} | 10 +++++----- .../workspace-split-view.element.ts | 2 +- .../storybook/stories/extending/entity-actions.mdx | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) delete mode 100644 src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-action-menu/index.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-entity-action-menu/index.ts rename src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/{workspace-action-menu/workspace-action-menu.element.ts => workspace-entity-action-menu/workspace-entity-action-menu.element.ts} (86%) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/index.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/index.ts index dc0e41c16f..be0ca6343a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/index.ts @@ -1,4 +1,4 @@ -export * from './workspace-action-menu/index.js'; +export * from './workspace-entity-action-menu/index.js'; export * from './workspace-action/index.js'; export * from './workspace-editor/index.js'; export * from './workspace-footer/index.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-action-menu/index.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-action-menu/index.ts deleted file mode 100644 index 02d1af5c38..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-action-menu/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './workspace-action-menu.element.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-entity-action-menu/index.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-entity-action-menu/index.ts new file mode 100644 index 0000000000..44a6ce51e0 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-entity-action-menu/index.ts @@ -0,0 +1 @@ +export * from './workspace-entity-action-menu.element.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-action-menu/workspace-action-menu.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-entity-action-menu/workspace-entity-action-menu.element.ts similarity index 86% rename from src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-action-menu/workspace-action-menu.element.ts rename to src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-entity-action-menu/workspace-entity-action-menu.element.ts index 92380bea73..22e3c54f50 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-action-menu/workspace-action-menu.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-entity-action-menu/workspace-entity-action-menu.element.ts @@ -3,8 +3,8 @@ import { css, html, customElement, state, nothing } from '@umbraco-cms/backoffic import type { UmbActionExecutedEvent } from '@umbraco-cms/backoffice/event'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; import { UMB_WORKSPACE_CONTEXT } from '@umbraco-cms/backoffice/workspace'; -@customElement('umb-workspace-action-menu') -export class UmbWorkspaceActionMenuElement extends UmbLitElement { +@customElement('umb-workspace-entity-action-menu') +export class UmbWorkspaceEntityActionMenuElement extends UmbLitElement { private _workspaceContext?: typeof UMB_WORKSPACE_CONTEXT.TYPE; @state() @@ -49,12 +49,12 @@ export class UmbWorkspaceActionMenuElement extends UmbLitElement { #renderActionsMenu() { return this._entityId && this._entityType ? html` - + Actions @@ -87,6 +87,6 @@ export class UmbWorkspaceActionMenuElement extends UmbLitElement { declare global { interface HTMLElementTagNameMap { - 'umb-workspace-action-menu': UmbWorkspaceActionMenuElement; + 'umb-workspace-entity-action-menu': UmbWorkspaceEntityActionMenuElement; } } diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view.element.ts index f498ff31b0..840765e937 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view.element.ts @@ -31,7 +31,7 @@ export class UmbWorkspaceSplitViewElement extends UmbLitElement { ${this.displayNavigation - ? html`` + ? html`` : ''} diff --git a/src/Umbraco.Web.UI.Client/storybook/stories/extending/entity-actions.mdx b/src/Umbraco.Web.UI.Client/storybook/stories/extending/entity-actions.mdx index 725b5253c4..f9b35e3215 100644 --- a/src/Umbraco.Web.UI.Client/storybook/stories/extending/entity-actions.mdx +++ b/src/Umbraco.Web.UI.Client/storybook/stories/extending/entity-actions.mdx @@ -28,7 +28,7 @@ TODO: introduction to actions
- Workspace Action Menu + Workspace Entity Action Menu
From 14870c8719497bd3e7604a497feb0a48de707384 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Wed, 28 Feb 2024 11:12:38 +0100 Subject: [PATCH 2/3] fix lit warning and declare global --- .../property-action-menu.element.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/property-action/shared/property-action-menu/property-action-menu.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/property-action/shared/property-action-menu/property-action-menu.element.ts index f315eee874..023e5863d3 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/property-action/shared/property-action-menu/property-action-menu.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/property-action/shared/property-action-menu/property-action-menu.element.ts @@ -12,15 +12,16 @@ export class UmbPropertyActionMenuElement extends UmbLitElement { #actionsInitializer?: UmbExtensionsElementInitializer; @property({ attribute: false }) - public get value(): unknown { - return this._value; - } public set value(value: unknown) { this._value = value; if (this.#actionsInitializer) { this.#actionsInitializer.properties = { value }; } } + public get value(): unknown { + return this._value; + } + private _value?: unknown; @property() @@ -80,3 +81,9 @@ export class UmbPropertyActionMenuElement extends UmbLitElement { `, ]; } + +declare global { + interface HTMLElementTagNameMap { + 'umb-property-action-menu': UmbPropertyActionMenuElement; + } +} From 868855bb98ce4252f5352799789c10f09c04446b Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Wed, 28 Feb 2024 11:19:46 +0100 Subject: [PATCH 3/3] fix lit warning with missing getter --- .../property-action-menu/property-action-menu.element.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/property-action/shared/property-action-menu/property-action-menu.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/property-action/shared/property-action-menu/property-action-menu.element.ts index 023e5863d3..b8af412389 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/property-action/shared/property-action-menu/property-action-menu.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/property-action/shared/property-action-menu/property-action-menu.element.ts @@ -24,8 +24,11 @@ export class UmbPropertyActionMenuElement extends UmbLitElement { private _value?: unknown; + #propertyEditorUiAlias = ''; + @property() set propertyEditorUiAlias(alias: string) { + this.#propertyEditorUiAlias = alias; // TODO: Stop using string for 'propertyAction', we need to start using Const. // TODO: Align property actions with entity actions. this.#actionsInitializer = new UmbExtensionsElementInitializer( @@ -39,6 +42,10 @@ export class UmbPropertyActionMenuElement extends UmbLitElement { 'extensionsInitializer', ); } + get propertyEditorUiAlias() { + return this.#propertyEditorUiAlias; + } + @state() private _actions: Array> = [];