Skip to content

Commit e71ed59

Browse files
author
Pedro Crespo
committed
Merge remote-tracking branch 'upstream/master'
2 parents 5320cef + 2fbeba2 commit e71ed59

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1979
-844
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ matrix:
2323
services:
2424
- docker
2525

26+
cache: pip
27+
2628
before_install:
2729
- python --version
2830
- uname -a
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
$schema: http://json-schema.org/draft-07/schema#
2+
$id: https://simcore.io/api/specs/shared/schemas/node-output-tree-api-v0.0.1.yaml
3+
4+
title: node output tree api
5+
description: nodes using the tree representation for the output
6+
must be able to handle the following requests
7+
type: object
8+
required:
9+
# the validator does not appreciate when required is missing here... and
10+
# sadly does not throw any meaningful error about it... so for now I put this...
11+
- getItemList
12+
- getItem
13+
properties:
14+
getItemList:
15+
description: a list of items making up one level of the tree
16+
type: object
17+
properties:
18+
request:
19+
summary: oa3 json schema description of the request structure.
20+
description: |
21+
If no `rootKey` is specified, the first level of the tree is returned.
22+
The `filter` will return any items matching the filter string as well as any
23+
folder items containing matching items further down the tree.
24+
type: object
25+
properties:
26+
rootKey:
27+
type: string
28+
filter:
29+
type: string
30+
response:
31+
type: array
32+
items:
33+
type: object
34+
properties:
35+
key:
36+
type: string
37+
label:
38+
type: string
39+
folder:
40+
type: boolean
41+
getItem:
42+
description: get details about an item in the list
43+
type: object
44+
properties:
45+
request:
46+
type: object
47+
required:
48+
- key
49+
properties:
50+
key:
51+
type: string
52+
response:
53+
type: object

api/specs/webserver/v0/node-v0.0.1.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ paths:
6969
schema:
7070
type: object
7171
# oneOf:
72-
# - $ref: '../../shared/schemas/node-output-list-api-v0.0.1.yaml#/properties/getItemList/request'
73-
# - $ref: '../../shared/schemas/node-output-list-api-v0.0.1.yaml#/properties/getItem/request'
72+
# - $ref: '../../shared/schemas/node-output-list-api-v0.0.1.yaml#/properties/getItemList/properties/request'
73+
# - $ref: '../../shared/schemas/node-output-list-api-v0.0.1.yaml#/properties/getItem/properties/request'
74+
# - $ref: '../../shared/schemas/node-output-tree-api-v0.0.1.yaml#/properties/getItemList/properties/request'
75+
# - $ref: '../../shared/schemas/node-output-tree-api-v0.0.1.yaml#/properties/getItem/properties/request'
7476
responses:
7577
default:
7678
description: node type specific api call according to the node type presented
@@ -79,8 +81,10 @@ paths:
7981
schema:
8082
type: object
8183
# oneOf:
82-
# - $ref: '../../shared/schemas/node-output-list-api-v0.0.1.yaml#/properties/getItemList/response'
83-
# - $ref: '../../shared/schemas/node-output-list-api-v0.0.1.yaml#/properties/getItem/response'
84+
# - $ref: '../../shared/schemas/node-output-list-api-v0.0.1.yaml#/properties/getItemList/properties/response'
85+
# - $ref: '../../shared/schemas/node-output-list-api-v0.0.1.yaml#/properties/getItem/properties/response'
86+
# - $ref: '../../shared/schemas/node-output-tree-api-v0.0.1.yaml#/properties/getItemList/properties/response'
87+
# - $ref: '../../shared/schemas/node-output-tree-api-v0.0.1.yaml#/properties/getItem/properties/response'
8488

8589
/node/{nodeInstanceUUID}/iframe:
8690
get:
@@ -122,10 +126,6 @@ components:
122126
type: string
123127
config:
124128
type: object
125-
apiCalls:
126-
type: object
127-
# oneOf:
128-
# - $ref: '../../shared/schemas/node-output-list-api-v0.0.1.yaml#/properties'
129129
outputApiCall:
130130
type: object
131131
properties:

services/director/src/simcore_service_director/registry_proxy.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def __registry_request(path, method="GET"):
9595
# r = s.get(api_url, verify=False) #getattr(s, method.lower())(api_url)
9696
request_result = getattr(_SESSION, method.lower())(api_url)
9797
_logger.info("Request status: %s",request_result.status_code)
98-
if request_result.status_code > 399:
98+
if request_result.status_code > 399:
9999
request_result.raise_for_status()
100100

101101
return request_result

services/web/client/source/class/qxapp/auth/ui/LoginPage.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,14 @@ qx.Class.define("qxapp.auth.ui.LoginPage", {
3838
this.__form = new qx.ui.form.Form();
3939

4040
let atm = new qx.ui.basic.Atom().set({
41-
icon: "qxapp/osparc-white-small.png",
41+
icon: "qxapp/osparc-white.svg",
4242
iconPosition: "top"
4343
});
44+
atm.getChildControl("icon").set({
45+
width: 250,
46+
height: 150,
47+
scale: true
48+
});
4449
this.add(atm);
4550

4651
let email = new qx.ui.form.TextField();

services/web/client/source/class/qxapp/component/form/Auto.js

+26-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,14 @@ qx.Class.define("qxapp.component.form.Auto", {
6666
/**
6767
* @param structure {Array} form structure
6868
*/
69-
construct : function(content) {
69+
construct : function(content, nodeModel) {
70+
// nodeModel is necessary for creating links
71+
if (nodeModel) {
72+
this.setNodeModel(nodeModel);
73+
} else {
74+
this.setNodeModel(null);
75+
}
76+
7077
this.base(arguments);
7178
this.__ctrlMap = {};
7279
this.__ctrlLinkMap = {};
@@ -86,6 +93,13 @@ qx.Class.define("qxapp.component.form.Auto", {
8693
this);
8794
},
8895

96+
properties: {
97+
nodeModel: {
98+
check: "qxapp.data.model.NodeModel",
99+
nullable: true
100+
}
101+
},
102+
89103
events : {
90104
/**
91105
* fire when the form changes content and
@@ -530,7 +544,17 @@ qx.Class.define("qxapp.component.form.Auto", {
530544
nodeUuid: fromNodeId,
531545
output: fromPortId
532546
};
533-
this.getControlLink(toPortId).setValue("Linked to " + fromNodeId + ": " + fromPortId);
547+
548+
const workbenchModel = this.getNodeModel().getWorkbenchModel();
549+
const fromNode = workbenchModel.getNodeModel(fromNodeId);
550+
const fromNodeLabel = fromNode.getLabel(fromNodeId);
551+
const port = fromNode.getOutput(fromPortId);
552+
const fromPortLabel = port ? port.label : null;
553+
if (fromNodeLabel && fromPortLabel) {
554+
this.getControlLink(toPortId).setValue("Linked to " + fromNodeLabel + ": " + fromPortLabel);
555+
} else {
556+
this.getControlLink(toPortId).setValue("Linked to " + fromNodeId + ": " + fromPortId);
557+
}
534558

535559
this.fireDataEvent("linkAdded", toPortId);
536560
},

services/web/client/source/class/qxapp/component/form/renderer/PropForm.js

+26-5
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,17 @@ qx.Class.define("qxapp.component.form.renderer.PropForm", {
2121
*
2222
* @param vizWidget {Widget} visualization widget to embedd
2323
*/
24-
construct: function(form, nodeModel) {
24+
construct: function(form, workbenchModel, nodeModel) {
25+
// workbenchModel and nodeModel are necessary for creating links
26+
if (workbenchModel) {
27+
this.setWorkbenchModel(workbenchModel);
28+
} else {
29+
this.setWorkbenchModel(null);
30+
}
2531
if (nodeModel) {
2632
this.setNodeModel(nodeModel);
33+
} else {
34+
this.setNodeModel(null);
2735
}
2836

2937
this.base(arguments, form);
@@ -40,8 +48,14 @@ qx.Class.define("qxapp.component.form.renderer.PropForm", {
4048
},
4149

4250
properties: {
51+
workbenchModel: {
52+
check: "qxapp.data.model.WorkbenchModel",
53+
nullable: true
54+
},
55+
4356
nodeModel: {
44-
check: "qxapp.data.model.NodeModel"
57+
check: "qxapp.data.model.NodeModel",
58+
nullable: true
4559
}
4660
},
4761

@@ -145,12 +159,19 @@ qx.Class.define("qxapp.component.form.renderer.PropForm", {
145159
}
146160
},
147161

148-
__arePortsCompatible: function(node1, port1, node2, port2) {
149-
return qxapp.data.Store.getInstance().arePortsCompatible(node1, port1, node2, port2);
162+
__arePortsCompatible: function(node1Id, port1Id, node2Id, port2Id) {
163+
if (this.getWorkbenchModel()) {
164+
const node1 = this.getWorkbenchModel().getNodeModel(node1Id);
165+
const port1 = node1.getOutput(port1Id);
166+
const node2 = this.getWorkbenchModel().getNodeModel(node2Id);
167+
const port2 = node2.getInput(port2Id);
168+
return qxapp.data.Store.getInstance().arePortsCompatible(port1, port2);
169+
}
170+
return false;
150171
},
151172

152173
__createDropMechanism: function(uiElement, portId) {
153-
if (this.isPropertyInitialized("nodeModel")) {
174+
if (this.getNodeModel()) {
154175
uiElement.setDroppable(true);
155176
uiElement.nodeId = this.getNodeModel().getNodeId();
156177
uiElement.portId = portId;

services/web/client/source/class/qxapp/component/widget/InputsMapper.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ qx.Class.define("qxapp.component.widget.InputsMapper", {
2222

2323
let that = this;
2424
tree.setDelegate({
25-
createItem: () => new qxapp.component.widget.inputs.NodeOutputListItem(),
25+
createItem: () => new qxapp.component.widget.inputs.NodeOutputTreeItem(),
2626
bindItem: (c, item, id) => {
2727
c.bindDefaultProperties(item, id);
2828
// c.bindProperty("key", "key", null, item, id);
@@ -78,7 +78,7 @@ qx.Class.define("qxapp.component.widget.InputsMapper", {
7878
const nodeInstanceUUID = null;
7979
const itemProps = qxapp.data.Store.getInstance().getItem(nodeInstanceUUID, fromPortKey, newItem.getKey());
8080
if (itemProps) {
81-
let form = new qxapp.component.form.Auto(itemProps);
81+
let form = new qxapp.component.form.Auto(itemProps, this.getNodeModel());
8282
let propsWidget = new qxapp.component.form.renderer.PropForm(form);
8383
newItem["propsWidget"] = propsWidget;
8484
}

services/web/client/source/class/qxapp/component/widget/NodeExposed.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,19 @@ qx.Class.define("qxapp.component.widget.NodeExposed", {
2525
});
2626

2727
let atom = new qx.ui.basic.Atom().set({
28-
label: nodeModel.getLabel() + "'s outputs",
29-
center : true,
28+
rich: true,
29+
center: true,
3030
draggable: true,
3131
droppable: true
3232
});
33+
atom.getChildControl("label").set({
34+
textAlign: "center"
35+
});
36+
nodeModel.bind("label", atom, "label", {
37+
converter: function(data) {
38+
return data + "'s<br>outputs";
39+
}
40+
});
3341

3442
this._add(atom, {
3543
flex: 1

services/web/client/source/class/qxapp/component/widget/NodeInput.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ qx.Class.define("qxapp.component.widget.NodeInput", {
1515
extend: qx.ui.core.Widget,
1616

1717
construct: function(nodeModel) {
18+
this.setNodeModel(nodeModel);
19+
1820
this.base();
1921

2022
let nodeInputLayout = new qx.ui.layout.VBox(10);
@@ -25,11 +27,11 @@ qx.Class.define("qxapp.component.widget.NodeInput", {
2527
});
2628

2729
let atom = new qx.ui.basic.Atom().set({
28-
label: nodeModel.getLabel(),
2930
center: true,
3031
draggable: true,
3132
droppable: true
3233
});
34+
nodeModel.bind("label", atom, "label");
3335
const title16Font = qx.bom.Font.fromConfig(qxapp.theme.Font.fonts["title-16"]);
3436
atom.getChildControl("label").set({
3537
font: title16Font
@@ -38,8 +40,6 @@ qx.Class.define("qxapp.component.widget.NodeInput", {
3840
this._add(atom, {
3941
flex: 1
4042
});
41-
42-
this.setNodeModel(nodeModel);
4343
},
4444

4545
properties: {

services/web/client/source/class/qxapp/component/widget/NodePorts.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ qx.Class.define("qxapp.component.widget.NodePorts", {
2626
});
2727

2828
const title16Font = qx.bom.Font.fromConfig(qxapp.theme.Font.fonts["title-16"]);
29-
let label = new qx.ui.basic.Label(nodeModel.getLabel()).set({
29+
let label = new qx.ui.basic.Label().set({
3030
font: title16Font,
3131
alignX: "center",
3232
alignY: "middle"
3333
});
34+
nodeModel.bind("label", label, "value");
3435
this._add(label);
3536

3637
this.setIsInputModel(isInputModel);
@@ -62,7 +63,7 @@ qx.Class.define("qxapp.component.widget.NodePorts", {
6263
return this.getNodeModel().getMetaData();
6364
},
6465

65-
populateNodeLayout: function() {
66+
populatePortsData: function() {
6667
const metaData = this.getNodeModel().getMetaData();
6768
this.__inputPort = {};
6869
this.__outputPort = {};
@@ -92,15 +93,21 @@ qx.Class.define("qxapp.component.widget.NodePorts", {
9293
let widget = null;
9394
switch (port.type) {
9495
case "node-output-list-api-v0.0.1": {
95-
let nodeOutputList = new qxapp.component.widget.inputs.NodeOutputList(this.getNodeModel(), port, portKey);
96-
widget = nodeOutputList.getOutputWidget();
96+
console.log("widget for ", port.type, " to be implemented");
97+
// let nodeOutputList = new qxapp.component.widget.inputs.NodeOutputList(this.getNodeModel(), port, portKey);
98+
// widget = nodeOutputList.getOutputWidget();
9799
break;
98100
}
99101
case "node-output-list-icon-api-v0.0.1": {
100102
let nodeOutputList = new qxapp.component.widget.inputs.NodeOutputListIcon(this.getNodeModel(), port, portKey);
101103
widget = nodeOutputList.getOutputWidget();
102104
break;
103105
}
106+
case "node-output-tree-api-v0.0.1": {
107+
let nodeOutputList = new qxapp.component.widget.inputs.NodeOutputTree(this.getNodeModel(), port, portKey);
108+
widget = nodeOutputList.getOutputWidget();
109+
break;
110+
}
104111
}
105112
if (widget !== null) {
106113
this._add(widget, {

0 commit comments

Comments
 (0)