You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Save as Copy function actually can save a lots of effort for user if they have item has many attributes and can be shared or just need to some subtle changes. But the current implementation of Save as Copy may not work as expected.
when you create a new item, you can activate the Save as Copy function, but it doesn't work.
When you edit an item (without M2O or M2M relations), when you click Save as Copy, the edit information is gone, it just save the copy of original records. This should be the right one but from UI it should not be triggered after you made some changes.
When you edit an item with M2O or M2M relations, the progress circle just spin for ever as it throws exception in SaveAsCopy().
I tried to analyze the source codes saveAsCopy() in app/src/composibles/use-item/use-item.ts, and have some thoughts on below.
We give an popup menu options for item in list page, which user can just select Save As Copy without entering the detail page, with this approach, user will not be confused on the edit content lost, so it just save a copy of the selected item as new one
In the implementation of saveAsCopy(), we call an post API to just create a new copy of the selected item based on the PK, and handle all these relations in backend and then returns the new created copy item.
Update the list page of collections with the new created copy item.
To Reproduce
create 2 collection and set some M2M relations, then edit one item in a collection, then trigger Save As Copy, you will get the progress circle spinning forever.
Update any collection item without M2M(M2O) collection, edit some content and then trigger Save As Copy, then you lost all the edits you made
Errors Shown
The progress circle spinning forever without a message popup. or you just lost the edits you made for an item.
What version of Directus are you using?
9.10
What version of Node.js are you using?
16.15.0
What database are you using?
postgres 14
What browser are you using?
chrome
How are you deploying Directus?
local test and AWS ECS
The text was updated successfully, but these errors were encountered:
Describe the Bug
Save as Copy function actually can save a lots of effort for user if they have item has many attributes and can be shared or just need to some subtle changes. But the current implementation of Save as Copy may not work as expected.
I tried to analyze the source codes saveAsCopy() in app/src/composibles/use-item/use-item.ts, and have some thoughts on below.
To Reproduce
create 2 collection and set some M2M relations, then edit one item in a collection, then trigger Save As Copy, you will get the progress circle spinning forever.
Update any collection item without M2M(M2O) collection, edit some content and then trigger Save As Copy, then you lost all the edits you made
Errors Shown
The progress circle spinning forever without a message popup. or you just lost the edits you made for an item.
What version of Directus are you using?
9.10
What version of Node.js are you using?
16.15.0
What database are you using?
postgres 14
What browser are you using?
chrome
How are you deploying Directus?
local test and AWS ECS
The text was updated successfully, but these errors were encountered: