Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@spficklin
Copy link
Member

@spficklin spficklin commented May 25, 2020

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.

  1. If the delete will be large and cascade it may cause the site to timeout (i.e. trying to delete an organism with thousands of records).
  2. While there is a new 'Unpublish' button, the 'Delete' button still looks the same. I have some concern that someone may not notice the change and think they are unpublishing when they click the 'Delete' button. If the person is paying attention the warning is there. What do you think?

@spficklin spficklin requested a review from laceysanderson May 25, 2020 23:26
Copy link
Member

@bradfordcondon bradfordcondon left a 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)

@spficklin
Copy link
Member Author

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?

Copy link
Member

@laceysanderson laceysanderson left a 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.
Screen Shot 2020-08-10 at 2 57 23 PM

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

@spficklin
Copy link
Member Author

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?

@laceysanderson
Copy link
Member

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. 🤞

@bradfordcondon
Copy link
Member

My preference in a vacuum is both on the right side, so if @laceysanderson approves too, perfect.

@spficklin
Copy link
Member Author

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.

Copy link
Member

@laceysanderson laceysanderson left a 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 :-)

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.

3 participants