Skip to content

Commit e341566

Browse files
authored
Merge branch 'master' into pr-osparc-rework-shutdown
2 parents 8d077cb + 801bbde commit e341566

File tree

13 files changed

+234
-65
lines changed

13 files changed

+234
-65
lines changed

.github/workflows/ci-testing-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1810,7 +1810,7 @@ jobs:
18101810
with:
18111811
python-version: ${{ matrix.python }}
18121812
cache-dependency-glob: "**/e2e/requirements/requirements.txt"
1813-
- uses: actions/setup-node@v5.0.0
1813+
- uses: actions/setup-node@v6.0.0
18141814
with:
18151815
node-version: ${{ matrix.node }}
18161816
cache: "npm"

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ jobs:
2929
uses: actions/checkout@v5
3030

3131
- name: Initialize CodeQL tools for scanning
32-
uses: github/codeql-action/init@v3
32+
uses: github/codeql-action/init@v4
3333
with:
3434
languages: ${{ matrix.language }}
3535
config-file: ./.github/codeql/codeql-config.yml
3636

3737
- name: Perform CodeQL Analysis
38-
uses: github/codeql-action/analyze@v3
38+
uses: github/codeql-action/analyze@v4

services/static-webserver/client/source/class/osparc/Application.js

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,10 @@ qx.Class.define("osparc.Application", {
138138
osparc.auth.Manager.getInstance().validateToken()
139139
.then(() => {
140140
const studyId = urlFragment.nav[1];
141-
const loadAfterLogin = { studyId };
141+
const loadAfterLogin = {
142+
id: "startStudy",
143+
studyId,
144+
};
142145
this.__loadMainPage(loadAfterLogin);
143146
})
144147
.catch(() => this.__loadLoginPage());
@@ -157,7 +160,10 @@ qx.Class.define("osparc.Application", {
157160
if (["anonymous", "guest"].includes(data.role.toLowerCase())) {
158161
this.__loadNodeViewerPage(studyId, viewerNodeId);
159162
} else {
160-
const loadAfterLogin = { studyId };
163+
const loadAfterLogin = {
164+
id: "startStudy",
165+
studyId,
166+
};
161167
this.__loadMainPage(loadAfterLogin);
162168
}
163169
});
@@ -171,13 +177,29 @@ qx.Class.define("osparc.Application", {
171177
osparc.auth.Manager.getInstance().validateToken()
172178
.then(() => {
173179
const conversationId = urlFragment.nav[1];
174-
const loadAfterLogin = { conversationId };
180+
const loadAfterLogin = {
181+
id: "openConversation",
182+
conversationId,
183+
};
175184
this.__loadMainPage(loadAfterLogin);
176185
})
177186
.catch(() => this.__loadLoginPage());
178187
}
179188
break;
180189
}
190+
case "review-users": {
191+
// Route: /#/review-users
192+
osparc.utils.Utils.cookie.deleteCookie("user");
193+
osparc.auth.Manager.getInstance().validateToken()
194+
.then(() => {
195+
const loadAfterLogin = {
196+
id: "openReviewUsers",
197+
};
198+
this.__loadMainPage(loadAfterLogin);
199+
})
200+
.catch(() => this.__loadLoginPage());
201+
break;
202+
}
181203
case "registration": {
182204
// Route: /#/registration/?invitation={token}
183205
if (urlFragment.params && urlFragment.params.invitation) {
@@ -516,15 +538,20 @@ qx.Class.define("osparc.Application", {
516538
});
517539
}
518540

519-
if (loadAfterLogin && loadAfterLogin["studyId"]) {
520-
const studyId = loadAfterLogin["studyId"];
521-
osparc.store.Store.getInstance().setCurrentStudyId(studyId);
522-
}
541+
if (loadAfterLogin) {
542+
if (loadAfterLogin["id"] === "startStudy" && loadAfterLogin["studyId"]) {
543+
const studyId = loadAfterLogin["studyId"];
544+
osparc.store.Store.getInstance().setCurrentStudyId(studyId);
545+
}
523546

524-
if (loadAfterLogin && loadAfterLogin["conversationId"]) {
525-
const conversationId = loadAfterLogin["conversationId"];
526-
const supportCenterWindow = osparc.support.SupportCenter.openWindow();
527-
supportCenterWindow.openConversation(conversationId);
547+
if (loadAfterLogin["id"] === "openConversation" && loadAfterLogin["conversationId"]) {
548+
const conversationId = loadAfterLogin["conversationId"];
549+
const supportCenterWindow = osparc.support.SupportCenter.openWindow();
550+
supportCenterWindow.openConversation(conversationId);
551+
}
552+
if (loadAfterLogin["id"] === "openReviewUsers" && osparc.data.Permissions.getInstance().isProductOwner()) {
553+
osparc.po.POCenterWindow.openWindow("reviewUsers");
554+
}
528555
}
529556

530557
const loadViewerPage = () => {

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ qx.Class.define("osparc.data.model.Conversation", {
8282

8383
type: {
8484
check: [
85-
"PROJECT_STATIC",
86-
"PROJECT_ANNOTATION",
87-
"SUPPORT",
85+
"PROJECT_STATIC", // osparc.store.ConversationsProject.TYPES.PROJECT_STATIC
86+
"PROJECT_ANNOTATION", // osparc.store.ConversationsProject.TYPES.PROJECT_ANNOTATION
87+
"SUPPORT", // osparc.store.ConversationsSupport.TYPES.SUPPORT
88+
"SUPPORT_CALL", // osparc.store.ConversationsSupport.TYPES.SUPPORT_CALL
8889
],
8990
nullable: false,
9091
init: null,
@@ -188,7 +189,8 @@ qx.Class.define("osparc.data.model.Conversation", {
188189
return promise
189190
.then(resp => {
190191
const messagesData = resp["data"];
191-
messagesData.forEach(messageData => this._addMessage(messageData));
192+
const markAsUnread = false;
193+
messagesData.forEach(messageData => this._addMessage(messageData, markAsUnread));
192194
this.__nextRequestParams = resp["_links"]["next"];
193195
return resp;
194196
})

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,12 @@ qx.Class.define("osparc.data.model.ConversationSupport", {
184184
},
185185

186186
// overriden
187-
_addMessage: function(messageData) {
187+
_addMessage: function(messageData, markAsUnread = true) {
188188
const message = this.base(arguments, messageData);
189189
this.__evalFirstAndLastMessage();
190190

191191
// mark conversation as unread if the message is from the other party
192-
if (!osparc.data.model.Message.isMyMessage(message)) {
192+
if (markAsUnread && !osparc.data.model.Message.isMyMessage(message)) {
193193
this.setReadBy(false);
194194
}
195195
return message;

services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,10 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", {
166166
study.bind("name", editTitle, "value");
167167

168168
const shareButton = this.getChildControl("study-menu-share");
169-
shareButton.setEnabled(osparc.data.model.Study.canIWrite(study.getAccessRights()));
169+
shareButton.set({
170+
visibility: osparc.auth.Data.getInstance().isGuest() ? "excluded" : "visible",
171+
enabled: osparc.data.model.Study.canIWrite(study.getAccessRights()),
172+
});
170173

171174
const reloadButton = this.getChildControl("study-menu-reload");
172175
study.getUi().bind("mode", reloadButton, "visibility", {

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

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
qx.Class.define("osparc.po.POCenter", {
1919
extend: osparc.ui.window.TabbedView,
2020

21-
construct: function() {
21+
construct: function(openPage) {
2222
this.base(arguments);
2323

2424
const miniProfile = osparc.desktop.account.MyAccount.createMiniProfileView().set({
@@ -31,6 +31,10 @@ qx.Class.define("osparc.po.POCenter", {
3131
this.__addPreRegistrationPage();
3232
this.__addInvitationsPage();
3333
this.__addProductPage();
34+
35+
if (openPage) {
36+
this.__openPage(openPage);
37+
}
3438
},
3539

3640
members: {
@@ -45,7 +49,8 @@ qx.Class.define("osparc.po.POCenter", {
4549
const title = this.tr("Review Users");
4650
const iconSrc = "@FontAwesome5Solid/user-plus/22";
4751
const usersPending = new osparc.po.UsersPending();
48-
this.addTab(title, iconSrc, usersPending);
52+
const page = this.addTab(title, iconSrc, usersPending);
53+
page.pageId = "reviewUsers";
4954
},
5055

5156
__addPreRegistrationPage: function() {
@@ -68,5 +73,14 @@ qx.Class.define("osparc.po.POCenter", {
6873
const productInfo = new osparc.po.ProductInfo();
6974
this.addTab(title, iconSrc, productInfo);
7075
},
76+
77+
__openPage: function(openPage) {
78+
const tabsView = this.getChildControl("tabs-view");
79+
const pages = tabsView.getChildren();
80+
const page = pages.find(page => page.pageId && page.pageId === openPage);
81+
if (page) {
82+
tabsView.setSelection([page]);
83+
}
84+
},
7185
}
7286
});

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@
1818
qx.Class.define("osparc.po.POCenterWindow", {
1919
extend: osparc.ui.window.TabbedWindow,
2020

21-
construct: function() {
21+
construct: function(openPage) {
2222
this.base(arguments, "po-center", this.tr("PO Center"));
2323

24-
const width = 900;
25-
const height = 600;
24+
const width = 1000;
25+
const height = 700;
2626
this.set({
2727
width,
2828
height
2929
});
3030

31-
const poCenter = new osparc.po.POCenter();
31+
const poCenter = new osparc.po.POCenter(openPage);
3232
this._setTabbedView(poCenter);
3333
},
3434

3535
statics: {
36-
openWindow: function() {
37-
const accountWindow = new osparc.po.POCenterWindow();
36+
openWindow: function(openPage) {
37+
const accountWindow = new osparc.po.POCenterWindow(openPage);
3838
accountWindow.center();
3939
accountWindow.open();
4040
return accountWindow;

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

Lines changed: 102 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@
1919
qx.Class.define("osparc.po.Users", {
2020
extend: osparc.po.BaseView,
2121

22+
statics: {
23+
GRID_POS: {
24+
NAME: 0,
25+
EMAIL: 1,
26+
DATE: 2,
27+
ACCOUNT_REQUEST_STATUS: 3,
28+
STATUS: 4,
29+
INFO: 5,
30+
}
31+
},
32+
2233
members: {
2334
_createChildControlImpl: function(id) {
2435
let control;
@@ -37,6 +48,12 @@ qx.Class.define("osparc.po.Users", {
3748
flex: 1
3849
});
3950
break;
51+
case "found-users-layout": {
52+
const grid = new qx.ui.layout.Grid(15, 5);
53+
control = new qx.ui.container.Composite(grid);
54+
this.getChildControl("found-users-container").add(control);
55+
break;
56+
}
4057
}
4158
return control || this.base(arguments, id);
4259
},
@@ -70,6 +87,8 @@ qx.Class.define("osparc.po.Users", {
7087
searchBtn.set({
7188
appearance: "form-button"
7289
});
90+
const commandEsc = new qx.ui.command.Command("Enter");
91+
searchBtn.setCommand(commandEsc);
7392
searchBtn.addListener("execute", () => {
7493
if (!osparc.data.Permissions.getInstance().canDo("user.users.search", true)) {
7594
return;
@@ -100,11 +119,88 @@ qx.Class.define("osparc.po.Users", {
100119
return form;
101120
},
102121

103-
__populateFoundUsersLayout: function(respData) {
104-
const foundUsersContainer = this.getChildControl("found-users-container");
105-
osparc.utils.Utils.removeAllChildren(foundUsersContainer);
106-
const usersRespViewer = new osparc.ui.basic.JsonTreeWidget(respData, "users-data");
107-
foundUsersContainer.add(usersRespViewer);
108-
}
122+
__createHeaderLabel: function(value) {
123+
const label = new qx.ui.basic.Label(value).set({
124+
font: "text-16",
125+
textColor: "text"
126+
});
127+
return label;
128+
},
129+
130+
__addHeader: function() {
131+
const foundUsersLayout = this.getChildControl("found-users-layout");
132+
foundUsersLayout.add(this.__createHeaderLabel(this.tr("Name")), {
133+
row: 0,
134+
column: this.self().GRID_POS.NAME,
135+
});
136+
foundUsersLayout.add(this.__createHeaderLabel(this.tr("Email")), {
137+
row: 0,
138+
column: this.self().GRID_POS.EMAIL,
139+
});
140+
foundUsersLayout.add(this.__createHeaderLabel(this.tr("Date")), {
141+
row: 0,
142+
column: this.self().GRID_POS.DATE,
143+
});
144+
foundUsersLayout.add(this.__createHeaderLabel(this.tr("Request")), {
145+
row: 0,
146+
column: this.self().GRID_POS.ACCOUNT_REQUEST_STATUS,
147+
});
148+
foundUsersLayout.add(this.__createHeaderLabel(this.tr("Status")), {
149+
row: 0,
150+
column: this.self().GRID_POS.STATUS,
151+
});
152+
},
153+
154+
__populateFoundUsersLayout: function(foundUsers) {
155+
const foundUsersLayout = this.getChildControl("found-users-layout");
156+
foundUsersLayout.removeAll();
157+
158+
this.__addHeader();
159+
foundUsers.forEach((user, index) => {
160+
const row = index + 1;
161+
162+
const fullNameLabel = new qx.ui.basic.Label(user.firstName + " " + user.lastName).set({
163+
selectable: true,
164+
});
165+
foundUsersLayout.add(fullNameLabel, {
166+
row,
167+
column: this.self().GRID_POS.NAME,
168+
});
169+
170+
const emailLabel = new qx.ui.basic.Label(user["email"]).set({
171+
selectable: true,
172+
});
173+
foundUsersLayout.add(emailLabel, {
174+
row,
175+
column: this.self().GRID_POS.EMAIL,
176+
});
177+
178+
const dateData = user["preRegistrationCreated"] || user["accountRequestReviewedAt"];
179+
const date = dateData ? osparc.utils.Utils.formatDateAndTime(new Date(dateData)) : "-";
180+
const dateLabel = new qx.ui.basic.Label(date);
181+
foundUsersLayout.add(dateLabel, {
182+
row,
183+
column: this.self().GRID_POS.DATE,
184+
});
185+
186+
const accountRequestStatusLabel = new qx.ui.basic.Label(user["accountRequestStatus"]);
187+
foundUsersLayout.add(accountRequestStatusLabel, {
188+
row,
189+
column: this.self().GRID_POS.ACCOUNT_REQUEST_STATUS,
190+
});
191+
192+
const statusLabel = new qx.ui.basic.Label(user["status"]);
193+
foundUsersLayout.add(statusLabel, {
194+
row,
195+
column: this.self().GRID_POS.STATUS,
196+
});
197+
198+
const infoButton = osparc.po.UsersPending.createInfoButton(user);
199+
foundUsersLayout.add(infoButton, {
200+
row,
201+
column: this.self().GRID_POS.INFO,
202+
});
203+
});
204+
},
109205
}
110206
});

0 commit comments

Comments
 (0)