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

fix: CE-1198-Cannot add animal after emptied drugs #772

Conversation

joshgamache
Copy link
Contributor

@joshgamache joshgamache commented Nov 25, 2024

Addresses bug CE-1198. A type error was flagging when drugs were added, then removed, from an animal outcome. Additional refactoring is also included in this.

Changes 🚧

  • Modified save validation with optional chaining to ensure undefined rather than error.
  • Refactored getValue ➡️ getDropdownOption used for dropdown options to operate as a common method.

How Has This Been Tested? 🔬

  • Manual testing, matching from issue report.

To test 🔬

  1. In a complaint outcome, add an outcome by animal
  2. Add a drug to the outcome, then delete it.
  3. Save the outcome. If there are validation errors, you should get a toast saying as such, not a full-page error. If there are no validation errors, it should save.

Checklist 📃

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Thanks for the PR!

Deployments, as required, will be available below:

Please create PRs in draft mode. Mark as ready to enable:

After merge, new images are deployed in:

@joshgamache joshgamache changed the base branch from main to release/yellow-boring-sponge November 25, 2024 22:42
@joshgamache joshgamache self-assigned this Nov 26, 2024
@joshgamache joshgamache changed the title Fix/ce 1198 cannot add animal after emptied drugs fix: CE-1198-Cannot add animal after emptied drugs Nov 26, 2024
@joshgamache joshgamache marked this pull request as ready for review November 26, 2024 16:35
@joshgamache joshgamache force-pushed the fix/CE-1198-cannot-add-animal-after-emptied-drugs branch 2 times, most recently from c0ffb3c to e2f0d72 Compare November 26, 2024 17:07
@joshgamache joshgamache force-pushed the fix/CE-1198-cannot-add-animal-after-emptied-drugs branch from f9777d0 to a82e175 Compare November 26, 2024 22:28
@afwilcox afwilcox merged commit 92e5fb0 into release/yellow-boring-sponge Nov 26, 2024
15 checks passed
@afwilcox afwilcox deleted the fix/CE-1198-cannot-add-animal-after-emptied-drugs branch November 26, 2024 23:56
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.

2 participants