-
Notifications
You must be signed in to change notification settings - Fork 36
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 basic tree creation functionality #5080
base: production
Are you sure you want to change the base?
Conversation
Triggered by 8d22dcb on branch refs/heads/issue-4833
Triggered by d93cd03 on branch refs/heads/issue-4833
Triggered by f4e2e53 on branch refs/heads/issue-4833
Triggered by 5a83d5b on branch refs/heads/issue-4833
Triggered by d8ca138 on branch refs/heads/issue-4833
Triggered by 6446193 on branch refs/heads/issue-4833
Triggered by dc79360 on branch refs/heads/issue-4833
@@ -252,7 +256,8 @@ export function IntegratedRecordSelector({ | |||
preHeaderButtons={collapsibleButton} | |||
sortField={sortField} | |||
viewName={viewName} | |||
onAdd={(resources): void => { | |||
onAdd={isTaxonTreeDefItemTable ? undefined : |
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.
considering that the TaxonTreeDefItems have their own specific adding setup, we did this so that there wouldn't be any weirdness with ranks (if you add a rank via the TreeDef editor then the new rank will be the lowest rank + 10 automatically and you can't edit it unless forms have been changed)
We don't think our changes will affect anything else but let us know 👍
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.
Testing instructions
- Log in as an admin.
- Go to the Storage and Geography tree views and make sure that the Add button is not present on either tree.
-
- Add button will appear after the edit button next to the tree's name.
- Go to the Taxon tree view and see that the Add button is there.
- After clicking on the Add button, ensure that a dialog with a list of default trees appear. Make sure you can select each one.
-
- The list should include Botany, Entomology, Herpetology, Ichthyology, Invertebrate Paleontology, Invertebrate Zoology, Mammalogy, Ornithology, Paleobotany, Vascular Plants, and Vertebrate Paleontology
- After selecting a record, make sure that you cannot add any TreeDefItems, but can still edit and delete existing ones.
-
- Check this on multiple subview types--subform, grid, and button. Button is the default, and the XML for a diff form is below.
- Upon saving, make sure that the new tree is in the tree dropdown.
Permissions
- Log in as a non-admin.
- Go to the Taxon tree view and make sure that the Add button is not there.
Its working pretty well so far! 👌👍👍
I encountered two issues:
- Creating two trees of the same type causes an error:
chrome_XDan9GxfIf.mp4
- While I can't add a Rank through this menu, I also can't successfuly delete one. I don't know if that's strictly related to this PR though.
chrome_XdQE0gEqkD.mp4
And as a side note, its not possible to delete an empty tree after creating it without deleting the ranks first, but that's probably a separate feature request.
chrome_KHw7gTqtgi.mp4
@alesan99 Can you try to recreate the second issue? I wasn't able to :( It also looks like the name of the tree is the same as an already existing tree, so that might be the issue? |
specifyweb/frontend/js_src/lib/components/FormSliders/IntegratedRecordSelector.tsx
Outdated
Show resolved
Hide resolved
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.
Testing instructions
- Log in as an admin.
- Go to the Storage and Geography tree views and make sure that the Add button is not present on either tree.
-
- Add button will appear after the edit button next to the tree's name.
- Go to the Taxon tree view and see that the Add button is there.
- After clicking on the Add button, ensure that a dialog with a list of default trees appear. Make sure you can select each one.
-
- The list should include Botany, Entomology, Herpetology, Ichthyology, Invertebrate Paleontology, Invertebrate Zoology, Mammalogy, Ornithology, Paleobotany, Vascular Plants, and Vertebrate Paleontology
- After selecting a record, make sure that you cannot add any TreeDefItems, but can still edit and delete existing ones.
-
- Check this on multiple subview types--subform, grid, and button. Button is the default, and the XML for a diff form is below.
- Upon saving, make sure that the new tree is in the tree dropdown.
Permissions
- Log in as a non-admin.
- Go to the Taxon tree view and make sure that the Add button is not there.
Some more insight into the second issue that @alesan99 discovered. When you first add a tree before it is saved and try to remove any of the ranks it works, if the tree has already been saved and you go back and try to delete the highest rank it works, but if the tree has been saved and you try to remove the lowest rank it causes an error.
Before saving the tree:
chrome_WdIZ09CVd1.mp4
After saving the tree:
chrome_abV21hmdfV.mp4
Co-authored-by: Max Patiiuk <[email protected]>
Triggered by f393c27 on branch refs/heads/issue-4833
Triggered by f0731e5 on branch refs/heads/issue-4833
Triggered by dd44985 on branch refs/heads/issue-4833
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.
It seems like we should obfuscate this button more than we have now. It's a bit too apparent considering how infrequent this action is going to be taken.
Where would you suggest it be? |
Fixes #5268, as part of #4833
This PR implements Version 1 of the Tree Creation Process outlined in 4833. You should be able to create trees via the new add button in the Tree View. 🎉
This PR creates a tree with ranks, but without any items or anything--testing adding to the new tree/etc isn't apart of testing since it doesn't come with a root node by default!
Checklist
and self-explanatory (or properly documented)
Testing instructions
Permissions
Here is the taxon tree definition form used in development, from #5073 (thanks Jason!)--it'll be added as the default form in
v7.9.8
, but this PR should work with any form. You'll need to click 'Show all tables' in App Resources--also make sure that you're adding it to Taxon Tree Definition, and not Taxon Tree Definition Item.