Skip to content

Commit d1d6417

Browse files
committed
modified-star
1 parent 7fa93ea commit d1d6417

File tree

1 file changed

+34
-5
lines changed
  • services/static-webserver/client/source/class/osparc/workbench

1 file changed

+34
-5
lines changed

services/static-webserver/client/source/class/osparc/workbench/NodeUI.js

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,11 @@ qx.Class.define("osparc.workbench.NodeUI", {
138138
CAPTION_POS: {
139139
ICON: 0, // from qooxdoo
140140
TITLE: 1, // from qooxdoo
141-
LOCK: 2,
142-
MARKER: 3,
143-
DEPRECATED: 4,
144-
MENU: 5
141+
MODIFIED_STAR: 2,
142+
LOCK: 3,
143+
MARKER: 4,
144+
DEPRECATED: 5,
145+
MENU: 6,
145146
},
146147

147148
captionHeight: function() {
@@ -184,6 +185,21 @@ qx.Class.define("osparc.workbench.NodeUI", {
184185
_createChildControlImpl: function(id) {
185186
let control;
186187
switch (id) {
188+
case "modified-star":
189+
control = new qx.ui.basic.Label("*").set({
190+
font: "text-14",
191+
toolTipText: this.tr("Needs to run to update the outputs"),
192+
padding: 4,
193+
paddingTop: 0,
194+
paddingBottom: 0,
195+
visibility: "excluded",
196+
alignY: "top",
197+
});
198+
this.getChildControl("captionbar").add(control, {
199+
row: 0,
200+
column: this.self().CAPTION_POS.MODIFIED_STAR
201+
});
202+
break;
187203
case "lock":
188204
control = new qx.ui.basic.Image().set({
189205
source: "@FontAwesome5Solid/lock/12",
@@ -419,7 +435,20 @@ qx.Class.define("osparc.workbench.NodeUI", {
419435
this.__optionsMenu.add(convertToParameter);
420436
}
421437

422-
const lockState = node.getStatus().getLockState();
438+
const nodeStatus = node.getStatus();
439+
const modifiedStar = this.getChildControl("modified-star");
440+
const evaluateShowStar = () => {
441+
const modified = nodeStatus.getModified();
442+
const isRunning = osparc.data.model.NodeStatus.isComputationalRunning(node);
443+
modifiedStar.set({
444+
visibility: modified && !isRunning ? "visible" : "excluded"
445+
});
446+
};
447+
evaluateShowStar();
448+
nodeStatus.addListener("changeModified", evaluateShowStar);
449+
nodeStatus.addListener("changeRunning", evaluateShowStar);
450+
451+
const lockState = nodeStatus.getLockState();
423452
const lock = this.getChildControl("lock");
424453
lockState.bind("locked", lock, "visibility", {
425454
converter: locked => {

0 commit comments

Comments
 (0)