@capillarytech/creatives-library 7.16.7 → 7.16.9-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 +1 -1
- package/v2Components/CapWhatsappCTA/index.js +2 -4
- package/v2Components/CapWhatsappCTA/messages.js +1 -1
- package/v2Containers/LanguageProvider/index.js +3 -0
- package/v2Containers/Line/Container/Video/index.js +2 -2
- package/v2Containers/Line/Container/Video/messages.js +9 -0
- package/v2Containers/Line/Container/Wrapper/tests/index.test.js +4 -0
- package/v2Containers/MobilePush/Create/index.js +21 -3
- package/v2Containers/MobilePush/Create/messages.js +48 -0
- package/v2Containers/MobilePush/Edit/index.js +19 -1
- package/v2Containers/MobilePush/Edit/messages.js +16 -0
- package/v2Containers/MobilePush/commonMethods.js +2 -2
package/package.json
CHANGED
|
@@ -142,7 +142,7 @@ export const CapWhatsappCTA = (props) => {
|
|
|
142
142
|
|
|
143
143
|
const onButtonTextChange = ({ target }) => {
|
|
144
144
|
const { value, id } = target;
|
|
145
|
-
let errorMessage =
|
|
145
|
+
let errorMessage = '';
|
|
146
146
|
if (!isValidText(value)) {
|
|
147
147
|
errorMessage = formatMessage(messages.ctaButtonErrorMessage);
|
|
148
148
|
}
|
|
@@ -179,14 +179,12 @@ export const CapWhatsappCTA = (props) => {
|
|
|
179
179
|
|
|
180
180
|
const ctaSaveDisabled = (index) => {
|
|
181
181
|
const { ctaType, text, phone_number, url } = ctaData[index] || {};
|
|
182
|
-
if (text === '') {
|
|
182
|
+
if (text === '' || buttonError) {
|
|
183
183
|
return true;
|
|
184
184
|
} else if (ctaType === PHONE_NUMBER && phone_number.length < 5) {
|
|
185
185
|
return true;
|
|
186
186
|
} else if (ctaType === WEBSITE && (url === '' || urlError)) {
|
|
187
187
|
return true;
|
|
188
|
-
} else if (text === '' || buttonError) {
|
|
189
|
-
return true;
|
|
190
188
|
}
|
|
191
189
|
return false;
|
|
192
190
|
};
|
|
@@ -55,7 +55,7 @@ export default defineMessages({
|
|
|
55
55
|
},
|
|
56
56
|
ctaButtonErrorMessage: {
|
|
57
57
|
id: `${prefix}.ctaButtonErrorMessage`,
|
|
58
|
-
defaultMessage: "Newlines, Emojis, or Special characters not allowed",
|
|
58
|
+
defaultMessage: "Newlines, Emojis, or Special characters are not allowed",
|
|
59
59
|
},
|
|
60
60
|
addButton: {
|
|
61
61
|
id: `${prefix}.addButton`,
|
|
@@ -12,6 +12,7 @@ import React from 'react';
|
|
|
12
12
|
import { ConfigProvider } from 'antd';
|
|
13
13
|
import enUS from 'antd/es/locale-provider/en_US';
|
|
14
14
|
import zhCN from 'antd/es/locale-provider/zh_CN';
|
|
15
|
+
import jaJP from 'antd/es/locale-provider/ja_JP';
|
|
15
16
|
import { connect } from 'react-redux';
|
|
16
17
|
import { createStructuredSelector } from 'reselect';
|
|
17
18
|
import { IntlProvider } from 'react-intl';
|
|
@@ -37,6 +38,7 @@ export class LanguageProvider extends React.PureComponent { // eslint-disable-li
|
|
|
37
38
|
'zh-cn': 'zh',
|
|
38
39
|
'zh': 'zh',
|
|
39
40
|
'en-US': 'en-US',
|
|
41
|
+
'ja-JP': 'ja-JP',
|
|
40
42
|
};
|
|
41
43
|
return map[locale];
|
|
42
44
|
};
|
|
@@ -57,6 +59,7 @@ export class LanguageProvider extends React.PureComponent { // eslint-disable-li
|
|
|
57
59
|
'zh-cn': zhCN,
|
|
58
60
|
'en-US': enUS,
|
|
59
61
|
'zh': zhCN,
|
|
62
|
+
'ja-JP': jaJP,
|
|
60
63
|
};
|
|
61
64
|
const jLocale = localStorage.getItem('jlocale') || 'en';
|
|
62
65
|
const file = mappedLocale[jLocale];
|
|
@@ -551,11 +551,11 @@ export const LineVideo = ({
|
|
|
551
551
|
value={selectedAction}
|
|
552
552
|
options={[
|
|
553
553
|
{
|
|
554
|
-
label:
|
|
554
|
+
label: <FormattedMessage {...messages.hide} />,
|
|
555
555
|
value: HIDE_ACTION_BUTTON,
|
|
556
556
|
},
|
|
557
557
|
{
|
|
558
|
-
label:
|
|
558
|
+
label: <FormattedMessage {...messages.display} />,
|
|
559
559
|
value: DISPLAY_ACTION_BUTTON,
|
|
560
560
|
},
|
|
561
561
|
]}
|
|
@@ -139,4 +139,13 @@ export default defineMessages({
|
|
|
139
139
|
id: `${scope}.inValidUrlErrorMessage`,
|
|
140
140
|
defaultMessage: 'Action url is not valid',
|
|
141
141
|
},
|
|
142
|
+
hide: {
|
|
143
|
+
id: `${scope}.hide`,
|
|
144
|
+
defaultMessage: 'Hide',
|
|
145
|
+
},
|
|
146
|
+
display: {
|
|
147
|
+
id: `${scope}.display`,
|
|
148
|
+
defaultMessage: 'Display',
|
|
149
|
+
},
|
|
150
|
+
|
|
142
151
|
});
|
|
@@ -72,6 +72,10 @@ describe('line wrapper test/>', () => {
|
|
|
72
72
|
const textWithEmojis = 'Invalid text 😊';
|
|
73
73
|
expect(isValidText(textWithEmojis)).toBe(false);
|
|
74
74
|
});
|
|
75
|
+
it('should return false for text with emojis,newlines,special char', () => {
|
|
76
|
+
const textWithEmojis = 'Invalid text 😊@#$ \n';
|
|
77
|
+
expect(isValidText(textWithEmojis)).toBe(false);
|
|
78
|
+
});
|
|
75
79
|
|
|
76
80
|
it('should return true for an empty string', () => {
|
|
77
81
|
const emptyString = '';
|
|
@@ -703,6 +703,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
703
703
|
};
|
|
704
704
|
|
|
705
705
|
injectMultiColSection = (section) => {
|
|
706
|
+
const { formatMessage } = this.props.intl;
|
|
706
707
|
forEach(section.inputFields, (inputField) => {
|
|
707
708
|
forEach(inputField.cols, (col) => {
|
|
708
709
|
const temp = col;
|
|
@@ -720,6 +721,23 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
720
721
|
if (temp.id === "mobile-push-preview") {
|
|
721
722
|
temp.content.appName = this.props.Templates.selectedWeChatAccount.name;
|
|
722
723
|
}
|
|
724
|
+
|
|
725
|
+
if (messages?.[temp?.value]) {
|
|
726
|
+
temp.value = formatMessage(messages[temp.value]);
|
|
727
|
+
}
|
|
728
|
+
if (messages?.[temp?.label]) {
|
|
729
|
+
temp.label = formatMessage(messages[temp.label]);
|
|
730
|
+
}
|
|
731
|
+
if (messages?.[temp?.errorMessage]) {
|
|
732
|
+
temp.errorMessage = formatMessage(messages[temp.errorMessage]);
|
|
733
|
+
}
|
|
734
|
+
if (messages?.[temp?.placeholder]) {
|
|
735
|
+
temp.placeholder = formatMessage(messages[temp.placeholder]);
|
|
736
|
+
}
|
|
737
|
+
if (messages?.[temp?.hoverText]) {
|
|
738
|
+
temp.hoverText = formatMessage(messages[temp.hoverText]);
|
|
739
|
+
}
|
|
740
|
+
|
|
723
741
|
temp.injectedEvents = {};
|
|
724
742
|
|
|
725
743
|
forEach(col.supportedEvents, (event) => {
|
|
@@ -1035,7 +1053,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
1035
1053
|
metaType: "text",
|
|
1036
1054
|
datatype: "string",
|
|
1037
1055
|
options: ["Deeplink", "External Link"],
|
|
1038
|
-
inductiveText: [
|
|
1056
|
+
inductiveText: [<FormattedMessage {...messages.aPageWithMobileApp}/>, <FormattedMessage {...messages.anExternalWebPage}/>],
|
|
1039
1057
|
value: "Deeplink",
|
|
1040
1058
|
required: true,
|
|
1041
1059
|
width: 18,
|
|
@@ -1110,7 +1128,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
1110
1128
|
metaType: "text",
|
|
1111
1129
|
datatype: "string",
|
|
1112
1130
|
options: ["Deeplink", "External Link"],
|
|
1113
|
-
inductiveText: [
|
|
1131
|
+
inductiveText: [<FormattedMessage {...messages.aPageWithMobileApp}/>, <FormattedMessage {...messages.anExternalWebPage}/>],
|
|
1114
1132
|
value: "Deeplink",
|
|
1115
1133
|
required: true,
|
|
1116
1134
|
width: 18,
|
|
@@ -1216,7 +1234,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
1216
1234
|
metaType: "text",
|
|
1217
1235
|
datatype: "string",
|
|
1218
1236
|
options: ["Deeplink", "External Link"],
|
|
1219
|
-
inductiveText: [
|
|
1237
|
+
inductiveText: [<FormattedMessage {...messages.aPageWithMobileApp}/>, <FormattedMessage {...messages.anExternalWebPage}/>],
|
|
1220
1238
|
value: "Deeplink",
|
|
1221
1239
|
required: true,
|
|
1222
1240
|
width: 18,
|
|
@@ -294,4 +294,52 @@ export default defineMessages({
|
|
|
294
294
|
id: 'creatives.containersV2.MobilePush.Create.change',
|
|
295
295
|
defaultMessage: 'change',
|
|
296
296
|
},
|
|
297
|
+
"Add labels": {
|
|
298
|
+
id: 'creatives.containersV2.MobilePush.Create.addLabels',
|
|
299
|
+
defaultMessage: 'Add labels',
|
|
300
|
+
},
|
|
301
|
+
"Cover Image": {
|
|
302
|
+
id: `creatives.containersV2.MobilePush.Create.coverImage`,
|
|
303
|
+
defaultMessage: 'Cover image',
|
|
304
|
+
},
|
|
305
|
+
"Maximum file size acceptable is 5 MB": {
|
|
306
|
+
id: 'creatives.containersV2.MobilePush.Create.coverImageDescription',
|
|
307
|
+
defaultMessage: 'Maximum file size acceptable is 5 MB',
|
|
308
|
+
},
|
|
309
|
+
"Add action link to content": {
|
|
310
|
+
id: 'creatives.containersV2.MobilePush.Create.addActionLinkToContent',
|
|
311
|
+
defaultMessage: 'Add action link to content',
|
|
312
|
+
},
|
|
313
|
+
"Add a hyperlink of the page which customer will be directed to": {
|
|
314
|
+
id: 'creatives.containersV2.MobilePush.Create.addActionLinkToContentDescription',
|
|
315
|
+
defaultMessage: 'Add a hyperlink of the page which customer will be directed to',
|
|
316
|
+
},
|
|
317
|
+
"aPageWithMobileApp": {
|
|
318
|
+
id: 'creatives.containersV2.MobilePush.Create.aPageWithMobileApp',
|
|
319
|
+
defaultMessage: 'A page within mobile app',
|
|
320
|
+
},
|
|
321
|
+
"anExternalWebPage": {
|
|
322
|
+
id: 'creatives.containersV2.MobilePush.Create.anExternalWebPage',
|
|
323
|
+
defaultMessage: 'An external web page',
|
|
324
|
+
},
|
|
325
|
+
"Add primary button to notification": {
|
|
326
|
+
id: 'creatives.containersV2.MobilePush.Create.addPrimaryButtonToNotification',
|
|
327
|
+
defaultMessage: 'Add primary button to notification',
|
|
328
|
+
},
|
|
329
|
+
"Button label": {
|
|
330
|
+
id: 'creatives.containersV2.MobilePush.Create.buttonLabel',
|
|
331
|
+
defaultMessage: 'Button label',
|
|
332
|
+
},
|
|
333
|
+
"Add secondary button to notification": {
|
|
334
|
+
id: 'creatives.containersV2.MobilePush.Create.addSecondaryButtonToNotification',
|
|
335
|
+
defaultMessage: 'Add secondary button to notification',
|
|
336
|
+
},
|
|
337
|
+
"Add action buttons to notification": {
|
|
338
|
+
id: 'creatives.containersV2.MobilePush.Create.addActionButtonsToNotification',
|
|
339
|
+
defaultMessage: 'Add action buttons to notification',
|
|
340
|
+
},
|
|
341
|
+
"This section is being revamped. Till then it will remain disabled.": {
|
|
342
|
+
id: 'creatives.containersV2.MobilePush.Create.thisSectionDisabledHoverText',
|
|
343
|
+
defaultMessage: 'This section is being revamped. Till then it will remain disabled.',
|
|
344
|
+
},
|
|
297
345
|
});
|
|
@@ -1023,7 +1023,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1023
1023
|
metaType: "text",
|
|
1024
1024
|
datatype: "string",
|
|
1025
1025
|
options: ["Deeplink", "External Link"],
|
|
1026
|
-
inductiveText: [
|
|
1026
|
+
inductiveText: [<FormattedMessage {...messages.aPageWithMobileApp}/>, <FormattedMessage {...messages.anExternalWebPage}/>],
|
|
1027
1027
|
value: "Deeplink",
|
|
1028
1028
|
required: true,
|
|
1029
1029
|
width: 18,
|
|
@@ -1417,6 +1417,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1417
1417
|
return sections;
|
|
1418
1418
|
};
|
|
1419
1419
|
injectMultiColSection = (section) => {
|
|
1420
|
+
const { formatMessage } = this.props.intl;
|
|
1420
1421
|
_.forEach(section.inputFields, (inputField) => {
|
|
1421
1422
|
_.forEach(inputField.cols, (col) => {
|
|
1422
1423
|
const temp = col;
|
|
@@ -1425,6 +1426,23 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1425
1426
|
temp.value.sections = this.injectSections(temp.value.sections);
|
|
1426
1427
|
return true;
|
|
1427
1428
|
}
|
|
1429
|
+
|
|
1430
|
+
if (messages?.[temp?.value]) {
|
|
1431
|
+
temp.value = formatMessage(messages[temp.value]);
|
|
1432
|
+
}
|
|
1433
|
+
if (messages?.[temp?.label]) {
|
|
1434
|
+
temp.label = formatMessage(messages[temp.label]);
|
|
1435
|
+
}
|
|
1436
|
+
if (messages?.[temp?.errorMessage]) {
|
|
1437
|
+
temp.errorMessage = formatMessage(messages[temp.errorMessage]);
|
|
1438
|
+
}
|
|
1439
|
+
if (messages?.[temp?.placeholder]) {
|
|
1440
|
+
temp.placeholder = formatMessage(messages[temp.placeholder]);
|
|
1441
|
+
}
|
|
1442
|
+
if (messages?.[temp?.hoverText]) {
|
|
1443
|
+
temp.hoverText = formatMessage(messages[temp.hoverText]);
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1428
1446
|
temp.injectedEvents = {};
|
|
1429
1447
|
temp.className = temp.className ? temp.className : '';
|
|
1430
1448
|
|
|
@@ -286,4 +286,20 @@ export default defineMessages({
|
|
|
286
286
|
id: 'creatives.containersV2.MobilePush.Edit.change',
|
|
287
287
|
defaultMessage: "change",
|
|
288
288
|
},
|
|
289
|
+
"aPageWithMobileApp": {
|
|
290
|
+
id: 'creatives.containersV2.MobilePush.Edit.aPageWithMobileApp',
|
|
291
|
+
defaultMessage: 'A page within mobile app',
|
|
292
|
+
},
|
|
293
|
+
"anExternalWebPage": {
|
|
294
|
+
id: 'creatives.containersV2.MobilePush.Edit.anExternalWebPage',
|
|
295
|
+
defaultMessage: 'An external web page',
|
|
296
|
+
},
|
|
297
|
+
"Button label": {
|
|
298
|
+
id: 'creatives.containersV2.MobilePush.Edit.buttonLabel',
|
|
299
|
+
defaultMessage: 'Button label',
|
|
300
|
+
},
|
|
301
|
+
"This section is being revamped. Till then it will remain disabled.": {
|
|
302
|
+
id: 'creatives.containersV2.MobilePush.Edit.thisSectionDisabledHoverText',
|
|
303
|
+
defaultMessage: 'This section is being revamped. Till then it will remain disabled.',
|
|
304
|
+
},
|
|
289
305
|
});
|
|
@@ -16,7 +16,7 @@ function getPrimaryCtaFields({inputFields, fieldIndex, deepLinkOptions, tab}) {
|
|
|
16
16
|
metaType: "text",
|
|
17
17
|
datatype: "string",
|
|
18
18
|
options: ["Deeplink", "External Link"],
|
|
19
|
-
inductiveText: [
|
|
19
|
+
inductiveText: [<FormattedMessage {...messages.aPageWithMobileApp}/>, <FormattedMessage {...messages.anExternalWebPage}/>],
|
|
20
20
|
value: "Deeplink",
|
|
21
21
|
required: true,
|
|
22
22
|
width: 18,
|
|
@@ -105,7 +105,7 @@ function getSecondaryCtaFields({inputFields, fieldIndex, deepLinkOptions}) {
|
|
|
105
105
|
metaType: "text",
|
|
106
106
|
datatype: "string",
|
|
107
107
|
options: ["Deeplink", "External Link"],
|
|
108
|
-
inductiveText: [
|
|
108
|
+
inductiveText: [<FormattedMessage {...messages.aPageWithMobileApp}/>, <FormattedMessage {...messages.anExternalWebPage}/>],
|
|
109
109
|
value: "Deeplink",
|
|
110
110
|
required: true,
|
|
111
111
|
width: 18,
|