Skip to content

Commit 16664b9

Browse files
committed
getFriendlyUsername
1 parent 2e9dff4 commit 16664b9

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

services/static-webserver/client/source/class/osparc/auth/Data.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ qx.Class.define("osparc.auth.Data", {
142142
return osparc.utils.Utils.cookie.getCookie("user") === "logout";
143143
},
144144

145+
getFriendlyUsername: function() {
146+
const firstName = this.getFirstName();
147+
if (firstName) {
148+
return firstName;
149+
}
150+
return this.getUsername();
151+
},
152+
145153
getFriendlyRole: function() {
146154
const role = this.getRole();
147155
let friendlyRole = role.replace(/_/g, " ");

services/static-webserver/client/source/class/osparc/product/quickStart/s4l/Welcome.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ qx.Class.define("osparc.product.quickStart.s4l.Welcome", {
5555
});
5656
content.add(intro1);
5757

58-
const welcomeText = this.tr("Welcome onboard ") + osparc.utils.Utils.capitalize(osparc.auth.Data.getInstance().getUsername()) + ",";
58+
const welcomeText = this.tr("Welcome onboard ") + osparc.utils.Utils.capitalize(osparc.auth.Data.getInstance().getFriendlyUsername()) + ",";
5959
const welcome = osparc.product.quickStart.Utils.createLabel(welcomeText);
6060
content.add(welcome);
6161

services/static-webserver/client/source/class/osparc/product/quickStart/s4lacad/Welcome.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ qx.Class.define("osparc.product.quickStart.s4lacad.Welcome", {
5555
});
5656
content.add(intro1);
5757

58-
const welcomeText = this.tr("Welcome onboard ") + osparc.utils.Utils.capitalize(osparc.auth.Data.getInstance().getUsername()) + ",";
58+
const welcomeText = this.tr("Welcome onboard ") + osparc.utils.Utils.capitalize(osparc.auth.Data.getInstance().getFriendlyUsername()) + ",";
5959
const welcome = osparc.product.quickStart.Utils.createLabel(welcomeText);
6060
content.add(welcome);
6161

services/static-webserver/client/source/class/osparc/product/quickStart/s4llite/Welcome.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ qx.Class.define("osparc.product.quickStart.s4llite.Welcome", {
2525

2626
members: {
2727
_populateCard: function() {
28-
const welcomeText = this.tr("Welcome onboard ") + osparc.utils.Utils.capitalize(osparc.auth.Data.getInstance().getUsername()) + ",";
28+
const welcomeText = this.tr("Welcome onboard ") + osparc.utils.Utils.capitalize(osparc.auth.Data.getInstance().getFriendlyUsername()) + ",";
2929
const welcome = osparc.product.quickStart.Utils.createLabel(welcomeText);
3030
this._add(welcome);
3131

services/static-webserver/client/source/class/osparc/product/quickStart/tis/Welcome.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ qx.Class.define("osparc.product.quickStart.tis.Welcome", {
2525

2626
members: {
2727
_populateCard: function() {
28-
const welcomeText = this.tr("Welcome onboard ") + osparc.utils.Utils.capitalize(osparc.auth.Data.getInstance().getUsername()) + ",";
28+
const welcomeText = this.tr("Welcome onboard ") + osparc.utils.Utils.capitalize(osparc.auth.Data.getInstance().getFriendlyUsername()) + ",";
2929
const welcome = osparc.product.quickStart.Utils.createLabel(welcomeText);
3030
this._add(welcome);
3131

0 commit comments

Comments
 (0)