Skip to content

♻️ [Frontend] Storage calls: Deprecate old endpoints #7231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1176,33 +1176,25 @@ qx.Class.define("osparc.data.Resources", {
"storageLocations": {
useCache: true,
endpoints: {
get: {
getLocations: {
method: "GET",
url: statics.API + "/storage/locations"
}
}
},
/*
* STORAGE DATASETS
* STORAGE
*/
"storageDatasets": {
"storageFiles": {
useCache: false,
endpoints: {
getByLocation: {
method: "GET",
url: statics.API + "/storage/locations/{locationId}/datasets"
}
}
},
/*
* STORAGE FILES
*/
"storageFiles": {
useCache: false,
endpoints: {
getByLocationAndDataset: {
url: statics.API + "/storage/locations/{locationId}/files/metadata"
},
getByStudy: {
method: "GET",
url: statics.API + "/storage/locations/{locationId}/datasets/{datasetId}/metadata"
url: statics.API + "/storage/locations/0/files/metadata?uuid_filter={studyId}"
},
getByNode: {
method: "GET",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ qx.Class.define("osparc.file.FilePicker", {
datasetId: outValue.dataset
}
};
osparc.data.Resources.fetch("storageFiles", "getByLocationAndDataset", params)
osparc.data.Resources.fetch("storageFiles", "getByStudy", params)
.then(files => {
const fileMetadata = files.find(file => file.file_id === outValue.path);
if (fileMetadata) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,11 @@ qx.Class.define("osparc.file.FilesTree", {
locationModel.getChildren().removeAll();
let openThis = null;
datasets.forEach(dataset => {
const studyId = dataset["file_uuid"].split("/")[0];
const datasetData = osparc.data.Converters.createDirEntry(
dataset.display_name,
dataset["label"],
locationId,
dataset.dataset_id
studyId,
);
datasetData.isDataset = true;
datasetData.loaded = false;
Expand All @@ -454,7 +455,7 @@ qx.Class.define("osparc.file.FilesTree", {
locationModel.getChildren().append(datasetModel);

// add cached files
const datasetId = dataset.dataset_id;
const datasetId = studyId;
const cachedData = dataStore.getFilesByLocationAndDatasetCached(locationId, datasetId);
if (cachedData) {
this.__filesToDataset(cachedData.location, cachedData.dataset, cachedData.files);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ qx.Class.define("osparc.store.Data", {
resolve(cachedData);
} else {
// Get available storage locations
osparc.data.Resources.get("storageLocations")
osparc.data.Resources.fetch("storageLocations", "getLocations")
.then(locations => {
// Add them to cache
this.__locationsCached = locations;
Expand Down Expand Up @@ -109,7 +109,7 @@ qx.Class.define("osparc.store.Data", {
locationId
}
};
osparc.data.Resources.fetch("storageDatasets", "getByLocation", params)
osparc.data.Resources.fetch("storageFiles", "getByLocation", params)
.then(datasets => {
const data = {
location: locationId,
Expand Down Expand Up @@ -162,10 +162,10 @@ qx.Class.define("osparc.store.Data", {
const params = {
url: {
locationId,
datasetId
datasetId,
}
};
osparc.data.Resources.fetch("storageFiles", "getByLocationAndDataset", params)
osparc.data.Resources.fetch("storageFiles", "getByStudy", params)
.then(files => {
const data = {
location: locationId,
Expand Down
Loading