Skip to content

Commit ec774ac

Browse files
authored
🐛 Frontend: Service related bug fixes (ITISFoundation#3149)
1 parent b3d7fa3 commit ec774ac

File tree

4 files changed

+24
-11
lines changed

4 files changed

+24
-11
lines changed

services/web/client/source/class/osparc/component/form/json/JsonSchemaForm.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,14 @@ qx.Class.define("osparc.component.form.json.JsonSchemaForm", {
187187
container.setLayout(new qx.ui.layout.VBox());
188188
}
189189
Object.entries(schema.properties).forEach(([key, value], index) => {
190-
const allProps = Object.values(schema.properties);
191-
const nextProp = index < allProps.length - 1 ? allProps[index+1] : null;
190+
// const allProps = Object.values(schema.properties);
191+
// const nextProp = index < allProps.length - 1 ? allProps[index+1] : null;
192192
container.add(this.__expand(key, value, data ? data[key] : data, depth+1, {
193193
required: schema.required && schema.required.includes(key)
194194
}), {
195-
lineBreak: nextProp && nextProp.type === "array" || value.type === "array",
196-
stretch: value.type === "array"
195+
// "lineBreak" and "stretch" are not VBox's properties
196+
// lineBreak: nextProp && nextProp.type === "array" || value.type === "array",
197+
// stretch: value.type === "array"
197198
});
198199
});
199200
return container;

services/web/client/source/class/osparc/component/permissions/Permissions.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ qx.Class.define("osparc.component.permissions.Permissions", {
223223
getCollaborators: function() {
224224
osparc.store.Store.getInstance().getPotentialCollaborators()
225225
.then(potentialCollaborators => {
226-
this.__collaborators = potentialCollaborators;
226+
this.__collaborators = Object.assign(this.__collaborators, potentialCollaborators);
227227
this.__reloadOrganizationsAndMembers();
228228
this.__reloadCollaboratorsList();
229229
});
@@ -284,11 +284,7 @@ qx.Class.define("osparc.component.permissions.Permissions", {
284284
collaborator["accessRights"] = aceessRights[gid];
285285
collaborator["showOptions"] = this._isUserOwner();
286286
const collaboratorModel = qx.data.marshal.Json.createModel(collaborator);
287-
if (parseInt(gid) === osparc.auth.Data.getInstance().getGroupId()) {
288-
this.__collaboratorsModel.insertAt(0, collaboratorModel);
289-
} else {
290-
this.__collaboratorsModel.append(collaboratorModel);
291-
}
287+
this.__collaboratorsModel.append(collaboratorModel);
292288
}
293289
});
294290
},

services/web/client/source/class/osparc/component/permissions/Study.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ qx.Class.define("osparc.component.permissions.Study", {
3333
construct: function(studyData) {
3434
this.__studyData = osparc.data.model.Study.deepCloneStudyObject(studyData);
3535

36-
this.base(arguments, this.__studyData);
36+
const initCollabs = [];
37+
if (osparc.data.Permissions.getInstance().canDo("study.everyone.share")) {
38+
initCollabs.push(this.self().getEveryoneObj());
39+
}
40+
this.base(arguments, this.__studyData, initCollabs);
3741
},
3842

3943
events: {
@@ -89,6 +93,17 @@ qx.Class.define("osparc.component.permissions.Study", {
8993

9094
removeCollaborator: function(studyData, gid) {
9195
return delete studyData["accessRights"][gid];
96+
},
97+
98+
getEveryoneObj: function() {
99+
return {
100+
"gid": 1,
101+
"label": "Everyone",
102+
"description": "",
103+
"thumbnail": null,
104+
"accessRights": this.getCollaboratorAccessRight(),
105+
"collabType": 0
106+
};
92107
}
93108
},
94109

services/web/client/source/class/osparc/data/Permissions.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ qx.Class.define("osparc.data.Permissions", {
121121
"services.all.read",
122122
"user.role.update",
123123
"user.clusters.create",
124+
"study.everyone.share",
124125
"study.snapshot.read",
125126
"study.snapshot.create",
126127
"study.nodestree.uuid.read",

0 commit comments

Comments
 (0)