diff --git a/services/static-webserver/client/source/class/osparc/auth/Data.js b/services/static-webserver/client/source/class/osparc/auth/Data.js index 306d3032558..2a4b27a9646 100644 --- a/services/static-webserver/client/source/class/osparc/auth/Data.js +++ b/services/static-webserver/client/source/class/osparc/auth/Data.js @@ -147,6 +147,17 @@ qx.Class.define("osparc.auth.Data", { return this.getUsername(); }, + getFullName: function() { + let name = ""; + if (this.getFirstName()) { + name += this.getFirstName(); + } + if (this.getLastName()) { + name += " " + this.getLastName(); + } + return name; + }, + getFriendlyRole: function() { const role = this.getRole(); let friendlyRole = role.replace(/_/g, " "); diff --git a/services/static-webserver/client/source/class/osparc/desktop/account/MyAccount.js b/services/static-webserver/client/source/class/osparc/desktop/account/MyAccount.js index 1d19d05f390..0df1dc1d8be 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/account/MyAccount.js +++ b/services/static-webserver/client/source/class/osparc/desktop/account/MyAccount.js @@ -64,24 +64,17 @@ qx.Class.define("osparc.desktop.account.MyAccount", { authData.bind("username", usernameLabel, "value"); layout.add(usernameLabel); - const nameLabel = new qx.ui.basic.Label().set({ + const fullNameLabel = new qx.ui.basic.Label().set({ font: "text-13", alignX: "center" }); - layout.add(nameLabel); - const updateName = () => { - let name = ""; - if (authData.getFirstName()) { - name += authData.getFirstName(); - } - if (authData.getLastName()) { - name += " " + authData.getLastName(); - } - nameLabel.setValue(name); - } - updateName(); - authData.addListener("changeFirstName", updateName); - authData.addListener("changeLastName", updateName); + layout.add(fullNameLabel); + authData.bind("firstName", fullNameLabel, "value", { + converter: () => authData.getFullName() + }); + authData.bind("lastName", fullNameLabel, "value", { + converter: () => authData.getFullName() + }); if (authData.getRole() !== "user") { const role = authData.getFriendlyRole(); diff --git a/services/static-webserver/client/source/class/osparc/theme/Appearance.js b/services/static-webserver/client/source/class/osparc/theme/Appearance.js index f293cde9228..8f3f01bbf4c 100644 --- a/services/static-webserver/client/source/class/osparc/theme/Appearance.js +++ b/services/static-webserver/client/source/class/osparc/theme/Appearance.js @@ -576,7 +576,6 @@ qx.Theme.define("osparc.theme.Appearance", { decorator: "form-button", cursor: "pointer", padding: 5, - center: true, }; if (states.hovered) { style.decorator = "form-button-hovered";