@capillarytech/creatives-library 8.0.198 → 8.0.199
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 -2
- package/package.json +1 -1
- package/services/api.js +0 -1
- package/v2Components/CapImageUpload/constants.js +1 -0
- package/v2Components/CapImageUpload/index.js +2 -1
- package/v2Components/CapMpushCTA/index.js +17 -18
- package/v2Components/CapMpushCTA/index.scss +18 -20
- package/v2Components/TemplatePreview/_templatePreview.scss +7 -8
- package/v2Containers/CreativesContainer/SlideBoxContent.js +0 -2
- package/v2Containers/MobilePushNew/components/CtaButtons.js +2 -2
- package/v2Containers/MobilePushNew/components/PlatformContentFields.js +6 -5
- package/v2Containers/MobilePushNew/components/tests/CtaButtons.test.js +1 -1
- package/v2Containers/MobilePushNew/components/tests/PlatformContentFields.test.js +35 -12
- package/v2Containers/MobilePushNew/constants.js +4 -4
- package/v2Containers/MobilePushNew/index.js +2 -1
- package/v2Containers/MobilePushNew/index.scss +26 -4
- package/v2Containers/MobilePushNew/style.js +11 -0
- package/v2Containers/Templates/_templates.scss +2 -2
- package/v2Containers/Whatsapp/constants.js +1 -22
- package/v2Containers/Whatsapp/index.js +1 -20
package/config/app.js
CHANGED
|
@@ -20,8 +20,7 @@ const config = {
|
|
|
20
20
|
accountConfig: (strs, accountId) => `${window.location.origin}/org/config/AccountAdd?q=a&channelId=2&accountId=${accountId}&edit=1`,
|
|
21
21
|
},
|
|
22
22
|
development: {
|
|
23
|
-
|
|
24
|
-
api_endpoint: 'http://localhost:2022/arya/api/v1/creatives',
|
|
23
|
+
api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/creatives',
|
|
25
24
|
campaigns_api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/campaigns',
|
|
26
25
|
campaigns_api_org_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/org/campaign',
|
|
27
26
|
auth_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/auth',
|
package/package.json
CHANGED
package/services/api.js
CHANGED
|
@@ -264,7 +264,6 @@ export const getUserData = () => {
|
|
|
264
264
|
|
|
265
265
|
export const createTemplate = ({template}) => {
|
|
266
266
|
const url = `${API_ENDPOINT}/templates/SMS`;
|
|
267
|
-
console.log("creating template",template);
|
|
268
267
|
return request(url, getAPICallObject('POST', template));
|
|
269
268
|
};
|
|
270
269
|
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
} from "../../v2Containers/CreativesContainer/constants";
|
|
28
28
|
|
|
29
29
|
import messages from './messages';
|
|
30
|
+
import { MOBILEPUSH } from '../CapVideoUpload/constants';
|
|
30
31
|
function CapImageUpload(props) {
|
|
31
32
|
const {
|
|
32
33
|
intl,
|
|
@@ -327,7 +328,7 @@ function CapImageUpload(props) {
|
|
|
327
328
|
getImageSizeLabel()
|
|
328
329
|
)
|
|
329
330
|
)}
|
|
330
|
-
{[VIBER, INAPP].includes(channel) && getImageSizeLabel()}
|
|
331
|
+
{[VIBER, INAPP, MOBILEPUSH].includes(channel) && getImageSizeLabel()}
|
|
331
332
|
<CapHeadingSpan type="label2" className="image-format">
|
|
332
333
|
{channel === INAPP ? <FormattedMessage {...messages.format2} /> : <FormattedMessage {...messages.format} />}
|
|
333
334
|
</CapHeadingSpan>
|
|
@@ -230,16 +230,16 @@ export const CapMpushCTA = (props) => {
|
|
|
230
230
|
if (isSaved) {
|
|
231
231
|
renderArray.push(
|
|
232
232
|
<CapRow
|
|
233
|
-
className="cap-
|
|
233
|
+
className="cap-mpush-saved-cta"
|
|
234
234
|
align="middle"
|
|
235
235
|
type="flex"
|
|
236
236
|
>
|
|
237
|
-
<CapRow className="
|
|
237
|
+
<CapRow className="mpush-cta-row">
|
|
238
238
|
<CapColumn>
|
|
239
|
-
<CapIcon size="s" type={'launch'}
|
|
239
|
+
<CapIcon size="s" type={'launch'} />
|
|
240
240
|
</CapColumn>
|
|
241
241
|
<CapColumn className="btn-text">
|
|
242
|
-
<CapLabel type="label2" className="
|
|
242
|
+
<CapLabel type="label2" className="mpush-saved-cta-button-text">
|
|
243
243
|
{text}
|
|
244
244
|
</CapLabel>
|
|
245
245
|
</CapColumn>
|
|
@@ -257,7 +257,7 @@ export const CapMpushCTA = (props) => {
|
|
|
257
257
|
{(
|
|
258
258
|
<CapRow className="cta-action-grp">
|
|
259
259
|
<CapColumn
|
|
260
|
-
className="
|
|
260
|
+
className="mpush-saved-cta-edit-icon"
|
|
261
261
|
onClick={() => isSavedCta(index, false)}
|
|
262
262
|
>
|
|
263
263
|
<CapIcon size="s" type="edit" className="cta-action" />
|
|
@@ -272,8 +272,8 @@ export const CapMpushCTA = (props) => {
|
|
|
272
272
|
} else {
|
|
273
273
|
renderArray.push(
|
|
274
274
|
<CapRow
|
|
275
|
-
className="cap-
|
|
276
|
-
id={`cap-
|
|
275
|
+
className="cap-mpush-cta"
|
|
276
|
+
id={`cap-mpush-cta-${index}`}
|
|
277
277
|
>
|
|
278
278
|
<CapColumn>
|
|
279
279
|
<CapHeading type="h4" className="cta-label">
|
|
@@ -295,7 +295,7 @@ export const CapMpushCTA = (props) => {
|
|
|
295
295
|
{formatMessage(messages.ctaType)}
|
|
296
296
|
</CapHeading>
|
|
297
297
|
<CapSelect.CapCustomSelect
|
|
298
|
-
id="
|
|
298
|
+
id="mpush-cta-type"
|
|
299
299
|
key="mpush-cta-type"
|
|
300
300
|
options={CTA_OPTIONS || []}
|
|
301
301
|
onChange={(value) => onUrlTypeChange(value, index)}
|
|
@@ -304,11 +304,11 @@ export const CapMpushCTA = (props) => {
|
|
|
304
304
|
</CapRow>
|
|
305
305
|
{urlType === DEEP_LINK && (
|
|
306
306
|
<CapRow style={{ width: '70%' }}>
|
|
307
|
-
<CapHeading type="h4">
|
|
307
|
+
<CapHeading type="h4" className="cta-deep-link-label">
|
|
308
308
|
{formatMessage(messages.urlDeepLink)}
|
|
309
309
|
</CapHeading>
|
|
310
310
|
<CapSelect.CapCustomSelect
|
|
311
|
-
id="
|
|
311
|
+
id="mpush-deep-link-type"
|
|
312
312
|
key="mpush-deep-link-type"
|
|
313
313
|
placeholder={formatMessage(messages.ctaDeepLinkOptionsPlaceholder)}
|
|
314
314
|
options={deepLink || []}
|
|
@@ -319,7 +319,7 @@ export const CapMpushCTA = (props) => {
|
|
|
319
319
|
)}
|
|
320
320
|
{urlType === EXTERNAL_URL && (
|
|
321
321
|
<CapTagListWithInput
|
|
322
|
-
inputId="
|
|
322
|
+
inputId="mpush-cta-external-link"
|
|
323
323
|
inputValue={localUrlValues[index] || ''}
|
|
324
324
|
inputOnChange={onUrlChange}
|
|
325
325
|
inputPlaceholder={formatMessage(messages.ctaExternalLinkPlaceholder)}
|
|
@@ -328,8 +328,7 @@ export const CapMpushCTA = (props) => {
|
|
|
328
328
|
inputErrorMessage={urlError}
|
|
329
329
|
headingText={formatMessage(messages.urlExternalLink)}
|
|
330
330
|
headingStyle={{ marginTop: '3%', marginRight: '50%'}}
|
|
331
|
-
containerStyle={{ width: '70%' }}
|
|
332
|
-
// tagListStyle={{ display: "flex" }}
|
|
331
|
+
containerStyle={{ width: '70%', marginTop: '-0.625rem' }}
|
|
333
332
|
moduleFilterEnabled={location?.query?.type !== "embedded"}
|
|
334
333
|
onTagSelect={onButtonTagSelect}
|
|
335
334
|
onContextChange={handleOnTagsContextChange}
|
|
@@ -357,8 +356,8 @@ export const CapMpushCTA = (props) => {
|
|
|
357
356
|
})()}
|
|
358
357
|
</CapLabel>
|
|
359
358
|
<CapInput
|
|
360
|
-
id="
|
|
361
|
-
className="
|
|
359
|
+
id="mpush-deep-link-keys"
|
|
360
|
+
className="mpush-deep-link-keys"
|
|
362
361
|
onChange={onDeepLinkKeysChange}
|
|
363
362
|
placeholder={formatMessage(messages.deepLinkKeysPlaceholder, { key: deepLinkKeysFromSelectionArray.join(', ') })}
|
|
364
363
|
value={Array.isArray(ctaDeepLinkKeysValue) ? ctaDeepLinkKeysValue.join(', ') : (ctaDeepLinkKeysValue || '')}
|
|
@@ -368,7 +367,7 @@ export const CapMpushCTA = (props) => {
|
|
|
368
367
|
/>
|
|
369
368
|
</CapRow>
|
|
370
369
|
)}
|
|
371
|
-
<CapRow className="
|
|
370
|
+
<CapRow className="mpush-cta-save-delete-btn">
|
|
372
371
|
<CapTooltip
|
|
373
372
|
title={
|
|
374
373
|
ctaSaveDisabled(index)
|
|
@@ -381,7 +380,7 @@ export const CapMpushCTA = (props) => {
|
|
|
381
380
|
<CapButton
|
|
382
381
|
onClick={() => isSavedCta(index, true)}
|
|
383
382
|
disabled={ctaSaveDisabled(index)}
|
|
384
|
-
className="
|
|
383
|
+
className="mpush-cta-save-btn"
|
|
385
384
|
>
|
|
386
385
|
{formatMessage(globalMessages.save)}
|
|
387
386
|
</CapButton>
|
|
@@ -389,7 +388,7 @@ export const CapMpushCTA = (props) => {
|
|
|
389
388
|
</CapTooltip>
|
|
390
389
|
<CapButton
|
|
391
390
|
onClick={() => deleteHandler(index)}
|
|
392
|
-
className="
|
|
391
|
+
className="mpush-cta-delete-btn"
|
|
393
392
|
type="secondary"
|
|
394
393
|
>
|
|
395
394
|
{formatMessage(globalMessages.delete)}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
@import '~@capillarytech/cap-ui-library/styles/_variables.scss';
|
|
2
2
|
|
|
3
|
-
.cap-
|
|
4
|
-
margin-top: $CAP_SPACE_16;
|
|
5
|
-
margin-left: 1.6rem;
|
|
3
|
+
.cap-mpush-cta {
|
|
6
4
|
padding: $CAP_SPACE_16 $CAP_SPACE_24;
|
|
7
5
|
border: 1px solid $CAP_G06;
|
|
8
6
|
border-radius: $CAP_SPACE_04;
|
|
9
7
|
|
|
10
8
|
.mpush-cta-buttons {
|
|
11
|
-
margin-top: $CAP_SPACE_12;
|
|
12
9
|
display: flex;
|
|
13
10
|
flex-direction: row;
|
|
14
|
-
align-items: flex-end;
|
|
15
11
|
justify-content: space-between;
|
|
16
12
|
|
|
17
13
|
.mpush-render-btn-length {
|
|
@@ -20,46 +16,51 @@
|
|
|
20
16
|
margin-left: 52%;
|
|
21
17
|
margin-bottom: $CAP_SPACE_12;
|
|
22
18
|
}
|
|
19
|
+
|
|
20
|
+
.cta-deep-link-label {
|
|
21
|
+
margin-bottom: 0.625rem;
|
|
22
|
+
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
#
|
|
25
|
+
#mpush-deep-link-type {
|
|
26
26
|
width: 100%;
|
|
27
27
|
margin-top: $CAP_SPACE_12;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
.
|
|
30
|
+
.mpush-cta-external-link {
|
|
31
31
|
margin-top: $CAP_SPACE_12;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
.
|
|
34
|
+
.mpush-cta-save-delete-btn {
|
|
35
35
|
margin-top: $CAP_SPACE_16;
|
|
36
36
|
|
|
37
|
-
.
|
|
37
|
+
.mpush-cta-save-btn {
|
|
38
38
|
margin-right: $CAP_SPACE_04;
|
|
39
39
|
}
|
|
40
|
-
.
|
|
40
|
+
.mpush-cta-delete-btn {
|
|
41
41
|
margin-left: $CAP_SPACE_04;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
+
|
|
45
|
+
.cta-deep-link-keys-value {
|
|
46
|
+
margin: $CAP_SPACE_08 0;
|
|
47
|
+
}
|
|
44
48
|
|
|
45
49
|
}
|
|
46
50
|
|
|
47
|
-
.cap-
|
|
51
|
+
.cap-mpush-saved-cta {
|
|
48
52
|
border: solid 1px $CAP_G06;
|
|
49
|
-
margin-left: $CAP_SPACE_20;
|
|
50
53
|
display: flex;
|
|
51
54
|
justify-content: space-between;
|
|
52
55
|
padding: $CAP_SPACE_08 $CAP_SPACE_12;
|
|
53
56
|
border-radius: $CAP_SPACE_04;
|
|
54
|
-
margin-top: $CAP_SPACE_12;
|
|
55
57
|
height: $CAP_SPACE_40;
|
|
56
58
|
|
|
57
|
-
.
|
|
59
|
+
.mpush-saved-cta-button-text {
|
|
58
60
|
font-weight: 500;
|
|
59
|
-
padding-left: $CAP_SPACE_16;
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
.
|
|
63
|
+
.mpush-saved-cta-edit-icon {
|
|
63
64
|
margin-left: 4.286rem;
|
|
64
65
|
}
|
|
65
66
|
}
|
|
@@ -77,7 +78,7 @@
|
|
|
77
78
|
.cta-action {
|
|
78
79
|
cursor: pointer;
|
|
79
80
|
}
|
|
80
|
-
.
|
|
81
|
+
.mpush-cta-row {
|
|
81
82
|
display: flex;
|
|
82
83
|
align-items: center;
|
|
83
84
|
}
|
|
@@ -89,7 +90,4 @@
|
|
|
89
90
|
}
|
|
90
91
|
.btn-text {
|
|
91
92
|
margin-left: $CAP_SPACE_08;
|
|
92
|
-
}
|
|
93
|
-
.btn-icon {
|
|
94
|
-
color: $CAP_G06;
|
|
95
93
|
}
|
|
@@ -600,7 +600,7 @@
|
|
|
600
600
|
.body-image{
|
|
601
601
|
img{
|
|
602
602
|
max-width: 18.75rem;
|
|
603
|
-
max-height:
|
|
603
|
+
max-height: 13.75rem;
|
|
604
604
|
margin-left: 1.571rem;
|
|
605
605
|
display: block;
|
|
606
606
|
}
|
|
@@ -671,8 +671,7 @@
|
|
|
671
671
|
font-weight: 600;
|
|
672
672
|
padding: $CAP_SPACE_04 $CAP_SPACE_08 $CAP_SPACE_04 $CAP_SPACE_08;
|
|
673
673
|
display: flex;
|
|
674
|
-
|
|
675
|
-
// justify-content: space-between;
|
|
674
|
+
justify-content: space-between;
|
|
676
675
|
.app-icon{
|
|
677
676
|
width: $CAP_SPACE_12;
|
|
678
677
|
height: $CAP_SPACE_12;
|
|
@@ -687,7 +686,7 @@
|
|
|
687
686
|
.app-header-right{
|
|
688
687
|
display: flex;
|
|
689
688
|
align-items: center;
|
|
690
|
-
|
|
689
|
+
margin-left: 7.8125rem;
|
|
691
690
|
span{
|
|
692
691
|
font-weight: 200;
|
|
693
692
|
}
|
|
@@ -719,8 +718,8 @@
|
|
|
719
718
|
background-color: #ffffff;
|
|
720
719
|
height: auto;
|
|
721
720
|
padding: 0.571rem;
|
|
722
|
-
padding-left: 1.571rem;
|
|
723
721
|
display: flex;
|
|
722
|
+
justify-content: space-between;
|
|
724
723
|
flex-direction: row;
|
|
725
724
|
gap: $CAP_SPACE_08;
|
|
726
725
|
.action{
|
|
@@ -810,7 +809,7 @@
|
|
|
810
809
|
// Mobile Push Carousel Styles
|
|
811
810
|
.mobile-push-carousel-container {
|
|
812
811
|
background-color: $CAP_WHITE;
|
|
813
|
-
padding-left: 1.375rem;
|
|
812
|
+
padding-left: 1.375rem;
|
|
814
813
|
}
|
|
815
814
|
}
|
|
816
815
|
|
|
@@ -868,7 +867,7 @@
|
|
|
868
867
|
top: 14%;
|
|
869
868
|
left: 29%;
|
|
870
869
|
width: 42%;
|
|
871
|
-
height:
|
|
870
|
+
height: 17.1875rem;
|
|
872
871
|
display: -webkit-box;
|
|
873
872
|
display: -ms-flexbox;
|
|
874
873
|
display: flex;
|
|
@@ -881,7 +880,7 @@
|
|
|
881
880
|
}
|
|
882
881
|
|
|
883
882
|
&.sms{
|
|
884
|
-
height:
|
|
883
|
+
height: 18.125rem;
|
|
885
884
|
width: 40%;
|
|
886
885
|
top: 16%;
|
|
887
886
|
.sms-icon{
|
|
@@ -111,8 +111,8 @@ const CtaButtons = ({
|
|
|
111
111
|
|
|
112
112
|
return (
|
|
113
113
|
<>
|
|
114
|
-
<CapRow>
|
|
115
|
-
<CapHeading type="
|
|
114
|
+
<CapRow className="mpush-cta-buttons">
|
|
115
|
+
<CapHeading type="h3">
|
|
116
116
|
<FormattedMessage {...messages.buttons} />
|
|
117
117
|
</CapHeading>
|
|
118
118
|
{!isPrimaryButtonSaved && !shouldShowPrimaryCTA && (
|
|
@@ -165,7 +165,7 @@ const PlatformContentFields = ({
|
|
|
165
165
|
<CapRow className="content-fields">
|
|
166
166
|
<CapRow className="creatives-mpush-title">
|
|
167
167
|
<CapColumn className="mpush-title-main">
|
|
168
|
-
<CapHeading type="
|
|
168
|
+
<CapHeading type="h3" className="mpush-title">
|
|
169
169
|
<FormattedMessage {...messages.title} />
|
|
170
170
|
</CapHeading>
|
|
171
171
|
{getTagList(0)}
|
|
@@ -189,12 +189,12 @@ const PlatformContentFields = ({
|
|
|
189
189
|
|
|
190
190
|
<CapRow className="creatives-mpush-message">
|
|
191
191
|
<CapColumn className="mpush-message-main">
|
|
192
|
-
<CapHeading type="
|
|
192
|
+
<CapHeading type="h3" className="mpush-message">
|
|
193
193
|
<FormattedMessage {...messages.message} />
|
|
194
194
|
</CapHeading>
|
|
195
195
|
{getTagList(1)}
|
|
196
196
|
</CapColumn>
|
|
197
|
-
<CapInput
|
|
197
|
+
<CapInput.TextArea
|
|
198
198
|
id={`mobile-push-message-name-input-${deviceType}`}
|
|
199
199
|
onChange={onMessageChange}
|
|
200
200
|
placeholder={formatMessage(messages.messagePlaceholder)}
|
|
@@ -208,11 +208,12 @@ const PlatformContentFields = ({
|
|
|
208
208
|
</CapError>
|
|
209
209
|
)
|
|
210
210
|
}
|
|
211
|
+
autosize={{ minRows: 3, maxRows: 5 }}
|
|
211
212
|
/>
|
|
212
213
|
</CapRow>
|
|
213
214
|
<CapDivider />
|
|
214
215
|
<CapRow className="creatives-mpush-media">
|
|
215
|
-
<CapHeading type="
|
|
216
|
+
<CapHeading type="h3" className="mpush-media-type">
|
|
216
217
|
<FormattedMessage {...messages.mediaType} />
|
|
217
218
|
</CapHeading>
|
|
218
219
|
<CapSelect.CapCustomSelect
|
|
@@ -238,7 +239,7 @@ const PlatformContentFields = ({
|
|
|
238
239
|
<CapDivider />
|
|
239
240
|
<CapRow className="creatives-mpush-actions">
|
|
240
241
|
<CapRow className="mpush-actions-main">
|
|
241
|
-
<CapHeading type="
|
|
242
|
+
<CapHeading type="h3" className="mpush-actions">
|
|
242
243
|
<FormattedMessage {...messages.buttonsAndLinks} />
|
|
243
244
|
</CapHeading>
|
|
244
245
|
<CapLabel className="optional-text">
|
|
@@ -388,7 +388,7 @@ describe('CtaButtons', () => {
|
|
|
388
388
|
it('should render heading with correct type', () => {
|
|
389
389
|
renderComponent();
|
|
390
390
|
|
|
391
|
-
expect(screen.getByTestId('cap-heading')).toHaveAttribute('data-heading-type', '
|
|
391
|
+
expect(screen.getByTestId('cap-heading')).toHaveAttribute('data-heading-type', 'h3');
|
|
392
392
|
});
|
|
393
393
|
|
|
394
394
|
it('should render button headings with correct type', () => {
|
|
@@ -10,14 +10,28 @@ import {
|
|
|
10
10
|
// Simple mock components
|
|
11
11
|
jest.mock("@capillarytech/cap-ui-library/CapRow", () => ({ children }) => <div>{children}</div>);
|
|
12
12
|
jest.mock("@capillarytech/cap-ui-library/CapColumn", () => ({ children }) => <div>{children}</div>);
|
|
13
|
-
jest.mock("@capillarytech/cap-ui-library/CapInput", () =>
|
|
14
|
-
value, onChange, errorMessage, error, ...props
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
jest.mock("@capillarytech/cap-ui-library/CapInput", () => {
|
|
14
|
+
const MockCapInput = ({ value, onChange, errorMessage, error, ...props }) => (
|
|
15
|
+
<div>
|
|
16
|
+
<input value={value || ""} onChange={onChange} error={error} {...props} />
|
|
17
|
+
{(errorMessage || error) && <div data-testid="error-message">{errorMessage || error}</div>}
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
MockCapInput.TextArea = ({ value, onChange, errorMessage, error, ...props }) => (
|
|
22
|
+
<div>
|
|
23
|
+
<textarea
|
|
24
|
+
value={value || ""}
|
|
25
|
+
onChange={onChange}
|
|
26
|
+
data-testid="message-textarea"
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
{(errorMessage || error) && <div data-testid="error-message">{errorMessage || error}</div>}
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
return MockCapInput;
|
|
34
|
+
});
|
|
21
35
|
jest.mock("@capillarytech/cap-ui-library/CapHeading", () => ({ children }) => <div>{children}</div>);
|
|
22
36
|
jest.mock("@capillarytech/cap-ui-library/CapError", () => ({ children }) => <div data-testid="cap-error">{children}</div>);
|
|
23
37
|
jest.mock("@capillarytech/cap-ui-library/CapDivider", () => () => <div data-testid="divider" />);
|
|
@@ -84,6 +98,7 @@ jest.mock("../../messages", () => ({
|
|
|
84
98
|
deepLinkKeys: { id: "deepLinkKeys", defaultMessage: "Deep Link Keys" },
|
|
85
99
|
deepLinkKeysPlaceholder: { id: "deepLinkKeysPlaceholder", defaultMessage: "Enter {key}" },
|
|
86
100
|
deepLinkKeysRequired: { id: "deepLinkKeysRequired", defaultMessage: "Deep link keys are required" },
|
|
101
|
+
addLabels: { id: "addLabels", defaultMessage: "Add labels" },
|
|
87
102
|
}));
|
|
88
103
|
|
|
89
104
|
// Mock constants
|
|
@@ -118,6 +133,7 @@ describe("PlatformContentFields", () => {
|
|
|
118
133
|
title: "",
|
|
119
134
|
message: "",
|
|
120
135
|
externalLink: "",
|
|
136
|
+
deepLinkKeys: "",
|
|
121
137
|
},
|
|
122
138
|
handlers: {
|
|
123
139
|
handleTitleChange: jest.fn(),
|
|
@@ -126,6 +142,7 @@ describe("PlatformContentFields", () => {
|
|
|
126
142
|
handleActionOnClickChange: jest.fn(),
|
|
127
143
|
handleLinkTypeChange: jest.fn(),
|
|
128
144
|
handleDeepLinkChange: jest.fn(),
|
|
145
|
+
handleDeepLinkKeysChange: jest.fn(),
|
|
129
146
|
handleExternalLinkChange: jest.fn(),
|
|
130
147
|
onTagSelect: jest.fn(),
|
|
131
148
|
handleOnTagsContextChange: jest.fn(),
|
|
@@ -145,10 +162,15 @@ describe("PlatformContentFields", () => {
|
|
|
145
162
|
{ value: "link2", label: "Link 2" },
|
|
146
163
|
],
|
|
147
164
|
deepLinkValue: "link1",
|
|
165
|
+
deepLinkKeysValue: [],
|
|
148
166
|
externalLinkValue: "https://example.com",
|
|
149
167
|
},
|
|
150
168
|
sameContent: false,
|
|
151
169
|
formatMessage: jest.fn((msg) => msg.defaultMessage),
|
|
170
|
+
location: { query: {} },
|
|
171
|
+
tags: ["tag1", "tag2"],
|
|
172
|
+
injectedTags: [],
|
|
173
|
+
selectedOfferDetails: null,
|
|
152
174
|
};
|
|
153
175
|
|
|
154
176
|
const renderComponent = (props = {}) => render(
|
|
@@ -174,9 +196,10 @@ describe("PlatformContentFields", () => {
|
|
|
174
196
|
});
|
|
175
197
|
|
|
176
198
|
it("should render message input with correct value", () => {
|
|
177
|
-
const {
|
|
178
|
-
const messageInput =
|
|
199
|
+
const { getByTestId } = renderComponent();
|
|
200
|
+
const messageInput = getByTestId("message-textarea");
|
|
179
201
|
expect(messageInput).toBeInTheDocument();
|
|
202
|
+
expect(messageInput.value).toBe("Test Message");
|
|
180
203
|
});
|
|
181
204
|
|
|
182
205
|
it("should render MediaUploaders component", () => {
|
|
@@ -217,8 +240,8 @@ describe("PlatformContentFields", () => {
|
|
|
217
240
|
|
|
218
241
|
describe("Message Field", () => {
|
|
219
242
|
it("should call message change handler", () => {
|
|
220
|
-
const {
|
|
221
|
-
const messageInput =
|
|
243
|
+
const { getByTestId } = renderComponent();
|
|
244
|
+
const messageInput = getByTestId("message-textarea");
|
|
222
245
|
|
|
223
246
|
fireEvent.change(messageInput, { target: { value: "New Message" } });
|
|
224
247
|
|
|
@@ -41,10 +41,10 @@ export const GET_MOBILEPUSH_TEMPLATES_LIST_FAILURE = 'app/v2Containers/WeChat/MP
|
|
|
41
41
|
export const MAPP_SDK = 'MAPP_SDK';
|
|
42
42
|
|
|
43
43
|
export const MEDIA_TYPES_OPTIONS = [
|
|
44
|
-
{ label: "
|
|
45
|
-
{ label: "
|
|
46
|
-
{ label: "
|
|
47
|
-
{ label: "
|
|
44
|
+
{ label: "None", value: "NONE" },
|
|
45
|
+
{ label: "Image", value: "IMAGE" },
|
|
46
|
+
{ label: "Video", value: "VIDEO" },
|
|
47
|
+
{ label: "Carousel", value: "CAROUSEL" },
|
|
48
48
|
];
|
|
49
49
|
|
|
50
50
|
export const MOBILE_PUSH_CHANNEL = "MOBILEPUSH";
|
|
@@ -92,6 +92,7 @@ import messages from "./messages";
|
|
|
92
92
|
import { EXTERNAL_URL } from "../CreativesContainer/constants";
|
|
93
93
|
import createMobilePushPayloadWithIntl from "../../utils/createMobilePushPayload";
|
|
94
94
|
import { MOBILEPUSH } from "../../v2Components/CapVideoUpload/constants";
|
|
95
|
+
import { StyledCapTab } from "./style";
|
|
95
96
|
|
|
96
97
|
// Helper function to extract deep link keys from URL where value equals key
|
|
97
98
|
const extractDeepLinkKeys = (deepLinkValue) => {
|
|
@@ -2893,7 +2894,7 @@ const MobilePushNew = ({
|
|
|
2893
2894
|
</CapCheckbox>
|
|
2894
2895
|
)}
|
|
2895
2896
|
<CapRow className="platform-header">
|
|
2896
|
-
<
|
|
2897
|
+
<StyledCapTab
|
|
2897
2898
|
className="platform-tabs"
|
|
2898
2899
|
activeKey={activeTab}
|
|
2899
2900
|
onChange={setActiveTab}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
@import '~@capillarytech/cap-ui-library/styles/_variables';
|
|
2
|
-
|
|
3
2
|
.header-row {
|
|
4
3
|
margin-bottom: $CAP_SPACE_24;
|
|
5
4
|
}
|
|
@@ -89,9 +88,10 @@
|
|
|
89
88
|
.mpush-title,
|
|
90
89
|
.mpush-message,
|
|
91
90
|
.mpush-media-type {
|
|
92
|
-
font-weight:
|
|
91
|
+
font-weight: $FONT_WEIGHT_MEDIUM;
|
|
93
92
|
color: #333;
|
|
94
93
|
margin: 0;
|
|
94
|
+
gap: $CAP_SPACE_04;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
.add-labels,
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
.notification-title {
|
|
188
|
-
font-weight:
|
|
188
|
+
font-weight: $FONT_WEIGHT_MEDIUM;
|
|
189
189
|
margin-bottom: $CAP_SPACE_08;
|
|
190
190
|
color: #333;
|
|
191
191
|
}
|
|
@@ -215,7 +215,7 @@
|
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
#add-primary-btn-heading #add-secondary-btn-heading {
|
|
218
|
-
font-weight:
|
|
218
|
+
font-weight: $FONT_WEIGHT_MEDIUM;
|
|
219
219
|
color: #1890ff;
|
|
220
220
|
}
|
|
221
221
|
|
|
@@ -336,4 +336,26 @@
|
|
|
336
336
|
|
|
337
337
|
.save-section {
|
|
338
338
|
margin-bottom: $CAP_SPACE_12;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.mpush-media-type {
|
|
342
|
+
margin-bottom: $CAP_SPACE_08;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.mpush-cta-buttons {
|
|
346
|
+
padding: $CAP_SPACE_20 0;
|
|
347
|
+
|
|
348
|
+
#add-primary-button,
|
|
349
|
+
#add-secondary-button {
|
|
350
|
+
color: $FONT_COLOR_05;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
#add-primary-btn-heading,
|
|
354
|
+
#add-secondary-btn-heading {
|
|
355
|
+
gap: $CAP_SPACE_04;
|
|
356
|
+
color: $FONT_COLOR_05;
|
|
357
|
+
font-weight: $FONT_WEIGHT_MEDIUM;
|
|
358
|
+
margin-left: $CAP_SPACE_04;
|
|
359
|
+
margin-bottom: $CAP_SPACE_04;
|
|
360
|
+
}
|
|
339
361
|
}
|
|
@@ -587,7 +587,7 @@
|
|
|
587
587
|
font-weight: 600;
|
|
588
588
|
}
|
|
589
589
|
.actions{
|
|
590
|
-
background-color:
|
|
590
|
+
background-color: $CAP_WHITE;
|
|
591
591
|
height: 32px;
|
|
592
592
|
padding: 4px;
|
|
593
593
|
.action{
|
|
@@ -649,7 +649,7 @@
|
|
|
649
649
|
text-align: center;
|
|
650
650
|
.action{
|
|
651
651
|
font-size: 12px;
|
|
652
|
-
color:
|
|
652
|
+
color: $CAP_BLUE01;
|
|
653
653
|
font-weight: 600;
|
|
654
654
|
text-align: center;
|
|
655
655
|
margin-left: 8px;
|
|
@@ -80,7 +80,7 @@ export const mediaTypeOptions = ({host, templateCategory}) => {
|
|
|
80
80
|
tagColor: CAP_GREEN02,
|
|
81
81
|
tagTextColor: CAP_GREEN01,
|
|
82
82
|
},
|
|
83
|
-
...(templateCategory === WHATSAPP_CATEGORIES.marketing && (
|
|
83
|
+
...(templateCategory === WHATSAPP_CATEGORIES.marketing && (host === HOST_GUPSHUP || host === HOST_KARIX)
|
|
84
84
|
? [
|
|
85
85
|
{
|
|
86
86
|
key: 'CAROUSEL',
|
|
@@ -104,25 +104,6 @@ export const mediaTypeOptions = ({host, templateCategory}) => {
|
|
|
104
104
|
];
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
-
export const VALUE_FIRST_CATEGORY_OPTIONS = [
|
|
108
|
-
{
|
|
109
|
-
key: 'marketing',
|
|
110
|
-
value: WHATSAPP_CATEGORIES.marketing,
|
|
111
|
-
label: <FormattedMessage {...messages.marketing} />,
|
|
112
|
-
tooltipLabel: <FormattedMessage {...messages.marketingTooltip} />,
|
|
113
|
-
tagColor: CAP_ORANGE01,
|
|
114
|
-
tagTextColor: CAP_ORANGE,
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
key: 'authentication',
|
|
118
|
-
value: WHATSAPP_CATEGORIES.authentication,
|
|
119
|
-
label: <FormattedMessage {...messages.authentication} />,
|
|
120
|
-
tooltipLabel: <FormattedMessage {...messages.authenticationTooltip} />,
|
|
121
|
-
tagColor: CAP_GREEN02,
|
|
122
|
-
tagTextColor: CAP_GREEN01,
|
|
123
|
-
},
|
|
124
|
-
];
|
|
125
|
-
|
|
126
107
|
export const KARIX_GUPSHUP_CATEGORY_OPTIONS = [
|
|
127
108
|
{
|
|
128
109
|
key: 'utility',
|
|
@@ -365,7 +346,6 @@ export const HOST_KARIX = 'karixwhatsappbulk';
|
|
|
365
346
|
export const HOST_GUPSHUP = 'gupshupwhatsappbulk';
|
|
366
347
|
export const HOST_ICS = 'icswababulk';
|
|
367
348
|
export const HOST_HAPTIC = 'hapticwhatsappbulk';
|
|
368
|
-
export const HOST_VALUE_FIRST = 'valuefirstwhatsappbulk';
|
|
369
349
|
|
|
370
350
|
export const SIZE_UNITS = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
371
351
|
export const DOCUMENT_FORMAT = 'PDF';
|
|
@@ -705,7 +685,6 @@ export const CATEGORY_OPTIONS_MAP = {
|
|
|
705
685
|
[HOST_GUPSHUP]: KARIX_GUPSHUP_CATEGORY_OPTIONS,
|
|
706
686
|
[HOST_ICS]: ICS_CATEGORY_OPTIONS,
|
|
707
687
|
[HOST_HAPTIC]: HAPTIC_CATEGORY_OPTIONS,
|
|
708
|
-
[HOST_VALUE_FIRST]: VALUE_FIRST_CATEGORY_OPTIONS,
|
|
709
688
|
};
|
|
710
689
|
|
|
711
690
|
export const REQUEST = "REQUEST";
|
|
@@ -55,7 +55,6 @@ import {
|
|
|
55
55
|
WHATSAPP,
|
|
56
56
|
TWILIO_CATEGORY_OPTIONS,
|
|
57
57
|
KARIX_GUPSHUP_CATEGORY_OPTIONS,
|
|
58
|
-
VALUE_FIRST_CATEGORY_OPTIONS,
|
|
59
58
|
LANGUAGE_OPTIONS,
|
|
60
59
|
WHATSAPP_STATUSES,
|
|
61
60
|
TAG,
|
|
@@ -99,7 +98,6 @@ import {
|
|
|
99
98
|
HAPTIC_CATEGORY_OPTIONS,
|
|
100
99
|
CORRECT_TEMPLATE_FORMAT_URL,
|
|
101
100
|
CATEGORY_OPTIONS_MAP,
|
|
102
|
-
HOST_VALUE_FIRST,
|
|
103
101
|
IMAGE,
|
|
104
102
|
VIDEO,
|
|
105
103
|
URL,
|
|
@@ -268,7 +266,6 @@ export const Whatsapp = (props) => {
|
|
|
268
266
|
const isMediaTypeCarousel = templateMediaType === WHATSAPP_MEDIA_TYPES.CAROUSEL;
|
|
269
267
|
const isHostIsNotTwilio = host !== HOST_TWILIO;
|
|
270
268
|
const isHaptic = host === HOST_HAPTIC;
|
|
271
|
-
const isHostValueFirst = host === HOST_VALUE_FIRST;
|
|
272
269
|
const WhatsappFooter = styled.div`
|
|
273
270
|
background-color: ${CAP_WHITE};
|
|
274
271
|
position: fixed;
|
|
@@ -836,11 +833,6 @@ export const Whatsapp = (props) => {
|
|
|
836
833
|
label: renderTemplateCategoryLabel(option.tooltipLabel, option.label),
|
|
837
834
|
}));
|
|
838
835
|
|
|
839
|
-
const valueFirstCategoryOptions = VALUE_FIRST_CATEGORY_OPTIONS.map((option) => ({
|
|
840
|
-
value: option.value,
|
|
841
|
-
label: renderTemplateCategoryLabel(option.tooltipLabel, option.label),
|
|
842
|
-
}));
|
|
843
|
-
|
|
844
836
|
const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.authentication);
|
|
845
837
|
const onChangeButtonType = ({ target: { value } }) => {
|
|
846
838
|
setButtonType(value);
|
|
@@ -1341,8 +1333,6 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
1341
1333
|
};
|
|
1342
1334
|
|
|
1343
1335
|
const getCategoryOptions = (host) => {
|
|
1344
|
-
console.log('host', host);
|
|
1345
|
-
console.log('CATEGORY_OPTIONS_MAP', CATEGORY_OPTIONS_MAP);
|
|
1346
1336
|
return CATEGORY_OPTIONS_MAP[host] || [];
|
|
1347
1337
|
}
|
|
1348
1338
|
|
|
@@ -1587,7 +1577,6 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
1587
1577
|
}
|
|
1588
1578
|
|
|
1589
1579
|
const createPayload = () => {
|
|
1590
|
-
console.log('in create payload');
|
|
1591
1580
|
let mediaParams = {};
|
|
1592
1581
|
const { whatsappVideoSrc = '', whatsappVideoPreviewImg = '' } = whatsappVideoSrcAndPreview;
|
|
1593
1582
|
switch (templateMediaType) {
|
|
@@ -1698,9 +1687,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
1698
1687
|
|
|
1699
1688
|
const createApprovalHandler = () => {
|
|
1700
1689
|
setSpin(true);
|
|
1701
|
-
|
|
1702
|
-
console.log('payload', payload);
|
|
1703
|
-
actions.createWhatsappTemplate(payload, (resp, errorMessage) => {
|
|
1690
|
+
actions.createWhatsappTemplate(createPayload(), (resp, errorMessage) => {
|
|
1704
1691
|
actionCallback({ resp, errorMessage });
|
|
1705
1692
|
if (!errorMessage) {
|
|
1706
1693
|
onCreateComplete();
|
|
@@ -2558,8 +2545,6 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2558
2545
|
};
|
|
2559
2546
|
|
|
2560
2547
|
const renderedEditMessage = (messageData, type, carousel) => {
|
|
2561
|
-
console.log("tagsWsapp----> messageData", messageData);
|
|
2562
|
-
console.log("tagsWsapp----> type", type);
|
|
2563
2548
|
const renderArray = [];
|
|
2564
2549
|
if (messageData && messageData?.length !== 0) {
|
|
2565
2550
|
let varCount = 0;
|
|
@@ -2578,9 +2563,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2578
2563
|
break;
|
|
2579
2564
|
}
|
|
2580
2565
|
if (elem.match(validRegex)?.length > 0) {
|
|
2581
|
-
console.log("tagsWsapp----> if condition ; elem", elem);
|
|
2582
2566
|
varCount += 1;
|
|
2583
|
-
console.log("tagsWsapp----> if condition ; varCount", varCount);
|
|
2584
2567
|
renderArray.push(
|
|
2585
2568
|
<TextArea
|
|
2586
2569
|
id={`${elem}_${index}`}
|
|
@@ -2596,7 +2579,6 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2596
2579
|
/>
|
|
2597
2580
|
);
|
|
2598
2581
|
} else {
|
|
2599
|
-
console.log("tagsWsapp----> outer else condition ; elem", elem);
|
|
2600
2582
|
renderArray.push(
|
|
2601
2583
|
<CapHeading
|
|
2602
2584
|
key={`${elem}_${index}`}
|
|
@@ -2717,7 +2699,6 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2717
2699
|
</CapHeading>
|
|
2718
2700
|
}
|
|
2719
2701
|
suffix={
|
|
2720
|
-
// console.log("location", location);
|
|
2721
2702
|
templateStatus === WHATSAPP_STATUSES.approved && !isAuthenticationTemplate && (
|
|
2722
2703
|
<TagList
|
|
2723
2704
|
label={formatMessage(globalMessages.addLabels)}
|