Skip to content

EAP: Update schema for Save and submit functionality#2240

Merged
AdityaKhatri merged 3 commits intoproject/early-action-protocolsfrom
feature/eap-schema
Mar 9, 2026
Merged

EAP: Update schema for Save and submit functionality#2240
AdityaKhatri merged 3 commits intoproject/early-action-protocolsfrom
feature/eap-schema

Conversation

@shreeyash07
Copy link
Copy Markdown
Collaborator

@shreeyash07 shreeyash07 commented Feb 16, 2026

Changes

  • Add EapObsolete resolution modal for EAP Forms
  • Add getIsSubmission context in form schema for save and submit functionality
  • Add lastModifiedAtRef to send modified_at while updating
  • Add new source information field for meal and NS capacity Tab

This PR Ensures:

  • No typos or grammatical errors
  • No conflict markers left in the code
  • No unwanted comments, temporary files, or auto-generated files
  • No inclusion of secret keys or sensitive data
  • No console.log statements meant for debugging
  • All CI checks have passed

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 16, 2026

⚠️ No Changeset found

Latest commit: 63d39b7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@shreeyash07 shreeyash07 changed the title EAP: changes in EAP: Update schema for Save and submit functionality Feb 16, 2026
Comment thread app/src/components/domain/EapObsoleteResolutionModal/index.tsx
Comment thread app/src/components/domain/EapObsoleteResolutionModal/index.tsx
});

const response = fullEapResponse ?? simplifiedEapResponse;
const pending = fullEapPending ?? simplifiedEapPending;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
const pending = fullEapPending ?? simplifiedEapPending;
const pending = fullEapPending || simplifiedEapPending;

)}
>
{pending && <BlockLoading />}
{!pending && (
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is this necessary?

"confirmStatusButtonLabel": "Confirm",
"updateStatusDescription": "Are you sure you want to update the status?",
"reviewChecklistDescription": "Upload the Review Checklist for the National Society to download and review. Make sure to keep a proper labeling of the file to avoid duplications.",
"editSimplifiedEapFormLinkLabel": "Edit sEAP",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
"editSimplifiedEapFormLinkLabel": "Edit sEAP",
"editSimplifiedEapFormLinkLabel": "Edit simplified EAP",

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.

No changes required in this. this is correct.

</Label>
</ListView>
)}
{isDefined(hasFormErrors) && (
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we've already alerted the users. Is this necessary again?

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.

This alert is different it persist its state in the modal to show warning and error.

const [fileIdToUrlMap, setFileIdToUrlMap] = useState<Record<number, string>>({});

const updateFileUrlMapping = useCallback((response: GetSimplifiedResponse) => {
lastModifiedAtRef.current = response?.modified_at;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Move this setting right after we get data from the request as opposed to doing it during updateFileUrlMapping

Comment on lines +377 to +378
// NOTE it is here to clear the state and
// replace is necessary for not pushing a new entry
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Mention in the note in a bit more detail about why the state was used and what happens if we don't replace it.
Also, try this:
window.history.replaceState({}, '')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Navigating my trigger the request again that will lead to the onSuccess being triggered again.

Comment thread app/src/views/EapFullForm/index.tsx Outdated
);

const updateFileUrlMapping = useCallback((response: GetFullEapResponse) => {
lastModifiedAtRef.current = response?.modified_at;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same as in the simplified form

Comment thread app/src/views/EapFullForm/index.tsx Outdated

// NOTE it is here to clear the state and
// replace is necessary for not pushing a new entry
navigate(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same as in the simplified form

: undefined,
});

const response = fullEapResponse ?? simplifiedEapResponse;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you add a note here why this is necessary?
I am a bit confused as to why simplified it sidelined 😋

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.

Both request runs in parallel only one will return data depending on which EAP type associated with the current context.

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.

SimplifiedEAP is not sidelined, its the fallback if you have any other way please suggest me.

- Add getIsSubmission context in form schema for save and submit
  functionality
- Add lastModifiedAtRef to send modified_at while updating
@AdityaKhatri AdityaKhatri merged commit 72bff3e into project/early-action-protocols Mar 9, 2026
18 checks passed
@AdityaKhatri AdityaKhatri deleted the feature/eap-schema branch March 9, 2026 05:12
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.

3 participants