Skip to content

Commit 6fdbb54

Browse files
authored
🐛 [Frontend] Do not reload Studies when loading Tags (#7551)
1 parent 1fd77ea commit 6fdbb54

File tree

6 files changed

+24
-4
lines changed

6 files changed

+24
-4
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,11 +676,13 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
676676
this.setMultiSelection(false);
677677
});
678678

679-
const store = osparc.store.Store.getInstance();
680-
store.addListener("changeTags", () => {
679+
const tagsStore = osparc.store.Tags.getInstance();
680+
tagsStore.addListener("tagsChanged", () => {
681681
this.invalidateStudies();
682682
this.__reloadStudies();
683683
}, this);
684+
685+
const store = osparc.store.Store.getInstance();
684686
store.addListener("studyStateChanged", e => {
685687
const {
686688
studyId,

services/static-webserver/client/source/class/osparc/form/tag/TagManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ qx.Class.define("osparc.form.tag.TagManager", {
4242
if (!title) {
4343
title = qx.locale.Manager.tr("Apply Tags");
4444
}
45-
return osparc.ui.window.Window.popUpInWindow(tagManager, title, 280, null).set({
45+
return osparc.ui.window.Window.popUpInWindow(tagManager, title, 300, null).set({
4646
allowMinimize: false,
4747
allowMaximize: false,
4848
showMinimize: false,

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
*/

services/static-webserver/client/source/class/osparc/store/Tags.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ qx.Class.define("osparc.store.Tags", {
119119
.then(accessRightsArray => {
120120
const accessRights = {};
121121
accessRightsArray.forEach(ar => accessRights[ar.gid] = ar);
122-
tag.setAccessRights(accessRights)
122+
tag.setAccessRights(accessRights);
123123
})
124124
.catch(err => console.error(err));
125125
},

services/static-webserver/client/source/class/osparc/utils/Utils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ qx.Class.define("osparc.utils.Utils", {
9595
if (control && control.getContentElement()) {
9696
control.getContentElement().setAttribute("autocomplete", "off");
9797
control.getContentElement().setAttribute("type", "search");
98+
control.getContentElement().setAttribute("name", "osparc-nope1234");
9899
}
99100
},
100101

0 commit comments

Comments
 (0)