Skip to content

CMS-1952: Fix submit with errors bug - #721

Open
ayumi-oxd wants to merge 4 commits into
mainfrom
CMS-1952
Open

CMS-1952: Fix submit with errors bug#721
ayumi-oxd wants to merge 4 commits into
mainfrom
CMS-1952

Conversation

@ayumi-oxd

Copy link
Copy Markdown
Collaborator

Jira Ticket

CMS-1952

Description

  • Added shouldShowSubmitErrorUI flag that ensures the summary error UI is only shown for validation errors other than internal notes.
  • Updated error summary and related UI components to use shouldShowSubmitErrorUI instead of checking for any validation errors, preventing unnecessary or redundant error displays.
  • Modified the saveForm function so that the form is only marked as "submitted" (which triggers error UI) when the status is not REQUESTED, aligning error display with actual submission attempts.

Copilot AI 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.

Pull request overview

Fixes CMS-1952 by refining validation error display and submission-state handling.

Changes:

  • Adds conditional submit-error UI visibility.
  • Updates validation summary and bypass controls.
  • Prevents draft saves from marking forms as submitted.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread frontend/src/components/FormPanel.jsx Outdated
@ayumi-oxd
ayumi-oxd marked this pull request as ready for review August 20, 2026 21:39
@ayumi-oxd
ayumi-oxd requested review from duncan-oxd and molund August 20, 2026 21:40

@duncan-oxd duncan-oxd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good overall, but I had some questions

Comment thread frontend/src/components/FormPanel.jsx Outdated
<Offcanvas.Body>
<div id="validation-errors">
{validation.errors.length > 0 && (
{shouldShowSubmitErrorUI && (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I know the task says not to show the ErrorSummary component if the only error is the internal notes, but I still think we should show it. Mike brought it up on the call the other day and I don't know if we ever reached a consensus though.

If the only error is ‘Internal notes’ do not show ‘Submit with errors’ functionality (Summary and submit anyways)

It might be worth double-checking with UX, because it would simplify the changes too!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Updated the behaviour to keep ErrorSummary visible after submit/approve attempts even when internal notes is the only error.

Comment thread frontend/src/components/FormPanel.jsx Outdated
@ayumi-oxd
ayumi-oxd requested a review from duncan-oxd August 21, 2026 19:15

@duncan-oxd duncan-oxd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice! The recent changes simplified this branch a lot. I put in a note about renaming one of the useMemo variables, since "hasNonNotesErrors" could be false because of the shouldShowErrorSummary dependency, even if there are non-note errors, and that could get confusing.

Otherwise, LGTM!

Comment thread frontend/src/components/FormPanel.jsx Outdated
return validation.errors.length > 0;
}, [submitted, validation.errors]);

const hasNonNotesErrors = useMemo(() => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is being used more like a shouldShowSubmitAnyway variable so it would clarify things to rename it to something like that, and add a couple of comments to say what we're using it for 👍

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