diff --git a/services/static-webserver/client/source/class/osparc/auth/Manager.js b/services/static-webserver/client/source/class/osparc/auth/Manager.js index e4352999026..6c232fb6075 100644 --- a/services/static-webserver/client/source/class/osparc/auth/Manager.js +++ b/services/static-webserver/client/source/class/osparc/auth/Manager.js @@ -244,8 +244,8 @@ qx.Class.define("osparc.auth.Manager", { const authData = osparc.auth.Data.getInstance(); authData.set({ email: profile["login"], - firstName: profile["first_name"], - lastName: profile["last_name"], + firstName: profile["first_name"] || profile["login"], + lastName: profile["last_name"] || "", expirationDate: "expirationDate" in profile ? new Date(profile["expirationDate"]) : null }); }, diff --git a/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js b/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js index c82e0df0c1f..3fa2b73ad42 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js @@ -577,7 +577,7 @@ qx.Class.define("osparc.dashboard.CardBase", { __showBlockedCardFromStatus: function(lockedStatus) { const status = lockedStatus["status"]; const owner = lockedStatus["owner"]; - let toolTip = osparc.utils.Utils.firstsUp(owner["first_name"], owner["last_name"]); + let toolTip = osparc.utils.Utils.firstsUp(owner["first_name"] || this.tr("A user"), owner["last_name"] || ""); let image = null; switch (status) { case "CLOSING": diff --git a/services/static-webserver/client/source/class/osparc/desktop/MainPageHandler.js b/services/static-webserver/client/source/class/osparc/desktop/MainPageHandler.js index cfaa130d6b0..6576305730e 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/MainPageHandler.js +++ b/services/static-webserver/client/source/class/osparc/desktop/MainPageHandler.js @@ -97,7 +97,11 @@ qx.Class.define("osparc.desktop.MainPageHandler", { lockedBy = studyData["state"]["locked"]["owner"]; } if (locked && lockedBy["user_id"] !== osparc.auth.Data.getInstance().getUserId()) { - const msg = qx.locale.Manager.tr("Study is already open by ") + lockedBy["first_name"]; + const msg = `${qx.locale.Manager.tr("Study is already open by ")} ${ + "first_name" in lockedBy && lockedBy["first_name"] != null ? + lockedBy["first_name"] : + qx.locale.Manager.tr("another user.") + }`; throw new Error(msg); } const store = osparc.store.Store.getInstance(); diff --git a/services/static-webserver/client/source/class/osparc/desktop/organizations/MembersList.js b/services/static-webserver/client/source/class/osparc/desktop/organizations/MembersList.js index 7fe0ab9e55e..c61dff1fc80 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/organizations/MembersList.js +++ b/services/static-webserver/client/source/class/osparc/desktop/organizations/MembersList.js @@ -227,7 +227,7 @@ qx.Class.define("osparc.desktop.organizations.MembersList", { const membersList = []; members.forEach(member => { member["thumbnail"] = osparc.utils.Avatar.getUrl(member["login"], 32); - member["name"] = osparc.utils.Utils.firstsUp(member["first_name"], member["last_name"]); + member["name"] = osparc.utils.Utils.firstsUp(member["first_name"] || member["login"], member["last_name"] || ""); let options = []; if (canIDelete) { // admin... diff --git a/services/static-webserver/client/source/class/osparc/desktop/preferences/pages/ClustersPage.js b/services/static-webserver/client/source/class/osparc/desktop/preferences/pages/ClustersPage.js index 7a4df9f8540..1dcf7734485 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/preferences/pages/ClustersPage.js +++ b/services/static-webserver/client/source/class/osparc/desktop/preferences/pages/ClustersPage.js @@ -292,7 +292,12 @@ qx.Class.define("osparc.desktop.preferences.pages.ClustersPage", { collabObj["login"] = collaborator["description"]; } else if (collaborator["collabType"] === 2) { collabObj["thumbnail"] = osparc.utils.Avatar.getUrl(collaborator["login"], 32); - collabObj["name"] = osparc.utils.Utils.firstsUp(collaborator["first_name"], collaborator["last_name"]); + collaborator["name"] = osparc.utils.Utils.firstsUp( + `${"first_name" in collaborator && collaborator["first_name"] != null ? + collaborator["first_name"] : collaborator["login"]}`, + `${"last_name" in collaborator && collaborator["last_name"] ? + collaborator["last_name"] : ""}` + ); collabObj["login"] = collaborator["login"]; } if (Object.keys(collabObj).length) { diff --git a/services/static-webserver/client/source/class/osparc/desktop/wallets/MembersList.js b/services/static-webserver/client/source/class/osparc/desktop/wallets/MembersList.js index b1a1c39f148..2514d68d718 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/wallets/MembersList.js +++ b/services/static-webserver/client/source/class/osparc/desktop/wallets/MembersList.js @@ -221,7 +221,12 @@ qx.Class.define("osparc.desktop.wallets.MembersList", { const collaborator = osparc.utils.Utils.deepCloneObject(collab); if ("first_name" in collaborator) { collaborator["thumbnail"] = osparc.utils.Avatar.getUrl(collaborator["login"], 32); - collaborator["name"] = osparc.utils.Utils.firstsUp(collaborator["first_name"], collaborator["last_name"]); + collaborator["name"] = osparc.utils.Utils.firstsUp( + `${"first_name" in collaborator && collaborator["first_name"] != null ? + collaborator["first_name"] : collaborator["login"]}`, + `${"last_name" in collaborator && collaborator["last_name"] != null ? + collaborator["last_name"] : ""}` + ); } collaborator["accessRights"] = accessRights; let options = []; diff --git a/services/static-webserver/client/source/class/osparc/filter/CollaboratorToggleButton.js b/services/static-webserver/client/source/class/osparc/filter/CollaboratorToggleButton.js index e23c61a2fab..90ccbd2171a 100644 --- a/services/static-webserver/client/source/class/osparc/filter/CollaboratorToggleButton.js +++ b/services/static-webserver/client/source/class/osparc/filter/CollaboratorToggleButton.js @@ -24,9 +24,11 @@ qx.Class.define("osparc.filter.CollaboratorToggleButton", { }); let label = null; - if ("first_name" in collaborator) { + if (collaborator["first_name"]) { // user - label = collaborator["first_name"] + " " + collaborator["last_name"]; + label = `${collaborator["first_name"]} ${"last_name" in collaborator && collaborator["last_name"] != null ? collaborator["last_name"] : ""}`; + } else if ("login" in collaborator) { + label = collaborator["login"]; } else { // org label = collaborator["label"]; diff --git a/services/static-webserver/client/source/class/osparc/filter/OrganizationMembers.js b/services/static-webserver/client/source/class/osparc/filter/OrganizationMembers.js index 88fa3865f6d..42e10a8bdb5 100644 --- a/services/static-webserver/client/source/class/osparc/filter/OrganizationMembers.js +++ b/services/static-webserver/client/source/class/osparc/filter/OrganizationMembers.js @@ -51,7 +51,7 @@ qx.Class.define("osparc.filter.OrganizationMembers", { .then(members => { members.sort((a, b) => (a["first_name"] > b["first_name"]) ? 1 : -1); members.forEach(member => { - const name = osparc.utils.Utils.firstsUp(member["first_name"], member["last_name"]); + const name = osparc.utils.Utils.firstsUp(member["first_name"] || member["login"], member["last_name"] || ""); const bnt = this._addOption(name); bnt.uid = member["id"]; }); diff --git a/services/static-webserver/client/source/class/osparc/filter/OrganizationsAndMembers.js b/services/static-webserver/client/source/class/osparc/filter/OrganizationsAndMembers.js index 8bd9eec5e48..bb3e9f47a01 100644 --- a/services/static-webserver/client/source/class/osparc/filter/OrganizationsAndMembers.js +++ b/services/static-webserver/client/source/class/osparc/filter/OrganizationsAndMembers.js @@ -39,7 +39,7 @@ qx.Class.define("osparc.filter.OrganizationsAndMembers", { addOption: function(group) { let name = ""; if ("first_name" in group) { - name = group["first_name"] + " " + group["last_name"]; + name = `${group["first_name"]} ${"last_name" in group && group["last_name"] != null ? group["last_name"] : ""}`; } else { name = group["label"]; } diff --git a/services/static-webserver/client/source/class/osparc/metadata/ServicesInStudyUpdate.js b/services/static-webserver/client/source/class/osparc/metadata/ServicesInStudyUpdate.js index a9b32ca60b4..cf364f8d145 100644 --- a/services/static-webserver/client/source/class/osparc/metadata/ServicesInStudyUpdate.js +++ b/services/static-webserver/client/source/class/osparc/metadata/ServicesInStudyUpdate.js @@ -176,7 +176,8 @@ qx.Class.define("osparc.metadata.ServicesInStudyUpdate", { }); const updateAllButton = this.__updateAllButton = new osparc.ui.form.FetchButton(this.tr("Update all"), "@MaterialIcons/update/14").set({ - backgroundColor: "strong-main", + appearance: "form-button", + padding: [2, 5], visibility: "excluded" }); this._servicesGrid.add(updateAllButton, { @@ -256,7 +257,8 @@ qx.Class.define("osparc.metadata.ServicesInStudyUpdate", { } if (isUpdatable) { updateButton.set({ - backgroundColor: "strong-main", + appearance: "form-button-outlined", + padding: [2, 5], label: this.tr("Update") }); } diff --git a/services/static-webserver/client/source/class/osparc/share/Collaborators.js b/services/static-webserver/client/source/class/osparc/share/Collaborators.js index ce63871af87..6bd4ca940b6 100644 --- a/services/static-webserver/client/source/class/osparc/share/Collaborators.js +++ b/services/static-webserver/client/source/class/osparc/share/Collaborators.js @@ -362,7 +362,12 @@ qx.Class.define("osparc.share.Collaborators", { const collaborator = osparc.utils.Utils.deepCloneObject(collab); if ("first_name" in collaborator) { collaborator["thumbnail"] = osparc.utils.Avatar.getUrl(collaborator["login"], 32); - collaborator["name"] = osparc.utils.Utils.firstsUp(collaborator["first_name"], collaborator["last_name"]); + collaborator["name"] = osparc.utils.Utils.firstsUp( + `${"first_name" in collaborator && collaborator["first_name"] != null ? + collaborator["first_name"] : collaborator["login"]}`, + `${"last_name" in collaborator && collaborator["last_name"] ? + collaborator["last_name"] : ""}` + ); } collaborator["accessRights"] = accessRights[gid]; collaborator["showOptions"] = (this._resourceType === "service") ? this._canIWrite() : this._canIDelete(); diff --git a/services/static-webserver/client/source/class/osparc/share/NewCollaboratorsManager.js b/services/static-webserver/client/source/class/osparc/share/NewCollaboratorsManager.js index 42783d7412b..169b0c7e5a0 100644 --- a/services/static-webserver/client/source/class/osparc/share/NewCollaboratorsManager.js +++ b/services/static-webserver/client/source/class/osparc/share/NewCollaboratorsManager.js @@ -71,7 +71,7 @@ qx.Class.define("osparc.share.NewCollaboratorsManager", { alignX: "right" })); const shareButton = this.__shareButton = new osparc.ui.form.FetchButton(this.tr("Share")).set({ - appearance: "strong-button" + appearance: "form-button" }); shareButton.addListener("execute", () => this.__shareClicked(), this); buttons.add(shareButton); diff --git a/services/static-webserver/client/source/class/osparc/store/Store.js b/services/static-webserver/client/source/class/osparc/store/Store.js index f0842cdc9d9..8d11350aeb9 100644 --- a/services/static-webserver/client/source/class/osparc/store/Store.js +++ b/services/static-webserver/client/source/class/osparc/store/Store.js @@ -599,7 +599,10 @@ qx.Class.define("osparc.store.Store", { .then(orgMemberss => { orgMemberss.forEach(orgMembers => { orgMembers.forEach(orgMember => { - orgMember["label"] = osparc.utils.Utils.firstsUp(orgMember["first_name"], orgMember["last_name"]); + orgMember["label"] = osparc.utils.Utils.firstsUp( + `${"first_name" in orgMember && orgMember["first_name"] != null ? orgMember["first_name"] : orgMember["login"]}`, + `${orgMember["last_name"] ? orgMember["last_name"] : ""}` + ); reachableMembers[orgMember["gid"]] = orgMember; }); }); 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 065d6efb453..85c786f5445 100644 --- a/services/static-webserver/client/source/class/osparc/utils/Utils.js +++ b/services/static-webserver/client/source/class/osparc/utils/Utils.js @@ -837,7 +837,7 @@ qx.Class.define("osparc.utils.Utils", { firstsUp: function(...args) { const labels = []; args.forEach(arg => labels.push(qx.lang.String.firstUp(arg))); - return labels.join(" "); + return labels.length > 1 ? labels.join(" ") : labels[0]; }, onlyFirstsUp: function(word) {