@capillarytech/creatives-library 7.12.68 → 7.12.70
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 +1 -1
- package/v2Components/CapWhatsappCTA/index.js +6 -6
- package/v2Components/CapWhatsappCTA/index.scss +1 -1
- package/v2Components/CapWhatsappCTA/messages.js +6 -2
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +4 -3
- package/v2Containers/CreativesContainer/index.scss +15 -0
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxHeader.test.js.snap +17 -2
- package/v2Containers/Whatsapp/index.js +9 -7
- package/v2Containers/Whatsapp/index.scss +1 -0
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +72 -72
package/package.json
CHANGED
|
@@ -63,11 +63,7 @@ export const CapWhatsappCTA = (props) => {
|
|
|
63
63
|
[type]: value,
|
|
64
64
|
};
|
|
65
65
|
if (type === 'urlType') {
|
|
66
|
-
|
|
67
|
-
clonedCta.url = '';
|
|
68
|
-
} else if (value === DYNAMIC_URL) {
|
|
69
|
-
clonedCta.url = '{{1}}';
|
|
70
|
-
}
|
|
66
|
+
clonedCta.url = '';
|
|
71
67
|
setUrlError(false);
|
|
72
68
|
}
|
|
73
69
|
updateHandler(clonedCta, index);
|
|
@@ -390,7 +386,11 @@ export const CapWhatsappCTA = (props) => {
|
|
|
390
386
|
id={index}
|
|
391
387
|
className="whatsapp-cta-url"
|
|
392
388
|
onChange={(event) => onUrlChange(event, urlType)}
|
|
393
|
-
placeholder={
|
|
389
|
+
placeholder={
|
|
390
|
+
urlType === DYNAMIC_URL
|
|
391
|
+
? formatMessage(messages.ctaDynamicPlaceholder)
|
|
392
|
+
: formatMessage(messages.ctaStaticPlaceholder)
|
|
393
|
+
}
|
|
394
394
|
value={url}
|
|
395
395
|
size="large"
|
|
396
396
|
maxLength={URL_MAX_LENGTH}
|
|
@@ -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',
|
|
@@ -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-slidebox-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-slidebox-template-name{
|
|
54
|
+
display: inline-block;
|
|
55
|
+
max-width: 450px;
|
|
56
|
+
white-space: nowrap;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
text-overflow: ellipsis;
|
|
59
|
+
margin-bottom: -3px;
|
|
45
60
|
}
|
|
@@ -69,7 +69,14 @@ exports[`Test SlideBoxHeader container Should render correct component for rcs c
|
|
|
69
69
|
</SlideBoxHeader__PrefixWrapper>
|
|
70
70
|
}
|
|
71
71
|
size="large"
|
|
72
|
-
title=
|
|
72
|
+
title={
|
|
73
|
+
<CapHeading
|
|
74
|
+
className="slidebox-header-template-name"
|
|
75
|
+
type="h1"
|
|
76
|
+
>
|
|
77
|
+
amit123456
|
|
78
|
+
</CapHeading>
|
|
79
|
+
}
|
|
73
80
|
titleClass=""
|
|
74
81
|
/>
|
|
75
82
|
</div>
|
|
@@ -145,6 +152,7 @@ exports[`Test SlideBoxHeader container Should render correct component for whats
|
|
|
145
152
|
/>
|
|
146
153
|
</SlideBoxHeader__StyledLabel>
|
|
147
154
|
<SlideBoxHeader__StyledLabel
|
|
155
|
+
className="whatsapp-rcs-slidebox-template-name"
|
|
148
156
|
type="label2"
|
|
149
157
|
>
|
|
150
158
|
amit123456
|
|
@@ -257,7 +265,14 @@ exports[`Test SlideBoxHeader container Should render correct component for whats
|
|
|
257
265
|
</SlideBoxHeader__PrefixWrapper>
|
|
258
266
|
}
|
|
259
267
|
size="large"
|
|
260
|
-
title=
|
|
268
|
+
title={
|
|
269
|
+
<CapHeading
|
|
270
|
+
className="slidebox-header-template-name"
|
|
271
|
+
type="h1"
|
|
272
|
+
>
|
|
273
|
+
creatives_whatsapp6
|
|
274
|
+
</CapHeading>
|
|
275
|
+
}
|
|
261
276
|
titleClass=""
|
|
262
277
|
/>
|
|
263
278
|
</div>
|
|
@@ -1406,13 +1406,15 @@ export const Whatsapp = (props) => {
|
|
|
1406
1406
|
}
|
|
1407
1407
|
placement={'right'}
|
|
1408
1408
|
>
|
|
1409
|
-
<
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1409
|
+
<div className="button-disabled-tooltip-wrapper">
|
|
1410
|
+
<CapButton
|
|
1411
|
+
onClick={saveToMessage}
|
|
1412
|
+
disabled={isEditDoneDisabled()}
|
|
1413
|
+
className="whatsapp-create-btn"
|
|
1414
|
+
>
|
|
1415
|
+
<FormattedMessage {...globalMessages.done} />
|
|
1416
|
+
</CapButton>
|
|
1417
|
+
</div>
|
|
1416
1418
|
</CapTooltip>
|
|
1417
1419
|
)}
|
|
1418
1420
|
</WhatsappFooter>
|
|
@@ -153333,51 +153333,51 @@ Click {{unsubscribe}} to unsubscribe",
|
|
|
153333
153333
|
title=""
|
|
153334
153334
|
visible={false}
|
|
153335
153335
|
>
|
|
153336
|
-
<
|
|
153337
|
-
className="
|
|
153338
|
-
disabled={false}
|
|
153339
|
-
isAddBtn={false}
|
|
153336
|
+
<div
|
|
153337
|
+
className="button-disabled-tooltip-wrapper"
|
|
153340
153338
|
key="trigger"
|
|
153341
|
-
onClick={[Function]}
|
|
153342
153339
|
onMouseEnter={[Function]}
|
|
153343
153340
|
onMouseLeave={[Function]}
|
|
153344
|
-
type="primary"
|
|
153345
153341
|
>
|
|
153346
|
-
<
|
|
153347
|
-
|
|
153348
|
-
className="cap-button-v2 whatsapp-create-btn"
|
|
153342
|
+
<CapButton
|
|
153343
|
+
className="whatsapp-create-btn"
|
|
153349
153344
|
disabled={false}
|
|
153350
|
-
|
|
153351
|
-
htmlType="button"
|
|
153352
|
-
loading={false}
|
|
153345
|
+
isAddBtn={false}
|
|
153353
153346
|
onClick={[Function]}
|
|
153354
|
-
onMouseEnter={[Function]}
|
|
153355
|
-
onMouseLeave={[Function]}
|
|
153356
153347
|
type="primary"
|
|
153357
153348
|
>
|
|
153358
|
-
<
|
|
153359
|
-
|
|
153360
|
-
|
|
153361
|
-
|
|
153362
|
-
|
|
153363
|
-
|
|
153364
|
-
|
|
153365
|
-
|
|
153366
|
-
|
|
153367
|
-
|
|
153368
|
-
|
|
153369
|
-
|
|
153370
|
-
|
|
153371
|
-
|
|
153349
|
+
<Button
|
|
153350
|
+
block={false}
|
|
153351
|
+
className="cap-button-v2 whatsapp-create-btn"
|
|
153352
|
+
disabled={false}
|
|
153353
|
+
ghost={false}
|
|
153354
|
+
htmlType="button"
|
|
153355
|
+
loading={false}
|
|
153356
|
+
onClick={[Function]}
|
|
153357
|
+
type="primary"
|
|
153358
|
+
>
|
|
153359
|
+
<Wave>
|
|
153360
|
+
<button
|
|
153361
|
+
className="ant-btn cap-button-v2 whatsapp-create-btn ant-btn-primary"
|
|
153362
|
+
disabled={false}
|
|
153363
|
+
onClick={[Function]}
|
|
153364
|
+
type="button"
|
|
153372
153365
|
>
|
|
153373
|
-
<
|
|
153374
|
-
Done
|
|
153375
|
-
|
|
153376
|
-
|
|
153377
|
-
|
|
153378
|
-
|
|
153379
|
-
|
|
153380
|
-
|
|
153366
|
+
<FormattedMessage
|
|
153367
|
+
defaultMessage="Done"
|
|
153368
|
+
id="creatives.containersV2.done"
|
|
153369
|
+
key=".2"
|
|
153370
|
+
values={Object {}}
|
|
153371
|
+
>
|
|
153372
|
+
<span>
|
|
153373
|
+
Done
|
|
153374
|
+
</span>
|
|
153375
|
+
</FormattedMessage>
|
|
153376
|
+
</button>
|
|
153377
|
+
</Wave>
|
|
153378
|
+
</Button>
|
|
153379
|
+
</CapButton>
|
|
153380
|
+
</div>
|
|
153381
153381
|
</Trigger>
|
|
153382
153382
|
</Tooltip>
|
|
153383
153383
|
</Tooltip>
|
|
@@ -164012,51 +164012,51 @@ exports[`Creatives Whatsapp test1/> should render edit mode in various cases 6`]
|
|
|
164012
164012
|
showAction={Array []}
|
|
164013
164013
|
visible={false}
|
|
164014
164014
|
>
|
|
164015
|
-
<
|
|
164016
|
-
className="
|
|
164017
|
-
disabled={true}
|
|
164018
|
-
isAddBtn={false}
|
|
164015
|
+
<div
|
|
164016
|
+
className="button-disabled-tooltip-wrapper"
|
|
164019
164017
|
key="trigger"
|
|
164020
|
-
onClick={[Function]}
|
|
164021
164018
|
onMouseEnter={[Function]}
|
|
164022
164019
|
onMouseLeave={[Function]}
|
|
164023
|
-
type="primary"
|
|
164024
164020
|
>
|
|
164025
|
-
<
|
|
164026
|
-
|
|
164027
|
-
className="cap-button-v2 whatsapp-create-btn"
|
|
164021
|
+
<CapButton
|
|
164022
|
+
className="whatsapp-create-btn"
|
|
164028
164023
|
disabled={true}
|
|
164029
|
-
|
|
164030
|
-
htmlType="button"
|
|
164031
|
-
loading={false}
|
|
164024
|
+
isAddBtn={false}
|
|
164032
164025
|
onClick={[Function]}
|
|
164033
|
-
onMouseEnter={[Function]}
|
|
164034
|
-
onMouseLeave={[Function]}
|
|
164035
164026
|
type="primary"
|
|
164036
164027
|
>
|
|
164037
|
-
<
|
|
164038
|
-
|
|
164039
|
-
|
|
164040
|
-
|
|
164041
|
-
|
|
164042
|
-
|
|
164043
|
-
|
|
164044
|
-
|
|
164045
|
-
|
|
164046
|
-
|
|
164047
|
-
|
|
164048
|
-
|
|
164049
|
-
|
|
164050
|
-
|
|
164028
|
+
<Button
|
|
164029
|
+
block={false}
|
|
164030
|
+
className="cap-button-v2 whatsapp-create-btn"
|
|
164031
|
+
disabled={true}
|
|
164032
|
+
ghost={false}
|
|
164033
|
+
htmlType="button"
|
|
164034
|
+
loading={false}
|
|
164035
|
+
onClick={[Function]}
|
|
164036
|
+
type="primary"
|
|
164037
|
+
>
|
|
164038
|
+
<Wave>
|
|
164039
|
+
<button
|
|
164040
|
+
className="ant-btn cap-button-v2 whatsapp-create-btn ant-btn-primary"
|
|
164041
|
+
disabled={true}
|
|
164042
|
+
onClick={[Function]}
|
|
164043
|
+
type="button"
|
|
164051
164044
|
>
|
|
164052
|
-
<
|
|
164053
|
-
Done
|
|
164054
|
-
|
|
164055
|
-
|
|
164056
|
-
|
|
164057
|
-
|
|
164058
|
-
|
|
164059
|
-
|
|
164045
|
+
<FormattedMessage
|
|
164046
|
+
defaultMessage="Done"
|
|
164047
|
+
id="creatives.containersV2.done"
|
|
164048
|
+
key=".2"
|
|
164049
|
+
values={Object {}}
|
|
164050
|
+
>
|
|
164051
|
+
<span>
|
|
164052
|
+
Done
|
|
164053
|
+
</span>
|
|
164054
|
+
</FormattedMessage>
|
|
164055
|
+
</button>
|
|
164056
|
+
</Wave>
|
|
164057
|
+
</Button>
|
|
164058
|
+
</CapButton>
|
|
164059
|
+
</div>
|
|
164060
164060
|
</Trigger>
|
|
164061
164061
|
</Tooltip>
|
|
164062
164062
|
</Tooltip>
|