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

Add update remove objectives #352

Merged
merged 44 commits into from
Mar 8, 2021
Merged

Add update remove objectives #352

merged 44 commits into from
Mar 8, 2021

Conversation

jasalisbury
Copy link
Contributor

@jasalisbury jasalisbury commented Mar 8, 2021

Description of change

The frontend can add objects to goals. Uses react-hook-form's field array for objectives. I could not find an example where a field array was nested without the first array also being a part of the field array. Since goals are done with the multiselect I couldn't figure out a way to use a field array with goals. I had some issues getting everything to work but once I moved the objective's "edit" state outside of hook form and into the objective component as state things started to simplify a bit.

Keeping as a draft until more pieces make it to main, mainly the context menu and validations.

How to test

  1. Pull down
  2. Create a new report, select grantee and the first few grants
  3. Go to the objective page, add a few goals
  4. Add, remove and update objectives

Issue(s)

Checklist

  • Meets issue criteria
  • Code tested
  • Meets accessibility standards (WCAG 2.1 Levels A, AA)
  • Documentation updated

This PR also includes a change for adding a context menu to the landing page activity reports table

The frontend can add objects to goals. Uses react-hook-form's
field array for objectives. I could not find an example where a field
array was nested without the first array also being a part of the field
array. Since goals are done with the multiselect I couldn't figure out a
way to use a field array with goals. I had some issues getting
everything to work but once I moved the objective's "edit" state outside
of hook form and into the objective component as state things started to
simplify a bit.

Waiting for the recent form validation PR to merge before moving this
forward. Still need to handle error messages and finalize validations.
Conflicts:
	frontend/src/components/MultiSelect.js
If a goal has zero objectives one is added. If a goal only has one
objective that objective cannot be removed.
Small goals were not taking up the proper space. Now they always take
100% of the parent and the trash can icon is placed to the right
Objectives no longer uses react-hook-from field arrays. This change
simplifies the code a bit. Also avoids the fight between the multiselect
and field arrays.
Splitting out the goal validator makes testing the validator easier.
Also makes understanding the validator easier as well.
@jasalisbury jasalisbury requested a review from rahearn March 8, 2021 15:41
@rahearn rahearn merged commit c9b73fc into HHS:main Mar 8, 2021
AdamAdHocTeam added a commit that referenced this pull request Jul 8, 2021
* Revert "Revert "Ttahub 182/add three new topics""

* Update yaml config to push to SB.
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.

Edit objectives in an Activity Report
3 participants