Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class SlideshowUI(TypedDict):


class AnnotationUI(BaseModel):
type: Literal["note", "rect", "text"]
type: Literal["note", "rect", "text", "conversation"]
color: Annotated[Color, PlainSerializer(Color.as_hex)]
attributes: Annotated[dict, Field(description="svg attributes")]

Expand Down Expand Up @@ -71,6 +71,15 @@ def _update_json_schema_extra(schema: JsonDict) -> None:
"color": "#0000FF",
"attributes": {"x": 415, "y": 100, "text": "Hey!"},
},
{
"type": "conversation",
"attributes": {
"conversationId": 2,
"x": 415,
"y": 100,
"title": "My chat",
},
},
]
},
)
Expand Down Expand Up @@ -169,6 +178,15 @@ def _update_json_schema_extra(schema: JsonDict) -> None:
"fontSize": 12,
},
},
"cf94f068-259c-4192-89f9-b2a56d51249d": {
"type": "conversation",
"attributes": {
"conversationId": 2,
"x": 119,
"y": 223,
"title": "My chat",
},
},
},
"current_node_id": "4b3345e5-861f-47b0-8b52-a4508449be79",
"template_type": "hypertool",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ def _replace_uuids(node: str | list | dict) -> str | list | dict:
project_copy["ui"].get("slideshow", {})
)

# exclude conversations
annotations = project_copy.get("ui", {}).get("annotations", {}).copy()
for ann_id, ann in annotations.items():
if ann["type"] == "conversation":
project_copy["ui"]["annotations"].pop(ann_id)

if clean_output_data:
for node_data in project_copy.get("workbench", {}).values():
for field in _FIELDS_TO_DELETE:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"accessRights": {},
"uuid": "de2578c5-431e-6257-a462-d7bf73b76c0c",
"name": "fake-project-name",
"description": "anim sint pariatur do dolore",
"prjOwner": "[email protected]",
"creationDate": "1865-11-30T04:00:14.000Z",
"lastChangeDate": "7364-11-30T10:04:52.000Z",
"thumbnail": "https://some_fake_project_thumbnail.com/fake",
"tags": [],
"classifiers": [],
"workbench": {
"b4b20476-e7c0-47c2-8cc4-f66ac21a13bf": {
"key": "simcore/services/frontend/file-picker",
"version": "1.0.0",
"label": "File Picker 0D",
"inputs": {},
"inputNodes": [],
"outputs": {},
"position": {
"x": 50,
"y": 150
}
},
"5739e377-17f7-4f09-a6ad-62659fb7fdec": {
"key": "simcore/services/comp/ucdavis-singlecell-cardiac-model",
"version": "1.0.0",
"label": "DBP-Clancy-Rabbit-Single-Cell solver",
"inputAccess": {
"Na": "ReadAndWrite",
"Kr": "ReadOnly",
"BCL": "ReadAndWrite",
"NBeats": "ReadOnly",
"Ligand": "Invisible",
"cAMKII": "Invisible"
},
"inputs": {
"Na": 0,
"Kr": 0,
"BCL": 200,
"NBeats": 5,
"Ligand": 0,
"cAMKII": "WT",
"initfile": {
"nodeUuid": "b4b20476-e7c0-47c2-8cc4-f66ac21a13bf",
"output": "outFile"
}
},
"inputNodes": [
"b4b20476-e7c0-47c2-8cc4-f66ac21a13bf"
],
"outputs": {},
"position": {
"x": 300,
"y": 150
}
},
"351fd505-1ee3-466d-ad6c-ea2915ffd364": {
"key": "simcore/services/dynamic/raw-graphs",
"version": "2.10.4",
"label": "2D plot",
"inputs": {},
"outputs": {},
"position": {
"x": 1073,
"y": 307
},
"progress": 100
}
},
"ui": {
"annotations": {
"b8a7e8e2-1c2d-4f3a-9c5e-123456789abc": {
"type": "conversation",
"attributes": {
"conversationId": 2,
"x": 415,
"y": 100,
"title": "My chat"
}
}
}
},
"quality": {},
"dev": {},
"workspaceId": null,
"type": "STANDARD",
"templateType": null
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"test_data_file_name",
[
"fake-project.json",
"fake-project-with-conversation.json",
"fake-template-projects.hack08.notebooks.json",
"fake-template-projects.isan.2dplot.json",
"fake-template-projects.isan.matward.json",
Expand Down Expand Up @@ -51,6 +52,13 @@ def test_clone_project_document(
for clone_node_id in clone["workbench"]:
assert clone_node_id not in node_ids

# checks no conversation have been copied
if "ui" in clone and "annotations" in clone["ui"]:
assert not any(
annotation["type"] == "conversation"
for annotation in clone["ui"]["annotations"].values()
)

# Here we do not use anymore jsonschema.validator since ...
#
# "OpenAPI 3.0 does not have an explicit null type as in JSON Schema, but you can use nullable:
Expand Down
Loading