Skip to content

Commit 30c8967

Browse files
authored
Merge branch 'master' into fix/trash-paging
2 parents 3e9c34c + ee36743 commit 30c8967

File tree

92 files changed

+676
-1313
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+676
-1313
lines changed

.env-devel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,10 @@ SIMCORE_VCS_RELEASE_TAG=latest
348348
STUDIES_ACCESS_ANONYMOUS_ALLOWED=0
349349
STUDIES_DEFAULT_SERVICE_THUMBNAIL=https://via.placeholder.com/170x120.png
350350
TRACING_OPENTELEMETRY_COLLECTOR_BATCH_SIZE=2
351-
TRACING_OPENTELEMETRY_COLLECTOR_PORT=4318
352351
TRACING_OPENTELEMETRY_COLLECTOR_ENDPOINT=http://opentelemetry-collector
353-
TRACING_OPENTELEMETRY_COLLECTOR_SAMPLING_PERCENTAGE=100
354352
TRACING_OPENTELEMETRY_COLLECTOR_EXPORTER_ENDPOINT=http://jaeger:4318
353+
TRACING_OPENTELEMETRY_COLLECTOR_PORT=4318
354+
TRACING_OPENTELEMETRY_COLLECTOR_SAMPLING_PERCENTAGE=100
355355
TRAEFIK_SIMCORE_ZONE=internal_simcore_stack
356356
TWILIO_ACCOUNT_SID=DUMMY
357357
TWILIO_AUTH_TOKEN=DUMMY
@@ -365,8 +365,8 @@ WEBSERVER_DEV_FEATURES_ENABLED=0
365365
WEBSERVER_DIAGNOSTICS={}
366366
WEBSERVER_EMAIL={}
367367
WEBSERVER_EXPORTER={}
368-
WEBSERVER_FRONTEND={}
369368
WEBSERVER_FOLDERS=1
369+
WEBSERVER_FRONTEND={}
370370
WEBSERVER_GARBAGE_COLLECTOR=null
371371
WEBSERVER_GROUPS=1
372372
WEBSERVER_GUNICORN_CMD_ARGS=--timeout=180

api/specs/web-server/_projects_crud.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from models_library.rest_pagination import Page
3131
from pydantic import BaseModel
3232
from simcore_service_webserver._meta import API_VTAG
33-
from simcore_service_webserver.projects._common_models import ProjectPathParams
33+
from simcore_service_webserver.projects._common.models import ProjectPathParams
3434
from simcore_service_webserver.projects._crud_handlers import ProjectCreateParams
3535
from simcore_service_webserver.projects._crud_handlers_models import (
3636
ProjectActiveQueryParams,

api/specs/web-server/_projects_groups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from fastapi import APIRouter, Depends, status
1010
from models_library.generics import Envelope
1111
from simcore_service_webserver._meta import API_VTAG
12-
from simcore_service_webserver.projects._common_models import ProjectPathParams
12+
from simcore_service_webserver.projects._common.models import ProjectPathParams
1313
from simcore_service_webserver.projects._groups_api import ProjectGroupGet
1414
from simcore_service_webserver.projects._groups_handlers import (
1515
_ProjectsGroupsBodyParams,

api/specs/web-server/_projects_wallet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from models_library.projects import ProjectID
1717
from models_library.wallets import WalletID
1818
from simcore_service_webserver._meta import API_VTAG
19-
from simcore_service_webserver.projects._common_models import ProjectPathParams
19+
from simcore_service_webserver.projects._common.models import ProjectPathParams
2020

2121
router = APIRouter(
2222
prefix=f"/{API_VTAG}",

services/static-webserver/client/source/class/osparc/dashboard/CardBase.js

Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ qx.Class.define("osparc.dashboard.CardBase", {
148148
return false;
149149
},
150150

151-
populateShareIcon: async function(shareIcon, accessRights) {
151+
populateShareIcon: function(shareIcon, accessRights) {
152152
const gids = Object.keys(accessRights).map(key => parseInt(key));
153153

154154
const groupsStore = osparc.store.Groups.getInstance();
@@ -169,6 +169,17 @@ qx.Class.define("osparc.dashboard.CardBase", {
169169
}
170170

171171
// Tooltip
172+
const canIWrite = osparc.data.model.Study.canIWrite(accessRights);
173+
const myGroupId = groupsStore.getMyGroupId();
174+
if (gids.length === 0 || (gids.length === 1 && gids[0] === myGroupId)) {
175+
if (canIWrite) {
176+
shareIcon.set({
177+
toolTipText: qx.locale.Manager.tr("Share")
178+
});
179+
}
180+
return;
181+
}
182+
172183
const sharedGrps = [];
173184
const groups = [];
174185
groups.push(groupEveryone);
@@ -181,43 +192,44 @@ qx.Class.define("osparc.dashboard.CardBase", {
181192
gids.splice(idx, 1);
182193
}
183194
});
184-
// once the groups were removed, the remaining group ids are users' primary groups ids
185-
const usersStore = osparc.store.Users.getInstance();
186-
const myGroupId = groupsStore.getMyGroupId();
187-
for (let i=0; i<gids.length; i++) {
188-
const gid = gids[i];
189-
if (myGroupId !== gid) {
190-
const user = await usersStore.getUser(gid);
191-
if (user) {
192-
sharedGrps.push(user);
195+
196+
const hint = new osparc.ui.hint.Hint(shareIcon);
197+
shareIcon.addListener("mouseover", async () => {
198+
hint.show();
199+
200+
// lazy load tooltip, this can be an expensive call
201+
202+
// once the groups were removed, the remaining group ids are users' primary groups ids
203+
const usersStore = osparc.store.Users.getInstance();
204+
for (let i=0; i<gids.length; i++) {
205+
const gid = gids[i];
206+
if (myGroupId !== gid) {
207+
const user = await usersStore.getUser(gid);
208+
if (user) {
209+
sharedGrps.push(user);
210+
}
193211
}
194212
}
195-
}
196213

197-
const canIWrite = osparc.data.model.Study.canIWrite(accessRights);
198-
if (sharedGrps.length === 0) {
199-
if (canIWrite) {
200-
shareIcon.set({
201-
toolTipText: qx.locale.Manager.tr("Share")
202-
});
203-
}
204-
return;
205-
}
206-
const sharedGrpLabels = [];
207-
const maxItems = 6;
208-
for (let i=0; i<sharedGrps.length; i++) {
209-
if (i > maxItems) {
210-
sharedGrpLabels.push("...");
211-
break;
212-
}
213-
const sharedGrpLabel = sharedGrps[i].getLabel();
214-
if (!sharedGrpLabels.includes(sharedGrpLabel)) {
215-
sharedGrpLabels.push(sharedGrpLabel);
214+
if (hint.getText() === "") {
215+
const sharedGrpLabels = [];
216+
const maxItems = 6;
217+
for (let i=0; i<sharedGrps.length; i++) {
218+
if (i > maxItems) {
219+
sharedGrpLabels.push("...");
220+
break;
221+
}
222+
const sharedGrpLabel = sharedGrps[i].getLabel();
223+
if (!sharedGrpLabels.includes(sharedGrpLabel)) {
224+
sharedGrpLabels.push(sharedGrpLabel);
225+
}
226+
}
227+
const hintText = sharedGrpLabels.join("<br>");
228+
if (hintText) {
229+
hint.setText(hintText);
230+
}
216231
}
217-
}
218-
const hintText = sharedGrpLabels.join("<br>");
219-
const hint = new osparc.ui.hint.Hint(shareIcon, hintText);
220-
shareIcon.addListener("mouseover", () => hint.show(), this);
232+
}, this);
221233
shareIcon.addListener("mouseout", () => hint.exclude(), this);
222234
},
223235
},
@@ -920,7 +932,6 @@ qx.Class.define("osparc.dashboard.CardBase", {
920932
});
921933
control.addListener("tap", e => {
922934
e.stopPropagation();
923-
this.setValue(false);
924935
this.fireDataEvent("emptyStudyClicked", this.getUuid());
925936
}, this);
926937
return control;

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,15 @@ qx.Class.define("osparc.desktop.wallets.MembersList", {
208208

209209
const myGroupId = osparc.auth.Data.getInstance().getGroupId();
210210
const membersList = [];
211-
const potentialCollaborators = osparc.store.Groups.getInstance().getPotentialCollaborators(true);
212211
const canIWrite = wallet.getMyAccessRights()["write"];
213-
wallet.getAccessRights().forEach(accessRights => {
212+
const accessRightss = wallet.getAccessRights();
213+
const usersStore = osparc.store.Users.getInstance();
214+
for (let i=0; i<Object.keys(accessRightss).length; i++) {
215+
const accessRights = accessRightss[i];
214216
const gid = parseInt(accessRights["gid"]);
215-
if (Object.prototype.hasOwnProperty.call(potentialCollaborators, gid)) {
216-
// only users or groupMe
217-
const collab = potentialCollaborators[gid];
217+
// only users or groupMe
218+
const collab = await usersStore.getUser(gid);
219+
if (collab) {
218220
const collaborator = {};
219221
collaborator["userId"] = gid === myGroupId ? osparc.auth.Data.getInstance().getUserId() : collab.getUserId();
220222
collaborator["groupId"] = collab.getGroupId();
@@ -250,7 +252,7 @@ qx.Class.define("osparc.desktop.wallets.MembersList", {
250252
collaborator["showOptions"] = Boolean(options.length);
251253
membersList.push(collaborator);
252254
}
253-
});
255+
}
254256
membersList.sort(this.self().sortWalletMembers);
255257
membersList.forEach(member => membersModel.append(qx.data.marshal.Json.createModel(member)));
256258
},

services/static-webserver/client/source/class/osparc/file/FileLabelWithActions.js

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ qx.Class.define("osparc.file.FileLabelWithActions", {
4949

5050
const deleteBtn = this.getChildControl("delete-button");
5151
deleteBtn.addListener("execute", () => this.__deleteSelected(), this);
52+
53+
this.__selection = [];
5254
},
5355

5456
events: {
@@ -61,13 +63,12 @@ qx.Class.define("osparc.file.FileLabelWithActions", {
6163
init: false,
6264
nullable: false,
6365
event: "changeMultiSelect",
64-
apply: "__enableMultiSelection",
66+
apply: "__changeMultiSelection",
6567
},
6668
},
6769

6870
members: {
6971
__selection: null,
70-
__multiSelection: null,
7172

7273
_createChildControlImpl: function(id) {
7374
let control;
@@ -99,9 +100,10 @@ qx.Class.define("osparc.file.FileLabelWithActions", {
99100
return control || this.base(arguments, id);
100101
},
101102

102-
__enableMultiSelection: function() {
103-
this.resetItemSelected();
104-
this.__multiSelection = [];
103+
__changeMultiSelection: function() {
104+
if (this.__selection.length > 1) {
105+
this.resetSelection();
106+
}
105107
},
106108

107109
setItemSelected: function(selectedItem) {
@@ -111,25 +113,25 @@ qx.Class.define("osparc.file.FileLabelWithActions", {
111113
this.getChildControl("delete-button").setEnabled(isFile);
112114
const selectedLabel = this.getChildControl("selected-label");
113115
if (isFile) {
114-
this.__selection = selectedItem;
116+
this.__selection = [selectedItem];
115117
selectedLabel.set({
116118
value: selectedItem.getLabel(),
117119
toolTipText: selectedItem.getFileId()
118120
});
119121
} else {
120-
this.__selection = null;
122+
this.__selection = [];
121123
selectedLabel.set({
122124
value: "",
123125
toolTipText: ""
124126
});
125127
}
126128
} else {
127-
this.resetItemSelected();
129+
this.resetSelection();
128130
}
129131
},
130132

131133
setMultiItemSelected: function(multiSelectionData) {
132-
this.__multiSelection = multiSelectionData;
134+
this.__selection = multiSelectionData;
133135
if (multiSelectionData && multiSelectionData.length) {
134136
if (multiSelectionData.length === 1) {
135137
this.setItemSelected(multiSelectionData[0]);
@@ -140,34 +142,27 @@ qx.Class.define("osparc.file.FileLabelWithActions", {
140142
});
141143
}
142144
} else {
143-
this.resetItemSelected();
145+
this.resetSelection();
144146
}
145147
},
146148

147-
resetItemSelected: function() {
148-
this.__selection = null;
149-
this.__multiSelection = [];
149+
resetSelection: function() {
150+
this.__selection = [];
150151
this.getChildControl("download-button").setEnabled(false);
151152
this.getChildControl("delete-button").setEnabled(false);
152153
this.getChildControl("selected-label").resetValue();
153154
},
154155

155-
getItemSelected: function() {
156-
const selectedItem = this.__selection;
157-
if (selectedItem && osparc.file.FilesTree.isFile(selectedItem)) {
158-
return selectedItem;
159-
}
160-
return null;
161-
},
162-
163156
__retrieveURLAndDownloadSelected: function() {
164157
if (this.isMultiSelect()) {
165-
this.__multiSelection.forEach(selection => {
166-
this.__retrieveURLAndDownloadFile(selection);
158+
this.__selection.forEach(selection => {
159+
if (selection && osparc.file.FilesTree.isFile(selection)) {
160+
this.__retrieveURLAndDownloadFile(selection);
161+
}
167162
});
168-
} else {
169-
const selection = this.getItemSelected();
170-
if (selection) {
163+
} else if (this.__selection.length) {
164+
const selection = this.__selection[0];
165+
if (selection && osparc.file.FilesTree.isFile(selection)) {
171166
this.__retrieveURLAndDownloadFile(selection);
172167
}
173168
}
@@ -176,10 +171,12 @@ qx.Class.define("osparc.file.FileLabelWithActions", {
176171
__deleteSelected: function() {
177172
if (this.isMultiSelect()) {
178173
const requests = [];
179-
this.__multiSelection.forEach(selection => {
180-
const request = this.__deleteFile(selection);
181-
if (request) {
182-
requests.push(request);
174+
this.__selection.forEach(selection => {
175+
if (selection && osparc.file.FilesTree.isFile(selection)) {
176+
const request = this.__deleteFile(selection);
177+
if (request) {
178+
requests.push(request);
179+
}
183180
}
184181
});
185182
Promise.all(requests)
@@ -190,9 +187,9 @@ qx.Class.define("osparc.file.FileLabelWithActions", {
190187
}
191188
});
192189
requests
193-
} else {
194-
const selection = this.getItemSelected();
195-
if (selection) {
190+
} else if (this.__selection.length) {
191+
const selection = this.__selection[0];
192+
if (selection && osparc.file.FilesTree.isFile(selection)) {
196193
const request = this.__deleteFile(selection);
197194
if (request) {
198195
request

0 commit comments

Comments
 (0)