diff --git a/blocks/Config/initialConfig.js b/blocks/Config/initialConfig.js index f834b7485..1f00bb8e7 100644 --- a/blocks/Config/initialConfig.js +++ b/blocks/Config/initialConfig.js @@ -58,4 +58,6 @@ export const initialConfig = { debug: false, metadata: null, + + uuid: '', }; diff --git a/blocks/Config/normalizeConfigValue.js b/blocks/Config/normalizeConfigValue.js index 835e234d0..8fd7e1295 100644 --- a/blocks/Config/normalizeConfigValue.js +++ b/blocks/Config/normalizeConfigValue.js @@ -91,6 +91,8 @@ const mapping = { groupOutput: asBoolean, userAgentIntegration: asString, debug: asBoolean, + + uuid: asString, }; /** diff --git a/blocks/UploadList/UploadList.js b/blocks/UploadList/UploadList.js index 7f5585cf4..123054409 100644 --- a/blocks/UploadList/UploadList.js +++ b/blocks/UploadList/UploadList.js @@ -143,6 +143,17 @@ export class UploadList extends UploaderBlock { this.subConfigValue('multipleMin', this._throttledHandleCollectionUpdate); this.subConfigValue('multipleMax', this._throttledHandleCollectionUpdate); + this.subConfigValue('uuid', (uuid) => { + const listUUID = uuid !== '' && uuid?.replace(/\\s+/g, '')?.split(','); + this._throttledHandleCollectionUpdate(); + + if (Array.isArray(listUUID) && listUUID?.length > 0) { + for (const uuid of listUUID) { + this.addFileFromUuid(uuid); + } + } + }); + this.sub('*currentActivity', (currentActivity) => { if (!this.couldOpenActivity && currentActivity === this.activityType) { this.$['*currentActivity'] = this.initActivity; diff --git a/types/exported.d.ts b/types/exported.d.ts index d23a3bd48..a22993aa5 100644 --- a/types/exported.d.ts +++ b/types/exported.d.ts @@ -48,6 +48,7 @@ export type ConfigType = { userAgentIntegration: string; debug: boolean; metadata: Metadata | MetadataCallback | null; + uuid: string; }; export type ConfigComplexType = Pick; export type ConfigPlainType = Omit;