From 6408df5f3ec31561d2901c282210f3eb602becd6 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Tue, 18 Nov 2025 17:11:51 +0000 Subject: [PATCH 1/3] Adds `$settings` to the block workspace label renderer --- .../workspace/block-workspace.context.ts | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace.context.ts index 4a8fcbb12fb1..4fb8ee1bb291 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace.context.ts @@ -113,8 +113,8 @@ export class UmbBlockWorkspaceContext { - this.#renderLabel(contentValues); + async ([contentValues, settingsValues]) => { + this.#renderLabel(contentValues, settingsValues); }, 'observeContentForLabelRender', ); @@ -243,11 +243,14 @@ export class UmbBlockWorkspaceContext | undefined) { + async #renderLabel( + contentValues: Array | undefined, + settingsValues: Array | undefined, + ) { const valueObject = {} as Record; if (contentValues) { for (const property of contentValues) { @@ -255,7 +258,15 @@ export class UmbBlockWorkspaceContext requestAnimationFrame(() => resolve(true))); const result = this.#labelRender.toString(); From ba7ca34911f35ebb0c8090485d5c80b4c146f305 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Tue, 18 Nov 2025 17:12:50 +0000 Subject: [PATCH 2/3] Adds a prefix to the Block workspace title --- .../block/workspace/block-workspace-editor.element.ts | 8 +++----- .../block/block/workspace/block-workspace.context.ts | 8 +++++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace-editor.element.ts index a76ed3ea2f37..ef9817a608e3 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace-editor.element.ts @@ -2,7 +2,6 @@ import { UMB_BLOCK_WORKSPACE_CONTEXT } from './index.js'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; import { customElement, css, html, state } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; -import { observeMultiple } from '@umbraco-cms/backoffice/observable-api'; @customElement('umb-block-workspace-editor') export class UmbBlockWorkspaceEditorElement extends UmbLitElement { @@ -11,10 +10,9 @@ export class UmbBlockWorkspaceEditorElement extends UmbLitElement { this.consumeContext(UMB_BLOCK_WORKSPACE_CONTEXT, (context) => { if (context) { this.observe( - observeMultiple([context.isNew, context.name]), - ([isNew, name]) => { - this._headline = - this.localize.term(isNew ? 'general_add' : 'general_edit') + ' ' + this.localize.string(name); + context.name, + (name) => { + this._headline = this.localize.string(name); }, 'observeOwnerContentElementTypeName', ); diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace.context.ts index 4fb8ee1bb291..08a6090eb4be 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace.context.ts @@ -269,9 +269,11 @@ export class UmbBlockWorkspaceContext requestAnimationFrame(() => resolve(true))); - const result = this.#labelRender.toString(); - this.#name.setValue(result); - this.view.setTitle(result); + const prefix = this.getIsNew() === true ? '#general_add' : '#general_edit'; + const label = this.#labelRender.toString(); + const title = `${prefix} ${label}`; + this.#name.setValue(title); + this.view.setTitle(title); } #allowNavigateAway = false; From 20b9e0a94eb6ddf0a9392e1d263ad14b6c6c8240 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Tue, 18 Nov 2025 17:12:58 +0000 Subject: [PATCH 3/3] Imports tidy-up --- .../block/block/workspace/block-workspace-editor.element.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace-editor.element.ts index ef9817a608e3..9ebd8991c52f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace-editor.element.ts @@ -1,6 +1,5 @@ import { UMB_BLOCK_WORKSPACE_CONTEXT } from './index.js'; -import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; -import { customElement, css, html, state } from '@umbraco-cms/backoffice/external/lit'; +import { css, customElement, html, state } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; @customElement('umb-block-workspace-editor') @@ -26,11 +25,10 @@ export class UmbBlockWorkspaceEditorElement extends UmbLitElement { private _headline: string = ''; override render() { - return html` `; + return html``; } static override readonly styles = [ - UmbTextStyles, css` :host { display: block;