From 95d2be209a23dd8da8a6e1a17c9bb42531a6aa2f Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 3 Jan 2025 10:19:06 +0100 Subject: [PATCH 1/3] getCopyrightLink --- .../source/class/osparc/product/AboutProduct.js | 12 ++++-------- .../client/source/class/osparc/product/Utils.js | 13 +++++++++++++ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/product/AboutProduct.js b/services/static-webserver/client/source/class/osparc/product/AboutProduct.js index c0760d010821..63e557456d77 100644 --- a/services/static-webserver/client/source/class/osparc/product/AboutProduct.js +++ b/services/static-webserver/client/source/class/osparc/product/AboutProduct.js @@ -166,17 +166,13 @@ qx.Class.define("osparc.product.AboutProduct", { }, __addCopyright: function() { - const copyrightLink = new osparc.ui.basic.LinkLabel().set({ - font: "link-label-14" - }); - const vendor = osparc.store.VendorInfo.getInstance().getVendor(); - if (vendor && "url" in vendor && "copyright" in vendor) { + const copyrightLink = osparc.product.Utils.getCopyrightLink(); + if (copyrightLink) { copyrightLink.set({ - value: vendor.copyright, - url: vendor.url + font: "link-label-14" }); + this.add(copyrightLink); } - this.add(copyrightLink); }, } }); diff --git a/services/static-webserver/client/source/class/osparc/product/Utils.js b/services/static-webserver/client/source/class/osparc/product/Utils.js index 31501afeb34f..a416394615d5 100644 --- a/services/static-webserver/client/source/class/osparc/product/Utils.js +++ b/services/static-webserver/client/source/class/osparc/product/Utils.js @@ -205,6 +205,19 @@ qx.Class.define("osparc.product.Utils", { return "REGISTER"; }, + getCopyrightLink: function() { + const copyrightLink = new osparc.ui.basic.LinkLabel(); + const vendor = osparc.store.VendorInfo.getInstance().getVendor(); + if (vendor && "url" in vendor && "copyright" in vendor) { + copyrightLink.set({ + value: vendor.copyright, + url: vendor.url + }); + return copyrightLink; + } + return null; + }, + // All products except oSPARC hasIdlingTrackerEnabled: function() { const product = this.getProductName(); From ebc214e64b2184a6b8da7daa02271c425bdbdb2f Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 3 Jan 2025 10:37:45 +0100 Subject: [PATCH 2/3] use helper --- .../client/source/class/osparc/auth/LoginPage.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/auth/LoginPage.js b/services/static-webserver/client/source/class/osparc/auth/LoginPage.js index a972fce24d64..82aec70c3c59 100644 --- a/services/static-webserver/client/source/class/osparc/auth/LoginPage.js +++ b/services/static-webserver/client/source/class/osparc/auth/LoginPage.js @@ -353,17 +353,13 @@ qx.Class.define("osparc.auth.LoginPage", { }); versionLinkLayout.add(createReleaseNotesLink); - const organizationLink = new osparc.ui.basic.LinkLabel().set({ - textColor: "text-darker" - }); - const vendor = osparc.store.VendorInfo.getInstance().getVendor(); - if (vendor && "url" in vendor && "copyright" in vendor) { - organizationLink.set({ - value: vendor.copyright, - url: vendor.url + const copyrightLink = osparc.product.Utils.getCopyrightLink(); + if (copyrightLink) { + copyrightLink.set({ + textColor: "text-darker" }); + versionLinkLayout.add(copyrightLink); } - versionLinkLayout.add(organizationLink); versionLinkLayout.add(new qx.ui.core.Spacer(), { flex: 1 From ee690a1f0f661b0b71fb6280128c5a753cb79f21 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 3 Jan 2025 11:48:39 +0100 Subject: [PATCH 3/3] cvurrent year --- .../client/source/class/osparc/product/Utils.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/product/Utils.js b/services/static-webserver/client/source/class/osparc/product/Utils.js index a416394615d5..f1b016e257a8 100644 --- a/services/static-webserver/client/source/class/osparc/product/Utils.js +++ b/services/static-webserver/client/source/class/osparc/product/Utils.js @@ -209,8 +209,16 @@ qx.Class.define("osparc.product.Utils", { const copyrightLink = new osparc.ui.basic.LinkLabel(); const vendor = osparc.store.VendorInfo.getInstance().getVendor(); if (vendor && "url" in vendor && "copyright" in vendor) { + let copyrightText = vendor.copyright; + // remove the copyright symbol (©) + copyrightText = copyrightText.replace("©", ""); + copyrightText = copyrightText.trim(); + // remove the year + copyrightText = copyrightText.replace(/^\d+\s/, ""); + // add the copyright symbol (©) and current year + copyrightText = `©${new Date().getFullYear()} ` + copyrightText; copyrightLink.set({ - value: vendor.copyright, + value: copyrightText, url: vendor.url }); return copyrightLink;