Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ S4L Lite: 11.08 meeting feedback (⚠️ devops) #3534

Merged
merged 15 commits into from
Nov 9, 2022
2 changes: 1 addition & 1 deletion services/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ services:
- traefik.http.services.${SWARM_STACK_NAME}_static_webserver.loadbalancer.healthcheck.interval=2000ms
- traefik.http.services.${SWARM_STACK_NAME}_static_webserver.loadbalancer.healthcheck.timeout=1000ms
- traefik.http.middlewares.${SWARM_STACK_NAME}_static_webserver_retry.retry.attempts=2
- 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/`))
- 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/`))
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.service=${SWARM_STACK_NAME}_static_webserver
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.entrypoints=http
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.priority=2
Expand Down
2 changes: 1 addition & 1 deletion services/static-webserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ Used for static content serving.

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

- `/` resolves to one of the three index.html pages inside the 4 products (osparc, tis, s4l, s4llight)
- `/` resolves to one of the three index.html pages inside the 4 products (osparc, tis, s4l, s4llite)
- `/static-frontend-data.json` contains information required by the fronted
6 changes: 3 additions & 3 deletions services/static-webserver/client/compile.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@
{
"class": "osparc.Application",
"theme": "osparc.theme.zmt.ThemeDark",
"name": "s4llight",
"title": "Sim4Life Light - ZMT",
"name": "s4llite",
"title": "Sim4Life Lite - ZMT",
"include": [
"iconfont.material.Load",
"iconfont.fontawesome5.Load",
"osparc.theme.zmt.ThemeLight"
],
"environment": {
"product.name": "s4llight"
"product.name": "s4llite"
},
"bootPath": "source/boot"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ qx.Class.define("osparc.Application", {
if (!osparc.CookiePolicy.areCookiesAccepted()) {
const cookiePolicy = new osparc.CookiePolicy();
const title = this.tr("Cookie Policy");
const height = osparc.utils.Utils.isProduct("tis") ? 180 : 145;
// "tis" and "s4llite" include the license agreement
const height = (osparc.utils.Utils.isProduct("tis") || osparc.utils.Utils.isProduct("s4llite")) ? 180 : 145;
const win = osparc.ui.window.Window.popUpInWindow(cookiePolicy, title, 400, height).set({
clickAwayClose: false,
resizable: false,
Expand Down Expand Up @@ -328,7 +329,7 @@ qx.Class.define("osparc.Application", {
let view = null;
switch (qx.core.Environment.get("product.name")) {
case "s4l":
case "s4llight":
case "s4llite":
view = new osparc.auth.LoginPageS4L();
this.__loadView(view);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ qx.Class.define("osparc.CookiePolicy", {
const acceptCookie = this.getChildControl("accept-cookie");
checkButtons.push(acceptCookie);

if (osparc.utils.Utils.isProduct("tis")) {
if (osparc.utils.Utils.isProduct("tis") || osparc.utils.Utils.isProduct("s4llite")) {
this.getChildControl("license-text");
const acceptLicense = this.getChildControl("accept-license");
checkButtons.push(acceptLicense);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,20 @@ qx.Class.define("osparc.auth.LoginPage", {
versionLink.setValue(text);
});

const organizationLink = new osparc.ui.basic.LinkLabel(`© ${new Date().getFullYear()} IT'IS Foundation`, "https://itis.swiss").set({
const organizationLink = new osparc.ui.basic.LinkLabel().set({
textColor: "text-darker"
});
if (osparc.utils.Utils.isProduct("s4l") || osparc.utils.Utils.isProduct("s4llite")) {
organizationLink.set({
value: `© ${new Date().getFullYear()} Zurich MedTech`,
url: "https://zmt.swiss"
});
} else {
organizationLink.set({
value: `© ${new Date().getFullYear()} IT'IS Foundation`,
url: "https://itis.swiss"
});
}
versionLinkLayout.add(organizationLink);

if (osparc.utils.Utils.isProduct("tis")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ qx.Class.define("osparc.auth.LoginPageS4L", {

this.setBackgroundColor("#025887");
this.getContentElement().setStyles({
"background-image": osparc.utils.Utils.isProduct("s4llight") ? "url(resource/osparc/s4l-light_splitimage.png)" : "url(resource/osparc/s4l_splitimage.jpeg)",
"background-image": osparc.utils.Utils.isProduct("s4llite") ? "url(resource/osparc/s4llite_splitimage.png)" : "url(resource/osparc/s4l_splitimage.jpeg)",
"background-repeat": "no-repeat",
"background-size": "auto 100%"
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,25 +89,25 @@ qx.Class.define("osparc.dashboard.Dashboard", {
const permissions = osparc.data.Permissions.getInstance();
const tabs = [{
id: "studiesTabBtn",
label: osparc.utils.Utils.isProduct("s4llight") ? this.tr("PROJECTS") : this.tr("STUDIES"),
label: osparc.utils.Utils.isProduct("s4llite") ? this.tr("PROJECTS") : this.tr("STUDIES"),
buildLayout: this.__createStudyBrowser
}];
if (permissions.canDo("dashboard.templates.read")) {
const templatesTab = {
id: "templatesTabBtn",
label: osparc.utils.Utils.isProduct("s4llight") ? this.tr("TUTORIALS") : this.tr("TEMPLATES"),
label: osparc.utils.Utils.isProduct("s4llite") ? this.tr("TUTORIALS") : this.tr("TEMPLATES"),
buildLayout: this.__createTemplateBrowser
};
tabs.push(templatesTab);
}
if (!osparc.utils.Utils.isProduct("s4llight") && permissions.canDo("dashboard.services.read")) {
if (!osparc.utils.Utils.isProduct("s4llite") && permissions.canDo("dashboard.services.read")) {
tabs.push({
id: "servicesTabBtn",
label: this.tr("SERVICES"),
buildLayout: this.__createServiceBrowser
});
}
if (!osparc.utils.Utils.isProduct("s4llight")) {
if (!osparc.utils.Utils.isProduct("s4llite")) {
tabs.push({
id: "dataTabBtn",
label: this.tr("DATA"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
this.__addNewPlanButton(mode);
} else if (osparc.utils.Utils.isProduct("s4l")) {
this.__addNewS4LServiceButtons(mode);
} else if (osparc.utils.Utils.isProduct("s4llight")) {
} else if (osparc.utils.Utils.isProduct("s4llite")) {
this.__removeNewStudyButtons();
this.__addNewS4LLightServiceButtons(mode);
this.__addNewS4LLiteServiceButtons(mode);
}
},

Expand Down Expand Up @@ -230,7 +230,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
});
},

__addNewS4LLightServiceButtons: function(mode) {
__addNewS4LLiteServiceButtons: function(mode) {
const store = osparc.store.Store.getInstance();
store.getServicesOnly(false)
.then(services => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ qx.Class.define("osparc.data.model.Node", {
},

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

const iframe = new osparc.component.widget.PersistentIframe();
if (osparc.utils.Utils.isProduct("s4llight")) {
if (osparc.utils.Utils.isProduct("s4llite")) {
iframe.setShowZoomButton(false);
}
iframe.addListener("restart", () => this.__restartIFrame(), this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ qx.Class.define("osparc.navigation.Manuals", {
switch (productName) {
case "osparc":
case "s4l":
case "s4llight":
case "s4llite":
licenseLink = "http://docs.osparc.io/#/docs/support/license";
break;
case "tis":
Expand All @@ -27,7 +27,7 @@ qx.Class.define("osparc.navigation.Manuals", {
switch (productName) {
case "osparc":
case "s4l":
case "s4llight":
case "s4llite":
manuals.push({
label: qx.locale.Manager.tr("User Manual"),
icon: "@FontAwesome5Solid/book/22",
Expand All @@ -53,18 +53,107 @@ qx.Class.define("osparc.navigation.Manuals", {
return manuals;
},

__openGithubIssueInfoDialog: function() {
const issueConfirmationWindow = new osparc.ui.window.Dialog("Information", null,
qx.locale.Manager.tr("To create an issue in GitHub, you must have an account in GitHub and be already logged-in.")
odeimaiz marked this conversation as resolved.
Show resolved Hide resolved
);
const contBtn = new qx.ui.form.Button(qx.locale.Manager.tr("Continue"), "@FontAwesome5Solid/external-link-alt/12");
contBtn.addListener("execute", () => {
window.open(osparc.utils.issue.Github.getNewIssueUrl());
issueConfirmationWindow.close();
}, this);
const loginBtn = new qx.ui.form.Button(qx.locale.Manager.tr("Log in in GitHub"), "@FontAwesome5Solid/external-link-alt/12");
loginBtn.addListener("execute", () => window.open("https://github.com/login"), this);
issueConfirmationWindow.addButton(contBtn);
issueConfirmationWindow.addButton(loginBtn);
issueConfirmationWindow.addCancelButton();
issueConfirmationWindow.open();
},

__openFogbugzIssueInfoDialog: function() {
const issueConfirmationWindow = new osparc.ui.window.Dialog("Information", null,
qx.locale.Manager.tr("To create an issue in Fogbugz, you must have an account in Fogbugz and be already logged-in.")
);
const contBtn = new qx.ui.form.Button(qx.locale.Manager.tr("Continue"), "@FontAwesome5Solid/external-link-alt/12");
contBtn.addListener("execute", () => {
osparc.data.Resources.get("statics")
.then(statics => {
const fbNewIssueUrl = osparc.utils.issue.Fogbugz.getNewIssueUrl(statics);
if (fbNewIssueUrl) {
window.open(fbNewIssueUrl);
issueConfirmationWindow.close();
}
});
}, this);
const loginBtn = new qx.ui.form.Button(qx.locale.Manager.tr("Log in in Fogbugz"), "@FontAwesome5Solid/external-link-alt/12");
loginBtn.addListener("execute", () => {
osparc.data.Resources.get("statics")
.then(statics => {
if (statics && statics.osparcIssuesLoginUrl) {
window.open(statics.osparcIssuesLoginUrl);
}
});
}, this);
issueConfirmationWindow.addButton(contBtn);
issueConfirmationWindow.addButton(loginBtn);
issueConfirmationWindow.addCancelButton();
issueConfirmationWindow.open();
},

__openSendEmailFeedbackDialog: function(statics) {
let email = null;
if (osparc.utils.Utils.isProduct("s4l") && statics.s4lSupportEmail) {
email = statics.s4lSupportEmail;
} else if (osparc.utils.Utils.isProduct("s4llite") || statics.s4lliteSupportEmail) {
email = statics.s4lliteSupportEmail;
}
if (email === null) {
return;
}

const productName = osparc.utils.Utils.getProductName();
const giveEmailFeedbackWindow = new osparc.ui.window.Dialog("Feedback", null,
qx.locale.Manager.tr("Send us an email to:")
);
const color = qx.theme.manager.Color.getInstance().resolve("text");
const textLink = `&nbsp<a href=mailto:${email}?subject=${productName} feedback" style='color: ${color}' target='_blank'>${email}</a>&nbsp`;
const mailto = new qx.ui.basic.Label(textLink).set({
selectable: true,
rich : true
});
giveEmailFeedbackWindow.addWidget(mailto);
giveEmailFeedbackWindow.addCancelButton().set({
label: qx.locale.Manager.tr("Close")
});
giveEmailFeedbackWindow.open();
},

addFeedbackButtonsToMenu: function(menu, statics) {
const newGHIssueBtn = new qx.ui.menu.Button(qx.locale.Manager.tr("Issue in GitHub"));
newGHIssueBtn.addListener("execute", () => osparc.navigation.UserMenuButton.openGithubIssueInfoDialog(), this);
newGHIssueBtn.addListener("execute", () => this.__openGithubIssueInfoDialog(), this);
menu.add(newGHIssueBtn);

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

const feedbackAnonBtn = new qx.ui.menu.Button(qx.locale.Manager.tr("Anonymous feedback"));
if (osparc.utils.Utils.isProduct("s4l") || osparc.utils.Utils.isProduct("s4llite")) {
const forumBtn = new qx.ui.menu.Button(qx.locale.Manager.tr("S4L Forum"));
forumBtn.addListener("execute", () => window.open("https://forum.zmt.swiss/"), this);
pcrespov marked this conversation as resolved.
Show resolved Hide resolved
menu.add(forumBtn);

if (statics.s4lSupportEmail || statics.s4lliteSupportEmail) {
const giveFeedbackBtn = new qx.ui.menu.Button(qx.locale.Manager.tr("Give us Feedback"));
giveFeedbackBtn.addListener("execute", () => this.__openSendEmailFeedbackDialog(statics), this);
menu.add(giveFeedbackBtn);
}
}

const feedbackAnonBtn = new qx.ui.menu.Button(qx.locale.Manager.tr("Anonymous feedback")).set({
visibility: statics.osparcFeedbackFormUrl ? "visible" : "excluded"
});
feedbackAnonBtn.addListener("execute", () => {
if (statics.osparcFeedbackFormUrl) {
window.open(statics.osparcFeedbackFormUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,53 +58,6 @@ qx.Class.define("osparc.navigation.UserMenuButton", {
const preferencesWindow = new osparc.desktop.preferences.PreferencesWindow();
preferencesWindow.center();
preferencesWindow.open();
},

openGithubIssueInfoDialog: function() {
const issueConfirmationWindow = new osparc.ui.window.Dialog("Information", null,
qx.locale.Manager.tr("To create an issue in GitHub, you must have an account in GitHub and be already logged-in.")
);
const contBtn = new qx.ui.form.Button(qx.locale.Manager.tr("Continue"), "@FontAwesome5Solid/external-link-alt/12");
contBtn.addListener("execute", () => {
window.open(osparc.utils.issue.Github.getNewIssueUrl());
issueConfirmationWindow.close();
}, this);
const loginBtn = new qx.ui.form.Button(qx.locale.Manager.tr("Log in in GitHub"), "@FontAwesome5Solid/external-link-alt/12");
loginBtn.addListener("execute", () => window.open("https://github.com/login"), this);
issueConfirmationWindow.addButton(contBtn);
issueConfirmationWindow.addButton(loginBtn);
issueConfirmationWindow.addCancelButton();
issueConfirmationWindow.open();
},

openFogbugzIssueInfoDialog: function() {
const issueConfirmationWindow = new osparc.ui.window.Dialog("Information", null,
qx.locale.Manager.tr("To create an issue in Fogbugz, you must have an account in Fogbugz and be already logged-in.")
);
const contBtn = new qx.ui.form.Button(qx.locale.Manager.tr("Continue"), "@FontAwesome5Solid/external-link-alt/12");
contBtn.addListener("execute", () => {
osparc.data.Resources.get("statics")
.then(statics => {
const fbNewIssueUrl = osparc.utils.issue.Fogbugz.getNewIssueUrl(statics);
if (fbNewIssueUrl) {
window.open(fbNewIssueUrl);
issueConfirmationWindow.close();
}
});
}, this);
const loginBtn = new qx.ui.form.Button(qx.locale.Manager.tr("Log in in Fogbugz"), "@FontAwesome5Solid/external-link-alt/12");
loginBtn.addListener("execute", () => {
osparc.data.Resources.get("statics")
.then(statics => {
if (statics && statics.osparcIssuesLoginUrl) {
window.open(statics.osparcIssuesLoginUrl);
}
});
}, this);
issueConfirmationWindow.addButton(contBtn);
issueConfirmationWindow.addButton(loginBtn);
issueConfirmationWindow.addCancelButton();
issueConfirmationWindow.open();
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ qx.Class.define("osparc.ui.window.Dialog", {

members: {
__messageLabel: null,
__extraWidgetsLayout: null,

_createChildControlImpl: function(id) {
let control;
Expand Down Expand Up @@ -75,16 +76,26 @@ qx.Class.define("osparc.ui.window.Dialog", {
this.add(this.__messageLabel, {
flex: 1
});
this.__extraWidgetsLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox()).set({
padding: 10
});
this.add(this.__extraWidgetsLayout, {
flex: 1
});
this.getChildControl("buttons-layout");
},

_applyMessage: function(message) {
this.__messageLabel.setValue(message);
},

addWidget: function(widget) {
this.__extraWidgetsLayout.add(widget);
},

/**
* Adds a button to the dialog.
* @param {qx.ui.toolbar.Button} button Button that will be added to the bottom bar of the dialog.
* @param {qx.ui.form.Button} button Button that will be added to the bottom bar of the dialog.
*/
addButton: function(button) {
const btnToolbar = this.getChildControl("buttons-layout");
Expand All @@ -97,6 +108,7 @@ qx.Class.define("osparc.ui.window.Dialog", {
addCancelButton: function() {
const cancelButton = this.getChildControl("cancel-button");
cancelButton.addListener("execute", () => this.close(), this);
return cancelButton;
}
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ qx.Class.define("osparc.utils.LibVersions", {

return {
name: name,
version: commitId,
version: commitId.substring(0, 7),
url: url
};
},
Expand Down
Loading