Skip to content

Commit 7f4d2da

Browse files
authored
Merge branch 'master' into is468/empty-trash
2 parents 2244e95 + a63e747 commit 7f4d2da

File tree

4 files changed

+53
-11
lines changed

4 files changed

+53
-11
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ qx.Class.define("osparc.desktop.wallets.MembersList", {
106106
},
107107

108108
__createIntroText: function() {
109-
const msg = this.tr("Only Accountants of an organization can share a wallet with the entire organization and members.");
109+
const msg = this.tr("Only Accountants of an Organization can share a wallet with other users.");
110110
const intro = new qx.ui.basic.Label().set({
111111
value: msg,
112112
alignX: "left",
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* oSPARC - The SIMCORE frontend - https://osparc.io
3+
* Copyright: 2025 IT'IS Foundation - https://itis.swiss
4+
* License: MIT - https://opensource.org/licenses/MIT
5+
* Authors: Odei Maiz (odeimaiz)
6+
*/
7+
8+
qx.Class.define("osparc.filter.SearchingCollaborators", {
9+
extend: qx.ui.basic.Atom,
10+
11+
construct: function() {
12+
this.base(arguments);
13+
14+
this.set({
15+
label: this.tr("Searching..."),
16+
icon: "@FontAwesome5Solid/circle-notch/14",
17+
appearance: "tagbutton",
18+
gap: 10,
19+
});
20+
21+
this.getChildControl("icon").getContentElement().addClass("rotate");
22+
this.getChildControl("label").setTextColor("text");
23+
},
24+
});

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

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ qx.Class.define("osparc.share.NewCollaboratorsManager", {
4444
__resourceData: null,
4545
__showOrganizations: null,
4646
__textFilter: null,
47-
__searchButton: null,
4847
__collabButtonsContainer: null,
48+
__searchingCollaborators: null,
49+
__searchDelayer: null,
4950
__shareButton: null,
5051
__selectedCollaborators: null,
5152
__potentialCollaborators: null,
@@ -72,17 +73,24 @@ qx.Class.define("osparc.share.NewCollaboratorsManager", {
7273
}));
7374
const filter = this.__textFilter = new osparc.filter.TextFilter("name", "collaboratorsManager");
7475
filter.setCompact(true);
75-
this.addListener("appear", () => filter.getChildControl("textfield").focus());
76+
const filterTextField = filter.getChildControl("textfield");
77+
filterTextField.setPlaceholder(this.tr("Search"));
78+
this.addListener("appear", () => filterTextField.focus());
7679
toolbar.add(filter, {
7780
flex: 1
7881
});
79-
const searchButton = this.__searchButton = new osparc.ui.form.FetchButton(this.tr("Search"), "@FontAwesome5Solid/search/12").set({
80-
maxHeight: 30,
82+
filterTextField.addListener("input", e => {
83+
const filterValue = e.getData();
84+
if (this.__searchDelayer) {
85+
clearTimeout(this.__searchDelayer);
86+
}
87+
if (filterValue.length > 3) {
88+
const waitBeforeSearching = 1000;
89+
this.__searchDelayer = setTimeout(() => {
90+
this.__searchUsers();
91+
}, waitBeforeSearching);
92+
}
8193
});
82-
const command = new qx.ui.command.Command("Enter");
83-
searchButton.setCommand(command);
84-
searchButton.addListener("execute", () => this.__searchUsers(), this);
85-
toolbar.add(searchButton);
8694
this.add(toolbar);
8795

8896
const collabButtonsContainer = this.__collabButtonsContainer = new qx.ui.container.Composite(new qx.ui.layout.VBox());
@@ -92,6 +100,10 @@ qx.Class.define("osparc.share.NewCollaboratorsManager", {
92100
flex: 1
93101
});
94102

103+
const searchingCollaborators = this.__searchingCollaborators = new osparc.filter.SearchingCollaborators();
104+
searchingCollaborators.exclude();
105+
this.__collabButtonsContainer.add(searchingCollaborators);
106+
95107
const buttons = new qx.ui.container.Composite(new qx.ui.layout.HBox().set({
96108
alignX: "right"
97109
}));
@@ -105,8 +117,8 @@ qx.Class.define("osparc.share.NewCollaboratorsManager", {
105117
},
106118

107119
__searchUsers: function() {
120+
this.__searchingCollaborators.show();
108121
const text = this.__textFilter.getChildControl("textfield").getValue();
109-
this.__searchButton.setFetching(true);
110122
osparc.store.Users.getInstance().searchUsers(text)
111123
.then(users => {
112124
users.forEach(user => user["collabType"] = 2);
@@ -116,7 +128,7 @@ qx.Class.define("osparc.share.NewCollaboratorsManager", {
116128
console.error(err);
117129
osparc.FlashMessenger.getInstance().logAs(err.message, "ERROR");
118130
})
119-
.finally(() => this.__searchButton.setFetching(false));
131+
.finally(() => this.__searchingCollaborators.exclude());
120132
},
121133

122134
__showProductEveryone: function() {
@@ -208,6 +220,10 @@ qx.Class.define("osparc.share.NewCollaboratorsManager", {
208220
}
209221
this.__collabButtonsContainer.add(this.__collaboratorButton(potentialCollaborator));
210222
});
223+
224+
// move it to last position
225+
this.__collabButtonsContainer.remove(this.__searchingCollaborators);
226+
this.__collabButtonsContainer.add(this.__searchingCollaborators);
211227
},
212228

213229
__shareClicked: function() {

services/static-webserver/client/source/class/osparc/ui/hint/Hint.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ qx.Class.define("osparc.ui.hint.Hint", {
7171

7272
setText: function(text) {
7373
this.getChildControl("label").setValue(text);
74+
// After setting the text, the dimensions of the Hint changed: recenter it
75+
setTimeout(() => this.updatePosition(), 10);
7476
}
7577
}
7678
});

0 commit comments

Comments
 (0)