File tree 3 files changed +40
-8
lines changed
services/static-webserver/client/source/class/osparc
3 files changed +40
-8
lines changed Original file line number Diff line number Diff line change @@ -33,9 +33,13 @@ qx.Class.define("osparc.NewUITracker", {
33
33
let msg = "" ;
34
34
msg += qx . locale . Manager . tr ( "A new version of the application is now available." ) ;
35
35
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." ) ;
37
37
// permanent message
38
- osparc . FlashMessenger . getInstance ( ) . logAs ( msg , "INFO" , 0 ) ;
38
+ const flashMessage = osparc . FlashMessenger . getInstance ( ) . logAs ( msg , "INFO" , 0 ) . set ( {
39
+ maxWidth : 500
40
+ } ) ;
41
+ const reloadButton = osparc . utils . Utils . reloadNoCacheButton ( ) ;
42
+ flashMessage . addWidget ( reloadButton ) ;
39
43
this . stopTracker ( ) ;
40
44
}
41
45
} ;
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ qx.Class.define("osparc.ui.message.FlashMessage", {
31
31
*/
32
32
construct : function ( message , level , duration ) {
33
33
this . base ( arguments ) ;
34
- this . _setLayout ( new qx . ui . layout . HBox ( 15 ) ) ;
34
+ this . _setLayout ( new qx . ui . layout . VBox ( 15 ) ) ;
35
35
36
36
this . set ( {
37
37
padding : 18 ,
@@ -112,31 +112,34 @@ qx.Class.define("osparc.ui.message.FlashMessage", {
112
112
} ,
113
113
114
114
members : {
115
- __closeCb : null ,
116
115
_createChildControlImpl : function ( id ) {
117
116
let control ;
118
117
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 ;
119
122
case "badge" :
120
123
control = new qx . ui . basic . Image ( ) . set ( {
121
124
alignY : "middle"
122
125
} ) ;
123
- this . _add ( control ) ;
126
+ this . getChildControl ( "message-layout" ) . add ( control ) ;
124
127
break ;
125
128
case "message" :
126
129
control = new qx . ui . basic . Label ( ) . set ( {
127
130
font : "text-16" ,
128
131
selectable : true ,
129
132
rich : true
130
133
} ) ;
131
- this . _add ( control , {
134
+ this . getChildControl ( "message-layout" ) . add ( control , {
132
135
flex : 1
133
136
} ) ;
134
137
break ;
135
138
case "closebutton" :
136
139
control = new osparc . ui . basic . IconButton ( "@MaterialIcons/close/16" , ( ) => this . fireEvent ( "closeMessage" ) ) . set ( {
137
140
alignY : "middle"
138
141
} ) ;
139
- this . _add ( control ) ;
142
+ this . getChildControl ( "message-layout" ) . add ( control ) ;
140
143
break ;
141
144
}
142
145
return control || this . base ( arguments , id ) ;
@@ -147,6 +150,10 @@ qx.Class.define("osparc.ui.message.FlashMessage", {
147
150
if ( label ) {
148
151
label . setValue ( value ) ;
149
152
}
150
- }
153
+ } ,
154
+
155
+ addWidget : function ( widget ) {
156
+ this . _add ( widget ) ;
157
+ } ,
151
158
}
152
159
} ) ;
Original file line number Diff line number Diff line change @@ -249,6 +249,27 @@ qx.Class.define("osparc.utils.Utils", {
249
249
// window.location.href = window.location.href.replace(/#.*$/, "");
250
250
} ,
251
251
252
+ reloadNoCacheButton : function ( ) {
253
+ const reloadButton = new qx . ui . form . Button ( ) . set ( {
254
+ label : qx . locale . Manager . tr ( "Reload" ) ,
255
+ icon : "@FontAwesome5Solid/redo/16" ,
256
+ font : "text-16" ,
257
+ gap : 10 ,
258
+ appearance : "strong-button" ,
259
+ allowGrowX : false ,
260
+ center : true ,
261
+ alignX : "center" ,
262
+ } ) ;
263
+ reloadButton . addListener ( "execute" , ( ) => {
264
+ // this argument, which is passed and consumed by the boot.js init file,
265
+ // adds a `nocache=rand()` query argument to the js resource calls.
266
+ // This forces a hard reload
267
+ const noCacheUrl = window . location . href + "?qooxdoo:add-no-cache=true" ;
268
+ window . location . href = noCacheUrl ;
269
+ } ) ;
270
+ return reloadButton ;
271
+ } ,
272
+
252
273
getUniqueStudyName : function ( preferredName , list ) {
253
274
let title = preferredName ;
254
275
const existingTitles = list . map ( study => study . name ) ;
You can’t perform that action at this time.
0 commit comments