Skip to content

Commit e094738

Browse files
committed
getReviewedUsers
1 parent 78abf4b commit e094738

File tree

2 files changed

+16
-48
lines changed

2 files changed

+16
-48
lines changed

services/static-webserver/client/source/class/osparc/data/Resources.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,10 @@ qx.Class.define("osparc.data.Resources", {
10651065
method: "GET",
10661066
url: statics.API + "/admin/user-accounts?review_status=PENDING"
10671067
},
1068+
getReviewedUsers: {
1069+
method: "GET",
1070+
url: statics.API + "/admin/user-accounts?review_status=REVIEWED"
1071+
},
10681072
approveUser: {
10691073
method: "POST",
10701074
url: statics.API + "/admin/user-accounts:approve"

services/static-webserver/client/source/class/osparc/po/UsersPending.js

Lines changed: 12 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -20,50 +20,6 @@ qx.Class.define("osparc.po.UsersPending", {
2020
extend: osparc.po.BaseView,
2121

2222
statics: {
23-
getPendingUsers: function() {
24-
return new Promise(resolve => {
25-
resolve({
26-
data: [{
27-
name: "John Doe",
28-
29-
date: "2025-01-01 00:00:00.702394",
30-
status: "PENDING",
31-
info: {
32-
"institution": "ETH Zurich",
33-
"department": "Department of Physics",
34-
"position": "PhD Student",
35-
"country": "Switzerland",
36-
"city": "Zurich",
37-
},
38-
}, {
39-
name: "Jane Doe",
40-
41-
date: "2025-01-01 00:01:00.702394",
42-
status: "REJECTED",
43-
info: {
44-
"institution": "ETH Zurich",
45-
"department": "Department of Physics",
46-
"position": "PhD Student",
47-
"country": "Switzerland",
48-
"city": "Zurich",
49-
},
50-
}, {
51-
name: "Alice Smith",
52-
53-
date: "2025-01-01 00:02:00.702394",
54-
status: "APPROVED",
55-
info: {
56-
"institution": "ETH Zurich",
57-
"department": "Department of Physics",
58-
"position": "PhD Student",
59-
"country": "Switzerland",
60-
"city": "Zurich",
61-
},
62-
}]
63-
});
64-
});
65-
},
66-
6723
createApproveButton: function(email) {
6824
const button = new osparc.ui.form.FetchButton(qx.locale.Manager.tr("Approve"));
6925
button.addListener("execute", () => {
@@ -250,8 +206,12 @@ qx.Class.define("osparc.po.UsersPending", {
250206
break;
251207
}
252208
case "APPROVED": {
209+
/*
253210
const resendEmailButton = this.self().createResendEmailButton(pendingUser.email);
254211
buttonsLayout.add(resendEmailButton);
212+
*/
213+
const rejectButton = this.self().createRejectButton(pendingUser.email);
214+
buttonsLayout.add(rejectButton);
255215
break;
256216
}
257217
}
@@ -260,13 +220,17 @@ qx.Class.define("osparc.po.UsersPending", {
260220
},
261221

262222
__populatePendingUsersLayout: function() {
263-
// osparc.data.Resources.fetch("poUsers", "getPendingUsers", params)
264-
this.self().getPendingUsers()
265-
.then(pendingUsers => {
223+
Promise.all([
224+
osparc.data.Resources.fetch("poUsers", "getPendingUsers"),
225+
osparc.data.Resources.fetch("poUsers", "getReviewedUsers")
226+
])
227+
.then(resps => {
228+
const pendingUsers = resps[0]["data"];
229+
const reviewedUsers = resps[1]["data"];
266230
const pendingUsersLayout = this.getChildControl("pending-users-layout");
267231
pendingUsersLayout.removeAll();
268232
this.__addHeader();
269-
this.__addRows(pendingUsers["data"]);
233+
this.__addRows(pendingUsers.concat(reviewedUsers));
270234
})
271235
.catch(err => osparc.FlashMessenger.logError(err));
272236
}

0 commit comments

Comments
 (0)