@capillarytech/creatives-library 7.12.67 → 7.12.69
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/config/app.js +1 -0
- package/package.json +1 -1
- package/services/tests/api.test.js +26 -0
- package/v2Components/CapWhatsappCTA/index.js +7 -8
- package/v2Components/CapWhatsappCTA/index.scss +2 -1
- package/v2Components/CapWhatsappCTA/messages.js +6 -2
- package/v2Components/CapWhatsappCTA/tests/index.test.js +11 -8
- package/v2Components/TemplatePreview/tests/__snapshots__/index.test.js.snap +13 -6
- package/v2Components/TemplatePreview/tests/index.test.js +5 -3
- package/v2Components/WhatsappStatusContainer/tests/__snapshots__/index.test.js.snap +55 -2
- package/v2Components/WhatsappStatusContainer/tests/index.test.js +8 -4
- package/v2Components/mockdata.js +94 -37
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +4 -3
- package/v2Containers/CreativesContainer/index.scss +15 -0
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +27 -25
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxHeader.test.js.snap +19 -4
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +76 -3
- package/v2Containers/CreativesContainer/tests/index.test.js +26 -12
- package/v2Containers/Templates/_templates.scss +20 -0
- package/v2Containers/Templates/index.js +15 -5
- package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +39 -265
- package/v2Containers/Templates/tests/index.test.js +35 -25
- package/v2Containers/Whatsapp/index.js +9 -7
- package/v2Containers/Whatsapp/index.scss +1 -0
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +60140 -4887
- package/v2Containers/Whatsapp/tests/__snapshots__/utils.test.js.snap +28 -21
- package/v2Containers/Whatsapp/tests/index.test.js +18 -4
- package/v2Containers/Whatsapp/tests/mockData.js +15 -1
- package/v2Containers/Whatsapp/tests/utils.test.js +11 -5
- package/v2Containers/mockdata.js +262 -227
package/config/app.js
CHANGED
|
@@ -17,6 +17,7 @@ const config = {
|
|
|
17
17
|
},
|
|
18
18
|
development: {
|
|
19
19
|
api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/creatives',
|
|
20
|
+
//api_endpoint: 'http://localhost:2022/arya/api/v1/creatives',
|
|
20
21
|
campaigns_api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/campaigns',
|
|
21
22
|
campaigns_api_org_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/org/campaign',
|
|
22
23
|
auth_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/auth',
|
package/package.json
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { getSenderDetails, uploadFile } from "../api";
|
|
2
|
+
|
|
3
|
+
describe("getSenderDetails -- Test with valid responses", () => {
|
|
4
|
+
it("Should return correct response", () =>
|
|
5
|
+
expect(getSenderDetails("WHATSAPP", -1)).toEqual(Promise.resolve()));
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
describe("uploadFile -- whatsapp image upload", () => {
|
|
9
|
+
it("Should return correct response", () =>
|
|
10
|
+
expect(
|
|
11
|
+
uploadFile({
|
|
12
|
+
file: new Image(),
|
|
13
|
+
assetType: "image",
|
|
14
|
+
fileParams: {
|
|
15
|
+
width: 275,
|
|
16
|
+
height: 183,
|
|
17
|
+
error: false,
|
|
18
|
+
},
|
|
19
|
+
whatsappParams: {
|
|
20
|
+
source: "whatsapp",
|
|
21
|
+
wabaId: "107499611940863",
|
|
22
|
+
accessToken: "Bearer gDwEuRIm9icV6phixociSw==",
|
|
23
|
+
},
|
|
24
|
+
})
|
|
25
|
+
).toEqual(Promise.resolve()));
|
|
26
|
+
});
|
|
@@ -63,13 +63,8 @@ export const CapWhatsappCTA = (props) => {
|
|
|
63
63
|
[type]: value,
|
|
64
64
|
};
|
|
65
65
|
if (type === 'urlType') {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
setUrlError(false);
|
|
69
|
-
} else if (value === DYNAMIC_URL) {
|
|
70
|
-
clonedCta.url = '{{1}}';
|
|
71
|
-
setUrlError(formatMessage(messages.ctaWebsiteUrlErrorMessage));
|
|
72
|
-
}
|
|
66
|
+
clonedCta.url = '';
|
|
67
|
+
setUrlError(false);
|
|
73
68
|
}
|
|
74
69
|
updateHandler(clonedCta, index);
|
|
75
70
|
};
|
|
@@ -391,7 +386,11 @@ export const CapWhatsappCTA = (props) => {
|
|
|
391
386
|
id={index}
|
|
392
387
|
className="whatsapp-cta-url"
|
|
393
388
|
onChange={(event) => onUrlChange(event, urlType)}
|
|
394
|
-
placeholder={
|
|
389
|
+
placeholder={
|
|
390
|
+
urlType === DYNAMIC_URL
|
|
391
|
+
? formatMessage(messages.ctaDynamicPlaceholder)
|
|
392
|
+
: formatMessage(messages.ctaStaticPlaceholder)
|
|
393
|
+
}
|
|
395
394
|
value={url}
|
|
396
395
|
size="large"
|
|
397
396
|
maxLength={URL_MAX_LENGTH}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
padding: 10px;
|
|
7
7
|
border-radius: 4px;
|
|
8
8
|
height: 48px;
|
|
9
|
+
width: 619px;
|
|
9
10
|
|
|
10
11
|
div:not(:last-child) {
|
|
11
12
|
margin-right: 9px;
|
|
@@ -44,7 +45,7 @@
|
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
.whatsapp-cta-tag-revert {
|
|
47
|
-
margin-left:
|
|
48
|
+
margin-left: 90px;
|
|
48
49
|
margin-top: 2px;
|
|
49
50
|
transform: scaleX(-1);
|
|
50
51
|
}
|
|
@@ -41,10 +41,14 @@ export default defineMessages({
|
|
|
41
41
|
id: `${prefix}.ctaWebsiteUrl`,
|
|
42
42
|
defaultMessage: 'Website URL',
|
|
43
43
|
},
|
|
44
|
-
|
|
45
|
-
id: `${prefix}.
|
|
44
|
+
ctaStaticPlaceholder: {
|
|
45
|
+
id: `${prefix}.ctaStaticPlaceholder`,
|
|
46
46
|
defaultMessage: 'Enter website URL',
|
|
47
47
|
},
|
|
48
|
+
ctaDynamicPlaceholder: {
|
|
49
|
+
id: `${prefix}.ctaDynamicPlaceholder`,
|
|
50
|
+
defaultMessage: 'Enter URL, variable is added by default',
|
|
51
|
+
},
|
|
48
52
|
ctaWebsiteUrlErrorMessage: {
|
|
49
53
|
id: `${prefix}.ctaWebsiteUrlErrorMessage`,
|
|
50
54
|
defaultMessage: 'URL is not valid',
|
|
@@ -3,18 +3,22 @@ import { injectIntl } from 'react-intl';
|
|
|
3
3
|
import '@testing-library/jest-dom';
|
|
4
4
|
import { render, screen, fireEvent } from '../../../utils/test-utils';
|
|
5
5
|
import { CapWhatsappCTA } from '../index';
|
|
6
|
-
import { INITIAL_CTA_DATA } from '../../../v2Containers/Whatsapp/constants';
|
|
7
|
-
import userEvent from '@testing-library/user-event';
|
|
8
6
|
|
|
9
7
|
const updateHandler = jest.fn();
|
|
10
8
|
const deleteHandler = jest.fn();
|
|
11
|
-
const initializeComponent = (
|
|
9
|
+
const initializeComponent = (
|
|
10
|
+
data,
|
|
11
|
+
isEditFlow = false,
|
|
12
|
+
host = 'twiliowhatsapptrans',
|
|
13
|
+
) => {
|
|
12
14
|
const Component = injectIntl(CapWhatsappCTA);
|
|
13
15
|
return render(
|
|
14
16
|
<Component
|
|
15
17
|
ctaData={data}
|
|
16
18
|
updateHandler={updateHandler}
|
|
17
19
|
deleteHandler={deleteHandler}
|
|
20
|
+
isEditFlow={isEditFlow}
|
|
21
|
+
hostName={host}
|
|
18
22
|
/>,
|
|
19
23
|
);
|
|
20
24
|
};
|
|
@@ -37,7 +41,6 @@ describe('CapWhatsappCTA', () => {
|
|
|
37
41
|
expect(screen.getAllByText('Phone number')[1]).toBeInTheDocument();
|
|
38
42
|
expect(screen.getByRole('button', { name: /save/i })).toBeDisabled();
|
|
39
43
|
});
|
|
40
|
-
|
|
41
44
|
it('first button', async () => {
|
|
42
45
|
initializeComponent([
|
|
43
46
|
{
|
|
@@ -108,9 +111,7 @@ describe('CapWhatsappCTA', () => {
|
|
|
108
111
|
},
|
|
109
112
|
};
|
|
110
113
|
// button text
|
|
111
|
-
const urlInput = await screen.getByPlaceholderText(
|
|
112
|
-
'Enter website URL',
|
|
113
|
-
);
|
|
114
|
+
const urlInput = await screen.getByPlaceholderText('Enter website URL');
|
|
114
115
|
fireEvent.change(urlInput, urlEvent1);
|
|
115
116
|
expect(updateHandler).toHaveBeenCalledWith(
|
|
116
117
|
{
|
|
@@ -147,6 +148,8 @@ describe('CapWhatsappCTA', () => {
|
|
|
147
148
|
isSaved: true,
|
|
148
149
|
},
|
|
149
150
|
]);
|
|
150
|
-
expect(
|
|
151
|
+
expect(
|
|
152
|
+
screen.getByText(/https:\/\/www\.google\.co\.in/i),
|
|
153
|
+
).toBeInTheDocument();
|
|
151
154
|
});
|
|
152
155
|
});
|
|
@@ -63,7 +63,7 @@ exports[`Test Templates container Should render correct preview component for wh
|
|
|
63
63
|
className="whatsapp-brand-name"
|
|
64
64
|
type="label1"
|
|
65
65
|
>
|
|
66
|
-
|
|
66
|
+
test
|
|
67
67
|
</CapLabel>
|
|
68
68
|
<div
|
|
69
69
|
className="msg-container whatsapp-message-container"
|
|
@@ -83,6 +83,11 @@ exports[`Test Templates container Should render correct preview component for wh
|
|
|
83
83
|
<div
|
|
84
84
|
className="whatsapp-content"
|
|
85
85
|
>
|
|
86
|
+
<CapImage
|
|
87
|
+
alt="Preview is being generated"
|
|
88
|
+
className="whatsapp-image"
|
|
89
|
+
src="https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/c9edc114-923b-4ac7-82d0-d6682213.jpg"
|
|
90
|
+
/>
|
|
86
91
|
You have received {{1}} points
|
|
87
92
|
<CapDivider
|
|
88
93
|
className="whatsapp-divider"
|
|
@@ -139,7 +144,7 @@ exports[`Test Templates container Should render correct preview component for wh
|
|
|
139
144
|
id="app.components.TemplatePreview.whatsappMessageLength"
|
|
140
145
|
values={
|
|
141
146
|
Object {
|
|
142
|
-
"length":
|
|
147
|
+
"length": 30,
|
|
143
148
|
}
|
|
144
149
|
}
|
|
145
150
|
/>
|
|
@@ -169,7 +174,7 @@ exports[`Test Templates container Should render correct preview component for wh
|
|
|
169
174
|
className="whatsapp-brand-name"
|
|
170
175
|
type="label1"
|
|
171
176
|
>
|
|
172
|
-
|
|
177
|
+
test
|
|
173
178
|
</CapLabel>
|
|
174
179
|
<div
|
|
175
180
|
className="msg-container whatsapp-message-container"
|
|
@@ -211,7 +216,7 @@ exports[`Test Templates container Should render correct preview component for wh
|
|
|
211
216
|
id="app.components.TemplatePreview.whatsappMessageLength"
|
|
212
217
|
values={
|
|
213
218
|
Object {
|
|
214
|
-
"length":
|
|
219
|
+
"length": 30,
|
|
215
220
|
}
|
|
216
221
|
}
|
|
217
222
|
/>
|
|
@@ -240,7 +245,9 @@ exports[`Test Templates container Should render correct preview component for wh
|
|
|
240
245
|
<CapLabel
|
|
241
246
|
className="whatsapp-brand-name"
|
|
242
247
|
type="label1"
|
|
243
|
-
|
|
248
|
+
>
|
|
249
|
+
test
|
|
250
|
+
</CapLabel>
|
|
244
251
|
<div
|
|
245
252
|
className="msg-container whatsapp-message-container"
|
|
246
253
|
>
|
|
@@ -276,7 +283,7 @@ exports[`Test Templates container Should render correct preview component for wh
|
|
|
276
283
|
id="app.components.TemplatePreview.whatsappMessageLength"
|
|
277
284
|
values={
|
|
278
285
|
Object {
|
|
279
|
-
"length":
|
|
286
|
+
"length": 0,
|
|
280
287
|
}
|
|
281
288
|
}
|
|
282
289
|
/>
|
|
@@ -27,6 +27,7 @@ describe('Test Templates container', () => {
|
|
|
27
27
|
'whatsapp',
|
|
28
28
|
{
|
|
29
29
|
templateMsg: 'You have received {{1}} points',
|
|
30
|
+
whatsappImageSrc: 'https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/c9edc114-923b-4ac7-82d0-d6682213.jpg',
|
|
30
31
|
ctaData: [
|
|
31
32
|
{
|
|
32
33
|
index: 0,
|
|
@@ -42,21 +43,22 @@ describe('Test Templates container', () => {
|
|
|
42
43
|
},
|
|
43
44
|
],
|
|
44
45
|
},
|
|
45
|
-
30,
|
|
46
46
|
'test',
|
|
47
|
+
30,
|
|
47
48
|
);
|
|
48
49
|
expect(renderedComponent).toMatchSnapshot();
|
|
49
50
|
renderFunction(
|
|
50
51
|
'whatsapp',
|
|
51
52
|
{
|
|
52
53
|
templateMsg: 'You have received {{1}} points',
|
|
54
|
+
whatsappImageSrc: '',
|
|
53
55
|
ctaData: [{}],
|
|
54
56
|
},
|
|
55
|
-
30,
|
|
56
57
|
'test',
|
|
58
|
+
30,
|
|
57
59
|
);
|
|
58
60
|
expect(renderedComponent).toMatchSnapshot();
|
|
59
|
-
renderFunction('whatsapp', {},
|
|
61
|
+
renderFunction('whatsapp', {}, 'test', 0);
|
|
60
62
|
expect(renderedComponent).toMatchSnapshot();
|
|
61
63
|
});
|
|
62
64
|
it('Should render correct preview component for rcs channel', () => {
|
|
@@ -28,10 +28,63 @@ exports[`Test WhatsappStatusContainer component Should render correct status com
|
|
|
28
28
|
tagTextColor="#f87d23"
|
|
29
29
|
>
|
|
30
30
|
<FormattedMessage
|
|
31
|
-
defaultMessage="
|
|
32
|
-
id="creatives.containersV2.Whatsapp.
|
|
31
|
+
defaultMessage="Marketing"
|
|
32
|
+
id="creatives.containersV2.Whatsapp.marketing"
|
|
33
33
|
values={Object {}}
|
|
34
34
|
/>
|
|
35
35
|
</CapColoredTag>
|
|
36
36
|
</CapRow>
|
|
37
37
|
`;
|
|
38
|
+
|
|
39
|
+
exports[`Test WhatsappStatusContainer component Should render correct status component for whatsapp channel 2`] = `
|
|
40
|
+
<CapRow
|
|
41
|
+
align="middle"
|
|
42
|
+
className="whatsapp-status-container"
|
|
43
|
+
type="flex"
|
|
44
|
+
>
|
|
45
|
+
<CapStatus
|
|
46
|
+
color=""
|
|
47
|
+
height="0.571rem"
|
|
48
|
+
labelType="label3"
|
|
49
|
+
text={
|
|
50
|
+
<FormattedMessage
|
|
51
|
+
defaultMessage="Approved"
|
|
52
|
+
id="creatives.containersV2.Whatsapp.approved"
|
|
53
|
+
values={Object {}}
|
|
54
|
+
/>
|
|
55
|
+
}
|
|
56
|
+
type="approved"
|
|
57
|
+
width="0.571rem"
|
|
58
|
+
/>
|
|
59
|
+
<CapColoredTag
|
|
60
|
+
className="whatsapp-category-tag"
|
|
61
|
+
tagColor="#f2e7fe"
|
|
62
|
+
tagFontSize="12px"
|
|
63
|
+
tagHeight="20px"
|
|
64
|
+
tagTextColor="#a451ff"
|
|
65
|
+
>
|
|
66
|
+
<FormattedMessage
|
|
67
|
+
defaultMessage="Alert update"
|
|
68
|
+
id="creatives.containersV2.Whatsapp.alertUpdate"
|
|
69
|
+
values={Object {}}
|
|
70
|
+
/>
|
|
71
|
+
</CapColoredTag>
|
|
72
|
+
</CapRow>
|
|
73
|
+
`;
|
|
74
|
+
|
|
75
|
+
exports[`Test WhatsappStatusContainer component Should render correct status component for whatsapp channel 3`] = `
|
|
76
|
+
<CapRow
|
|
77
|
+
align="middle"
|
|
78
|
+
className="whatsapp-status-container"
|
|
79
|
+
type="flex"
|
|
80
|
+
>
|
|
81
|
+
<CapStatus
|
|
82
|
+
color=""
|
|
83
|
+
height="0.571rem"
|
|
84
|
+
labelType="label3"
|
|
85
|
+
text=""
|
|
86
|
+
type=""
|
|
87
|
+
width="0.571rem"
|
|
88
|
+
/>
|
|
89
|
+
</CapRow>
|
|
90
|
+
`;
|
|
@@ -3,21 +3,25 @@ import { shallowWithIntl } from '../../../helpers/intl-enzym-test-helpers';
|
|
|
3
3
|
import { WhatsappStatusContainer } from '../index';
|
|
4
4
|
import mockdata from '../../mockdata';
|
|
5
5
|
|
|
6
|
-
const {
|
|
6
|
+
const { whatsappTemplate1,whatsappTemplate2 } = mockdata;
|
|
7
7
|
|
|
8
8
|
describe('Test WhatsappStatusContainer component', () => {
|
|
9
9
|
let renderedComponent;
|
|
10
10
|
|
|
11
|
-
const renderFunction = () => {
|
|
11
|
+
const renderFunction = (data) => {
|
|
12
12
|
renderedComponent = shallowWithIntl(
|
|
13
13
|
<WhatsappStatusContainer
|
|
14
|
-
template={
|
|
14
|
+
template={data}
|
|
15
15
|
/>
|
|
16
16
|
);
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
it('Should render correct status component for whatsapp channel', () => {
|
|
20
|
-
renderFunction();
|
|
20
|
+
renderFunction(whatsappTemplate1);
|
|
21
|
+
expect(renderedComponent).toMatchSnapshot();
|
|
22
|
+
renderFunction(whatsappTemplate2);
|
|
23
|
+
expect(renderedComponent).toMatchSnapshot();
|
|
24
|
+
renderFunction({});
|
|
21
25
|
expect(renderedComponent).toMatchSnapshot();
|
|
22
26
|
});
|
|
23
27
|
});
|
package/v2Components/mockdata.js
CHANGED
|
@@ -1,39 +1,96 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
2
|
+
whatsappTemplate1: {
|
|
3
|
+
_id: '62d3f971b497b671d3bbf8f7',
|
|
4
|
+
name: 'creatives_whatsapp6',
|
|
5
|
+
type: 'WHATSAPP',
|
|
6
|
+
versions: {
|
|
7
|
+
$init: true,
|
|
8
|
+
history: [],
|
|
9
|
+
base: {
|
|
10
|
+
content: {
|
|
11
|
+
whatsapp: {
|
|
12
|
+
status: 'approved',
|
|
13
|
+
templateId: '720951875646523',
|
|
14
|
+
hostName: 'karixwhatsappbulk',
|
|
15
|
+
accessToken: 'Bearer gDwEuRIm9icV6phixociSw==',
|
|
16
|
+
accountId: '107499611940863',
|
|
17
|
+
templateEditor: false,
|
|
18
|
+
karixFileHandle:
|
|
19
|
+
'4::aW1hZ2UvanBlZw==:ARZpmm0pMfsBvKepIjR-HG2HIw_78ynisr-riY1s4xpi2noK9QsvtvVfnZb5hUxks5HM5JHG0gCn_ZtPuJzya1SH3eq4Upn3M0eqsDLr4CzdPw:e:1658404714:259409122277300:100066839164237:ARbbCRjU-2ksqoUOp4Y',
|
|
20
|
+
imageUrl:
|
|
21
|
+
'https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/c9edc114-923b-4ac7-82d0-d6682213.jpg',
|
|
22
|
+
mediaType: 'IMAGE',
|
|
23
|
+
buttons: [
|
|
24
|
+
{
|
|
25
|
+
phone_number: '+919738752617',
|
|
26
|
+
text: 'Call',
|
|
27
|
+
type: 'PHONE_NUMBER',
|
|
28
|
+
index: 0,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
url: 'https://docs.google.com/{{1}}',
|
|
32
|
+
text: 'Visit',
|
|
33
|
+
type: 'DYNAMIC_URL',
|
|
34
|
+
index: 1,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
buttonType: 'CTA',
|
|
38
|
+
languages: [
|
|
39
|
+
{
|
|
40
|
+
content:
|
|
41
|
+
'Hey {{1}}, Easier implementation, tracking, reporting and planning of promotions is now live! Check it out at {{2}}\nClick {{3}} to unsubscribe',
|
|
42
|
+
language: 'en',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
category: 'MARKETING',
|
|
46
|
+
rejection_reason: '',
|
|
47
|
+
},
|
|
30
48
|
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
isActive: true,
|
|
52
|
+
orgId: 50074,
|
|
53
|
+
createdBy: '15000449',
|
|
54
|
+
updatedBy: '15000449',
|
|
55
|
+
createdAt: '2022-07-17T11:58:45.592Z',
|
|
56
|
+
updatedAt: '2022-07-17T11:58:45.592Z',
|
|
57
|
+
totalCount: 8,
|
|
58
|
+
},
|
|
59
|
+
whatsappTemplate2: {
|
|
60
|
+
_id: '62d3edc8b497b63ff5bbf8ea',
|
|
61
|
+
name: 'test_twilio_159425',
|
|
62
|
+
type: 'WHATSAPP',
|
|
63
|
+
versions: {
|
|
64
|
+
$init: true,
|
|
65
|
+
history: [],
|
|
66
|
+
base: {
|
|
67
|
+
content: {
|
|
68
|
+
whatsapp: {
|
|
69
|
+
status: 'approved',
|
|
70
|
+
templateId: 'HTee0274fb8dfdd45427bb678f875b0d54',
|
|
71
|
+
hostName: 'twiliowhatsapptrans',
|
|
72
|
+
accessToken: '4676323eb5d1f975b0987070c03a8efc',
|
|
73
|
+
accountId: 'AC41030cebba9e2f1ce37c78235da0ee18',
|
|
74
|
+
templateEditor: false,
|
|
75
|
+
mediaType: 'TEXT',
|
|
76
|
+
languages: [
|
|
77
|
+
{
|
|
78
|
+
content: 'Hi {{1}}, your payment is successful.',
|
|
79
|
+
language: 'en',
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
category: 'ALERT_UPDATE',
|
|
83
|
+
rejection_reason: null,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
isActive: true,
|
|
89
|
+
orgId: 50371,
|
|
90
|
+
createdBy: '15000449',
|
|
91
|
+
updatedBy: '15000449',
|
|
92
|
+
createdAt: '2022-07-17T11:08:56.326Z',
|
|
93
|
+
updatedAt: '2022-07-17T11:08:56.326Z',
|
|
94
|
+
totalCount: 7,
|
|
95
|
+
},
|
|
96
|
+
};
|
|
@@ -2,9 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { FormattedMessage } from 'react-intl';
|
|
4
4
|
import get from 'lodash/get';
|
|
5
|
-
import { CapHeader, CapIcons, CapLabel, CapLink, CapSteps, CapIcon } from '@capillarytech/cap-ui-library';
|
|
5
|
+
import { CapHeader, CapIcons, CapLabel, CapLink, CapSteps, CapIcon, CapHeading } from '@capillarytech/cap-ui-library';
|
|
6
6
|
import moment from 'moment';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
+
import './index.scss';
|
|
8
9
|
import messages from './messages';
|
|
9
10
|
import whatsppMsg from '../Whatsapp/messages';
|
|
10
11
|
import { LANGUAGE_OPTIONS } from '../Whatsapp/constants';
|
|
@@ -83,7 +84,7 @@ export function SlideBoxHeader(props) {
|
|
|
83
84
|
{showTemplateNameHeader && templateNameRenderProp()}
|
|
84
85
|
{slidBoxContent === 'preview' && (
|
|
85
86
|
<CapHeader
|
|
86
|
-
title={templateData.name}
|
|
87
|
+
title={<CapHeading className='slidebox-header-template-name' type="h1">{templateData.name}</CapHeading>}
|
|
87
88
|
description={<CapLabel type="label3">
|
|
88
89
|
<FormattedMessage {...messages.lastUpdated} values={{date: moment(templateData.updatedAt).format('DD MMM YYYY'), user: templateData.updatedByName}}/>
|
|
89
90
|
</CapLabel>}
|
|
@@ -102,7 +103,7 @@ export function SlideBoxHeader(props) {
|
|
|
102
103
|
{showTemplateName ? (
|
|
103
104
|
<>
|
|
104
105
|
{renderData("label1", <FormattedMessage {...globalMessages.templateNameLabel} />)}
|
|
105
|
-
|
|
106
|
+
<StyledLabel className='whatsapp-rcs-template-name' type="label2">{templateName}</StyledLabel>
|
|
106
107
|
</>
|
|
107
108
|
) : ""}
|
|
108
109
|
{isWhatsappEdit && (
|
|
@@ -42,4 +42,19 @@ $classPrefix: add-creatives-section;
|
|
|
42
42
|
.slidebox-header div:first-child {
|
|
43
43
|
width: 100%;
|
|
44
44
|
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.slidebox-header-template-name{
|
|
48
|
+
max-width: 750px;
|
|
49
|
+
white-space: nowrap;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
text-overflow: ellipsis;
|
|
52
|
+
}
|
|
53
|
+
.whatsapp-rcs-template-name{
|
|
54
|
+
display: inline-block;
|
|
55
|
+
width: 450px;
|
|
56
|
+
white-space: nowrap;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
text-overflow: ellipsis;
|
|
59
|
+
margin-bottom: -3px;
|
|
45
60
|
}
|
|
@@ -710,7 +710,7 @@ exports[`Test SlideBoxContent container Should render correct component for what
|
|
|
710
710
|
charCounterEnabled={false}
|
|
711
711
|
content={
|
|
712
712
|
Object {
|
|
713
|
-
"charCount":
|
|
713
|
+
"charCount": 151,
|
|
714
714
|
"ctaData": Array [
|
|
715
715
|
Object {
|
|
716
716
|
"index": 0,
|
|
@@ -720,42 +720,41 @@ exports[`Test SlideBoxContent container Should render correct component for what
|
|
|
720
720
|
},
|
|
721
721
|
Object {
|
|
722
722
|
"index": 1,
|
|
723
|
-
"text": "
|
|
724
|
-
"type": "
|
|
725
|
-
"url": "https://
|
|
723
|
+
"text": "Visit",
|
|
724
|
+
"type": "DYNAMIC_URL",
|
|
725
|
+
"url": "https://docs.google.com/{{1}}",
|
|
726
726
|
},
|
|
727
727
|
],
|
|
728
728
|
"templateMsg": <CapLabel
|
|
729
729
|
type="label5"
|
|
730
730
|
>
|
|
731
|
-
|
|
731
|
+
Hey {{1}}, Easier implementation, tracking, reporting and planning of promotions is now live! Check it out at {{2}}
|
|
732
732
|
Click {{unsubscribe}} to unsubscribe
|
|
733
733
|
</CapLabel>,
|
|
734
|
+
"whatsappImageSrc": "https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/c9edc114-923b-4ac7-82d0-d6682213.jpg",
|
|
734
735
|
}
|
|
735
736
|
}
|
|
736
737
|
showCount={true}
|
|
737
738
|
templateData={
|
|
738
739
|
Object {
|
|
739
|
-
"_id": "
|
|
740
|
-
"createdAt": "2022-
|
|
740
|
+
"_id": "62d3f971b497b671d3bbf8f7",
|
|
741
|
+
"createdAt": "2022-07-17T11:58:45.592Z",
|
|
741
742
|
"createdBy": "15000449",
|
|
742
743
|
"isActive": true,
|
|
743
744
|
"mode": "preview",
|
|
744
|
-
"name": "
|
|
745
|
-
"orgId":
|
|
746
|
-
"totalCount":
|
|
745
|
+
"name": "creatives_whatsapp6",
|
|
746
|
+
"orgId": 50074,
|
|
747
|
+
"totalCount": 8,
|
|
747
748
|
"type": "WHATSAPP",
|
|
748
|
-
"updatedAt": "2022-
|
|
749
|
+
"updatedAt": "2022-07-17T11:58:45.592Z",
|
|
749
750
|
"updatedBy": "15000449",
|
|
750
|
-
"updatedByName": "Ashish Karan fd",
|
|
751
751
|
"versions": Object {
|
|
752
752
|
"$init": true,
|
|
753
753
|
"base": Object {
|
|
754
754
|
"content": Object {
|
|
755
755
|
"whatsapp": Object {
|
|
756
|
-
"accessToken": "
|
|
757
|
-
"accountId": "
|
|
758
|
-
"accountName": "whatsappTest",
|
|
756
|
+
"accessToken": "Bearer gDwEuRIm9icV6phixociSw==",
|
|
757
|
+
"accountId": "107499611940863",
|
|
759
758
|
"buttonType": "CTA",
|
|
760
759
|
"buttons": Array [
|
|
761
760
|
Object {
|
|
@@ -766,24 +765,27 @@ Click {{unsubscribe}} to unsubscribe
|
|
|
766
765
|
},
|
|
767
766
|
Object {
|
|
768
767
|
"index": 1,
|
|
769
|
-
"text": "
|
|
770
|
-
"type": "
|
|
771
|
-
"url": "https://
|
|
768
|
+
"text": "Visit",
|
|
769
|
+
"type": "DYNAMIC_URL",
|
|
770
|
+
"url": "https://docs.google.com/{{1}}",
|
|
772
771
|
},
|
|
773
772
|
],
|
|
774
|
-
"category": "
|
|
773
|
+
"category": "MARKETING",
|
|
774
|
+
"hostName": "karixwhatsappbulk",
|
|
775
|
+
"imageUrl": "https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/c9edc114-923b-4ac7-82d0-d6682213.jpg",
|
|
776
|
+
"karixFileHandle": "4::aW1hZ2UvanBlZw==:ARZpmm0pMfsBvKepIjR-HG2HIw_78ynisr-riY1s4xpi2noK9QsvtvVfnZb5hUxks5HM5JHG0gCn_ZtPuJzya1SH3eq4Upn3M0eqsDLr4CzdPw:e:1658404714:259409122277300:100066839164237:ARbbCRjU-2ksqoUOp4Y",
|
|
775
777
|
"languages": Array [
|
|
776
778
|
Object {
|
|
777
|
-
"content": "
|
|
778
|
-
Click {{
|
|
779
|
+
"content": "Hey {{1}}, Easier implementation, tracking, reporting and planning of promotions is now live! Check it out at {{2}}
|
|
780
|
+
Click {{3}} to unsubscribe",
|
|
779
781
|
"language": "en",
|
|
780
782
|
},
|
|
781
783
|
],
|
|
782
|
-
"mediaType": "
|
|
783
|
-
"rejection_reason":
|
|
784
|
+
"mediaType": "IMAGE",
|
|
785
|
+
"rejection_reason": "",
|
|
784
786
|
"status": "approved",
|
|
785
|
-
"templateEditor":
|
|
786
|
-
"templateId": "
|
|
787
|
+
"templateEditor": false,
|
|
788
|
+
"templateId": "720951875646523",
|
|
787
789
|
},
|
|
788
790
|
},
|
|
789
791
|
},
|