Skip to content

Commit 3e67319

Browse files
author
Egor Didenko
committed
feat: added uuid property in lr-config and upload image
1 parent 9666f21 commit 3e67319

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

Diff for: blocks/Config/initialConfig.js

+2
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,6 @@ export const initialConfig = {
5858
debug: false,
5959

6060
metadata: null,
61+
62+
uuid: '',
6163
};

Diff for: blocks/Config/normalizeConfigValue.js

+2
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ const mapping = {
9191
groupOutput: asBoolean,
9292
userAgentIntegration: asString,
9393
debug: asBoolean,
94+
95+
uuid: asString,
9496
};
9597

9698
/**

Diff for: blocks/UploadList/UploadList.js

+11
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,17 @@ export class UploadList extends UploaderBlock {
143143
this.subConfigValue('multipleMin', this._throttledHandleCollectionUpdate);
144144
this.subConfigValue('multipleMax', this._throttledHandleCollectionUpdate);
145145

146+
this.subConfigValue('uuid', (uuid) => {
147+
const listUUID = uuid !== '' && uuid?.replace(/\\s+/g, '')?.split(',');
148+
this._throttledHandleCollectionUpdate();
149+
150+
if (Array.isArray(listUUID) && listUUID?.length > 0) {
151+
for (const uuid of listUUID) {
152+
this.addFileFromUuid(uuid);
153+
}
154+
}
155+
});
156+
146157
this.sub('*currentActivity', (currentActivity) => {
147158
if (!this.couldOpenActivity && currentActivity === this.activityType) {
148159
this.$['*currentActivity'] = this.initActivity;

Diff for: types/exported.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export type ConfigType = {
4848
userAgentIntegration: string;
4949
debug: boolean;
5050
metadata: Metadata | MetadataCallback | null;
51+
uuid: string;
5152
};
5253
export type ConfigComplexType = Pick<ConfigType, 'metadata'>;
5354
export type ConfigPlainType = Omit<ConfigType, keyof ConfigComplexType>;

0 commit comments

Comments
 (0)