Skip to content

Commit 47ac1b3

Browse files
committed
suggest sharing
1 parent 51c2cb5 commit 47ac1b3

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

services/static-webserver/client/source/class/osparc/editor/AnnotationNoteCreator.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
qx.Class.define("osparc.editor.AnnotationNoteCreator", {
1919
extend: qx.ui.core.Widget,
2020

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

24+
this.__study = study;
25+
2426
this._setLayout(new qx.ui.layout.VBox(10));
2527

2628
this.getChildControl("instructions");
@@ -93,6 +95,18 @@ qx.Class.define("osparc.editor.AnnotationNoteCreator", {
9395
const {
9496
selectedGids,
9597
} = e.getData();
98+
99+
const currentAccessRights = this.__study.getAccessRights();
100+
console.log("currentAccessRights", currentAccessRights);
101+
console.log("selectedGids", selectedGids);
102+
const proposeSharing = [];
103+
selectedGids.forEach(selectedGid => {
104+
if (!(parseInt(selectedGid) in currentAccessRights)) {
105+
proposeSharing.push(parseInt(selectedGid));
106+
}
107+
});
108+
console.log("share?", proposeSharing);
109+
96110
if (selectedGids) {
97111
collaboratorsManager.close();
98112
this.__setRecipientGid(selectedGids[0]);

services/static-webserver/client/source/class/osparc/workbench/WorkbenchUI.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1927,7 +1927,7 @@ qx.Class.define("osparc.workbench.WorkbenchUI", {
19271927
serializeData.attributes = initPos;
19281928
}
19291929
if (type === "note") {
1930-
const noteEditor = new osparc.editor.AnnotationNoteCreator();
1930+
const noteEditor = new osparc.editor.AnnotationNoteCreator(this.getStudy());
19311931
const win = osparc.editor.AnnotationNoteCreator.popUpInWindow(noteEditor);
19321932
noteEditor.addListener("addNote", () => {
19331933
const gid = noteEditor.getRecipientGid();

0 commit comments

Comments
 (0)