From 18bbf5609bad84b8661becd426aed16268b5bb3a Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Mon, 1 Dec 2025 17:03:14 +0100 Subject: [PATCH] Data Type Workspace: Enable client mandatory field validation for configuration properties (#20799) * Add validation property to PropertyEditorSettingsProperty Introduces a 'validation' field to the PropertyEditorSettingsProperty interface, allowing configuration of mandatory status and custom mandatory messages for property editor settings. * Pass validation property to umb-property component --- .../property-editor/extensions/property-editor.extension.ts | 4 ++++ .../property-editor-config/property-editor-config.element.ts | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/extensions/property-editor.extension.ts b/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/extensions/property-editor.extension.ts index 31ff43ed7b..3185e282c2 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/extensions/property-editor.extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/extensions/property-editor.extension.ts @@ -69,6 +69,10 @@ export interface PropertyEditorSettingsProperty { propertyEditorDataSourceAlias?: string; config?: UmbPropertyEditorConfig; weight?: number; + validation?: { + mandatory: boolean; + mandatoryMessage?: string | null; + }; } // eslint-disable-next-line @typescript-eslint/naming-convention diff --git a/src/Umbraco.Web.UI.Client/src/packages/data-type/components/property-editor-config/property-editor-config.element.ts b/src/Umbraco.Web.UI.Client/src/packages/data-type/components/property-editor-config/property-editor-config.element.ts index 4ee552be0c..8f30247448 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/data-type/components/property-editor-config/property-editor-config.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/data-type/components/property-editor-config/property-editor-config.element.ts @@ -52,7 +52,8 @@ export class UmbPropertyEditorConfigElement extends UmbLitElement { alias=${property.alias} property-editor-ui-alias=${property.propertyEditorUiAlias} property-editor-data-source-alias=${ifDefined(property.propertyEditorDataSourceAlias)} - .config=${property.config}>`, + .config=${property.config} + .validation=${property.validation}>`, ) : html`There is no configuration for this property editor.