Skip to content

Commit 62b874c

Browse files
committed
bound shared field
1 parent 64f94c8 commit 62b874c

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

services/static-webserver/client/source/class/osparc/info/StudyMedium.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ qx.Class.define("osparc.info.StudyMedium", {
119119
}, {
120120
label: this.tr("ACCESS RIGHTS"),
121121
view: osparc.info.StudyUtils.createAccessRights(this.getStudy())
122+
}, {
123+
label: this.tr("SHARED"),
124+
view: osparc.info.StudyUtils.createShared(this.getStudy())
122125
}, {
123126
label: this.tr("CREATED"),
124127
view: osparc.info.StudyUtils.createCreationDate(this.getStudy())

services/static-webserver/client/source/class/osparc/info/StudyUtils.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,20 @@ qx.Class.define("osparc.info.StudyUtils", {
101101
return accessRights;
102102
},
103103

104+
/**
105+
* @param study {osparc.data.model.Study} Study Model
106+
*/
107+
createShared: function(study) {
108+
const isShared = new qx.ui.basic.Label();
109+
const populateLabel = () => {
110+
const nCollabs = Object.keys(study.getAccessRights()).length;
111+
isShared.setValue(nCollabs === 1 ? qx.locale.Manager.tr("Not Shared") : "+" + String(nCollabs-1));
112+
}
113+
study.addListener("changeAccessRights", () => populateLabel());
114+
populateLabel();
115+
return isShared;
116+
},
117+
104118
/**
105119
* @param study {osparc.data.model.Study} Study Model
106120
*/

0 commit comments

Comments
 (0)