Duplicate flows and dashboards: POST /flows/{name}/duplicate and /dashboards/{name}/duplicate copy the working copy into {name}_copy (then _copy_2, ...) as an unpublished draft with " (copy)" on the title. A flow copy takes its node sources as drafts and leaves origin and runtime.json behind; copying code nodes is a superuser's (the save check, now taking the replaced copy). Client regenerated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-16 09:21:30 +02:00
co-authored by Claude Opus 5.5
parent 8b1a456cd3
commit 8a868e0f26
9 changed files with 215 additions and 9 deletions
+16
View File
@@ -123,6 +123,22 @@ def test_an_unpublished_dashboard_can_be_renamed_and_deleted(store: DashboardSto
assert not store.exists("home")
def test_a_duplicate_is_an_unpublished_copy_of_the_working_copy(
store: DashboardStore,
):
store.write(default_dashboard("house"))
edited = store.write_draft(
store.read("house", draft=True).model_copy(update={"title": "Edited"})
)
copy = store.duplicate("house")
assert (copy.name, copy.title, copy.version) == ("house_copy", "Edited (copy)", 1)
assert store.has_draft("house_copy") and not store.is_published("house_copy")
assert store.read("house", draft=True).version == edited.version
assert store.duplicate("house").name == "house_copy_2"
def test_deleting_and_renaming(store: DashboardStore):
store.write(default_dashboard("house"))