Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MDS-5604] Disable ESUP form submit while uploading documents #2826

Merged
merged 3 commits into from
Nov 28, 2023

Conversation

taraepp
Copy link
Collaborator

@taraepp taraepp commented Nov 27, 2023

Objective

  • disable the submit button on ESUP form while documents are uploading
  • found & fixed bug where BE error would occur when using the "Edit Documents" action on an amended ESUP (would occur on submit, due to document type field name mismatch)
  • found another bug where all the necessary data for parties was being filtered out on the applications page- making previously selected parties show as their ID, and not showing expected options in new records- removed the filtering

MDS-5604

Why are you making this change? Provide a short explanation and/or screenshots

  • I did put the "form is loading" tracking in with the modal actions: reason being they're already combined, consider refactor to separate file in future if we do more form upgrades
  • had fun with redux hooks! Guided by docs https://react-redux.js.org/api/hooks
    • at first I implemented the useActions at the bottom of the page, but in the end it wasn't any better or less verbose than useDispatch so I cut it out.
  • had a real struggle with that test, adding redux logic forced me to essentially mock the redux form.
  • bonus conversions to TS
  • I took out a isMultiple param that wasn't doing anything (we were passing it as a prop to a component that didn't consume it)

…k if the form is loading, then used action to set on the upload events, and the reducer on the form where value is used. Also fixed a bug with editing documents on an issued amendment
…, and updates to test for esup file upload so that it can run
@taraepp taraepp changed the title Mds 5604 disable esup submit uploading docs [MDS-5604] Disable ESUP form submit while uploading documents Nov 27, 2023
@@ -168,7 +167,7 @@ export const ExplosivesPermitFormNew: FC<ExplosivesPermitFormProps &
);
const disabled = formMode === EsupFormMode.edit_document;
const showBackButton = formMode === EsupFormMode.select_type_modal;
const isAmendment = formMode === EsupFormMode.amend;
const isAmendment = formMode === EsupFormMode.amend || initialValues.isAmendment;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this was the change for bug with "Edit Documents" on amendment.

@taraepp taraepp added 💻 Frontend This pull request includes frontend changes. 💊 Fix Fixes something that isn't working :) labels Nov 27, 2023
Copy link
Contributor

@henryoforeh-dev henryoforeh-dev left a comment

Choose a reason for hiding this comment

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

Nice work!

@taraepp taraepp merged commit cf1f234 into develop Nov 28, 2023
@taraepp taraepp deleted the mds-5604-disable-esup-submit-uploading-docs branch November 28, 2023 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💊 Fix Fixes something that isn't working :) 💻 Frontend This pull request includes frontend changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants