Skip to content

Commit

Permalink
S4L Product: labeling (#4245)
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz authored May 17, 2023
1 parent 18deae1 commit 3a510de
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
tagByGroup.addListener("execute", () => this._groupByChanged("tags"));
groupByMenu.add(tagByGroup);
groupOptions.add(tagByGroup);
if (osparc.product.Utils.isProduct("s4llite")) {
if (osparc.product.Utils.isProduct("s4l") || osparc.product.Utils.isProduct("s4llite")) {
tagByGroup.execute();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ qx.Class.define("osparc.desktop.MainPage", {
if (!isReadOnly && preferencesSettings.getConfirmBackToDashboard()) {
const studyName = this.__studyEditor.getStudy().getName();
const win = new osparc.ui.window.Confirmation();
if (osparc.product.Utils.isProduct("s4llite")) {
if (osparc.product.Utils.isProduct("s4l") || osparc.product.Utils.isProduct("s4llite")) {
let msg = this.tr("Do you want to close ") + "<b>" + studyName + "</b>?";
msg += "<br><br>";
msg += this.tr("Make sure you saved your changes to:");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ qx.Class.define("osparc.product.AboutProduct", {
members: {
__buildLayout: function() {
switch (osparc.product.Utils.getProductName()) {
case "s4l":
this.__buildS4LLayout();
break;
case "s4llite":
this.__buildS4LLiteLayout();
break;
Expand All @@ -66,6 +69,32 @@ qx.Class.define("osparc.product.AboutProduct", {
}
},

__buildS4LLayout: function() {
const color = qx.theme.manager.Color.getInstance().resolve("text");

const introText = "TODO: Intro text";

const licenseUrl = "";
const licenseText = `TODO: Click <a href=${licenseUrl} style='color: ${color}' target='_blank'>here</a> to read the license agreements.`;

// more info ZMT website
const moreInfoUrl = "https://zmt.swiss/";
const moreInfoText = `For more information about <i>S4L</i>, visit <a href=${moreInfoUrl} style='color: ${color}' target='_blank'>our website</a>.`;

[
introText,
licenseText,
moreInfoText
].forEach(text => {
const label = osparc.product.tutorial.Utils.createLabel(text).set({
maxWidth: this.self().MAX_WIDTH - 2*this.self().PADDING
});
this.add(label);
});

this.__addCopyright();
},

__buildS4LLiteLayout: function() {
const color = qx.theme.manager.Color.getInstance().resolve("text");

Expand All @@ -90,6 +119,10 @@ qx.Class.define("osparc.product.AboutProduct", {
this.add(label);
});

this.__addCopyright();
},

__addCopyright: function() {
const copyrightLink = new osparc.ui.basic.LinkLabel().set({
font: "link-label-14"
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,24 @@ qx.Class.define("osparc.product.Utils", {
},

getStudyAlias: function(options = {}) {
let alias = qx.locale.Manager.tr("study");
if (this.isProduct("s4llite")) {
if (options.plural) {
alias = qx.locale.Manager.tr("projects");
} else {
alias = qx.locale.Manager.tr("project");
}
} else if (options.plural) {
alias = qx.locale.Manager.tr("studies");
let alias = null;
const product = this.getProductName();
switch (product) {
case "s4l":
case "s4llite":
if (options.plural) {
alias = qx.locale.Manager.tr("projects");
} else {
alias = qx.locale.Manager.tr("project");
}
break;
default:
if (options.plural) {
alias = qx.locale.Manager.tr("studies");
} else {
alias = qx.locale.Manager.tr("study");
}
break;
}

if (options.firstUpperCase) {
Expand All @@ -54,15 +63,24 @@ qx.Class.define("osparc.product.Utils", {
},

getTemplateAlias: function(options = {}) {
let alias = qx.locale.Manager.tr("template");
if (this.isProduct("s4llite")) {
if (options.plural) {
alias = qx.locale.Manager.tr("tutorials");
} else {
alias = qx.locale.Manager.tr("tutorial");
}
} else if (options.plural) {
alias = qx.locale.Manager.tr("templates");
let alias = null;
const product = this.getProductName();
switch (product) {
case "s4l":
case "s4llite":
if (options.plural) {
alias = qx.locale.Manager.tr("tutorials");
} else {
alias = qx.locale.Manager.tr("tutorial");
}
break;
default:
if (options.plural) {
alias = qx.locale.Manager.tr("templates");
} else {
alias = qx.locale.Manager.tr("template");
}
break;
}

if (options.firstUpperCase) {
Expand Down Expand Up @@ -113,14 +131,14 @@ qx.Class.define("osparc.product.Utils", {
},

showLicenseExtra: function() {
if (this.isProduct("s4llite") || this.isProduct("tis")) {
if (this.isProduct("s4l") || this.isProduct("s4llite") || this.isProduct("tis")) {
return true;
}
return false;
},

showAboutProduct: function() {
if (this.isProduct("s4llite")) {
if (this.isProduct("s4l") || this.isProduct("s4llite")) {
return true;
}
return false;
Expand All @@ -141,28 +159,28 @@ qx.Class.define("osparc.product.Utils", {
},

showClusters: function() {
if (this.isProduct("s4llite")) {
if (this.isProduct("s4llite") || this.isProduct("tis")) {
return false;
}
return true;
},

showDisableServiceAutoStart: function() {
if (this.isProduct("s4llite")) {
if (this.isProduct("s4llite") || this.isProduct("tis")) {
return false;
}
return true;
},

showQuality: function() {
if (this.isProduct("s4llite")) {
if (this.isProduct("s4l") || this.isProduct("s4llite")) {
return false;
}
return true;
},

showClassifiers: function() {
if (this.isProduct("s4llite")) {
if (this.isProduct("s4l") || this.isProduct("s4llite")) {
return false;
}
return true;
Expand Down

0 comments on commit 3a510de

Please sign in to comment.