Skip to content

Commit 29746ef

Browse files
authored
✨ S4L Lite: 11.08 meeting feedback (⚠️ devops) (ITISFoundation#3534)
1 parent 767860c commit 29746ef

27 files changed

+155
-89
lines changed

services/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ services:
170170
- traefik.http.services.${SWARM_STACK_NAME}_static_webserver.loadbalancer.healthcheck.interval=2000ms
171171
- traefik.http.services.${SWARM_STACK_NAME}_static_webserver.loadbalancer.healthcheck.timeout=1000ms
172172
- traefik.http.middlewares.${SWARM_STACK_NAME}_static_webserver_retry.retry.attempts=2
173-
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.rule=hostregexp(`{host:.+}`) && (Path(`/osparc`,`/s4l`,`/s4llight`,`/tis`,`/transpiled`,`/resource`) || PathPrefix(`/osparc/`,`/s4l/`,`/s4llight/`,`/tis/`,`/transpiled/`,`/resource/`))
173+
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.rule=hostregexp(`{host:.+}`) && (Path(`/osparc`,`/s4l`,`/s4llite`,`/tis`,`/transpiled`,`/resource`) || PathPrefix(`/osparc/`,`/s4l/`,`/s4llite/`,`/tis/`,`/transpiled/`,`/resource/`))
174174
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.service=${SWARM_STACK_NAME}_static_webserver
175175
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.entrypoints=http
176176
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.priority=2

services/static-webserver/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ Used for static content serving.
66

77
In the future will fully serve all static content. Currently the `webserver` is still serving the following routes:
88

9-
- `/` resolves to one of the three index.html pages inside the 4 products (osparc, tis, s4l, s4llight)
9+
- `/` resolves to one of the three index.html pages inside the 4 products (osparc, tis, s4l, s4llite)
1010
- `/static-frontend-data.json` contains information required by the fronted

services/static-webserver/client/compile.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@
5353
{
5454
"class": "osparc.Application",
5555
"theme": "osparc.theme.zmt.ThemeDark",
56-
"name": "s4llight",
57-
"title": "Sim4Life Light - ZMT",
56+
"name": "s4llite",
57+
"title": "Sim4Life Lite - ZMT",
5858
"include": [
5959
"iconfont.material.Load",
6060
"iconfont.fontawesome5.Load",
6161
"osparc.theme.zmt.ThemeLight"
6262
],
6363
"environment": {
64-
"product.name": "s4llight"
64+
"product.name": "s4llite"
6565
},
6666
"bootPath": "source/boot"
6767
},

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,8 @@ qx.Class.define("osparc.Application", {
280280
if (!osparc.CookiePolicy.areCookiesAccepted()) {
281281
const cookiePolicy = new osparc.CookiePolicy();
282282
const title = this.tr("Cookie Policy");
283-
const height = osparc.utils.Utils.isProduct("tis") ? 180 : 145;
283+
// "tis" and "s4llite" include the license agreement
284+
const height = (osparc.utils.Utils.isProduct("tis") || osparc.utils.Utils.isProduct("s4llite")) ? 180 : 145;
284285
const win = osparc.ui.window.Window.popUpInWindow(cookiePolicy, title, 400, height).set({
285286
clickAwayClose: false,
286287
resizable: false,
@@ -328,7 +329,7 @@ qx.Class.define("osparc.Application", {
328329
let view = null;
329330
switch (qx.core.Environment.get("product.name")) {
330331
case "s4l":
331-
case "s4llight":
332+
case "s4llite":
332333
view = new osparc.auth.LoginPageS4L();
333334
this.__loadView(view);
334335
break;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ qx.Class.define("osparc.CookiePolicy", {
136136
const acceptCookie = this.getChildControl("accept-cookie");
137137
checkButtons.push(acceptCookie);
138138

139-
if (osparc.utils.Utils.isProduct("tis")) {
139+
if (osparc.utils.Utils.isProduct("tis") || osparc.utils.Utils.isProduct("s4llite")) {
140140
this.getChildControl("license-text");
141141
const acceptLicense = this.getChildControl("accept-license");
142142
checkButtons.push(acceptLicense);

services/static-webserver/client/source/class/osparc/auth/LoginPage.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,20 @@ qx.Class.define("osparc.auth.LoginPage", {
198198
versionLink.setValue(text);
199199
});
200200

201-
const organizationLink = new osparc.ui.basic.LinkLabel(${new Date().getFullYear()} IT'IS Foundation`, "https://itis.swiss").set({
201+
const organizationLink = new osparc.ui.basic.LinkLabel().set({
202202
textColor: "text-darker"
203203
});
204+
if (osparc.utils.Utils.isProduct("s4l") || osparc.utils.Utils.isProduct("s4llite")) {
205+
organizationLink.set({
206+
value: ${new Date().getFullYear()} Zurich MedTech`,
207+
url: "https://zmt.swiss"
208+
});
209+
} else {
210+
organizationLink.set({
211+
value: ${new Date().getFullYear()} IT'IS Foundation`,
212+
url: "https://itis.swiss"
213+
});
214+
}
204215
versionLinkLayout.add(organizationLink);
205216

206217
if (osparc.utils.Utils.isProduct("tis")) {

services/static-webserver/client/source/class/osparc/auth/LoginPageS4L.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ qx.Class.define("osparc.auth.LoginPageS4L", {
4444

4545
this.setBackgroundColor("#025887");
4646
this.getContentElement().setStyles({
47-
"background-image": osparc.utils.Utils.isProduct("s4llight") ? "url(resource/osparc/s4l-light_splitimage.png)" : "url(resource/osparc/s4l_splitimage.jpeg)",
47+
"background-image": osparc.utils.Utils.isProduct("s4llite") ? "url(resource/osparc/s4llite_splitimage.png)" : "url(resource/osparc/s4l_splitimage.jpeg)",
4848
"background-repeat": "no-repeat",
4949
"background-size": "auto 100%"
5050
});

services/static-webserver/client/source/class/osparc/dashboard/Dashboard.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,25 +89,25 @@ qx.Class.define("osparc.dashboard.Dashboard", {
8989
const permissions = osparc.data.Permissions.getInstance();
9090
const tabs = [{
9191
id: "studiesTabBtn",
92-
label: osparc.utils.Utils.isProduct("s4llight") ? this.tr("PROJECTS") : this.tr("STUDIES"),
92+
label: osparc.utils.Utils.isProduct("s4llite") ? this.tr("PROJECTS") : this.tr("STUDIES"),
9393
buildLayout: this.__createStudyBrowser
9494
}];
9595
if (permissions.canDo("dashboard.templates.read")) {
9696
const templatesTab = {
9797
id: "templatesTabBtn",
98-
label: osparc.utils.Utils.isProduct("s4llight") ? this.tr("TUTORIALS") : this.tr("TEMPLATES"),
98+
label: osparc.utils.Utils.isProduct("s4llite") ? this.tr("TUTORIALS") : this.tr("TEMPLATES"),
9999
buildLayout: this.__createTemplateBrowser
100100
};
101101
tabs.push(templatesTab);
102102
}
103-
if (!osparc.utils.Utils.isProduct("s4llight") && permissions.canDo("dashboard.services.read")) {
103+
if (!osparc.utils.Utils.isProduct("s4llite") && permissions.canDo("dashboard.services.read")) {
104104
tabs.push({
105105
id: "servicesTabBtn",
106106
label: this.tr("SERVICES"),
107107
buildLayout: this.__createServiceBrowser
108108
});
109109
}
110-
if (!osparc.utils.Utils.isProduct("s4llight")) {
110+
if (!osparc.utils.Utils.isProduct("s4llite")) {
111111
tabs.push({
112112
id: "dataTabBtn",
113113
label: this.tr("DATA"),

services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
153153
this.__addNewPlanButton(mode);
154154
} else if (osparc.utils.Utils.isProduct("s4l")) {
155155
this.__addNewS4LServiceButtons(mode);
156-
} else if (osparc.utils.Utils.isProduct("s4llight")) {
156+
} else if (osparc.utils.Utils.isProduct("s4llite")) {
157157
this.__removeNewStudyButtons();
158-
this.__addNewS4LLightServiceButtons(mode);
158+
this.__addNewS4LLiteServiceButtons(mode);
159159
}
160160
},
161161

@@ -230,7 +230,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
230230
});
231231
},
232232

233-
__addNewS4LLightServiceButtons: function(mode) {
233+
__addNewS4LLiteServiceButtons: function(mode) {
234234
const store = osparc.store.Store.getInstance();
235235
store.getServicesOnly(false)
236236
.then(services => {

services/static-webserver/client/source/class/osparc/data/model/Node.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ qx.Class.define("osparc.data.model.Node", {
999999
},
10001000

10011001
__initLoadingPage: function() {
1002-
const showZoomMaximizeButton = !osparc.utils.Utils.isProduct("s4llight");
1002+
const showZoomMaximizeButton = !osparc.utils.Utils.isProduct("s4llite");
10031003
const loadingPage = new osparc.ui.message.Loading(this.__getLoadingPageHeader(), this.__getExtraMessages(), showZoomMaximizeButton);
10041004
this.addListener("changeLabel", () => loadingPage.setHeader(this.__getLoadingPageHeader()), this);
10051005
this.getStatus().addListener("changeInteractive", () => {
@@ -1026,7 +1026,7 @@ qx.Class.define("osparc.data.model.Node", {
10261026
this.__initLoadingPage();
10271027

10281028
const iframe = new osparc.component.widget.PersistentIframe();
1029-
if (osparc.utils.Utils.isProduct("s4llight")) {
1029+
if (osparc.utils.Utils.isProduct("s4llite")) {
10301030
iframe.setShowZoomButton(false);
10311031
}
10321032
iframe.addListener("restart", () => this.__restartIFrame(), this);

services/static-webserver/client/source/class/osparc/navigation/Manuals.js

Lines changed: 94 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ qx.Class.define("osparc.navigation.Manuals", {
99
switch (productName) {
1010
case "osparc":
1111
case "s4l":
12-
case "s4llight":
12+
case "s4llite":
1313
licenseLink = "http://docs.osparc.io/#/docs/support/license";
1414
break;
1515
case "tis":
@@ -27,7 +27,7 @@ qx.Class.define("osparc.navigation.Manuals", {
2727
switch (productName) {
2828
case "osparc":
2929
case "s4l":
30-
case "s4llight":
30+
case "s4llite":
3131
manuals.push({
3232
label: qx.locale.Manager.tr("User Manual"),
3333
icon: "@FontAwesome5Solid/book/22",
@@ -53,18 +53,107 @@ qx.Class.define("osparc.navigation.Manuals", {
5353
return manuals;
5454
},
5555

56+
__openGithubIssueInfoDialog: function() {
57+
const issueConfirmationWindow = new osparc.ui.window.Dialog("Information", null,
58+
qx.locale.Manager.tr("To create an issue in GitHub, you must have an account in GitHub and be already logged-in.")
59+
);
60+
const contBtn = new qx.ui.form.Button(qx.locale.Manager.tr("Continue"), "@FontAwesome5Solid/external-link-alt/12");
61+
contBtn.addListener("execute", () => {
62+
window.open(osparc.utils.issue.Github.getNewIssueUrl());
63+
issueConfirmationWindow.close();
64+
}, this);
65+
const loginBtn = new qx.ui.form.Button(qx.locale.Manager.tr("Log in in GitHub"), "@FontAwesome5Solid/external-link-alt/12");
66+
loginBtn.addListener("execute", () => window.open("https://github.com/login"), this);
67+
issueConfirmationWindow.addButton(contBtn);
68+
issueConfirmationWindow.addButton(loginBtn);
69+
issueConfirmationWindow.addCancelButton();
70+
issueConfirmationWindow.open();
71+
},
72+
73+
__openFogbugzIssueInfoDialog: function() {
74+
const issueConfirmationWindow = new osparc.ui.window.Dialog("Information", null,
75+
qx.locale.Manager.tr("To create an issue in Fogbugz, you must have an account in Fogbugz and be already logged-in.")
76+
);
77+
const contBtn = new qx.ui.form.Button(qx.locale.Manager.tr("Continue"), "@FontAwesome5Solid/external-link-alt/12");
78+
contBtn.addListener("execute", () => {
79+
osparc.data.Resources.get("statics")
80+
.then(statics => {
81+
const fbNewIssueUrl = osparc.utils.issue.Fogbugz.getNewIssueUrl(statics);
82+
if (fbNewIssueUrl) {
83+
window.open(fbNewIssueUrl);
84+
issueConfirmationWindow.close();
85+
}
86+
});
87+
}, this);
88+
const loginBtn = new qx.ui.form.Button(qx.locale.Manager.tr("Log in in Fogbugz"), "@FontAwesome5Solid/external-link-alt/12");
89+
loginBtn.addListener("execute", () => {
90+
osparc.data.Resources.get("statics")
91+
.then(statics => {
92+
if (statics && statics.osparcIssuesLoginUrl) {
93+
window.open(statics.osparcIssuesLoginUrl);
94+
}
95+
});
96+
}, this);
97+
issueConfirmationWindow.addButton(contBtn);
98+
issueConfirmationWindow.addButton(loginBtn);
99+
issueConfirmationWindow.addCancelButton();
100+
issueConfirmationWindow.open();
101+
},
102+
103+
__openSendEmailFeedbackDialog: function(statics) {
104+
let email = null;
105+
if (osparc.utils.Utils.isProduct("s4l") && statics.s4lSupportEmail) {
106+
email = statics.s4lSupportEmail;
107+
} else if (osparc.utils.Utils.isProduct("s4llite") || statics.s4lliteSupportEmail) {
108+
email = statics.s4lliteSupportEmail;
109+
}
110+
if (email === null) {
111+
return;
112+
}
113+
114+
const productName = osparc.utils.Utils.getProductName();
115+
const giveEmailFeedbackWindow = new osparc.ui.window.Dialog("Feedback", null,
116+
qx.locale.Manager.tr("Send us an email to:")
117+
);
118+
const color = qx.theme.manager.Color.getInstance().resolve("text");
119+
const textLink = `&nbsp<a href=mailto:${email}?subject=${productName} feedback" style='color: ${color}' target='_blank'>${email}</a>&nbsp`;
120+
const mailto = new qx.ui.basic.Label(textLink).set({
121+
selectable: true,
122+
rich : true
123+
});
124+
giveEmailFeedbackWindow.addWidget(mailto);
125+
giveEmailFeedbackWindow.addCancelButton().set({
126+
label: qx.locale.Manager.tr("Close")
127+
});
128+
giveEmailFeedbackWindow.open();
129+
},
130+
56131
addFeedbackButtonsToMenu: function(menu, statics) {
57132
const newGHIssueBtn = new qx.ui.menu.Button(qx.locale.Manager.tr("Issue in GitHub"));
58-
newGHIssueBtn.addListener("execute", () => osparc.navigation.UserMenuButton.openGithubIssueInfoDialog(), this);
133+
newGHIssueBtn.addListener("execute", () => this.__openGithubIssueInfoDialog(), this);
59134
menu.add(newGHIssueBtn);
60135

61136
if (osparc.utils.Utils.isInZ43()) {
62137
const newFogbugzIssueBtn = new qx.ui.menu.Button(qx.locale.Manager.tr("Issue in Fogbugz"));
63-
newFogbugzIssueBtn.addListener("execute", () => osparc.navigation.UserMenuButton.openFogbugzIssueInfoDialog(), this);
138+
newFogbugzIssueBtn.addListener("execute", () => this.__openFogbugzIssueInfoDialog(), this);
64139
menu.add(newFogbugzIssueBtn);
65140
}
66141

67-
const feedbackAnonBtn = new qx.ui.menu.Button(qx.locale.Manager.tr("Anonymous feedback"));
142+
if (osparc.utils.Utils.isProduct("s4l") || osparc.utils.Utils.isProduct("s4llite")) {
143+
const forumBtn = new qx.ui.menu.Button(qx.locale.Manager.tr("S4L Forum"));
144+
forumBtn.addListener("execute", () => window.open("https://forum.zmt.swiss/"), this);
145+
menu.add(forumBtn);
146+
147+
if (statics.s4lSupportEmail || statics.s4lliteSupportEmail) {
148+
const giveFeedbackBtn = new qx.ui.menu.Button(qx.locale.Manager.tr("Give us Feedback"));
149+
giveFeedbackBtn.addListener("execute", () => this.__openSendEmailFeedbackDialog(statics), this);
150+
menu.add(giveFeedbackBtn);
151+
}
152+
}
153+
154+
const feedbackAnonBtn = new qx.ui.menu.Button(qx.locale.Manager.tr("Anonymous feedback")).set({
155+
visibility: statics.osparcFeedbackFormUrl ? "visible" : "excluded"
156+
});
68157
feedbackAnonBtn.addListener("execute", () => {
69158
if (statics.osparcFeedbackFormUrl) {
70159
window.open(statics.osparcFeedbackFormUrl);

services/static-webserver/client/source/class/osparc/navigation/UserMenuButton.js

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -58,53 +58,6 @@ qx.Class.define("osparc.navigation.UserMenuButton", {
5858
const preferencesWindow = new osparc.desktop.preferences.PreferencesWindow();
5959
preferencesWindow.center();
6060
preferencesWindow.open();
61-
},
62-
63-
openGithubIssueInfoDialog: function() {
64-
const issueConfirmationWindow = new osparc.ui.window.Dialog("Information", null,
65-
qx.locale.Manager.tr("To create an issue in GitHub, you must have an account in GitHub and be already logged-in.")
66-
);
67-
const contBtn = new qx.ui.form.Button(qx.locale.Manager.tr("Continue"), "@FontAwesome5Solid/external-link-alt/12");
68-
contBtn.addListener("execute", () => {
69-
window.open(osparc.utils.issue.Github.getNewIssueUrl());
70-
issueConfirmationWindow.close();
71-
}, this);
72-
const loginBtn = new qx.ui.form.Button(qx.locale.Manager.tr("Log in in GitHub"), "@FontAwesome5Solid/external-link-alt/12");
73-
loginBtn.addListener("execute", () => window.open("https://github.com/login"), this);
74-
issueConfirmationWindow.addButton(contBtn);
75-
issueConfirmationWindow.addButton(loginBtn);
76-
issueConfirmationWindow.addCancelButton();
77-
issueConfirmationWindow.open();
78-
},
79-
80-
openFogbugzIssueInfoDialog: function() {
81-
const issueConfirmationWindow = new osparc.ui.window.Dialog("Information", null,
82-
qx.locale.Manager.tr("To create an issue in Fogbugz, you must have an account in Fogbugz and be already logged-in.")
83-
);
84-
const contBtn = new qx.ui.form.Button(qx.locale.Manager.tr("Continue"), "@FontAwesome5Solid/external-link-alt/12");
85-
contBtn.addListener("execute", () => {
86-
osparc.data.Resources.get("statics")
87-
.then(statics => {
88-
const fbNewIssueUrl = osparc.utils.issue.Fogbugz.getNewIssueUrl(statics);
89-
if (fbNewIssueUrl) {
90-
window.open(fbNewIssueUrl);
91-
issueConfirmationWindow.close();
92-
}
93-
});
94-
}, this);
95-
const loginBtn = new qx.ui.form.Button(qx.locale.Manager.tr("Log in in Fogbugz"), "@FontAwesome5Solid/external-link-alt/12");
96-
loginBtn.addListener("execute", () => {
97-
osparc.data.Resources.get("statics")
98-
.then(statics => {
99-
if (statics && statics.osparcIssuesLoginUrl) {
100-
window.open(statics.osparcIssuesLoginUrl);
101-
}
102-
});
103-
}, this);
104-
issueConfirmationWindow.addButton(contBtn);
105-
issueConfirmationWindow.addButton(loginBtn);
106-
issueConfirmationWindow.addCancelButton();
107-
issueConfirmationWindow.open();
10861
}
10962
},
11063

services/static-webserver/client/source/class/osparc/ui/window/Dialog.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ qx.Class.define("osparc.ui.window.Dialog", {
4545

4646
members: {
4747
__messageLabel: null,
48+
__extraWidgetsLayout: null,
4849

4950
_createChildControlImpl: function(id) {
5051
let control;
@@ -75,16 +76,26 @@ qx.Class.define("osparc.ui.window.Dialog", {
7576
this.add(this.__messageLabel, {
7677
flex: 1
7778
});
79+
this.__extraWidgetsLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox()).set({
80+
padding: 10
81+
});
82+
this.add(this.__extraWidgetsLayout, {
83+
flex: 1
84+
});
7885
this.getChildControl("buttons-layout");
7986
},
8087

8188
_applyMessage: function(message) {
8289
this.__messageLabel.setValue(message);
8390
},
8491

92+
addWidget: function(widget) {
93+
this.__extraWidgetsLayout.add(widget);
94+
},
95+
8596
/**
8697
* Adds a button to the dialog.
87-
* @param {qx.ui.toolbar.Button} button Button that will be added to the bottom bar of the dialog.
98+
* @param {qx.ui.form.Button} button Button that will be added to the bottom bar of the dialog.
8899
*/
89100
addButton: function(button) {
90101
const btnToolbar = this.getChildControl("buttons-layout");
@@ -97,6 +108,7 @@ qx.Class.define("osparc.ui.window.Dialog", {
97108
addCancelButton: function() {
98109
const cancelButton = this.getChildControl("cancel-button");
99110
cancelButton.addListener("execute", () => this.close(), this);
111+
return cancelButton;
100112
}
101113
}
102114
});

services/static-webserver/client/source/class/osparc/utils/LibVersions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ qx.Class.define("osparc.utils.LibVersions", {
4343

4444
return {
4545
name: name,
46-
version: commitId,
46+
version: commitId.substring(0, 7),
4747
url: url
4848
};
4949
},

0 commit comments

Comments
 (0)