@capillarytech/creatives-library 7.17.150 → 7.17.152-alpha.1
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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capillarytech/creatives-library",
|
|
3
3
|
"author": "meharaj",
|
|
4
|
-
"version": "7.17.
|
|
4
|
+
"version": "7.17.152-alpha.1",
|
|
5
5
|
"description": "Capillary creatives ui",
|
|
6
6
|
"main": "./index.js",
|
|
7
7
|
"module": "./index.es.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"@babel/polyfill": "7.4.3",
|
|
16
16
|
"@bugsnag/js": "^7.2.1",
|
|
17
17
|
"@bugsnag/plugin-react": "^7.2.1",
|
|
18
|
-
"@capillarytech/cap-ui-utils": "2.0.
|
|
18
|
+
"@capillarytech/cap-ui-utils": "2.0.9",
|
|
19
19
|
"@mailupinc/bee-plugin": "^1.2.0",
|
|
20
20
|
"babel-cli": "^6.26.0",
|
|
21
21
|
"chalk": "1.1.3",
|
package/services/api.js
CHANGED
|
@@ -273,9 +273,9 @@ export const createChannelWiseTemplate = ({ channel, template }) => {
|
|
|
273
273
|
export const getTemplateDetails = ({id, channel}) => {
|
|
274
274
|
const url = `${API_ENDPOINT}/templates/${id}/${channel ? channel.toUpperCase() : 'SMS'}`;
|
|
275
275
|
const compressedTemplatesData = request(url, getAPICallObject('GET'));
|
|
276
|
-
return compressedTemplatesData.then(
|
|
276
|
+
return compressedTemplatesData.then((data) => {
|
|
277
277
|
const { response = '' } = data || {};
|
|
278
|
-
const decompressData =
|
|
278
|
+
const decompressData = decompressJsonObject(response);
|
|
279
279
|
if (channel?.toUpperCase() === EMAIL) {
|
|
280
280
|
return { ...data, response: addBaseToTemplate(decompressData) };
|
|
281
281
|
}
|
|
@@ -289,9 +289,9 @@ export const getAllTemplates = ({channel, queryParams = {}}) => {
|
|
|
289
289
|
queryParams,
|
|
290
290
|
});
|
|
291
291
|
const compressedTemplatesData = request(url, getAPICallObject('GET'));
|
|
292
|
-
return compressedTemplatesData.then(
|
|
292
|
+
return compressedTemplatesData.then((data) => {
|
|
293
293
|
const { response = '' } = data || {};
|
|
294
|
-
return { ...data, response:
|
|
294
|
+
return { ...data, response: decompressJsonObject(response)};
|
|
295
295
|
});
|
|
296
296
|
};
|
|
297
297
|
|
|
@@ -115,9 +115,9 @@ describe('getAllTemplates -- Test with valid responses', () => {
|
|
|
115
115
|
},
|
|
116
116
|
}),
|
|
117
117
|
}));
|
|
118
|
-
mockDecompressJsonObject.mockReturnValue(
|
|
118
|
+
mockDecompressJsonObject.mockReturnValue({
|
|
119
119
|
_id: '123',
|
|
120
|
-
})
|
|
120
|
+
});
|
|
121
121
|
expect(await getAllTemplates({channel: 'email'})).toEqual({
|
|
122
122
|
response: {
|
|
123
123
|
_id: '123',
|
|
@@ -136,9 +136,9 @@ describe('getAllTemplates -- Test with valid responses', () => {
|
|
|
136
136
|
},
|
|
137
137
|
}),
|
|
138
138
|
}));
|
|
139
|
-
mockDecompressJsonObject.mockReturnValue(
|
|
139
|
+
mockDecompressJsonObject.mockReturnValue({
|
|
140
140
|
_id: '123',
|
|
141
|
-
})
|
|
141
|
+
});
|
|
142
142
|
expect(await getAllTemplates({channel: 'email'})).toEqual({
|
|
143
143
|
data: {
|
|
144
144
|
_id: '123',
|
|
@@ -172,12 +172,12 @@ describe('getTemplateDetails -- Test with valid responses', () => {
|
|
|
172
172
|
},
|
|
173
173
|
}),
|
|
174
174
|
}));
|
|
175
|
-
mockDecompressJsonObject.mockReturnValue(
|
|
175
|
+
mockDecompressJsonObject.mockReturnValue({
|
|
176
176
|
_id: '123',
|
|
177
177
|
versions: {
|
|
178
178
|
history: ['v1', 'v2'],
|
|
179
179
|
},
|
|
180
|
-
})
|
|
180
|
+
});
|
|
181
181
|
expect(await getTemplateDetails({id: '123', channel: 'email'})).toEqual({
|
|
182
182
|
response: {
|
|
183
183
|
_id: '123',
|
|
@@ -203,12 +203,12 @@ describe('getTemplateDetails -- Test with valid responses', () => {
|
|
|
203
203
|
},
|
|
204
204
|
}),
|
|
205
205
|
}));
|
|
206
|
-
mockDecompressJsonObject.mockReturnValue(
|
|
206
|
+
mockDecompressJsonObject.mockReturnValue({
|
|
207
207
|
_id: '123',
|
|
208
208
|
versions: {
|
|
209
209
|
history: ['v1', 'v2'],
|
|
210
210
|
},
|
|
211
|
-
})
|
|
211
|
+
});
|
|
212
212
|
expect(await getTemplateDetails({id: '123'})).toEqual({
|
|
213
213
|
data: {
|
|
214
214
|
_id: '123',
|
|
@@ -245,9 +245,9 @@ describe('getTemplateInfoById -- Test with valid responses', () => {
|
|
|
245
245
|
},
|
|
246
246
|
}),
|
|
247
247
|
}));
|
|
248
|
-
mockDecompressJsonObject.mockReturnValue(
|
|
248
|
+
mockDecompressJsonObject.mockReturnValue({
|
|
249
249
|
_id: '123',
|
|
250
|
-
})
|
|
250
|
+
});
|
|
251
251
|
expect(await getTemplateInfoById({id: '123', username: 'capillary_zns', 'oa_id': 'jfhagsdhj', token: 'tuyagjahs'})).toEqual({
|
|
252
252
|
response: {
|
|
253
253
|
_id: '123',
|
|
@@ -266,9 +266,9 @@ describe('getTemplateInfoById -- Test with valid responses', () => {
|
|
|
266
266
|
},
|
|
267
267
|
}),
|
|
268
268
|
}));
|
|
269
|
-
mockDecompressJsonObject.mockReturnValue(
|
|
269
|
+
mockDecompressJsonObject.mockReturnValue({
|
|
270
270
|
_id: '123',
|
|
271
|
-
})
|
|
271
|
+
});
|
|
272
272
|
expect(await getTemplateInfoById({id: '123', username: 'capillary_zns', 'oa_id': 'jfhagsdhj', token: 'tuyagjahs'})).toEqual({
|
|
273
273
|
data: {
|
|
274
274
|
_id: '123',
|
|
@@ -1591,8 +1591,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1591
1591
|
if (data.expandableDetails && data.expandableDetails.image) {
|
|
1592
1592
|
bodyTextStyle.WebkitLineClamp = 3;
|
|
1593
1593
|
}
|
|
1594
|
+
const isFullMode = this.isFullMode();
|
|
1594
1595
|
result = (
|
|
1595
|
-
<div className=
|
|
1596
|
+
<div className={`${isFullMode} ? android-push-message-Container: message-preview android-push-message-Container `}>
|
|
1596
1597
|
<div className="message-pop align-left">
|
|
1597
1598
|
<div className="message-container">
|
|
1598
1599
|
<div className="app-name">
|