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

WasteLine form conditionals #582

Merged
merged 13 commits into from
Aug 30, 2023

Conversation

dpgraham4401
Copy link
Member

@dpgraham4401 dpgraham4401 commented Aug 30, 2023

Description

This PR makes a few modifications to our WasteLineForm.

  1. epaWaste and dotHazardous field depend on each other if epaWaste is true, then dotHazardous must be true. Converse, if dotHazardous is false, epaWaste must be false
  2. If epaWaste is set to false, federal waste code select is disabled
  3. If epaWaste is set to false, all federal waste codes are removed
  4. Conditionally, we render DOT Description + DOT ID number or.... just Waste Description depending on the values for dotHazardous and epaWaste.
  5. Add error messages for the waste description/DOT description + ID when not provided.

Issue ticket number and link

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

We need to be able to read the state of the field 'epaWaste' in order to
conditionally display/disable other fields.
… field in WasteLine

while the dotInformation is optional if the shipement is not dotHazardous, we've also added a refine method to the wasteline schema so if dotHazardous is true, both fields in dotInformation is required
here's our logic, if dotHazardous then epaWaste can be true or false. However, if epaWaste is True then dotHazardous must be true
epaWaste and dotHazardous field depend on each other if epaWaste is true, then dotHazardous must be true. Converse, if dotHazardous is false, epaWaste must be false
@github-actions github-actions bot added the client Related to front end workings (React/Redux) label Aug 30, 2023
@dpgraham4401 dpgraham4401 merged commit dc7c88d into USEPA:main Aug 30, 2023
6 checks passed
@dpgraham4401 dpgraham4401 deleted the waste_description_conditional branch August 30, 2023 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Related to front end workings (React/Redux)
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant