Skip to content

Allow Empty value #106

Merged
AaronSadlerUK merged 1 commit into
AaronSadlerUK:developfrom
JBoye:104-allow-empty-menus
Feb 12, 2026
Merged

Allow Empty value #106
AaronSadlerUK merged 1 commit into
AaronSadlerUK:developfrom
JBoye:104-allow-empty-menus

Conversation

@JBoye

@JBoye JBoye commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

Only validate when the property has been marked as mandatory in the doctype

Fixed #104

Copilot AI review requested due to automatic review settings February 12, 2026 09:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts UmbNav property editor validation so an empty menu is only treated as invalid when the property is marked mandatory in the Document Type (fixes #104).

Changes:

  • Gate the valueMissing validator behind a new mandatory flag.
  • Add a mandatory?: boolean property to the property editor UI element.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 18 to 22
this.addValidator(
'valueMissing',
() => this.localize.term('umbnav_requiredMessage'),
() => !this.value || this.value.length === 0
() => this.mandatory === true && (!this.value || this.value.length === 0)
);

Copilot AI Feb 12, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The required-field behavior is now conditional on mandatory, but there are no Playwright tests asserting (1) optional UmbNav properties allow saving with an empty value and (2) mandatory UmbNav properties still block saving when empty. Adding an e2e test (or extending an existing one) for these two scenarios would prevent regressions and confirm the mandatory flag is being provided by the backoffice host as expected.

Copilot uses AI. Check for mistakes.
@AaronSadlerUK AaronSadlerUK merged commit 07c0ab6 into AaronSadlerUK:develop Feb 12, 2026
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow empty menus

3 participants