If a process is shared to the public, there should be the option to copy and edit this process in the users own spaces.
TODOs:
[x] Rename "Add to your workspace" into "Edit" (with icon)
[x] The following modal should have the title "Options for Editing", a list with multiple options (rectangular buttons like currently, horizontal scrollable if too many workspaces) and under it a selection/info area. The buttons for the modal should be "Close" and "Copy and Edit" (and a closing cross icon on the top right)
[ ] First option: "Direct Edit" button. It should only be activated if the user is member of the same space where the process is currently hosted and if she has access to the folder (i.e. is authorized). In this case, show in the info area the text: "The process will not be copied. You directly edit the original process. This will change the process for every other user including this sharing document." If the user has no access to the folder, gray the "Direct Edit" button out.
[x] Other options: show a button for every space the user has access to. The text: "Copy to XX Space". Every click on own of the buttons should render a tree view in the info area for the folders of this workspace, so that the user can select a folder where she wants to copy the process to.
[x] Clicking on "Copy and Edit" should not copy referenced files (e.g. images). instead it increases the reference_counter for this file in the DB.
TODOs for implementing the Ref Counter:
[x] for every new upload of a file in the frontend needs to set the
[x] for every change/modification of an existing file, a new file in the GCP DB need to be created (not overriding an exiting file). Set the reference_counter to 1 for this new file and decrease the reference_counter by 1 for the modified file
[x] if a process, BPMN element (task, event, etc.) or file gets deleted, also decrease the reference_counter by 1 for every referenced file
[x] if undo is clicked after a BPMN element (task, event, etc.) was deleted, increase the reference_counter by 1
[x] if a process is copied (not moved), increase the reference_counter by 1
[x] batch process: if reference_counter is 0 then delete the file after one week
If a process is shared to the public, there should be the option to copy and edit this process in the users own spaces.
TODOs:
reference_counter
for this file in the DB.TODOs for implementing the Ref Counter:
reference_counter
to 1 for this new file and decrease thereference_counter
by 1 for the modified filereference_counter
by 1 for every referenced filereference_counter
by 1reference_counter
by 1reference_counter
is 0 then delete the file after one week