Skip to content

fix: mandatory fields [DHIS2-21165]#538

Open
tomzemp wants to merge 7 commits intomasterfrom
DHIS2-21165/mandatory-fields
Open

fix: mandatory fields [DHIS2-21165]#538
tomzemp wants to merge 7 commits intomasterfrom
DHIS2-21165/mandatory-fields

Conversation

@tomzemp
Copy link
Copy Markdown
Member

@tomzemp tomzemp commented Mar 20, 2026

See https://dhis2.atlassian.net/browse/DHIS2-21165

Discussed this from a product behaviour standpoint with Karoline.

Mandatory fields: now highlighted by default after you click "complete" or "run validation" if they are missing values
Warning message for completion with missing mandatory values: even when data sets did not require mandatory fields to be filled out in order to be completed, the old app showed a warning about these missing values for mandatory fields. The new app is also updated to behave in this way:
image

From a code standpoint, this required a bunch of reorganisation of some code and some logic updates on how errors get reset (so they don't get lost when changing sections), hence scope of code changes is a bit larger than what one might expect from the request.

@dhis2-bot
Copy link
Copy Markdown
Contributor

dhis2-bot commented Mar 20, 2026

🚀 Deployed on https://pr-538--dhis2-data-entry.netlify.app

@dhis2-bot dhis2-bot temporarily deployed to netlify March 20, 2026 15:13 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify March 26, 2026 10:15 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify March 26, 2026 11:39 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify March 26, 2026 12:32 Inactive
@tomzemp tomzemp marked this pull request as ready for review March 26, 2026 12:33
@sonarqubecloud
Copy link
Copy Markdown

@dhis2-bot dhis2-bot temporarily deployed to netlify March 26, 2026 12:58 Inactive
error || (isRequired && !value && completeAttempted)
error ||
(isRequired &&
(!value || value?.value === '') &&
Copy link
Copy Markdown
Member Author

@tomzemp tomzemp Mar 26, 2026

Choose a reason for hiding this comment

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

this change is necessary because the value from useValueStore is not actually just a value but also metadata. The intention is that something should be marked as "red" if there's no value, not if the store has metadata details about the value. I think it was probably just a mistake in this file to process the value in this way, but I don't want to go back and review the code in extensive detail in the context of this PR, hence this quick fix

@tomzemp tomzemp requested a review from a team March 26, 2026 13:03
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.

2 participants