From 8253733f4bb3bc03bdd1c8d1c87a9fc3fba247df Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Wed, 25 Sep 2024 14:36:58 +0200 Subject: [PATCH 1/9] rename tabs --- services/static-webserver/client/compile.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/static-webserver/client/compile.json b/services/static-webserver/client/compile.json index f6cce359eed..780532e3cf0 100644 --- a/services/static-webserver/client/compile.json +++ b/services/static-webserver/client/compile.json @@ -136,7 +136,7 @@ "class": "osparc.Application", "theme": "osparc.theme.products.tis.ThemeDark", "name": "tis", - "title": "TI Plan - IT'IS", + "title": "TIP V3.0 - IT'IS", "include": [ "iconfont.material.Load", "iconfont.fontawesome5.Load", @@ -152,7 +152,7 @@ "class": "osparc.Application", "theme": "osparc.theme.products.tis.ThemeDark", "name": "tiplite", - "title": "TI Plan lite - IT'IS", + "title": "TIP.lite - IT'IS", "include": [ "iconfont.material.Load", "iconfont.fontawesome5.Load", From d73d4a911e4d86523b026ed6d9c02bc5e5bbdf90 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Wed, 25 Sep 2024 14:37:25 +0200 Subject: [PATCH 2/9] getProductName --- .../source/class/osparc/product/quickStart/tis/S4LPostPro.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/product/quickStart/tis/S4LPostPro.js b/services/static-webserver/client/source/class/osparc/product/quickStart/tis/S4LPostPro.js index bfff8f37e26..34dc48774a2 100644 --- a/services/static-webserver/client/source/class/osparc/product/quickStart/tis/S4LPostPro.js +++ b/services/static-webserver/client/source/class/osparc/product/quickStart/tis/S4LPostPro.js @@ -21,7 +21,8 @@ qx.Class.define("osparc.product.quickStart.tis.S4LPostPro", { construct: function() { let title = ""; if (osparc.product.Utils.isProduct("tiplite")) { - title += "" + this.tr("(Not available in TIP lite)") + "

"; + const notAvailableText = this.tr("Not available in"); + title += ` (${notAvailableText} ${osparc.product.Utils.getProductName()})

`; } title += this.tr("Sim4Life Post Processing"); this.base(arguments, title); From dbbfc8eb35a573b8fbd1bfa380a743457b28401f Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Wed, 25 Sep 2024 14:38:57 +0200 Subject: [PATCH 3/9] new studies --- .../client/source/resource/osparc/new_studies.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/static-webserver/client/source/resource/osparc/new_studies.json b/services/static-webserver/client/source/resource/osparc/new_studies.json index 9c0da6e74a4..56b1f860903 100644 --- a/services/static-webserver/client/source/resource/osparc/new_studies.json +++ b/services/static-webserver/client/source/resource/osparc/new_studies.json @@ -68,7 +68,7 @@ "showDisabled": true, "expectedTemplateLabel": "mcTI Planning Tool", "title": "Multichannel TI", - "description": "Not available in TIP lite", + "description": "Not available in TIP.lite", "newStudyLabel": "Multichannel TI", "category": "precomputed", "idToWidget": "newMTIPlanButton" @@ -76,7 +76,7 @@ "showDisabled": true, "expectedTemplateLabel": "pmTI Planning Tool", "title": "Phase-modulation TI", - "description": "Not available in TIP lite", + "description": "Not available in TIP.lite", "newStudyLabel": "Phase-modulation TI", "category": "precomputed", "idToWidget": "newPMTIPlanButton" @@ -84,7 +84,7 @@ "showDisabled": true, "expectedTemplateLabel": "personalized TI Planning Tool", "title": "Personalized
Classic TI", - "description": "Not available in TIP lite", + "description": "Not available in TIP.lite", "newStudyLabel": "Personalized Classic TI", "category": "personalized", "idToWidget": "personalizationNewTIPlanButton", @@ -93,7 +93,7 @@ "showDisabled": true, "expectedTemplateLabel": "personalized mcTI Planning Tool", "title": "Personalized
Multichannel TI", - "description": "Not available in TIP lite", + "description": "Not available in TIP.lite", "newStudyLabel": "Personalized Multichannel TI", "category": "personalized", "idToWidget": "personalizationNewMTIPlanButton", @@ -102,7 +102,7 @@ "showDisabled": true, "expectedTemplateLabel": "personalized pmTI Planning Tool", "title": "Personalized
Phase-modulation TI", - "description": "Not available in TIP lite", + "description": "Not available in TIP.lite", "newStudyLabel": "Personalized Phase-modulation TI", "category": "personalized", "idToWidget": "personalizationNewPMTIPlanButton", From 62b0669076f58dc7d52187c7bbf5821017f87522 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Wed, 25 Sep 2024 14:47:39 +0200 Subject: [PATCH 4/9] replace_me_product_name --- .../client/source/class/osparc/dashboard/NewStudies.js | 5 ++++- .../client/source/resource/osparc/new_studies.json | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/NewStudies.js b/services/static-webserver/client/source/class/osparc/dashboard/NewStudies.js index 7c01ff5c74d..88ad56d5f69 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/NewStudies.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/NewStudies.js @@ -167,7 +167,10 @@ qx.Class.define("osparc.dashboard.NewStudies", { const newStudyClicked = () => this.fireDataEvent("newStudyClicked", templateInfo); const title = templateInfo.title; - const desc = templateInfo.description; + let desc = templateInfo.description; + if (desc) { + desc = desc.replace("replace_me_product_name", osparc.product.Utils.getProductName()); + } const newPlanButton = new osparc.dashboard.GridButtonNew(title, desc); newPlanButton.setCardKey(templateInfo.idToWidget); osparc.utils.Utils.setIdToWidget(newPlanButton, templateInfo.idToWidget); diff --git a/services/static-webserver/client/source/resource/osparc/new_studies.json b/services/static-webserver/client/source/resource/osparc/new_studies.json index 56b1f860903..5ae53fa0827 100644 --- a/services/static-webserver/client/source/resource/osparc/new_studies.json +++ b/services/static-webserver/client/source/resource/osparc/new_studies.json @@ -68,7 +68,7 @@ "showDisabled": true, "expectedTemplateLabel": "mcTI Planning Tool", "title": "Multichannel TI", - "description": "Not available in TIP.lite", + "description": "Not available in replace_me_product_name", "newStudyLabel": "Multichannel TI", "category": "precomputed", "idToWidget": "newMTIPlanButton" @@ -76,7 +76,7 @@ "showDisabled": true, "expectedTemplateLabel": "pmTI Planning Tool", "title": "Phase-modulation TI", - "description": "Not available in TIP.lite", + "description": "Not available in replace_me_product_name", "newStudyLabel": "Phase-modulation TI", "category": "precomputed", "idToWidget": "newPMTIPlanButton" @@ -84,7 +84,7 @@ "showDisabled": true, "expectedTemplateLabel": "personalized TI Planning Tool", "title": "Personalized
Classic TI", - "description": "Not available in TIP.lite", + "description": "Not available in replace_me_product_name", "newStudyLabel": "Personalized Classic TI", "category": "personalized", "idToWidget": "personalizationNewTIPlanButton", @@ -93,7 +93,7 @@ "showDisabled": true, "expectedTemplateLabel": "personalized mcTI Planning Tool", "title": "Personalized
Multichannel TI", - "description": "Not available in TIP.lite", + "description": "Not available in replace_me_product_name", "newStudyLabel": "Personalized Multichannel TI", "category": "personalized", "idToWidget": "personalizationNewMTIPlanButton", @@ -102,7 +102,7 @@ "showDisabled": true, "expectedTemplateLabel": "personalized pmTI Planning Tool", "title": "Personalized
Phase-modulation TI", - "description": "Not available in TIP.lite", + "description": "Not available in replace_me_product_name", "newStudyLabel": "Personalized Phase-modulation TI", "category": "personalized", "idToWidget": "personalizationNewPMTIPlanButton", From 00ed89749023cf500c26c9519c328907e1515d04 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Wed, 25 Sep 2024 14:56:06 +0200 Subject: [PATCH 5/9] getDisplayName --- .../client/source/class/osparc/dashboard/NewStudies.js | 2 +- .../source/class/osparc/product/quickStart/tis/S4LPostPro.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/NewStudies.js b/services/static-webserver/client/source/class/osparc/dashboard/NewStudies.js index 88ad56d5f69..a57400bfb96 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/NewStudies.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/NewStudies.js @@ -169,7 +169,7 @@ qx.Class.define("osparc.dashboard.NewStudies", { const title = templateInfo.title; let desc = templateInfo.description; if (desc) { - desc = desc.replace("replace_me_product_name", osparc.product.Utils.getProductName()); + desc = desc.replace("replace_me_product_name", osparc.store.StaticInfo.getDisplayName()); } const newPlanButton = new osparc.dashboard.GridButtonNew(title, desc); newPlanButton.setCardKey(templateInfo.idToWidget); diff --git a/services/static-webserver/client/source/class/osparc/product/quickStart/tis/S4LPostPro.js b/services/static-webserver/client/source/class/osparc/product/quickStart/tis/S4LPostPro.js index 34dc48774a2..b8be1c6d1ea 100644 --- a/services/static-webserver/client/source/class/osparc/product/quickStart/tis/S4LPostPro.js +++ b/services/static-webserver/client/source/class/osparc/product/quickStart/tis/S4LPostPro.js @@ -22,7 +22,7 @@ qx.Class.define("osparc.product.quickStart.tis.S4LPostPro", { let title = ""; if (osparc.product.Utils.isProduct("tiplite")) { const notAvailableText = this.tr("Not available in"); - title += ` (${notAvailableText} ${osparc.product.Utils.getProductName()})

`; + title += ` (${notAvailableText} ${osparc.store.StaticInfo.getDisplayName()})

`; } title += this.tr("Sim4Life Post Processing"); this.base(arguments, title); From 0c30b871213323cf624c8c7c86c570f46e9652cd Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Wed, 25 Sep 2024 14:57:57 +0200 Subject: [PATCH 6/9] minor --- .../client/source/class/osparc/dashboard/NewStudies.js | 2 +- .../source/class/osparc/product/quickStart/tis/S4LPostPro.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/NewStudies.js b/services/static-webserver/client/source/class/osparc/dashboard/NewStudies.js index a57400bfb96..9e126382e6d 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/NewStudies.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/NewStudies.js @@ -169,7 +169,7 @@ qx.Class.define("osparc.dashboard.NewStudies", { const title = templateInfo.title; let desc = templateInfo.description; if (desc) { - desc = desc.replace("replace_me_product_name", osparc.store.StaticInfo.getDisplayName()); + desc = desc.replace("replace_me_product_name", osparc.store.StaticInfo.getInstance().getDisplayName()); } const newPlanButton = new osparc.dashboard.GridButtonNew(title, desc); newPlanButton.setCardKey(templateInfo.idToWidget); diff --git a/services/static-webserver/client/source/class/osparc/product/quickStart/tis/S4LPostPro.js b/services/static-webserver/client/source/class/osparc/product/quickStart/tis/S4LPostPro.js index b8be1c6d1ea..a667a6b4b07 100644 --- a/services/static-webserver/client/source/class/osparc/product/quickStart/tis/S4LPostPro.js +++ b/services/static-webserver/client/source/class/osparc/product/quickStart/tis/S4LPostPro.js @@ -22,7 +22,7 @@ qx.Class.define("osparc.product.quickStart.tis.S4LPostPro", { let title = ""; if (osparc.product.Utils.isProduct("tiplite")) { const notAvailableText = this.tr("Not available in"); - title += ` (${notAvailableText} ${osparc.store.StaticInfo.getDisplayName()})

`; + title += ` (${notAvailableText} ${osparc.store.StaticInfo.getInstance().getDisplayName()})

`; } title += this.tr("Sim4Life Post Processing"); this.base(arguments, title); From 54595041f1d5f40fe88fd53adda1d8c49d03412f Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Thu, 26 Sep 2024 08:59:10 +0200 Subject: [PATCH 7/9] replaceTokens --- .../client/source/class/osparc/dashboard/NewStudies.js | 2 +- .../client/source/class/osparc/utils/Utils.js | 4 ++++ .../client/source/resource/osparc/new_studies.json | 10 +++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/NewStudies.js b/services/static-webserver/client/source/class/osparc/dashboard/NewStudies.js index 9e126382e6d..3d2519f92ba 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/NewStudies.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/NewStudies.js @@ -169,7 +169,7 @@ qx.Class.define("osparc.dashboard.NewStudies", { const title = templateInfo.title; let desc = templateInfo.description; if (desc) { - desc = desc.replace("replace_me_product_name", osparc.store.StaticInfo.getInstance().getDisplayName()); + desc = osparc.utils.Utils.replaceTokens(desc, "replace_me_product_name", osparc.store.StaticInfo.getInstance().getDisplayName()); } const newPlanButton = new osparc.dashboard.GridButtonNew(title, desc); newPlanButton.setCardKey(templateInfo.idToWidget); diff --git a/services/static-webserver/client/source/class/osparc/utils/Utils.js b/services/static-webserver/client/source/class/osparc/utils/Utils.js index 23947464d6d..d3939072363 100644 --- a/services/static-webserver/client/source/class/osparc/utils/Utils.js +++ b/services/static-webserver/client/source/class/osparc/utils/Utils.js @@ -91,6 +91,10 @@ qx.Class.define("osparc.utils.Utils", { FLOATING_Z_INDEX: 110000, + replaceTokens: function(str, key, value) { + return str.replaceAll("{"+key+"}", value); + }, + /** * @param {qx.ui.basic.Image} image */ diff --git a/services/static-webserver/client/source/resource/osparc/new_studies.json b/services/static-webserver/client/source/resource/osparc/new_studies.json index 5ae53fa0827..6aaef0fde1f 100644 --- a/services/static-webserver/client/source/resource/osparc/new_studies.json +++ b/services/static-webserver/client/source/resource/osparc/new_studies.json @@ -68,7 +68,7 @@ "showDisabled": true, "expectedTemplateLabel": "mcTI Planning Tool", "title": "Multichannel TI", - "description": "Not available in replace_me_product_name", + "description": "Not available in {replace_me_product_name}", "newStudyLabel": "Multichannel TI", "category": "precomputed", "idToWidget": "newMTIPlanButton" @@ -76,7 +76,7 @@ "showDisabled": true, "expectedTemplateLabel": "pmTI Planning Tool", "title": "Phase-modulation TI", - "description": "Not available in replace_me_product_name", + "description": "Not available in {replace_me_product_name}", "newStudyLabel": "Phase-modulation TI", "category": "precomputed", "idToWidget": "newPMTIPlanButton" @@ -84,7 +84,7 @@ "showDisabled": true, "expectedTemplateLabel": "personalized TI Planning Tool", "title": "Personalized
Classic TI", - "description": "Not available in replace_me_product_name", + "description": "Not available in {replace_me_product_name}", "newStudyLabel": "Personalized Classic TI", "category": "personalized", "idToWidget": "personalizationNewTIPlanButton", @@ -93,7 +93,7 @@ "showDisabled": true, "expectedTemplateLabel": "personalized mcTI Planning Tool", "title": "Personalized
Multichannel TI", - "description": "Not available in replace_me_product_name", + "description": "Not available in {replace_me_product_name}", "newStudyLabel": "Personalized Multichannel TI", "category": "personalized", "idToWidget": "personalizationNewMTIPlanButton", @@ -102,7 +102,7 @@ "showDisabled": true, "expectedTemplateLabel": "personalized pmTI Planning Tool", "title": "Personalized
Phase-modulation TI", - "description": "Not available in replace_me_product_name", + "description": "Not available in {replace_me_product_name}", "newStudyLabel": "Personalized Phase-modulation TI", "category": "personalized", "idToWidget": "personalizationNewPMTIPlanButton", From 7deca1020934941dabe46b741a3efa6cb0d2b5f8 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Thu, 26 Sep 2024 09:05:07 +0200 Subject: [PATCH 8/9] ${token} --- .../static-webserver/client/scripts/post-compile.py | 2 +- .../static-webserver/client/source/boot/index.html | 8 ++++---- .../client/source/class/osparc/utils/Utils.js | 2 +- .../client/source/resource/osparc/new_studies.json | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/services/static-webserver/client/scripts/post-compile.py b/services/static-webserver/client/scripts/post-compile.py index 6c532c83cee..afc1cd5033a 100644 --- a/services/static-webserver/client/scripts/post-compile.py +++ b/services/static-webserver/client/scripts/post-compile.py @@ -31,7 +31,7 @@ def update_apps_metadata(): replacements = i.get("replacements") for key in replacements: replace_text = replacements[key] - data = data.replace(key, replace_text) + data = data.replace("${"+key+"}", replace_text) with open(filename, "w") as file: print(f"Updating app metadata: {filename}") file.write(data) diff --git a/services/static-webserver/client/source/boot/index.html b/services/static-webserver/client/source/boot/index.html index 48b35c48db9..aa9e202a085 100644 --- a/services/static-webserver/client/source/boot/index.html +++ b/services/static-webserver/client/source/boot/index.html @@ -41,9 +41,9 @@ - - - + + + ${appTitle} - +