@capillarytech/creatives-library 6.10.3 → 6.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -84,9 +84,10 @@ export const LineImage = ({
|
|
|
84
84
|
}, [errorMessageTitle, imageSrc, messageTitle, isImageError]);
|
|
85
85
|
|
|
86
86
|
useEffect(() => {
|
|
87
|
-
if (Line
|
|
88
|
-
const imgSrc = get(Line,
|
|
89
|
-
const imgPreview = get(Line,
|
|
87
|
+
if (Line[`uploadedAssetData${index}`] && Object.keys(Line[`uploadedAssetData${index}`]).length) {
|
|
88
|
+
const imgSrc = get(Line, `uploadedAssetData${index}.metaInfo.secure_file_path`, '');
|
|
89
|
+
const imgPreview = get(Line, `uploadedAssetData${index}.metaInfo.secure_file_path_preview`, '');
|
|
90
|
+
actions.clearAsset(index);
|
|
90
91
|
if (imgSrc) {
|
|
91
92
|
updateUploadedAssetList({
|
|
92
93
|
...uploadedAssetList,
|
|
@@ -95,10 +96,9 @@ export const LineImage = ({
|
|
|
95
96
|
imgSrc,
|
|
96
97
|
},
|
|
97
98
|
});
|
|
98
|
-
actions.clearAsset();
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
}, [Line
|
|
101
|
+
}, [Line[`uploadedAssetData${index}`]]);
|
|
102
102
|
|
|
103
103
|
useEffect(() => {
|
|
104
104
|
const imgSrc = get(uploadedAssetList[index], 'imgSrc', '');
|
|
@@ -142,6 +142,7 @@ export const LineImage = ({
|
|
|
142
142
|
data.file,
|
|
143
143
|
data.type,
|
|
144
144
|
data.fileParams,
|
|
145
|
+
index,
|
|
145
146
|
);
|
|
146
147
|
}
|
|
147
148
|
}
|
|
@@ -89,8 +89,8 @@ export const LineImageCarouselContent = ({
|
|
|
89
89
|
}, [imageSrc, isImageError]);
|
|
90
90
|
|
|
91
91
|
useEffect(() => {
|
|
92
|
-
if (Line
|
|
93
|
-
const imgSrc = get(Line,
|
|
92
|
+
if (Line[`uploadedAssetDataImageCarousel${index}`] && Object.keys(Line[`uploadedAssetDataImageCarousel${index}`]).length) {
|
|
93
|
+
const imgSrc = get(Line, `uploadedAssetDataImageCarousel${index}.metaInfo.secure_file_path`, '');
|
|
94
94
|
if (imgSrc) {
|
|
95
95
|
updateUploadedAssetList({
|
|
96
96
|
...uploadedAssetList,
|
|
@@ -101,10 +101,10 @@ export const LineImageCarouselContent = ({
|
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
103
|
});
|
|
104
|
-
actions.clearAsset(
|
|
104
|
+
actions.clearAsset(`ImageCarousel${index}`);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
}, [Line
|
|
107
|
+
}, [Line[`uploadedAssetDataImageCarousel${index}`]]);
|
|
108
108
|
|
|
109
109
|
useEffect(() => {
|
|
110
110
|
const imgSrc = get(uploadedAssetList[index], `${activeIndex}.imgSrc`, '');
|
|
@@ -148,7 +148,7 @@ export const LineImageCarouselContent = ({
|
|
|
148
148
|
data.file,
|
|
149
149
|
data.type,
|
|
150
150
|
data.fileParams,
|
|
151
|
-
|
|
151
|
+
`ImageCarousel${index}`,
|
|
152
152
|
);
|
|
153
153
|
}
|
|
154
154
|
}
|
|
@@ -57,6 +57,7 @@ export const LineImageMap = ({
|
|
|
57
57
|
getAllTemplates,
|
|
58
58
|
uploadedAssetList,
|
|
59
59
|
updateUploadedAssetList,
|
|
60
|
+
deleteUploadedImgList,
|
|
60
61
|
}) => {
|
|
61
62
|
if (activeKey !== IMAGE_MAP) {
|
|
62
63
|
return null;
|
|
@@ -129,7 +130,7 @@ export const LineImageMap = ({
|
|
|
129
130
|
}, [errorMessageTitle, imageSrc, messageTitle, isImageError, imageMapTemplate, actionLinks, assetType, isImage, templateSchema, altText]);
|
|
130
131
|
|
|
131
132
|
useEffect(() => {
|
|
132
|
-
const imgSrc = get(Line,
|
|
133
|
+
const imgSrc = get(Line, `uploadedAssetData${index}`, false);
|
|
133
134
|
if (imgSrc && typeof imgSrc !== 'object') {
|
|
134
135
|
updateUploadedAssetList({
|
|
135
136
|
...uploadedAssetList,
|
|
@@ -137,9 +138,9 @@ export const LineImageMap = ({
|
|
|
137
138
|
imgSrc: imgSrc.slice(0, -5),
|
|
138
139
|
},
|
|
139
140
|
});
|
|
140
|
-
actions.clearAsset();
|
|
141
|
+
actions.clearAsset(index);
|
|
141
142
|
}
|
|
142
|
-
}, [Line
|
|
143
|
+
}, [Line[`uploadedAssetData${index}`]]);
|
|
143
144
|
|
|
144
145
|
useEffect(() => {
|
|
145
146
|
const imgSrc = get(uploadedAssetList[index], 'imgSrc', '');
|
|
@@ -202,6 +203,7 @@ export const LineImageMap = ({
|
|
|
202
203
|
data.file,
|
|
203
204
|
data.type,
|
|
204
205
|
data.fileParams,
|
|
206
|
+
index,
|
|
205
207
|
);
|
|
206
208
|
}
|
|
207
209
|
}
|
|
@@ -338,6 +340,7 @@ export const LineImageMap = ({
|
|
|
338
340
|
|
|
339
341
|
const onReUpload = () => {
|
|
340
342
|
updateImageStatus(false);
|
|
343
|
+
deleteUploadedImgList(index);
|
|
341
344
|
updateImageSrc('');
|
|
342
345
|
}
|
|
343
346
|
|
|
@@ -42,14 +42,14 @@ function createReducer(state = initialState, action) {
|
|
|
42
42
|
return state
|
|
43
43
|
.set('uploadAssetSuccess', (action.statusCode !== undefined && action.statusCode !== '' && action.statusCode < 300))
|
|
44
44
|
.set('assetUploading', false)
|
|
45
|
-
.set(action.templateType ? `uploadedAssetData${action.templateType}` : 'uploadedAssetData', action.data);
|
|
45
|
+
.set(action.templateType !== undefined ? `uploadedAssetData${action.templateType}` : 'uploadedAssetData', action.data);
|
|
46
46
|
case types.UPLOAD_ASSET_FAILURE:
|
|
47
47
|
return state
|
|
48
48
|
.set('uploadAssetSuccess', false)
|
|
49
49
|
.set('assetUploading', false);
|
|
50
50
|
case types.CLEAR_ASSET:
|
|
51
51
|
return state
|
|
52
|
-
.delete(action.templateType ? `uploadedAssetData${action.templateType}` : 'uploadedAssetData');
|
|
52
|
+
.delete(action.templateType !== undefined ? `uploadedAssetData${action.templateType}` : 'uploadedAssetData');
|
|
53
53
|
// FOR EDIT
|
|
54
54
|
case types.EDIT_TEMPLATE_REQUEST:
|
|
55
55
|
return state
|