File tree Expand file tree Collapse file tree 3 files changed +103
-0
lines changed
src/simcore_service_webserver/projects Expand file tree Collapse file tree 3 files changed +103
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,12 @@ def _replace_uuids(node: str | list | dict) -> str | list | dict:
9393 project_copy ["ui" ].get ("slideshow" , {})
9494 )
9595
96+ # exclude conversations
97+ annotations = project_copy .get ("ui" , {}).get ("annotations" , {}).copy ()
98+ for ann_id , ann in annotations .items ():
99+ if ann ["type" ] == "conversation" :
100+ project_copy ["ui" ]["annotations" ].pop (ann_id )
101+
96102 if clean_output_data :
97103 for node_data in project_copy .get ("workbench" , {}).values ():
98104 for field in _FIELDS_TO_DELETE :
Original file line number Diff line number Diff line change 1+ {
2+ "accessRights" : {},
3+ "uuid" : " de2578c5-431e-6257-a462-d7bf73b76c0c" ,
4+ "name" : " fake-project-name" ,
5+ "description" : " anim sint pariatur do dolore" ,
6+ 7+ "creationDate" : " 1865-11-30T04:00:14.000Z" ,
8+ "lastChangeDate" : " 7364-11-30T10:04:52.000Z" ,
9+ "thumbnail" : " https://some_fake_project_thumbnail.com/fake" ,
10+ "tags" : [],
11+ "classifiers" : [],
12+ "workbench" : {
13+ "b4b20476-e7c0-47c2-8cc4-f66ac21a13bf" : {
14+ "key" : " simcore/services/frontend/file-picker" ,
15+ "version" : " 1.0.0" ,
16+ "label" : " File Picker 0D" ,
17+ "inputs" : {},
18+ "inputNodes" : [],
19+ "outputs" : {},
20+ "position" : {
21+ "x" : 50 ,
22+ "y" : 150
23+ }
24+ },
25+ "5739e377-17f7-4f09-a6ad-62659fb7fdec" : {
26+ "key" : " simcore/services/comp/ucdavis-singlecell-cardiac-model" ,
27+ "version" : " 1.0.0" ,
28+ "label" : " DBP-Clancy-Rabbit-Single-Cell solver" ,
29+ "inputAccess" : {
30+ "Na" : " ReadAndWrite" ,
31+ "Kr" : " ReadOnly" ,
32+ "BCL" : " ReadAndWrite" ,
33+ "NBeats" : " ReadOnly" ,
34+ "Ligand" : " Invisible" ,
35+ "cAMKII" : " Invisible"
36+ },
37+ "inputs" : {
38+ "Na" : 0 ,
39+ "Kr" : 0 ,
40+ "BCL" : 200 ,
41+ "NBeats" : 5 ,
42+ "Ligand" : 0 ,
43+ "cAMKII" : " WT" ,
44+ "initfile" : {
45+ "nodeUuid" : " b4b20476-e7c0-47c2-8cc4-f66ac21a13bf" ,
46+ "output" : " outFile"
47+ }
48+ },
49+ "inputNodes" : [
50+ " b4b20476-e7c0-47c2-8cc4-f66ac21a13bf"
51+ ],
52+ "outputs" : {},
53+ "position" : {
54+ "x" : 300 ,
55+ "y" : 150
56+ }
57+ },
58+ "351fd505-1ee3-466d-ad6c-ea2915ffd364" : {
59+ "key" : " simcore/services/dynamic/raw-graphs" ,
60+ "version" : " 2.10.4" ,
61+ "label" : " 2D plot" ,
62+ "inputs" : {},
63+ "outputs" : {},
64+ "position" : {
65+ "x" : 1073 ,
66+ "y" : 307
67+ },
68+ "progress" : 100
69+ }
70+ },
71+ "ui" : {
72+ "annotations" : {
73+ "b8a7e8e2-1c2d-4f3a-9c5e-123456789abc" : {
74+ "type" : " conversation" ,
75+ "attributes" : {
76+ "conversationId" : 2 ,
77+ "x" : 415 ,
78+ "y" : 100 ,
79+ "title" : " My chat"
80+ }
81+ }
82+ }
83+ },
84+ "quality" : {},
85+ "dev" : {},
86+ "workspaceId" : null ,
87+ "type" : " STANDARD" ,
88+ "templateType" : null
89+ }
Original file line number Diff line number Diff line change 2222 "test_data_file_name" ,
2323 [
2424 "fake-project.json" ,
25+ "fake-project-with-conversation.json" ,
2526 "fake-template-projects.hack08.notebooks.json" ,
2627 "fake-template-projects.isan.2dplot.json" ,
2728 "fake-template-projects.isan.matward.json" ,
@@ -51,6 +52,13 @@ def test_clone_project_document(
5152 for clone_node_id in clone ["workbench" ]:
5253 assert clone_node_id not in node_ids
5354
55+ # checks no conversation have been copied
56+ if "ui" in clone and "annotations" in clone ["ui" ]:
57+ assert not any (
58+ annotation ["type" ] == "conversation"
59+ for annotation in clone ["ui" ]["annotations" ].values ()
60+ )
61+
5462 # Here we do not use anymore jsonschema.validator since ...
5563 #
5664 # "OpenAPI 3.0 does not have an explicit null type as in JSON Schema, but you can use nullable:
You can’t perform that action at this time.
0 commit comments