Skip to content

Commit 6ca6aad

Browse files
author
Pedro Crespo
committed
Merge remote-tracking branch 'upstream/master'
2 parents e733846 + cae4fb1 commit 6ca6aad

File tree

11 files changed

+515
-113
lines changed

11 files changed

+515
-113
lines changed

services/docker-compose.deploy.devel.yml

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ services:
6565
- S3_ACCESS_KEY=12345678
6666
- S3_SECRET_KEY=12345678
6767
- S3_BUCKET_NAME=simcore
68+
- SMTP_HOST=smtp.speag.com
69+
- SMTP_PORT=25
6870
rabbit:
6971
image: rabbitmq:3-management
7072
environment:

services/docker-compose.deploy.yml

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ services:
6060
- S3_ACCESS_KEY=12345678
6161
- S3_SECRET_KEY=12345678
6262
- S3_BUCKET_NAME=simcore
63+
- SMTP_HOST=smtp.speag.com
64+
- SMTP_PORT=25
6365
rabbit:
6466
image: rabbitmq:3-management
6567
environment:

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

+6
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,18 @@ qx.Class.define("qxapp.component.widget.FilePicker", {
9797
};
9898
let emptyModel = qx.data.marshal.Json.createModel(data, true);
9999
this.__tree.setModel(emptyModel);
100+
let that = this;
100101
this.__tree.setDelegate({
101102
createItem: () => new qxapp.component.widget.FileTreeItem(),
102103
bindItem: (c, item, id) => {
103104
c.bindDefaultProperties(item, id);
104105
c.bindProperty("fileId", "fileId", null, item, id);
105106
c.bindProperty("size", "size", null, item, id);
107+
},
108+
configureItem: item => {
109+
item.addListener("dbltap", e => {
110+
that.__itemSelected(); // eslint-disable-line no-underscore-dangle
111+
}, that);
106112
}
107113
});
108114
},

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

+26-3
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ qx.Class.define("qxapp.component.widget.NewProjectDlg", {
3838
let templatesList = new qx.ui.form.List().set({
3939
minHeight: 200
4040
});
41-
templatesList.add(new qx.ui.form.ListItem(this.tr("Blank Project")));
41+
let blankItem = new qx.ui.form.ListItem(this.tr("Blank Project"));
42+
templatesList.add(blankItem);
4243
templatesList.add(new qx.ui.form.ListItem(this.tr("EM General")));
4344
templatesList.add(new qx.ui.form.ListItem(this.tr("EM-Neuro")));
4445
templatesList.add(new qx.ui.form.ListItem(this.tr("EM-Thermal")));
46+
templatesList.setSelection([blankItem]);
4547
prjFormLayout.add(new qx.ui.basic.Label(this.tr("Categories / Templates")));
4648
prjFormLayout.add(templatesList, {
4749
flex: 1
@@ -92,8 +94,24 @@ qx.Class.define("qxapp.component.widget.NewProjectDlg", {
9294

9395
prjFormLayout.add(new qx.ui.core.Spacer(5));
9496

95-
let createBtn = new qx.ui.form.Button(this.tr("Create"));
96-
createBtn.addListener("execute", function() {
97+
// create the form manager
98+
let manager = new qx.ui.form.validation.Manager();
99+
// create a async validator function
100+
let projectTitleValidator = new qx.ui.form.validation.AsyncValidator(
101+
function(validator, value) {
102+
if (value === null || value.length === 0) {
103+
validator.setValid(false, "Project title is required");
104+
} else {
105+
validator.setValid(true);
106+
}
107+
}
108+
);
109+
manager.add(projectTitle, projectTitleValidator);
110+
111+
manager.addListener("complete", function() {
112+
if (!manager.getValid()) {
113+
return;
114+
}
97115
const title = projectTitle.getValue();
98116
const desc = description.getValue();
99117
const sele = templatesList.getSelection();
@@ -108,6 +126,11 @@ qx.Class.define("qxapp.component.widget.NewProjectDlg", {
108126
};
109127
this.fireDataEvent("CreatePrj", data);
110128
}, this);
129+
130+
let createBtn = new qx.ui.form.Button(this.tr("Create"));
131+
createBtn.addListener("execute", function() {
132+
manager.validate();
133+
}, this);
111134
prjFormLayout.add(createBtn);
112135

113136
this._add(prjFormLayout, {

services/web/client/source/class/qxapp/component/widget/SettingsView.js renamed to services/web/client/source/class/qxapp/component/widget/NodeView.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const PORT_INPUTS_WIDTH = 300;
22

3-
qx.Class.define("qxapp.component.widget.SettingsView", {
3+
qx.Class.define("qxapp.component.widget.NodeView", {
44
extend: qx.ui.container.Composite,
55

66
construct: function() {
@@ -30,7 +30,10 @@ qx.Class.define("qxapp.component.widget.SettingsView", {
3030
let mainLayout = this.__mainLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox(10));
3131
mainLayout.set({
3232
alignX: "center",
33-
padding: 70
33+
paddingTop: 20,
34+
paddingRight: 30,
35+
paddingBottom: 20,
36+
paddingLeft: 30
3437
});
3538
this.add(mainLayout, {
3639
flex: 1

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

+89-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,17 @@ qx.Class.define("qxapp.component.widget.TreeTool", {
1616

1717
this.__buildLayout();
1818
this.buildTree();
19+
20+
this.addListener("keypress", function(keyEvent) {
21+
if (keyEvent.getKeyIdentifier() === "F2") {
22+
this.__changeLabel();
23+
}
24+
}, this);
1925
},
2026

2127
events: {
22-
"NodeDoubleClicked": "qx.event.type.Data"
28+
"NodeDoubleClicked": "qx.event.type.Data",
29+
"NodeLabelChanged": "qx.event.type.Data"
2330
},
2431

2532
properties: {
@@ -35,7 +42,6 @@ qx.Class.define("qxapp.component.widget.TreeTool", {
3542

3643
members: {
3744
__tree: null,
38-
__selectedNodeId: null,
3945

4046
__buildLayout: function() {
4147
let tree = this.__tree = new qx.ui.tree.VirtualTree(null, "label", "children").set({
@@ -73,6 +79,7 @@ qx.Class.define("qxapp.component.widget.TreeTool", {
7379
createItem: () => new qxapp.component.widget.NodeTreeItem(),
7480
bindItem: (c, item, id) => {
7581
c.bindDefaultProperties(item, id);
82+
c.bindProperty("label", "label", null, item, id);
7683
c.bindProperty("nodeId", "nodeId", null, item, id);
7784
}
7885
});
@@ -118,6 +125,86 @@ qx.Class.define("qxapp.component.widget.TreeTool", {
118125
this.__tree.openNodeAndParents(nodeInTree);
119126
this.__tree.setSelection(new qx.data.Array([nodeInTree]));
120127
}
128+
},
129+
130+
__changeLabel: function() {
131+
let treeSelection = this.__tree.getSelection();
132+
if (treeSelection.length < 1) {
133+
return;
134+
}
135+
let selectedItem = treeSelection.toArray()[0];
136+
const selectedNodeId = selectedItem.getNodeId();
137+
if (selectedNodeId === "root") {
138+
return;
139+
}
140+
141+
let nodeLabelEditor = this.__createNodeLabelEditor(selectedItem);
142+
const bounds = this.getLayoutParent().getBounds();
143+
nodeLabelEditor.moveTo(bounds.left+100, bounds.top+150);
144+
nodeLabelEditor.open();
145+
},
146+
147+
__createNodeLabelEditor : function(selectedItem) {
148+
const oldLabel = selectedItem.getLabel();
149+
const maxWidth = 350;
150+
const minWidth = 100;
151+
const labelWidth = Math.min(Math.max(parseInt(oldLabel.length*4), minWidth), maxWidth);
152+
let labelEditorWin = new qx.ui.window.Window("Rename").set({
153+
appearance: "window-small-cap",
154+
layout: new qx.ui.layout.HBox(4),
155+
padding: 2,
156+
modal: true,
157+
showMaximize: false,
158+
showMinimize: false,
159+
width: labelWidth
160+
});
161+
162+
// Create a text field in which to edit the data
163+
let labelEditor = new qx.ui.form.TextField(oldLabel).set({
164+
allowGrowX: true,
165+
minWidth: labelWidth
166+
});
167+
labelEditorWin.add(labelEditor, {
168+
flex: 1
169+
});
170+
171+
labelEditorWin.addListener("appear", e => {
172+
labelEditor.focus();
173+
labelEditor.setTextSelection(0, labelEditor.getValue().length);
174+
}, this);
175+
176+
// Create the "Save" button to close the cell editor
177+
let save = new qx.ui.form.Button("Save");
178+
save.addListener("execute", function(e) {
179+
const newLabel = labelEditor.getValue();
180+
selectedItem.setLabel(newLabel);
181+
const data = {
182+
nodeId: selectedItem.getNodeId(),
183+
newLabel: newLabel
184+
};
185+
this.fireDataEvent("NodeLabelChanged", data);
186+
187+
labelEditorWin.close();
188+
}, this);
189+
labelEditorWin.add(save);
190+
191+
// Let user press Enter from the cell editor text field to finish.
192+
let command = new qx.ui.command.Command("Enter");
193+
command.addListener("execute", e => {
194+
save.execute();
195+
command.dispose();
196+
command = null;
197+
});
198+
199+
// Let user press Enter from the cell editor text field to finish.
200+
let commandEsc = new qx.ui.command.Command("Esc");
201+
commandEsc.addListener("execute", e => {
202+
labelEditorWin.close();
203+
commandEsc.dispose();
204+
commandEsc = null;
205+
});
206+
207+
return labelEditorWin;
121208
}
122209
}
123210
});

services/web/client/source/class/qxapp/component/workbench/NodeBase.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,10 @@ qx.Class.define("qxapp.component.workbench.NodeBase", {
103103
}
104104
this.__inputPort = {};
105105
this.__outputPort = {};
106-
this.__createUIPorts(true, metaData.inputs);
107-
this.__createUIPorts(false, metaData.outputs);
106+
if (metaData) {
107+
this.__createUIPorts(true, metaData.inputs);
108+
this.__createUIPorts(false, metaData.outputs);
109+
}
108110
},
109111

110112
getInputPort: function() {

services/web/client/source/class/qxapp/desktop/PrjBrowser.js

-15
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,6 @@ qx.Class.define("qxapp.desktop.PrjBrowser", {
4747
__controller2: null,
4848
__list2: null,
4949

50-
__createControls: function() {
51-
let controlsLayout = new qx.ui.container.Composite(new qx.ui.layout.HBox(10));
52-
53-
let newPrjBtn = new qx.ui.form.Button(this.tr("New Project")).set({
54-
width: 150,
55-
height: 50
56-
});
57-
newPrjBtn.addListener("execute", function() {
58-
this.__newPrjBtnClkd();
59-
}, this);
60-
controlsLayout.add(newPrjBtn);
61-
62-
return controlsLayout;
63-
},
64-
6550
newPrjBtnClkd: function() {
6651
let win = new qx.ui.window.Window(this.tr("Create New Project")).set({
6752
layout: new qx.ui.layout.Grow(),

services/web/client/source/class/qxapp/desktop/PrjEditor.js

+13-5
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ qx.Class.define("qxapp.desktop.PrjEditor", {
7272
let workbenchView = this.__workbenchView = new qxapp.component.workbench.WorkbenchView(project.getWorkbenchModel());
7373
this.showInMainView(workbenchView, "root");
7474

75-
let settingsView = this.__settingsView = new qxapp.component.widget.SettingsView().set({
76-
minHeight: 200,
77-
maxHeight: 500
75+
let settingsView = this.__settingsView = new qxapp.component.widget.NodeView().set({
76+
minHeight: 200
7877
});
7978
settingsView.setWorkbenchModel(project.getWorkbenchModel());
8079
},
@@ -117,6 +116,15 @@ qx.Class.define("qxapp.desktop.PrjEditor", {
117116
}, this);
118117
});
119118

119+
this.__treeView.addListener("NodeLabelChanged", function(e) {
120+
const data = e.getData();
121+
const nodeId = data.nodeId;
122+
const newLabel = data.newLabel;
123+
124+
let nodeModel = this.getProjectModel().getWorkbenchModel().getNodeModel(nodeId);
125+
nodeModel.setLabel(newLabel);
126+
}, this);
127+
120128
this.__settingsView.addListener("ShowViewer", e => {
121129
const data = e.getData();
122130
const url = data.url;
@@ -273,8 +281,8 @@ qx.Class.define("qxapp.desktop.PrjEditor", {
273281
console.log(currentPipeline);
274282
let req = new qxapp.io.request.ApiRequest("/start_pipeline", "POST");
275283
let data = {};
276-
data = currentPipeline;
277-
data["pipeline_mockup_id"] = qxapp.utils.Utils.uuidv4();
284+
data["workbench"] = currentPipeline;
285+
data["project_id"] = this.getProjectModel().getUuid();
278286
req.set({
279287
requestData: qx.util.Serializer.toJson(data)
280288
});

services/web/client/source/class/qxapp/desktop/mainPanel/MainPanel.js

+8-29
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,14 @@ qx.Class.define("qxapp.desktop.mainPanel.MainPanel", {
88

99
this._setLayout(new qx.ui.layout.VBox(5));
1010

11-
// let optionsBar = this.__optionsBar = new qxapp.desktop.mainPanel.OptionsBar();
12-
let mainView = new qx.ui.core.Widget();
1311
let controlsBar = this.__controlsBar = new qxapp.desktop.mainPanel.ControlsBar();
14-
/*
15-
optionsBar.set({
16-
width: 60,
17-
allowGrowX: false
18-
});
19-
*/
2012
controlsBar.set({
2113
height: 60,
2214
allowGrowY: false
2315
});
2416

25-
let hBox = this.__hBox = new qx.ui.container.Composite(new qx.ui.layout.HBox(5));
26-
// hBox.add(optionsBar);
27-
hBox.add(mainView, {
28-
flex: 1
17+
let hBox = this.__mainView = new qx.ui.container.Composite(new qx.ui.layout.HBox(5)).set({
18+
allowGrowY: true
2919
});
3020

3121
this._add(hBox, {
@@ -42,28 +32,17 @@ qx.Class.define("qxapp.desktop.mainPanel.MainPanel", {
4232
}
4333
},
4434

45-
events: {},
46-
4735
members: {
48-
__hBox: null,
49-
// __optionsBar: null,
36+
__mainView: null,
5037
__controlsBar: null,
5138

5239
__applyMainView: function(newWidget) {
53-
// const mainViewIndex = 1;
54-
const mainViewIndex = 0;
55-
if (this.__hBox._indexOf(newWidget) != mainViewIndex) {
56-
this.__hBox._removeAt(mainViewIndex);
57-
this.__hBox._addAt(newWidget, mainViewIndex, {
58-
flex: 1
59-
});
60-
}
40+
this.__mainView.removeAll();
41+
this.__mainView.add(newWidget, {
42+
flex: 1
43+
});
6144
},
62-
/*
63-
getOptions: function() {
64-
return this.__optionsBar;
65-
},
66-
*/
45+
6746
getControls: function() {
6847
return this.__controlsBar;
6948
}

0 commit comments

Comments
 (0)