Skip to content

Commit 70250ad

Browse files
committed
Contact info
1 parent c30485a commit 70250ad

File tree

1 file changed

+121
-34
lines changed
  • services/static-webserver/client/source/class/osparc/user

1 file changed

+121
-34
lines changed

services/static-webserver/client/source/class/osparc/user/UserDetails.js

Lines changed: 121 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,23 @@ qx.Class.define("osparc.user.UserDetails", {
3636
WIDTH: 400,
3737
HEIGHT: 300,
3838

39-
GRID_POS: {
39+
TOP_GRID: {
4040
USERNAME: 0,
4141
FULLNAME: 1,
4242
EMAIL: 2,
4343
PHONE: 3,
4444
USER_ID: 4,
4545
GROUP_ID: 5,
46-
}
46+
},
47+
48+
MIDDLE_GRID: {
49+
INSTITUTION: 0,
50+
ADDRESS: 1,
51+
CITY: 2,
52+
STATE: 3,
53+
COUNTRY: 4,
54+
POSTAL_CODE: 5,
55+
},
4756
},
4857

4958
properties: {
@@ -79,7 +88,7 @@ qx.Class.define("osparc.user.UserDetails", {
7988
});
8089
this.getChildControl("top-layout").add(control);
8190
break;
82-
case "main-info": {
91+
case "top-info": {
8392
const grid = new qx.ui.layout.Grid(10, 6);
8493
grid.setColumnFlex(1, 1);
8594
grid.setColumnAlign(0, "right", "middle");
@@ -89,84 +98,152 @@ qx.Class.define("osparc.user.UserDetails", {
8998
});
9099
break;
91100
}
101+
case "middle-info": {
102+
const grid = new qx.ui.layout.Grid(10, 6);
103+
grid.setColumnFlex(1, 1);
104+
grid.setColumnAlign(0, "right", "middle");
105+
control = new qx.ui.container.Composite(grid);
106+
this.add(control);
107+
break;
108+
}
92109
case "username": {
93-
const title = new qx.ui.basic.Label("Username");
94-
this.getChildControl("main-info").add(title, {
95-
row: this.self().GRID_POS.USERNAME,
110+
this.getChildControl("top-info").add(new qx.ui.basic.Label("Username"), {
111+
row: this.self().TOP_GRID.USERNAME,
96112
column: 0
97113
});
98114
control = new qx.ui.basic.Label();
99-
this.getChildControl("main-info").add(control, {
100-
row: this.self().GRID_POS.USERNAME,
115+
this.getChildControl("top-info").add(control, {
116+
row: this.self().TOP_GRID.USERNAME,
101117
column: 1
102118
});
103119
break;
104120
}
105121
case "fullname": {
106-
const title = new qx.ui.basic.Label("Full Name");
107-
this.getChildControl("main-info").add(title, {
108-
row: this.self().GRID_POS.FULLNAME,
122+
this.getChildControl("top-info").add(new qx.ui.basic.Label("Full Name"), {
123+
row: this.self().TOP_GRID.FULLNAME,
109124
column: 0
110125
});
111126
control = new qx.ui.basic.Label();
112-
this.getChildControl("main-info").add(control, {
113-
row: this.self().GRID_POS.FULLNAME,
127+
this.getChildControl("top-info").add(control, {
128+
row: this.self().TOP_GRID.FULLNAME,
114129
column: 1
115130
});
116131
break;
117132
}
118133
case "email": {
119-
const title = new qx.ui.basic.Label("Email");
120-
this.getChildControl("main-info").add(title, {
121-
row: this.self().GRID_POS.EMAIL,
134+
this.getChildControl("top-info").add(new qx.ui.basic.Label("Email"), {
135+
row: this.self().TOP_GRID.EMAIL,
122136
column: 0
123137
});
124138
control = new qx.ui.basic.Label();
125-
this.getChildControl("main-info").add(control, {
126-
row: this.self().GRID_POS.EMAIL,
139+
this.getChildControl("top-info").add(control, {
140+
row: this.self().TOP_GRID.EMAIL,
127141
column: 1
128142
});
129143
break;
130144
}
131145
case "phone": {
132-
const title = new qx.ui.basic.Label("Phone");
133-
this.getChildControl("main-info").add(title, {
134-
row: this.self().GRID_POS.PHONE,
146+
this.getChildControl("top-info").add(new qx.ui.basic.Label("Phone"), {
147+
row: this.self().TOP_GRID.PHONE,
135148
column: 0
136149
});
137150
control = new qx.ui.basic.Label();
138-
this.getChildControl("main-info").add(control, {
139-
row: this.self().GRID_POS.PHONE,
151+
this.getChildControl("top-info").add(control, {
152+
row: this.self().TOP_GRID.PHONE,
140153
column: 1
141154
});
142155
break;
143156
}
144157
case "user-id": {
145-
const title = new qx.ui.basic.Label("User ID");
146-
this.getChildControl("main-info").add(title, {
147-
row: this.self().GRID_POS.USER_ID,
158+
this.getChildControl("top-info").add(new qx.ui.basic.Label("User ID"), {
159+
row: this.self().TOP_GRID.USER_ID,
148160
column: 0
149161
});
150162
control = new qx.ui.basic.Label();
151-
this.getChildControl("main-info").add(control, {
152-
row: this.self().GRID_POS.USER_ID,
163+
this.getChildControl("top-info").add(control, {
164+
row: this.self().TOP_GRID.USER_ID,
153165
column: 1
154166
});
155167
break;
156168
}
157169
case "group-id": {
158-
const title = new qx.ui.basic.Label("Group ID");
159-
this.getChildControl("main-info").add(title, {
160-
row: this.self().GRID_POS.GROUP_ID,
170+
this.getChildControl("top-info").add(new qx.ui.basic.Label("Group ID"), {
171+
row: this.self().TOP_GRID.GROUP_ID,
161172
column: 0
162173
});
163174
control = new qx.ui.basic.Label();
164-
this.getChildControl("main-info").add(control, {
165-
row: this.self().GRID_POS.GROUP_ID,
175+
this.getChildControl("top-info").add(control, {
176+
row: this.self().TOP_GRID.GROUP_ID,
166177
column: 1
167178
});
168179
break;
169180
}
181+
case "institution":
182+
this.getChildControl("middle-info").add(new qx.ui.basic.Label("Institution"), {
183+
row: this.self().MIDDLE_GRID.INSTITUTION,
184+
column: 0
185+
});
186+
control = new qx.ui.basic.Label();
187+
this.getChildControl("middle-info").add(control, {
188+
row: this.self().MIDDLE_GRID.INSTITUTION,
189+
column: 1
190+
});
191+
break;
192+
case "address":
193+
this.getChildControl("middle-info").add(new qx.ui.basic.Label("Address"), {
194+
row: this.self().MIDDLE_GRID.ADDRESS,
195+
column: 0
196+
});
197+
control = new qx.ui.basic.Label();
198+
this.getChildControl("middle-info").add(control, {
199+
row: this.self().MIDDLE_GRID.ADDRESS,
200+
column: 1
201+
});
202+
break;
203+
case "city":
204+
this.getChildControl("middle-info").add(new qx.ui.basic.Label("City"), {
205+
row: this.self().MIDDLE_GRID.CITY,
206+
column: 0
207+
});
208+
control = new qx.ui.basic.Label();
209+
this.getChildControl("middle-info").add(control, {
210+
row: this.self().MIDDLE_GRID.CITY,
211+
column: 1
212+
});
213+
break;
214+
case "state":
215+
this.getChildControl("middle-info").add(new qx.ui.basic.Label("State"), {
216+
row: this.self().MIDDLE_GRID.STATE,
217+
column: 0
218+
});
219+
control = new qx.ui.basic.Label();
220+
this.getChildControl("middle-info").add(control, {
221+
row: this.self().MIDDLE_GRID.STATE,
222+
column: 1
223+
});
224+
break;
225+
case "country":
226+
this.getChildControl("middle-info").add(new qx.ui.basic.Label("Country"), {
227+
row: this.self().MIDDLE_GRID.COUNTRY,
228+
column: 0
229+
});
230+
control = new qx.ui.basic.Label();
231+
this.getChildControl("middle-info").add(control, {
232+
row: this.self().MIDDLE_GRID.COUNTRY,
233+
column: 1
234+
});
235+
break;
236+
case "postal-code":
237+
this.getChildControl("middle-info").add(new qx.ui.basic.Label("Postal Code"), {
238+
row: this.self().MIDDLE_GRID.POSTAL_CODE,
239+
column: 0
240+
});
241+
control = new qx.ui.basic.Label();
242+
this.getChildControl("middle-info").add(control, {
243+
row: this.self().MIDDLE_GRID.POSTAL_CODE,
244+
column: 1
245+
});
246+
break;
170247
}
171248
return control || this.base(arguments, id);
172249
},
@@ -200,12 +277,22 @@ qx.Class.define("osparc.user.UserDetails", {
200277
this.setCaption(user.getUsername());
201278

202279
this.getChildControl("thumbnail").setSource(user.createThumbnail(96));
280+
281+
// top grid
203282
this.getChildControl("username").setValue(user.getUsername());
204283
this.getChildControl("fullname").setValue([user.getFirstName(), user.getLastName()].filter(Boolean).join(" "));
205284
this.getChildControl("email").setValue(user.getEmail());
206-
this.getChildControl("phone").setValue(user.getPhoneNumber());
285+
this.getChildControl("phone").setValue(user.getPhoneNumber() || "-");
207286
this.getChildControl("user-id").setValue(String(user.getUserId()));
208287
this.getChildControl("group-id").setValue(String(user.getGroupId()));
288+
289+
// middle grid
290+
this.getChildControl("institution").setValue(user.getInstitution() || "-");
291+
this.getChildControl("address").setValue(user.getAddress() || "-");
292+
this.getChildControl("city").setValue(user.getCity() || "-");
293+
this.getChildControl("state").setValue(user.getState() || "-");
294+
this.getChildControl("country").setValue(user.getCountry() || "-");
295+
this.getChildControl("postal-code").setValue(user.getPostalCode() || "-");
209296
},
210297
}
211298
});

0 commit comments

Comments
 (0)