specify / specify7

Specify 7
https://www.specifysoftware.org/products/specify-7/
GNU General Public License v2.0
66 stars 36 forks source link

Deletion of 'Root' storage shouldn't be supported using Specify UI #1819

Open realVinayak opened 2 years ago

realVinayak commented 2 years ago

Describe the bug Deletion of 'Root' Storage shouldn't be supported since creating new Storage objects require a Parent Storage object. I was able to delete the 'Root' Storage object through the Specify 7 UI.

To Reproduce Steps to reproduce the behavior:

  1. Go to the 'Root' Storage object in Specify 7 UI.
  2. Click on 'Delete' icon.
  3. 'Root' Storage object will then be deleted.

Expected behavior Specify UI should not support deletion of 'Root' Storage object

maxpatiiuk commented 2 years ago

You are right, in most cases, you don't want to delete root node. And you are not able to do this, unless the root node doesn't have any children. Most trees have nodes in them. Storage is the exception, which is often empty for institutions that don't use it.

Also, if you delete all tree nodes, you might be able to add a new root though the WorkBench.

There may also be some use cases for deleting root tree node:

maxpatiiuk commented 2 years ago

Maybe ability to remove tree roots should be part of the "No Restrictions mode" for the tree viewer.

Or even better, this could be implemented using record-level permission system, once we have it.

grantfitzsimmons commented 1 year ago

From @carlosmbe:

Describe the bug In the rare case that a tree has nothing using it. When you delete the root, behaviour can vary.

Performed in Litho Strat

  1. 404 Error with tree still present under it
  2. Crash - Protected Error

This next one was performed in a Taxon Tree

  1. Successful Deletion but prevented from creating a new child or interacting with the tree once more. Although 3 is expected behaviour. Be great if it was not possible since not having any parent available in LifoStrat makes it difficult to create anything where that is a required it's a required field.

To Reproduce Steps to reproduce the behavior:

  1. Go to morpaleo or another mostly empty database
  2. Delete root of a tree
  3. See error

Suggestion Block delete similar to how it is blocked when children are present

Screen Recording, Crash Reports and Crash Reports

  1. Crash - Protected Error Specify 7 Crash Report - 2023-05-02T21_11_35.261Z (1).txt Specify 7 Crash Report - 2023-05-02T21_11_35.261Z.txt

https://user-images.githubusercontent.com/53784701/235783960-fee77c11-e290-4863-ab45-aaced85208e4.mp4

  1. 404 Error with tree still present under it

https://user-images.githubusercontent.com/53784701/235783839-4bdced86-949d-4548-94bb-ae27eb8aba06.mp4

  1. Successful Deletion but prevented from creating a new child or interacting with the tree once more. <The UI Doesn’t allow it> Screenshot 2023-05-02 at 3 38 15 PM

Desktop: OS: Mac OSx Ventura Browser: Chrome Specify 7 Version: 7.8.10-prerelease

Database Name: Morpaleo or ANY

Reported By Carlos @carlosmbe

emenslin commented 4 months ago

Can recreate in edge (7.9.6). Deleted the storage tree root and it looked like the node had not been deleted but when I clicked on it I got a 404. Navigating back just shows a blank tree image