Skip to content

Commit

Permalink
Apply lost changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Marishka17 committed Aug 11, 2021
1 parent 45d569f commit 0920d14
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion cvat-core/src/cloud-storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
created_date: undefined,
updated_date: undefined,
manifest_path: undefined,
manifest_set: undefined,
};

for (const property in data) {
Expand Down Expand Up @@ -206,7 +207,7 @@
manifestPath: {
get: () => data.manifest_path,
set: (value) => {
if (typeof value !== 'string') {
if (typeof value === 'string') {
data.manifest_path = value;
} else {
throw new ArgumentError('Value must be a string');
Expand Down Expand Up @@ -303,6 +304,28 @@
updatedDate: {
get: () => data.updated_date,
},
/**
* @name manifests
* @type {string[]}
* @memberof module:API.cvat.classes.CloudStorage
* @instance
* @throws {module:API.cvat.exceptions.ArgumentError}
*/
manifests: {
get: () => data.manifest_set,
set: (manifests) => {
if (Array.isArray(manifests)) {
for (const elem of manifests) {
if (typeof elem !== 'string') {
throw new ArgumentError('Each element of the manifests array must be a string');
}
}
data.manifest_set = manifests;
} else {
throw new ArgumentError('Value must be an array');
}
},
},
}),
);
}
Expand Down Expand Up @@ -409,6 +432,10 @@
initialData.credentials_type = this.credentialsType;
}

if (this.manifests) {
initialData.manifest_set = this.manifests;
}

const cloudStorageData = {
...initialData,
...prepareOptionalFields(this),
Expand All @@ -424,6 +451,7 @@
credentials_type: this.credentialsType,
provider_type: this.providerType,
resource: this.resourceName,
manifest_set: this.manifests,
};

const cloudStorageData = {
Expand Down

0 comments on commit 0920d14

Please sign in to comment.