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

🎨🐛 [Frontend] Copyright with current year #6996

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,27 @@ qx.Class.define("osparc.product.Utils", {
return "REGISTER";
},

getCopyrightLink: function() {
Copy link
Member

@pcrespov pcrespov Jan 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some thoughts:

what is copyright date used for?

  • the year in a copyright footnote is a crucial piece of information that identifies the creation or publication date of the work, thereby clarifying its copyright status and duration.
  • The year indicates when the copyright was claimed or began.
  • The copyright duration in most countries is based on the life of the author plus a specific number of years (e.g., 70 years in the US and EU). However, for corporate or anonymous works, it may be a fixed term starting from the date of publication. The year helps calculate when the copyright will expire.

Therefore:

  • There is no need to change the copyright to the latest year all the time
  • I understand that this provides an easy and fast fix but I think it is a bad practice to override the information provided by the PO in the backend. Some alternatives are:
      1. Provide a product.vendor.copyright note as a template string e.g. $(year) ITIS-Foundation is variable but 2024 ITIS-Foundation is fixed year
      1. Compose copyright note from vendor fields instead of a having a dedicated entry for it. Therefore we drop copyright and add an optional copyrightYear and if not provided you add the latest.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I honestly don't have a strong opinion on this one, it was reported in the team chat and this was a fix. Shall we leave to the POs?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not even think this might be an issue if you ask the POs.
I would ask. Write here the answer (and who answered you) and resolve it fast within this PR.

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: copyrightText,
url: vendor.url
});
return copyrightLink;
}
return null;
},

// All products except oSPARC
hasIdlingTrackerEnabled: function() {
const product = this.getProductName();
Expand Down
Loading