Skip to content

Commit

Permalink
feat: added uuid property in lr-config and upload image
Browse files Browse the repository at this point in the history
  • Loading branch information
Egor Didenko committed Apr 2, 2024
1 parent 9666f21 commit 3e67319
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions blocks/Config/initialConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ export const initialConfig = {
debug: false,

metadata: null,

uuid: '',
};
2 changes: 2 additions & 0 deletions blocks/Config/normalizeConfigValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ const mapping = {
groupOutput: asBoolean,
userAgentIntegration: asString,
debug: asBoolean,

uuid: asString,
};

/**
Expand Down
11 changes: 11 additions & 0 deletions blocks/UploadList/UploadList.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions types/exported.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export type ConfigType = {
userAgentIntegration: string;
debug: boolean;
metadata: Metadata | MetadataCallback | null;
uuid: string;
};
export type ConfigComplexType = Pick<ConfigType, 'metadata'>;
export type ConfigPlainType = Omit<ConfigType, keyof ConfigComplexType>;
Expand Down

0 comments on commit 3e67319

Please sign in to comment.