@capillarytech/creatives-library 7.12.35 → 7.12.37
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/v2Components/CapWhatsappCTA/index.js +43 -20
- package/v2Components/CapWhatsappCTA/index.scss +7 -1
- package/v2Components/CapWhatsappCTA/messages.js +9 -0
- package/v2Containers/CreativesContainer/index.js +3 -3
- package/v2Containers/Whatsapp/index.js +15 -7
- package/v2Containers/Whatsapp/index.scss +11 -13
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +820 -240
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
|
@@ -13,6 +13,7 @@ import CapInput from '@capillarytech/cap-ui-library/CapInput';
|
|
|
13
13
|
import CapButton from '@capillarytech/cap-ui-library/CapButton';
|
|
14
14
|
import CapLabel from '@capillarytech/cap-ui-library/CapLabel';
|
|
15
15
|
import CapIcon from '@capillarytech/cap-ui-library/CapIcon';
|
|
16
|
+
import CapTooltip from '@capillarytech/cap-ui-library/CapTooltip';
|
|
16
17
|
import globalMessages from '../../v2Containers/Cap/messages';
|
|
17
18
|
import whatsappMsg from '../../v2Containers/Whatsapp/messages';
|
|
18
19
|
import messages from './messages';
|
|
@@ -194,7 +195,7 @@ export const CapWhatsappCTA = (props) => {
|
|
|
194
195
|
<CapRow>
|
|
195
196
|
<CapColumn span={12}>
|
|
196
197
|
{/* Type of action */}
|
|
197
|
-
<CapHeading type="h4">
|
|
198
|
+
<CapHeading type="h4" className="cta-label">
|
|
198
199
|
{formatMessage(messages.ctaType)}
|
|
199
200
|
</CapHeading>
|
|
200
201
|
<CapSelect
|
|
@@ -206,7 +207,7 @@ export const CapWhatsappCTA = (props) => {
|
|
|
206
207
|
</CapColumn>
|
|
207
208
|
<CapColumn span={12}>
|
|
208
209
|
{/* Button text */}
|
|
209
|
-
<CapHeading type="h4">
|
|
210
|
+
<CapHeading type="h4" className="cta-label">
|
|
210
211
|
{formatMessage(messages.ctaButtonText)}
|
|
211
212
|
</CapHeading>
|
|
212
213
|
<CapInput
|
|
@@ -225,7 +226,7 @@ export const CapWhatsappCTA = (props) => {
|
|
|
225
226
|
<CapRow>
|
|
226
227
|
<CapColumn span={11}>
|
|
227
228
|
{/* phone number */}
|
|
228
|
-
<CapHeading type="h4">
|
|
229
|
+
<CapHeading type="h4" className="cta-label">
|
|
229
230
|
{formatMessage(messages.ctaPhoneNo)}
|
|
230
231
|
</CapHeading>
|
|
231
232
|
<PhoneInput
|
|
@@ -245,7 +246,7 @@ export const CapWhatsappCTA = (props) => {
|
|
|
245
246
|
<CapRow>
|
|
246
247
|
<CapColumn span={12}>
|
|
247
248
|
{/* URL Type */}
|
|
248
|
-
<CapHeading type="h4">
|
|
249
|
+
<CapHeading type="h4" className="cta-label">
|
|
249
250
|
{formatMessage(messages.ctaWebsiteType)}
|
|
250
251
|
</CapHeading>
|
|
251
252
|
<CapSelect
|
|
@@ -256,7 +257,7 @@ export const CapWhatsappCTA = (props) => {
|
|
|
256
257
|
</CapColumn>
|
|
257
258
|
<CapColumn span={12}>
|
|
258
259
|
{/* cta url */}
|
|
259
|
-
<CapHeading type="h4">
|
|
260
|
+
<CapHeading type="h4" className="cta-label">
|
|
260
261
|
{formatMessage(messages.ctaWebsiteUrl)}
|
|
261
262
|
</CapHeading>
|
|
262
263
|
<CapInput
|
|
@@ -274,13 +275,24 @@ export const CapWhatsappCTA = (props) => {
|
|
|
274
275
|
</CapRow>
|
|
275
276
|
)}
|
|
276
277
|
<CapRow className="whatsapp-cta-save-delete-btn">
|
|
277
|
-
<
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
278
|
+
<CapTooltip
|
|
279
|
+
title={
|
|
280
|
+
ctaSaveDisabled(index)
|
|
281
|
+
? formatMessage(messages.ctaSaveDisabled)
|
|
282
|
+
: ''
|
|
283
|
+
}
|
|
284
|
+
placement={'bottom'}
|
|
281
285
|
>
|
|
282
|
-
|
|
283
|
-
|
|
286
|
+
<div className="button-disabled-tooltip-wrapper">
|
|
287
|
+
<CapButton
|
|
288
|
+
onClick={() => saveCta(index)}
|
|
289
|
+
disabled={ctaSaveDisabled(index)}
|
|
290
|
+
className="whatsapp-cta-save-btn"
|
|
291
|
+
>
|
|
292
|
+
{formatMessage(globalMessages.save)}
|
|
293
|
+
</CapButton>
|
|
294
|
+
</div>
|
|
295
|
+
</CapTooltip>
|
|
284
296
|
<CapButton
|
|
285
297
|
onClick={() => deleteHandler(index)}
|
|
286
298
|
className="whatsapp-cta-delete-btn"
|
|
@@ -299,16 +311,27 @@ export const CapWhatsappCTA = (props) => {
|
|
|
299
311
|
ctaData.length < 2 &&
|
|
300
312
|
renderArray.push(
|
|
301
313
|
<CapRow>
|
|
302
|
-
<
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
314
|
+
<CapTooltip
|
|
315
|
+
title={
|
|
316
|
+
ctaData.length === 1 && !ctaData[0].isSaved
|
|
317
|
+
? formatMessage(messages.ctaAddDisabled)
|
|
318
|
+
: ''
|
|
319
|
+
}
|
|
320
|
+
placement={'right'}
|
|
309
321
|
>
|
|
310
|
-
|
|
311
|
-
|
|
322
|
+
<div className="button-disabled-tooltip-wrapper">
|
|
323
|
+
<CapButton
|
|
324
|
+
type="flat"
|
|
325
|
+
id="whatsapp-cta-add-button"
|
|
326
|
+
disabled={ctaData.length === 1 && !ctaData[0].isSaved}
|
|
327
|
+
className="margin-t-12 margin-l-24"
|
|
328
|
+
isAddBtn
|
|
329
|
+
onClick={addCta}
|
|
330
|
+
>
|
|
331
|
+
{formatMessage(messages.addButton)}
|
|
332
|
+
</CapButton>
|
|
333
|
+
</div>
|
|
334
|
+
</CapTooltip>
|
|
312
335
|
</CapRow>,
|
|
313
336
|
);
|
|
314
337
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
.cap-whatsapp-saved-cta {
|
|
4
4
|
border: solid 1px $CAP_G06;
|
|
5
5
|
margin-left: 24px;
|
|
6
|
-
padding:
|
|
6
|
+
padding: 10px;
|
|
7
7
|
border-radius: 4px;
|
|
8
8
|
|
|
9
9
|
div:not(:last-child) {
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
|
|
13
13
|
.url,
|
|
14
14
|
.phone {
|
|
15
|
+
white-space: nowrap;
|
|
15
16
|
overflow: hidden;
|
|
17
|
+
text-overflow: ellipsis;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
.url-type {
|
|
@@ -30,6 +32,10 @@
|
|
|
30
32
|
padding: 20px;
|
|
31
33
|
border-radius: 4px;
|
|
32
34
|
|
|
35
|
+
.cta-label {
|
|
36
|
+
margin-bottom: 4px;
|
|
37
|
+
}
|
|
38
|
+
|
|
33
39
|
.whatsapp-cta-save-delete-btn {
|
|
34
40
|
.ant-btn {
|
|
35
41
|
margin-right: $CAP_SPACE_16;
|
|
@@ -53,4 +53,13 @@ export default defineMessages({
|
|
|
53
53
|
id: `${prefix}.addButton`,
|
|
54
54
|
defaultMessage: 'Add button',
|
|
55
55
|
},
|
|
56
|
+
ctaSaveDisabled: {
|
|
57
|
+
id: `${prefix}.ctaSaveDisabled`,
|
|
58
|
+
defaultMessage: 'Please complete the above fields to enable button',
|
|
59
|
+
},
|
|
60
|
+
ctaAddDisabled: {
|
|
61
|
+
id: `${prefix}.ctaAddDisabled`,
|
|
62
|
+
defaultMessage:
|
|
63
|
+
'Please save the first button before proceeding to create second button',
|
|
64
|
+
},
|
|
56
65
|
});
|
|
@@ -375,7 +375,7 @@ export class Creatives extends React.Component {
|
|
|
375
375
|
language,
|
|
376
376
|
category,
|
|
377
377
|
mediaType,
|
|
378
|
-
|
|
378
|
+
buttonType = 'NONE',
|
|
379
379
|
buttons = [],
|
|
380
380
|
} = {},
|
|
381
381
|
} = templateData;
|
|
@@ -588,7 +588,7 @@ export class Creatives extends React.Component {
|
|
|
588
588
|
category,
|
|
589
589
|
templateEditor,
|
|
590
590
|
varMapped,
|
|
591
|
-
buttonType
|
|
591
|
+
buttonType = 'NONE',
|
|
592
592
|
buttons = [],
|
|
593
593
|
} = cloneDeep(versions.base.content.whatsapp);
|
|
594
594
|
const modifiedButtons = cloneDeep(buttons).map((btn) => {
|
|
@@ -612,7 +612,7 @@ export class Creatives extends React.Component {
|
|
|
612
612
|
category,
|
|
613
613
|
language: languages[0].language,
|
|
614
614
|
mediaType,
|
|
615
|
-
|
|
615
|
+
buttonType,
|
|
616
616
|
buttons : modifiedButtons,
|
|
617
617
|
},
|
|
618
618
|
};
|
|
@@ -451,7 +451,7 @@ export const Whatsapp = (props) => {
|
|
|
451
451
|
setCtadata((prevState) => {
|
|
452
452
|
const clonedCta = cloneDeep(prevState);
|
|
453
453
|
const filteredCta = clonedCta.filter((i) => i.index !== index);
|
|
454
|
-
if(filteredCta.length === 1){
|
|
454
|
+
if (filteredCta.length === 1) {
|
|
455
455
|
filteredCta[0].index = 0;
|
|
456
456
|
}
|
|
457
457
|
return filteredCta;
|
|
@@ -461,19 +461,21 @@ export const Whatsapp = (props) => {
|
|
|
461
461
|
const buttonRadioOptions = [
|
|
462
462
|
{
|
|
463
463
|
value: WHATSAPP_BUTTON_TYPES.NONE,
|
|
464
|
-
label:
|
|
464
|
+
label: (
|
|
465
|
+
<CapHeading type="h4" className="whatsapp-button-none">
|
|
466
|
+
{formatMessage(messages.btnTypeNone)}
|
|
467
|
+
</CapHeading>
|
|
468
|
+
),
|
|
465
469
|
},
|
|
466
470
|
{
|
|
467
471
|
value: WHATSAPP_BUTTON_TYPES.CTA,
|
|
468
472
|
label: (
|
|
469
473
|
<>
|
|
470
|
-
<div className="whatsapp-button">
|
|
474
|
+
<div className="whatsapp-button-cta">
|
|
471
475
|
<CapHeading type="h4">
|
|
472
476
|
{formatMessage(messages.btnTypeCTA)}
|
|
473
477
|
</CapHeading>
|
|
474
|
-
<CapLabel
|
|
475
|
-
{formatMessage(messages.ctaDesc)}
|
|
476
|
-
</CapLabel>
|
|
478
|
+
<CapLabel>{formatMessage(messages.ctaDesc)}</CapLabel>
|
|
477
479
|
</div>
|
|
478
480
|
{buttonType === WHATSAPP_BUTTON_TYPES.CTA && (
|
|
479
481
|
<CapWhatsappCTA
|
|
@@ -492,7 +494,13 @@ export const Whatsapp = (props) => {
|
|
|
492
494
|
placement="bottom"
|
|
493
495
|
title={!isEditFlow && formatMessage(messages.disabledFeatureTooltip)}
|
|
494
496
|
>
|
|
495
|
-
<div
|
|
497
|
+
<div
|
|
498
|
+
className="whatsapp-button-quick-reply"
|
|
499
|
+
style={{
|
|
500
|
+
marginTop:
|
|
501
|
+
buttonType === WHATSAPP_BUTTON_TYPES.CTA ? '0px' : '24px',
|
|
502
|
+
}}
|
|
503
|
+
>
|
|
496
504
|
<CapHeading type="h4">
|
|
497
505
|
{formatMessage(messages.btnTypeQuickReply)}
|
|
498
506
|
</CapHeading>
|
|
@@ -80,13 +80,19 @@
|
|
|
80
80
|
display: grid;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
.whatsapp-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
.whatsapp-button-none{
|
|
84
|
+
display: inline-grid;
|
|
85
|
+
margin-top: 16px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.whatsapp-button-cta {
|
|
89
|
+
display: inline-grid;
|
|
90
|
+
margin-top: 24px;
|
|
86
91
|
}
|
|
87
92
|
|
|
88
|
-
.whatsapp-
|
|
89
|
-
|
|
93
|
+
.whatsapp-button-quick-reply {
|
|
94
|
+
display: inline-grid;
|
|
95
|
+
opacity: 0.4;
|
|
90
96
|
}
|
|
91
97
|
|
|
92
98
|
.whatsapp-optional-label {
|
|
@@ -95,12 +101,4 @@
|
|
|
95
101
|
font-weight: normal;
|
|
96
102
|
font-size: 12px;
|
|
97
103
|
}
|
|
98
|
-
|
|
99
|
-
.whatsapp-button {
|
|
100
|
-
display: inline-grid;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.whatsapp-cta-desc {
|
|
104
|
-
margin-bottom: 17px;
|
|
105
|
-
}
|
|
106
104
|
}
|