From 6f4c5121600a70e5c789ce3cf3e5614e48d33a64 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 26 Jun 2024 11:49:16 +0100 Subject: [PATCH] Conditionally render property description --- .../property-layout/property-layout.element.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/property/property-layout/property-layout.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/property/property-layout/property-layout.element.ts index 78ef7682db..1bbbdaae6a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/property/property-layout/property-layout.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/property/property-layout/property-layout.element.ts @@ -60,7 +60,6 @@ export class UmbPropertyLayoutElement extends UmbLitElement { public invalid?: boolean; override render() { - const ufmValue = { alias: this.alias, label: this.label, description: this.description }; // TODO: Only show alias on label if user has access to DocumentType within settings: return html`
@@ -69,9 +68,7 @@ export class UmbPropertyLayoutElement extends UmbLitElement { ${when(this.invalid, () => html`!`)} - - - + ${this.#renderDescription()}
@@ -82,6 +79,12 @@ export class UmbPropertyLayoutElement extends UmbLitElement { `; } + #renderDescription() { + if (!this.description) return; + const ufmValue = { alias: this.alias, label: this.label, description: this.description }; + return html``; + } + static override styles = [ UmbTextStyles, css`