Skip to content

Commit d24f215

Browse files
committed
add reload button to Flash message
1 parent d499877 commit d24f215

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

services/static-webserver/client/source/class/osparc/NewUITracker.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ qx.Class.define("osparc.NewUITracker", {
3333
let msg = "";
3434
msg += qx.locale.Manager.tr("A new version of the application is now available.");
3535
msg += "<br>";
36-
msg += qx.locale.Manager.tr("Reload to get the latest features.");
36+
msg += qx.locale.Manager.tr("Click the Reload button to get the latest features.");
3737
// permanent message
38-
osparc.FlashMessenger.getInstance().logAs(msg, "INFO", 0);
38+
const flashMessage = osparc.FlashMessenger.getInstance().logAs(msg, "INFO", 0);
39+
const reloadButton = osparc.utils.Utils.reloadNoCacheButton();
40+
flashMessage.addWidget(reloadButton);
3941
this.stopTracker();
4042
}
4143
};

services/static-webserver/client/source/class/osparc/ui/message/FlashMessage.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ qx.Class.define("osparc.ui.message.FlashMessage", {
3131
*/
3232
construct: function(message, level, duration) {
3333
this.base(arguments);
34-
this._setLayout(new qx.ui.layout.HBox(15));
34+
this._setLayout(new qx.ui.layout.VBox(15));
3535

3636
this.set({
3737
padding: 18,
@@ -112,31 +112,34 @@ qx.Class.define("osparc.ui.message.FlashMessage", {
112112
},
113113

114114
members: {
115-
__closeCb: null,
116115
_createChildControlImpl: function(id) {
117116
let control;
118117
switch (id) {
118+
case "message-layout":
119+
control = new qx.ui.container.Composite(new qx.ui.layout.HBox(15));
120+
this._add(control);
121+
break;
119122
case "badge":
120123
control = new qx.ui.basic.Image().set({
121124
alignY: "middle"
122125
});
123-
this._add(control);
126+
this.getChildControl("message-layout").add(control);
124127
break;
125128
case "message":
126129
control = new qx.ui.basic.Label().set({
127130
font: "text-16",
128131
selectable: true,
129132
rich: true
130133
});
131-
this._add(control, {
134+
this.getChildControl("message-layout").add(control, {
132135
flex: 1
133136
});
134137
break;
135138
case "closebutton":
136139
control = new osparc.ui.basic.IconButton("@MaterialIcons/close/16", () => this.fireEvent("closeMessage")).set({
137140
alignY: "middle"
138141
});
139-
this._add(control);
142+
this.getChildControl("message-layout").add(control);
140143
break;
141144
}
142145
return control || this.base(arguments, id);
@@ -147,6 +150,10 @@ qx.Class.define("osparc.ui.message.FlashMessage", {
147150
if (label) {
148151
label.setValue(value);
149152
}
150-
}
153+
},
154+
155+
addWidget: function(widget) {
156+
this._add(widget);
157+
},
151158
}
152159
});

0 commit comments

Comments
 (0)