Skip to content

Commit c07e651

Browse files
committed
aesthetics
1 parent 3a98a7a commit c07e651

File tree

3 files changed

+47
-24
lines changed

3 files changed

+47
-24
lines changed

services/static-webserver/client/source/class/osparc/desktop/organizations/MembersList.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ qx.Class.define("osparc.desktop.organizations.MembersList", {
2323

2424
this._setLayout(new qx.ui.layout.VBox(10));
2525

26-
this._add(this.__createIntroText());
26+
this._add(this.__createAddMembersText());
2727
this._add(this.__getMemberInvitation());
2828
this._add(this.__getRolesToolbar());
2929
this._add(this.__getMembersFilter());
@@ -81,6 +81,7 @@ qx.Class.define("osparc.desktop.organizations.MembersList", {
8181
__currentOrg: null,
8282
__introLabel: null,
8383
__memberInvitation: null,
84+
__changeRoleLabel: null,
8485
__membersModel: null,
8586

8687
setCurrentOrg: function(orgModel) {
@@ -91,7 +92,7 @@ qx.Class.define("osparc.desktop.organizations.MembersList", {
9192
this.__reloadOrgMembers();
9293
},
9394

94-
__createIntroText: function() {
95+
__createAddMembersText: function() {
9596
const intro = this.__introLabel = new qx.ui.basic.Label().set({
9697
alignX: "left",
9798
rich: true,
@@ -123,14 +124,24 @@ qx.Class.define("osparc.desktop.organizations.MembersList", {
123124
},
124125

125126
__getRolesToolbar: function() {
126-
return osparc.data.Roles.createRolesOrgInfo();
127+
const hBoxWithRoles = osparc.data.Roles.createRolesOrgInfo();
128+
129+
const changeRoleLabel = this.__changeRoleLabel = new qx.ui.basic.Label().set({
130+
alignX: "left",
131+
value: this.tr("You can change the role of the existing members."),
132+
font: "text-13",
133+
visibility: "hidden",
134+
});
135+
hBoxWithRoles.addAt(changeRoleLabel, 0);
136+
137+
return hBoxWithRoles;
127138
},
128139

129140
__getMembersFilter: function() {
130141
const filter = new osparc.filter.TextFilter("text", "organizationMembersList").set({
131-
allowStretchX: true,
132-
margin: [0, 10, 5, 10]
142+
// margin: [0, 10, 5, 10]
133143
});
144+
filter.setCompact(true);
134145
return filter;
135146
},
136147

@@ -212,14 +223,16 @@ qx.Class.define("osparc.desktop.organizations.MembersList", {
212223
const canIDelete = organization.getAccessRights()["delete"];
213224

214225
const introText = canIWrite ?
215-
this.tr("You can add new members and promote or demote existing ones.<br>In order to add new members, type their username or email if this is public.") :
226+
this.tr("In order to add new members, type their username or email if this is public.") :
216227
this.tr("You can't add new members to this Organization. Please contact an Administrator or Manager.");
217228
this.__introLabel.setValue(introText);
218229

219230
this.__memberInvitation.set({
220231
enabled: canIWrite
221232
});
222233

234+
this.__changeRoleLabel.setVisibility(canIWrite ? "visible" : "excluded");
235+
223236
const myGroupId = osparc.auth.Data.getInstance().getGroupId();
224237
const membersList = [];
225238
const groupMembers = organization.getGroupMembers();

services/static-webserver/client/source/class/osparc/filter/TextFilter.js

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ qx.Class.define("osparc.filter.TextFilter", {
3535
allowStretchY: false
3636
});
3737

38-
this.__textField = this.getChildControl("textfield");
39-
38+
this.getChildControl("textfield");
4039
this.getChildControl("clearbutton");
4140

4241
this.__attachEventHandlers();
@@ -46,18 +45,23 @@ qx.Class.define("osparc.filter.TextFilter", {
4645
appearance: {
4746
refine: true,
4847
init: "textfilter"
49-
}
48+
},
49+
50+
compact: {
51+
check: "Boolean",
52+
init: false,
53+
apply: "__applyCompact",
54+
},
5055
},
5156

5257
members: {
53-
__textField: null,
54-
5558
/**
5659
* Function that resets the field and dispatches the update.
5760
*/
5861
reset: function() {
59-
this.__textField.resetValue();
60-
this.__textField.fireDataEvent("input", "");
62+
const textField = this.getChildControl("textfield");
63+
textField.resetValue();
64+
textField.fireDataEvent("input", "");
6165
},
6266

6367
_createChildControlImpl: function(id) {
@@ -78,7 +82,7 @@ qx.Class.define("osparc.filter.TextFilter", {
7882
case "clearbutton":
7983
control = new osparc.ui.basic.IconButton("@MaterialIcons/close/12", () => {
8084
this.reset();
81-
this.__textField.focus();
85+
this.getChildControl("textfield").focus();
8286
});
8387
this._add(control, {
8488
right: 0,
@@ -89,8 +93,21 @@ qx.Class.define("osparc.filter.TextFilter", {
8993
return control || this.base(arguments, id);
9094
},
9195

96+
__applyCompact: function(compact) {
97+
this.set({
98+
allowStretchX: compact,
99+
allowGrowX: compact,
100+
maxHeight: compact ? 30 : null,
101+
margin: compact ? 0 : null,
102+
});
103+
104+
this.getChildControl("clearbutton").setLayoutProperties({
105+
bottom: compact ? 4 : 6,
106+
});
107+
},
108+
92109
__attachEventHandlers: function() {
93-
this.__textField.addListener("input", evt => {
110+
this.getChildControl("textfield").addListener("input", evt => {
94111
this._filterChange(evt.getData().trim().toLowerCase());
95112
});
96113
}

services/static-webserver/client/source/class/osparc/share/NewCollaboratorsManager.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,8 @@ qx.Class.define("osparc.share.NewCollaboratorsManager", {
6969
const toolbar = new qx.ui.container.Composite(new qx.ui.layout.HBox(10).set({
7070
alignY: "middle",
7171
}));
72-
const filter = this.__textFilter = new osparc.filter.TextFilter("name", "collaboratorsManager").set({
73-
allowGrowX: true,
74-
margin: 0,
75-
allowStretchX: true,
76-
maxHeight: 30,
77-
});
78-
filter.getChildControl("clearbutton").setLayoutProperties({
79-
bottom: 4,
80-
});
72+
const filter = this.__textFilter = new osparc.filter.TextFilter("name", "collaboratorsManager");
73+
filter.setCompact(true);
8174
this.addListener("appear", () => filter.getChildControl("textfield").focus());
8275
toolbar.add(filter, {
8376
flex: 1

0 commit comments

Comments
 (0)