Skip to content

Commit 11bb378

Browse files
committed
show Flash Message
1 parent 6463064 commit 11bb378

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

services/static-webserver/client/source/class/osparc/node/slideshow/BaseNodeView.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ qx.Class.define("osparc.node.slideshow.BaseNodeView", {
165165
flex: 1
166166
});
167167

168-
const outputsBtn = this._outputsBtn = new qx.ui.form.ToggleButton().set({
168+
const outputsBtn = this.__outputsBtn = new qx.ui.form.ToggleButton().set({
169169
width: 110,
170170
label: this.tr("Outputs"),
171171
icon: "@FontAwesome5Solid/sign-out-alt/14",
@@ -198,7 +198,7 @@ qx.Class.define("osparc.node.slideshow.BaseNodeView", {
198198
});
199199
mainView.bind("backgroundColor", outputsLayout, "backgroundColor");
200200
mainView.bind("backgroundColor", outputsLayout.getChildControl("frame"), "backgroundColor");
201-
this._outputsBtn.bind("value", outputsLayout, "visibility", {
201+
this.__outputsBtn.bind("value", outputsLayout, "visibility", {
202202
converter: value => value ? "visible" : "excluded"
203203
});
204204
hBox.add(outputsLayout);
@@ -266,7 +266,7 @@ qx.Class.define("osparc.node.slideshow.BaseNodeView", {
266266
},
267267

268268
getOutputsButton: function() {
269-
return this._outputsBtn;
269+
return this.__outputsBtn;
270270
},
271271

272272
getMainView: function() {
@@ -415,7 +415,7 @@ qx.Class.define("osparc.node.slideshow.BaseNodeView", {
415415
node.getStatus().addListener("changeProgress", () => updateProgress(), this);
416416
}
417417

418-
node.bind("outputs", this._outputsBtn, "label", {
418+
node.bind("outputs", this.__outputsBtn, "label", {
419419
converter: outputsData => {
420420
let outputCounter = 0;
421421
Object.keys(outputsData).forEach(outKey => {
@@ -427,7 +427,17 @@ qx.Class.define("osparc.node.slideshow.BaseNodeView", {
427427
return this.tr("Outputs") + ` (${outputCounter})`;
428428
}
429429
});
430-
this._outputsBtn.addListener("changeLabel", () => osparc.utils.Utils.makeButtonBlink(this._outputsBtn, 2));
430+
this.__outputsBtn.addListener("changeLabel", () => {
431+
// new output received
432+
// make button blink
433+
osparc.utils.Utils.makeButtonBlink(this.__outputsBtn, 2);
434+
// and show Flash Message
435+
const outputs = this.getNode().getOutputs();
436+
if (outputs && Object.keys(outputs).length > 0) {
437+
const flashMsg = this.tr("New Outputs received");
438+
osparc.FlashMessenger.getInstance().logAs(flashMsg, "INFO");
439+
}
440+
});
431441

432442
this._addLogger();
433443
}

services/static-webserver/client/source/class/osparc/node/slideshow/NodeView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ qx.Class.define("osparc.node.slideshow.NodeView", {
9898
this._outputsLayout.add(outputsForm);
9999
}
100100

101-
this._outputsBtn.set({
101+
this.getOutputsButton().set({
102102
value: false,
103103
enabled: this.getNode().hasOutputs() > 0
104104
});

0 commit comments

Comments
 (0)