m2ms / fragalysis-frontend

The React, Redux frontend built by webpack
Other
1 stars 1 forks source link

Delete custom dataset #876

Open boriskovar-m2ms opened 2 years ago

boriskovar-m2ms commented 2 years ago

User will be able to delete results of the jobs which are computed dataset which are displayed in the right hand side.

API call to delete given dataset: DELETE api/compound-sets/

User will be able to delete the sets from jobs table. User will be able to select multiple job results and press the button Remove. The system will show a confirmation dialog with text "Are you sure you want to delete following datasets: " with two buttons Yes and No. After confirmation (Yes button pressed) system will remove tab for each selected computed dataset from RHS and after that call DELETE api/compound-sets/ for each selected job. Pressing the No will cancel the action.

ag-m2ms commented 2 years ago

This might be a bigger problem than what it looks like. There is a handful of edge cases which have to be handled:

If I encounter any other edge cases I will update this comment.

ag-m2ms commented 2 years ago

This tracks updates to the points mentioned above:

boriskovar-m2ms commented 2 years ago

@rsanchezgarc @phraenquex

Results from the jobs will be uploaded to the fragalysis and user will able to see and inspect these results directly in the fragalysis front-end. Every action is stored as an action so user can undo-redo these actions, create a project (which will save a snapshot), save an anonymous snapshot so someone else can restore the snapshot which in turn will replay last action (if any) on given objects. It’s important to understand that it doesn’t matter if the dataset is only marked as deleted and not physically deleted on the backend, but if frontend doesn’t receive any information about existence of the dataset then, from frontend point of view, it doesn’t matter if it is physically or only logically deleted. There are two basic modus operandi for a normal user.

  1. Free form work – In this mode user doesn’t work within framework of the projects. User can perform actions on the dataset and after that delete given dataset. a. User refreshes the page – actions are lost, and everything is fine b. User doesn’t refresh the page – i. What to do when he tries to undo/redo actions? Disable the buttons and tell the user somewhere to reload the page? Try to just ignore actions which are performed on the missing objects and notify user that given actions was skipped (Do we need to indicate this also on the actions timeline)? ii. What to do when user tries to save a snapshot? Disable this functionality until user does refresh the page? Or let user save and if object doesn’t exist action on that object is not stored. If snapshot already exists, then actions on no longer existing objects are ignored (do we need to notify user?).
  2. Working on the project – Here it is very important to understand, compared to free form work, there is an autosave feature which after five actions stores these actions in the backend so the invalid actions are already there, so I THINK we have no other option then just to make sure that actions on invalid objects are ignored.

Ignoring of the actions performed on the missing objects when loading snapshot should be present but should be verified and fixed where it's not so.