Skip to content

fix: display submit errors#36

Merged
varl merged 1 commit into
alphafrom
display-submit-errors
Apr 23, 2020
Merged

fix: display submit errors#36
varl merged 1 commit into
alphafrom
display-submit-errors

Conversation

@ghost

@ghost ghost commented Apr 22, 2020

Copy link
Copy Markdown

This fixes the display of field specific submitErrors (see here: meta.submitError). The hasError helper is already dealing with this properly, since it looks at meta.invalid and that's triggered for validation and submission errors.

Using if blocks instead of an expression here for readability, since otherwise it got quite long and difficult to parse. Plus, this only returns the value if it's truthy, slightly different logic, but should be the same in practice (since the values should only be strings and it returns '' at the end).

I noticed the forms tests aren't being run (or it seems like it): https://dhis2.slack.com/archives/CBM8LNEQM/p1587567537209200. After that's resolved I'll take a look at updating tests where necessary.

Closes #33

@ghost
ghost marked this pull request as ready for review April 22, 2020 15:21
@ghost
ghost self-requested a review as a code owner April 22, 2020 15:21

@HendrikThePendric HendrikThePendric left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Excellent.

Using if blocks instead of an expression here for readability,

I fully agree this was the time to move to blocks 👍

@varl
varl merged commit 9d67f70 into alpha Apr 23, 2020
@varl
varl deleted the display-submit-errors branch April 23, 2020 11:14
@dhis2-bot

Copy link
Copy Markdown
Contributor

@dhis2-bot

Copy link
Copy Markdown
Contributor

eirikhaugstulen added a commit that referenced this pull request Apr 13, 2026
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Eirik <eirik.haugstulen@gmail.com>
eirikhaugstulen added a commit that referenced this pull request Apr 15, 2026
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Eirik <eirik.haugstulen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants