-
Notifications
You must be signed in to change notification settings - Fork 51
Fix for issue #660 #1061
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 for issue #660 #1061
Conversation
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.
I tested unpublishing and deleting a simple record and this worked as expected. The submitted code looks good to me.
I was thinking if there would be a good place to add this info to the readthedocs site, but I dont see an obvious place and I think the modal warnings are informative enough (for delete, anyway)
Co-authored-by: Bradford Condon <[email protected]>
|
Getting back to this one. Thanks @bradfordcondon for the review. I committed the warning message text change you suggested. Do we need another review prior to merging this? |
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.
I'm looking at this right now. Still working on a second functional review but the first thing that jumped out at me is that the new delete button is where the old unpublish button (labelled delete for max confusion) was. I'm worried that my users won't see the difference and will just click the delete labelled button in the same spot and accidentally delete from the database... Could we switch the location of the delete and unpublish buttons so that unpublish is on the far right. This way, if you click without reading, you're still achieving the same thing you were before. It just feels like it would need to be more intentional to delete from the database this way.
UPDATE: I completed my functional review and this is my only comment. I just found it too easy for muscle memory to delete the record more fully then I intended ;-p
|
The delete button is on the far right to prevent accidental clicking of it. We do have that confirmation page to catch accidents but if someone goes through too quickly they could just ignore it. So the thinking is to keep that button far away. I agree, for folks used to the other layout with the 'delete' button meaning 'unpublish' this might cause problems. I guess we could put the 'unpublish' and 'delete' buttons side-by-side on the right side. What do you think of that? |
I like this idea. That should at least give people pause when they go to click the delete button that something obvious has changed. 🤞 |
|
My preference in a vacuum is both on the right side, so if @laceysanderson approves too, perfect. |
|
Okay, the button has been moved to the right. I also retested everything to make sure it all still works. Which it does. @laceysanderson it's ready for review again. |
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.
Functional test looks perfect 👍 The new position of the button is great and everything still works as expected :-)
Bug Fix
Issue #660
Description
This PR adds a new 'Unpublish' button to each entity form. When clicked, the entity is unpublished from the site. This is the functionality that the 'Delete' button used to provide. Also, this PR, redefines the 'Delete' button so that when clicked it both unpublishes and deletes from the underlying database (i.e. Chado). Both the unpublish and the delete have a confirmation form.
Also, If a base record is deleted and there are other dependent records (e.g. feature records from an organism) that get removed via a cascade delete but those records have published content, then they get removed by a job to remove orphans that gets added after the delete.
Testing?
Just try out each button. One thing that happens when deleting a base record is that all ancillary records are cascade deleted via Chado table constraints. So, if you delete an organism, you will also end up deleting all features, stocks, etc.... So, test that out and be careful.
Screenshots (if appropriate):
Additional Notes (if any):
There are two possible issues here.