Skip to content

Commit ac1af68

Browse files
authored
🐛 [Frontend] Studies: list more than 5 studies in folder (#6813)
1 parent 9870a85 commit ac1af68

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -631,16 +631,18 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
631631
// check the entries in currentParams are the same as the reqParams
632632
let sameContext = true;
633633
Object.entries(currentParams).forEach(([key, value]) => {
634-
sameContext &= key in reqParams && reqParams[key] === value;
634+
// loose equality: will do a Number to String conversion if necessary
635+
sameContext &= key in reqParams && reqParams[key] == value;
635636
});
636637
return !sameContext;
637638
},
638639

639640
__getNextPageParams: function() {
640-
if (this._resourcesContainer.getFlatList() && this._resourcesContainer.getFlatList().nextRequest) {
641+
const studiesContainer = this._resourcesContainer.getFlatList();
642+
if (studiesContainer && studiesContainer.nextRequest) {
641643
// Context might have been changed while waiting for the response.
642644
// The new call is on the way, therefore this response can be ignored.
643-
const url = new URL(this._resourcesContainer.getFlatList().nextRequest);
645+
const url = new URL(studiesContainer.nextRequest);
644646
const urlSearchParams = new URLSearchParams(url.search);
645647
const urlParams = {};
646648
for (const [snakeKey, value] of urlSearchParams.entries()) {
@@ -650,12 +652,12 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
650652
const contextChanged = this.__didContextChange(urlParams);
651653
if (
652654
!contextChanged &&
653-
osparc.utils.Utils.hasParamFromURL(this._resourcesContainer.getFlatList().nextRequest, "offset") &&
654-
osparc.utils.Utils.hasParamFromURL(this._resourcesContainer.getFlatList().nextRequest, "limit")
655+
osparc.utils.Utils.hasParamFromURL(studiesContainer.nextRequest, "offset") &&
656+
osparc.utils.Utils.hasParamFromURL(studiesContainer.nextRequest, "limit")
655657
) {
656658
return {
657-
offset: osparc.utils.Utils.getParamFromURL(this._resourcesContainer.getFlatList().nextRequest, "offset"),
658-
limit: osparc.utils.Utils.getParamFromURL(this._resourcesContainer.getFlatList().nextRequest, "limit")
659+
offset: osparc.utils.Utils.getParamFromURL(studiesContainer.nextRequest, "offset"),
660+
limit: osparc.utils.Utils.getParamFromURL(studiesContainer.nextRequest, "limit")
659661
};
660662
}
661663
}

services/static-webserver/client/source/class/osparc/data/model/Workbench.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,10 @@ qx.Class.define("osparc.data.model.Workbench", {
797797
} else {
798798
// patch only what was changed
799799
Object.keys(workbenchDiffs[nodeId]).forEach(changedFieldKey => {
800-
patchData[changedFieldKey] = nodeData[changedFieldKey];
800+
if (nodeData[changedFieldKey] !== undefined) {
801+
// do not patch if it's undefined
802+
patchData[changedFieldKey] = nodeData[changedFieldKey];
803+
}
801804
});
802805
}
803806
const params = {
@@ -807,7 +810,9 @@ qx.Class.define("osparc.data.model.Workbench", {
807810
},
808811
data: patchData
809812
};
810-
promises.push(osparc.data.Resources.fetch("studies", "patchNode", params));
813+
if (Object.keys(patchData).length) {
814+
promises.push(osparc.data.Resources.fetch("studies", "patchNode", params));
815+
}
811816
})
812817
return Promise.all(promises);
813818
}

0 commit comments

Comments
 (0)