-
Notifications
You must be signed in to change notification settings - Fork 74
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
Edit taxonomy form #977
Merged
Merged
Edit taxonomy form #977
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
allisonking
commented
Aug 11, 2022
Not sure what's going on with the pytest external test 😕 |
@allisonking good news, the test is passing again! bad news....the merge conflicts 🙃 |
allisonking
commented
Aug 15, 2022
@allisonking do we need a follow-up issue for the tooltips TODO? |
ThomasLaPiana
approved these changes
Aug 16, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, LGTM!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #857, closes #855
Code Changes
DataCategoryTag
component toTaxonomyEntityTag
and refactor it a little to share more codeinputs.tsx
, one to include a disabled state, and one to add a grid option to the CustomTextArea componentEditTaxonomyForm
component for the edit form, reusable between each taxonomy typehooks.ts
file for getting info about each type of taxonomy, including labels, queries, mutations, and in the future tooltips can go here too.Steps to Confirm
nox -s dev
localhost:3000/taxonomy
Pre-Merge Checklist
CHANGELOG.md
Description Of Changes
These taxonomy pages are all very similar but operate on slightly different data. However, they all have a few fields in common, which are the ones that are editable. This means we can mostly use the same component and pull out the parts that are unique:
/api/v1/data_category
vs/api/v1/data_subject
)The pattern I went for was that
EditTaxonomyForm.tsx
andTaxonomyTabContent.tsx
stay agnostic of which taxonomy field they are operating on. Instead, custom hooks pull in all of the unique parts into an object with properties that are the same across the taxonomies. When the tabs are being created, we pass in each custom hook as a prop, and then everything renders nicely.An alternative which seems more natural would be to call each hook and then pass its data into each
TaxonomyTabContent.tsx
, but this would remove the lazy loading the tabs provide us (only loading the data when a tab is clicked on).Screen.Recording.2022-08-15.at.2.13.47.PM.mov