Skip to content

Commit 27a690e

Browse files
committed
[skip ci] minor
1 parent 2b253f8 commit 27a690e

File tree

1 file changed

+43
-43
lines changed
  • services/static-webserver/client/source/class/osparc/file

1 file changed

+43
-43
lines changed

services/static-webserver/client/source/class/osparc/file/FilesTree.js

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -133,18 +133,17 @@ qx.Class.define("osparc.file.FilesTree", {
133133
__datasets: null,
134134
__loadPaths: null,
135135

136-
__resetChecks: function() {
137-
this.__locations = new Set();
138-
this.__datasets = new Set();
139-
},
140-
141136
resetCache: function() {
142137
this.__resetChecks();
143138

144139
const dataStore = osparc.store.Data.getInstance();
145140
dataStore.resetCache();
146141
},
147142

143+
populateTree: function() {
144+
return this.__populateLocations();
145+
},
146+
148147
populateStudyTree: function(studyId) {
149148
const treeName = osparc.product.Utils.getStudyAlias({firstUpperCase: true}) + " Files";
150149
this.__resetTree(treeName);
@@ -198,10 +197,6 @@ qx.Class.define("osparc.file.FilesTree", {
198197
});
199198
},
200199

201-
populateTree: function() {
202-
return this.__populateLocations();
203-
},
204-
205200
loadFilePath: function(outFileVal) {
206201
const locationId = outFileVal.store;
207202
let datasetId = "dataset" in outFileVal ? outFileVal.dataset : null;
@@ -217,40 +212,9 @@ qx.Class.define("osparc.file.FilesTree", {
217212
this.__populateLocations();
218213
},
219214

220-
__addToLoadFilePath: function(locationId, datasetId, pathId) {
221-
if (datasetId) {
222-
if (!(locationId in this.__loadPaths)) {
223-
this.__loadPaths[locationId] = {};
224-
}
225-
if (!(datasetId in this.__loadPaths[locationId])) {
226-
this.__loadPaths[locationId][datasetId] = new Set();
227-
}
228-
this.__loadPaths[locationId][datasetId].add(pathId);
229-
}
230-
},
231-
232-
__hasLocationNeedToBeLoaded: function(locationId) {
233-
return (locationId in this.__loadPaths) && (Object.keys(this.__loadPaths[locationId]).length > 0);
234-
},
235-
236-
__hasDatasetNeedToBeLoaded: function(locationId, datasetId) {
237-
return (locationId in this.__loadPaths) && (datasetId in this.__loadPaths[locationId]) && (this.__loadPaths[locationId][datasetId].size > 0);
238-
},
239-
240-
__filesReceived: function(locationId, datasetId, files) {
241-
if (this.__hasDatasetNeedToBeLoaded(locationId, datasetId)) {
242-
const paths = Array.from(this.__loadPaths[locationId][datasetId]);
243-
for (let i=0; i<paths.length; i++) {
244-
const path = paths[i];
245-
for (let j=0; j<files.length; j++) {
246-
const file = files[j];
247-
if (file === path) {
248-
this.__loadPaths[locationId].delete(datasetId);
249-
return;
250-
}
251-
}
252-
}
253-
}
215+
__resetChecks: function() {
216+
this.__locations = new Set();
217+
this.__datasets = new Set();
254218
},
255219

256220
__resetTree: function(treeName, itemId) {
@@ -350,6 +314,42 @@ qx.Class.define("osparc.file.FilesTree", {
350314
}
351315
},
352316

317+
__addToLoadFilePath: function(locationId, datasetId, pathId) {
318+
if (datasetId) {
319+
if (!(locationId in this.__loadPaths)) {
320+
this.__loadPaths[locationId] = {};
321+
}
322+
if (!(datasetId in this.__loadPaths[locationId])) {
323+
this.__loadPaths[locationId][datasetId] = new Set();
324+
}
325+
this.__loadPaths[locationId][datasetId].add(pathId);
326+
}
327+
},
328+
329+
__hasLocationNeedToBeLoaded: function(locationId) {
330+
return (locationId in this.__loadPaths) && (Object.keys(this.__loadPaths[locationId]).length > 0);
331+
},
332+
333+
__hasDatasetNeedToBeLoaded: function(locationId, datasetId) {
334+
return (locationId in this.__loadPaths) && (datasetId in this.__loadPaths[locationId]) && (this.__loadPaths[locationId][datasetId].size > 0);
335+
},
336+
337+
__filesReceived: function(locationId, datasetId, files) {
338+
if (this.__hasDatasetNeedToBeLoaded(locationId, datasetId)) {
339+
const paths = Array.from(this.__loadPaths[locationId][datasetId]);
340+
for (let i=0; i<paths.length; i++) {
341+
const path = paths[i];
342+
for (let j=0; j<files.length; j++) {
343+
const file = files[j];
344+
if (file === path) {
345+
this.__loadPaths[locationId].delete(datasetId);
346+
return;
347+
}
348+
}
349+
}
350+
}
351+
},
352+
353353
__populateLocation: function(locationId = null) {
354354
if (locationId !== null) {
355355
const locationModel = this.__getLocationModel(locationId);

0 commit comments

Comments
 (0)