altinn-studio icon indicating copy to clipboard operation
altinn-studio copied to clipboard

Minimize confirm-dialogue on task-deletion to imply only for tasks with altered layoutsets

Open standeren opened this issue 10 months ago • 1 comments

Description

In order to minimize the confirm-dialogues when deleting tasks from the process editor, we need a way to check if the task has a connected layout set that has been changed.

There are two ways of doing this that should be combined for optimization purposes.

  1. First we should keep a state for the added DATA tasks (since these are currently the only task type that gets automated added layout sets) in the process editor during the current session. No need to keep this state up to date by removing the deleted ones, since we only care about what tasks are added. If the app-developer tries to delete a task that is in the state of added tasks, he/she will be not be presented with the confirm-dialogue.
  2. To further improve the usability we should also use a more persistent way of checking wether the layout set connected to the deleted task has been altered. An endpoint in backend should be implemented that checks if the layout set includes more than one page --> return that layout set has been altered, and if it only includes one page check if the content of the file is different from the default layout page --> return that layout set has been altered. (We might need to check the Settings.json file as well). If the endpoint says that there has been changes --> show confirm-dialogue. Otherwise delete.

Doing the call to the check endpoint in backend should only be done for the tasks that are not in the state of added tasks during that session.

The confirm-dialogue should have a informative text saying something like:

Prosessteget du prøver å slette har en tilhørende sidegruppe, [NAVN],  med innhold 
du kanskje vil beholde. Dersom du sletter steget sletter du også hele sidegruppen med 
alle tilhørende sider og komponenter.

standeren avatar Apr 11 '24 11:04 standeren

Should be solved after #12660 is done, therefor blocked ⚠️

standeren avatar Apr 19 '24 10:04 standeren