From 6f7b4b4c7066014e7c631f26a26fca65a1da174d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Thu, 4 Jul 2024 16:00:02 +0200 Subject: [PATCH] correct headline --- .../property-type-workspace-editor.element.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/property-type/workspace/property-type-workspace-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/property-type/workspace/property-type-workspace-editor.element.ts index e0c0258395..a68efbee13 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/property-type/workspace/property-type-workspace-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/property-type/workspace/property-type-workspace-editor.element.ts @@ -7,6 +7,9 @@ export class UmbPropertyTypeWorkspaceEditorElement extends UmbLitElement { // #workspaceContext?: typeof UMB_PROPERTY_TYPE_WORKSPACE_CONTEXT.TYPE; + @state() + _isNew?: boolean; + @state() _name?: string; @@ -18,6 +21,9 @@ export class UmbPropertyTypeWorkspaceEditorElement extends UmbLitElement { this.consumeContext(UMB_PROPERTY_TYPE_WORKSPACE_CONTEXT, (context) => { this.#workspaceContext = context; + this.observe(context.isNew, (isNew) => { + this._isNew = isNew; + }); this.observe(context.name, (name) => { this._name = name; }); @@ -26,11 +32,14 @@ export class UmbPropertyTypeWorkspaceEditorElement extends UmbLitElement { } override render() { - return this.workspaceAlias + return this.workspaceAlias && this._isNew !== undefined ? html` + headline=${this.localize.term( + this._isNew ? 'contentTypeEditor_addProperty' : 'contentTypeEditor_editProperty', + [this._name], + )}> ` : '';