Skip to content

Commit 017b42f

Browse files
authored
Fix bugs (#980)
* Added "label" field to FilePicker output * HACK: Do not display logs coming from unknown nodeIDs
1 parent cbcf89c commit 017b42f

File tree

7 files changed

+55
-38
lines changed

7 files changed

+55
-38
lines changed

api/specs/webserver/v0/components/schemas/project-v0.0.1-converted.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ properties:
114114
output:
115115
type: string
116116
- type: object
117-
additionalProperties: false
117+
additionalProperties: true
118118
required:
119119
- store
120120
- path
@@ -125,6 +125,8 @@ properties:
125125
- integer
126126
path:
127127
type: string
128+
label:
129+
type: string
128130
inputAccess:
129131
description: map with key - access level pairs
130132
type: object
@@ -159,7 +161,7 @@ properties:
159161
- number
160162
- 'null'
161163
- type: object
162-
additionalProperties: false
164+
additionalProperties: true
163165
required:
164166
- store
165167
- path
@@ -170,6 +172,8 @@ properties:
170172
- integer
171173
path:
172174
type: string
175+
label:
176+
type: string
173177
outputNode:
174178
type: boolean
175179
parent:

api/specs/webserver/v0/components/schemas/project-v0.0.1.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
},
147147
{
148148
"type": "object",
149-
"additionalProperties": false,
149+
"additionalProperties": true,
150150
"required": [
151151
"store",
152152
"path"
@@ -157,6 +157,9 @@
157157
},
158158
"path": {
159159
"type": "string"
160+
},
161+
"label": {
162+
"type": "string"
160163
}
161164
}
162165
}
@@ -206,7 +209,7 @@
206209
},
207210
{
208211
"type": "object",
209-
"additionalProperties": false,
212+
"additionalProperties": true,
210213
"required": [
211214
"store",
212215
"path"
@@ -217,6 +220,9 @@
217220
},
218221
"path": {
219222
"type": "string"
223+
},
224+
"label": {
225+
"type": "string"
220226
}
221227
}
222228
}

services/web/client/source/class/qxapp/component/service/NodeStatus.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,11 @@ qx.Class.define("qxapp.component.service.NodeStatus", {
102102
this.__node.bind("progress", this.__label, "value", {
103103
converter: progress => {
104104
if (progress === 100) {
105-
const file = node.getOutputValues().outFile.path;
106-
const splitFilename = file.split("/");
105+
const outInfo = node.getOutputValues().outFile;
106+
if ("label" in outInfo) {
107+
return outInfo.label;
108+
}
109+
const splitFilename = outInfo.path.split("/");
107110
return splitFilename[splitFilename.length-1];
108111
}
109112
return this.tr("Select a file");

services/web/client/source/class/qxapp/component/widget/inputs/NodeOutputTreeItem.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ qx.Class.define("qxapp.component.widget.inputs.NodeOutputTreeItem", {
110110
this.__valueLabel.setValue(value);
111111
},
112112
_transformValue: function(value) {
113+
if (value.getLabel) {
114+
return value.getLabel();
115+
}
113116
if (value.getPath) {
114117
const fileName = value.getPath().split("/");
115118
if (fileName.length) {

services/web/client/source/class/qxapp/component/widget/logger/LoggerView.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -266,18 +266,22 @@ qx.Class.define("qxapp.component.widget.logger.LoggerView", {
266266
},
267267

268268
__addLogs: function(nodeId, msgs = [""], logLevel = 0) {
269-
const workbench = this.getWorkbench();
270-
const node = workbench.getNode(nodeId);
271269
let label = null;
272-
if (node) {
273-
label = node.getLabel();
274-
node.addListener("changeLabel", e => {
275-
const newLabel = e.getData();
276-
this.__logModel.nodeLabelChanged(nodeId, newLabel);
277-
this.__updateTable();
278-
}, this);
279-
} else {
270+
if (nodeId === "root") {
280271
label = "Workbench";
272+
} else {
273+
const workbench = this.getWorkbench();
274+
const node = workbench.getNode(nodeId);
275+
if (node) {
276+
label = node.getLabel();
277+
node.addListener("changeLabel", e => {
278+
const newLabel = e.getData();
279+
this.__logModel.nodeLabelChanged(nodeId, newLabel);
280+
this.__updateTable();
281+
}, this);
282+
} else {
283+
return;
284+
}
281285
}
282286

283287
const nodeColor = this.__getNodesColor(nodeId);

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,11 @@ qx.Class.define("qxapp.desktop.StudyEditor", {
363363
null,
364364
this.__retrieveInputs.bind(this, node, portKey)
365365
);
366-
this.getLogger().debug(null, "Updating pipeline");
366+
this.getLogger().debug("root", "Updating pipeline");
367367
},
368368

369369
__retrieveInputs: function(node, portKey = null) {
370-
this.getLogger().debug(null, "Retrieveing inputs");
370+
this.getLogger().debug("root", "Retrieveing inputs");
371371
if (node) {
372372
node.retrieveInputs(portKey);
373373
}
@@ -417,14 +417,14 @@ qx.Class.define("qxapp.desktop.StudyEditor", {
417417
const req = new qxapp.io.request.ApiRequest(url, "POST");
418418
req.addListener("success", this.__onPipelinesubmitted, this);
419419
req.addListener("error", e => {
420-
this.getLogger().error(null, "Error submitting pipeline");
420+
this.getLogger().error("root", "Error submitting pipeline");
421421
}, this);
422422
req.addListener("fail", e => {
423-
this.getLogger().error(null, "Failed submitting pipeline");
423+
this.getLogger().error("root", "Failed submitting pipeline");
424424
}, this);
425425
req.send();
426426

427-
this.getLogger().info(null, "Starting pipeline");
427+
this.getLogger().info("root", "Starting pipeline");
428428
return true;
429429
},
430430

@@ -441,28 +441,28 @@ qx.Class.define("qxapp.desktop.StudyEditor", {
441441
});
442442
req.addListener("success", this.__onPipelineStopped, this);
443443
req.addListener("error", e => {
444-
this.getLogger().error(null, "Error stopping pipeline");
444+
this.getLogger().error("root", "Error stopping pipeline");
445445
}, this);
446446
req.addListener("fail", e => {
447-
this.getLogger().error(null, "Failed stopping pipeline");
447+
this.getLogger().error("root", "Failed stopping pipeline");
448448
}, this);
449449
// req.send();
450450

451-
this.getLogger().info(null, "Stopping pipeline. Not yet implemented");
451+
this.getLogger().info("root", "Stopping pipeline. Not yet implemented");
452452
return true;
453453
},
454454

455455
__onPipelinesubmitted: function(e) {
456456
const resp = e.getTarget().getResponse();
457457
const pipelineId = resp.data["project_id"];
458-
this.getLogger().debug(null, "Pipeline ID " + pipelineId);
458+
this.getLogger().debug("root", "Pipeline ID " + pipelineId);
459459
const notGood = [null, undefined, -1];
460460
if (notGood.includes(pipelineId)) {
461461
this.__pipelineId = null;
462-
this.getLogger().error(null, "Submition failed");
462+
this.getLogger().error("root", "Submition failed");
463463
} else {
464464
this.__pipelineId = pipelineId;
465-
this.getLogger().info(null, "Pipeline started");
465+
this.getLogger().info("root", "Pipeline started");
466466
}
467467
},
468468

@@ -515,7 +515,7 @@ qx.Class.define("qxapp.desktop.StudyEditor", {
515515
}
516516
}, this);
517517
resource.addListenerOnce("putError", ev => {
518-
this.getLogger().error(null, "Error updating pipeline");
518+
this.getLogger().error("root", "Error updating pipeline");
519519
}, this);
520520
resource.put({
521521
"project_id": prjUuid

services/web/client/source/class/qxapp/file/FilePicker.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ qx.Class.define("qxapp.file.FilePicker", {
6868
addBtn.addListener("fileAdded", e => {
6969
const fileMetadata = e.getData();
7070
if ("location" in fileMetadata && "path" in fileMetadata) {
71-
this.__setOutputFile(fileMetadata["location"], fileMetadata["path"]);
71+
this.__setOutputFile(fileMetadata["location"], fileMetadata["path"], fileMetadata["name"]);
7272
}
7373
this.__initResources(fileMetadata["location"]);
7474
}, this);
@@ -140,11 +140,7 @@ qx.Class.define("qxapp.file.FilePicker", {
140140
const data = this.__filesTree.getSelectedFile();
141141
if (data && data["isFile"]) {
142142
const selectedItem = data["selectedItem"];
143-
const outputFile = this.__getOutputFile();
144-
outputFile.value = {
145-
store: selectedItem.getLocation(),
146-
path: selectedItem.getFileId()
147-
};
143+
this.__setOutputFile(selectedItem.getLocation(), selectedItem.getFileId(), selectedItem.getLabel());
148144
this.getNode().setProgress(100);
149145
this.getNode().repopulateOutputPortData();
150146
this.fireEvent("finished");
@@ -156,12 +152,13 @@ qx.Class.define("qxapp.file.FilePicker", {
156152
return outputs["outFile"];
157153
},
158154

159-
__setOutputFile: function(store, path) {
155+
__setOutputFile: function(store, path, label) {
160156
if (store && path) {
161-
const outputs = this.getNode().getOutputs();
162-
outputs["value"]["outFile"] = {
157+
const outputs = this.__getOutputFile();
158+
outputs["value"] = {
163159
store,
164-
path
160+
path,
161+
label
165162
};
166163
}
167164
},

0 commit comments

Comments
 (0)