@capillarytech/creatives-library 3.0.31 → 3.0.33
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/app.js +1 -1
- package/components/BreadCrumbs/messages.js +1 -1
- package/components/CapTagList/index.js +3 -3
- package/components/CapTagList/messages.js +16 -4
- package/components/Ckeditor/messages.js +1 -1
- package/components/CustomPopOver/index.js +3 -4
- package/components/CustomPopOver/messages.js +5 -1
- package/components/DateFilter/index.js +12 -12
- package/components/DateFilter/messages.js +40 -0
- package/components/DateRange/index.js +5 -4
- package/components/DateRange/messages.js +13 -1
- package/components/Edmeditor/messages.js +1 -1
- package/components/EmailPreview/index.js +4 -4
- package/components/EmailPreview/messages.js +18 -2
- package/components/Footer/messages.js +1 -1
- package/components/FormBuilder/index.js +13 -17
- package/components/FormBuilder/messages.js +33 -1
- package/components/Header/messages.js +4 -4
- package/components/ImagePreview/index.js +1 -1
- package/components/ImagePreview/messages.js +5 -1
- package/components/PageHeader/messages.js +1 -1
- package/components/PreviewSideBar/index.js +2 -2
- package/components/PreviewSideBar/messages.js +14 -6
- package/components/Sidebar/messages.js +3 -3
- package/components/SmsTest/index.js +6 -4
- package/components/SmsTest/messages.js +9 -1
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/messages.js +3 -3
- package/components/TemplatePreview/index.js +12 -7
- package/components/TemplatePreview/messages.js +29 -5
- package/components/Toastr/messages.js +1 -1
- package/components/ToastrMessage/index.js +4 -1
- package/components/ToastrMessage/messages.js +5 -1
- package/components/TopBar/messages.js +1 -1
- package/config/app.js +4 -0
- package/containers/Assets/Gallery/messages.js +20 -20
- package/containers/Cap/index.js +6 -5
- package/containers/Cap/messages.js +75 -0
- package/containers/Dashboard/index.js +2 -2
- package/containers/Dashboard/messages.js +1 -1
- package/containers/Ebill/index.js +1 -1
- package/containers/Ebill/messages.js +20 -16
- package/containers/Email/index.js +24 -24
- package/containers/Email/messages.js +107 -59
- package/containers/Line/Create/index.js +5 -5
- package/containers/Line/Create/messages.js +58 -42
- package/containers/Line/Edit/index.js +12 -12
- package/containers/Line/Edit/messages.js +58 -38
- package/containers/Login/components/LoginForm/index.js +10 -7
- package/containers/Login/components/LoginForm/messages.js +15 -3
- package/containers/Login/index.js +1 -1
- package/containers/Login/messages.js +7 -3
- package/containers/MobilePush/Create/index.js +43 -43
- package/containers/MobilePush/Create/messages.js +111 -75
- package/containers/MobilePush/Edit/index.js +43 -43
- package/containers/MobilePush/Edit/messages.js +100 -83
- package/containers/NotFoundPage/messages.js +1 -1
- package/containers/Sms/Create/index.js +7 -8
- package/containers/Sms/Create/messages.js +43 -19
- package/containers/Sms/Edit/index.js +4 -4
- package/containers/Sms/Edit/messages.js +36 -20
- package/containers/TagList/messages.js +1 -1
- package/containers/Templates/index.js +20 -19
- package/containers/Templates/messages.js +136 -64
- package/containers/TestPage/messages.js +1 -1
- package/containers/Testv2/index.js +2 -2
- package/containers/Testv2/messages.js +9 -1
- package/containers/WeChat/MapTemplates/index.js +10 -10
- package/containers/WeChat/MapTemplates/messages.js +49 -17
- package/containers/WeChat/RichmediaTemplates/Create/messages.js +33 -33
- package/containers/WeChat/RichmediaTemplates/Edit/messages.js +1 -1
- package/containers/WeChat/RichmediaTemplates/View/index.js +2 -2
- package/containers/WeChat/RichmediaTemplates/View/messages.js +9 -1
- package/hoc/withStyles.js +12 -0
- package/index.js +8 -1
- package/package.json +1 -4
- package/reducers.js +1 -1
- package/routes.js +4 -1
- package/services/api.js +25 -2
- package/translations/en.json +1396 -360
- package/translations/zh.json +1417 -381
- package/utils/smsCharCountV2.js +28 -6
- package/v2Components/BreadCrumbs/messages.js +1 -1
- package/v2Components/CallTaskPreview/messages.js +1 -1
- package/v2Components/CapTagList/index.js +6 -5
- package/v2Components/CapTagList/messages.js +24 -4
- package/v2Components/Ckeditor/messages.js +1 -1
- package/v2Components/CmsTemplatesComponent/messages.js +2 -2
- package/v2Components/CustomPopOver/index.js +4 -2
- package/v2Components/CustomPopOver/messages.js +5 -1
- package/v2Components/Edmeditor/messages.js +1 -1
- package/v2Components/EmailPreview/index.js +2 -2
- package/v2Components/EmailPreview/messages.js +11 -3
- package/v2Components/EmailPreviewV2/index.js +1 -1
- package/v2Components/EmailPreviewV2/messages.js +13 -9
- package/v2Components/Footer/messages.js +1 -1
- package/v2Components/FormBuilder/index.js +17 -14
- package/v2Components/FormBuilder/messages.js +49 -1
- package/v2Components/Header/messages.js +4 -4
- package/v2Components/ImagePreview/index.js +3 -2
- package/v2Components/ImagePreview/messages.js +5 -1
- package/v2Components/MobilePushPreviewV2/index.js +2 -5
- package/v2Components/MobilePushPreviewV2/messages.js +9 -1
- package/v2Components/NavigationBar/messages.js +1 -1
- package/v2Components/NewCallTask/messages.js +5 -5
- package/v2Components/PreviewSideBar/messages.js +6 -6
- package/v2Components/SmsTest/index.js +6 -4
- package/v2Components/SmsTest/messages.js +9 -1
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/messages.js +3 -3
- package/v2Components/TemplatePreview/_templatePreview.scss +8 -0
- package/v2Components/TemplatePreview/index.js +35 -16
- package/v2Components/TemplatePreview/messages.js +23 -7
- package/v2Components/Toastr/messages.js +1 -1
- package/v2Components/ToastrMessage/index.js +3 -2
- package/v2Components/ToastrMessage/messages.js +5 -1
- package/v2Components/TopBar/messages.js +7 -7
- package/v2Containers/App/constants.js +11 -0
- package/v2Containers/Assets/Gallery/messages.js +24 -24
- package/v2Containers/CallTask/messages.js +6 -6
- package/v2Containers/Cap/index.js +5 -4
- package/v2Containers/Cap/messages.js +75 -0
- package/v2Containers/Cap/messsages.js +19 -15
- package/v2Containers/Cap/sagas.js +1 -8
- package/v2Containers/ChannelTemplates/messages.js +1 -1
- package/v2Containers/CreativesContainer/messages.js +16 -8
- package/v2Containers/Dashboard/index.js +2 -1
- package/v2Containers/Dashboard/messages.js +1 -1
- package/v2Containers/Ebill/index.js +1 -1
- package/v2Containers/Ebill/messages.js +20 -16
- package/v2Containers/Email/index.js +20 -20
- package/v2Containers/Email/messages.js +97 -61
- package/v2Containers/EmailWrapper/index.js +64 -44
- package/v2Containers/EmailWrapper/messages.js +12 -12
- package/v2Containers/LanguageProvider/actions.js +9 -4
- package/v2Containers/LanguageProvider/constants.js +7 -0
- package/v2Containers/LanguageProvider/index.js +32 -10
- package/v2Containers/LanguageProvider/reducer.js +12 -4
- package/v2Containers/LanguageProvider/sagas.js +39 -0
- package/v2Containers/LanguageProvider/selectors.js +1 -1
- package/v2Containers/Line/Create/index.js +3 -3
- package/v2Containers/Line/Create/messages.js +53 -41
- package/v2Containers/Line/Edit/index.js +10 -10
- package/v2Containers/Line/Edit/messages.js +55 -39
- package/v2Containers/Login/components/LoginForm/index.js +9 -6
- package/v2Containers/Login/components/LoginForm/messages.js +15 -3
- package/v2Containers/Login/index.js +1 -1
- package/v2Containers/Login/messages.js +7 -3
- package/v2Containers/MobilePush/Create/index.js +33 -33
- package/v2Containers/MobilePush/Create/messages.js +109 -81
- package/v2Containers/MobilePush/Edit/index.js +22 -22
- package/v2Containers/MobilePush/Edit/messages.js +95 -79
- package/v2Containers/MobilepushWrapper/messages.js +5 -5
- package/v2Containers/NotFoundPage/messages.js +1 -1
- package/v2Containers/Sms/Create/index.js +6 -6
- package/v2Containers/Sms/Create/messages.js +41 -21
- package/v2Containers/Sms/Edit/index.js +6 -6
- package/v2Containers/Sms/Edit/messages.js +36 -20
- package/v2Containers/TagList/messages.js +1 -1
- package/v2Containers/Templates/messages.js +27 -3
- package/v2Containers/TemplatesV2/TemplatesV2.style.js +29 -0
- package/v2Containers/TemplatesV2/index.js +29 -51
- package/v2Containers/TemplatesV2/messages.js +29 -5
- package/v2Containers/TestPage/messages.js +1 -1
- package/v2Containers/Testv2/index.js +2 -2
- package/v2Containers/Testv2/messages.js +9 -1
- package/v2Containers/WeChat/MapTemplates/index.js +8 -8
- package/v2Containers/WeChat/MapTemplates/messages.js +49 -17
- package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +6 -6
- package/v2Containers/WeChat/RichmediaTemplates/Create/messages.js +95 -43
- package/v2Containers/WeChat/RichmediaTemplates/Edit/messages.js +1 -1
- package/v2Containers/WeChat/RichmediaTemplates/View/messages.js +9 -1
- package/v2Containers/TemplatesV2/_templatesV2.scss +0 -5
package/utils/smsCharCountV2.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import * as Api from './../services/api';
|
|
3
|
+
let optoutUrl;
|
|
4
|
+
let showOptoutCount = true;
|
|
5
|
+
let responseState = "REQUEST";
|
|
6
|
+
|
|
2
7
|
function getURLParameter(name) {
|
|
3
8
|
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [, ""])[1].replace(/\+/g, '%20')) || null
|
|
4
9
|
}
|
|
@@ -49,13 +54,27 @@ export function checkUnicode(content) {
|
|
|
49
54
|
return false;
|
|
50
55
|
}
|
|
51
56
|
export function updateCharCount(content, isUnicodeEnabled) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
57
|
+
if (showOptoutCount && optoutUrl === undefined && responseState === 'REQUEST') {
|
|
58
|
+
Api.getUnsubscribeUrl().then((res) => {
|
|
59
|
+
optoutUrl = res.response.response;
|
|
60
|
+
responseState = "SUCCESS";
|
|
61
|
+
}).catch((err) => {
|
|
62
|
+
showOptoutCount = false;
|
|
63
|
+
responseState = "FAIL";
|
|
64
|
+
optoutUrl = undefined;
|
|
65
|
+
console.log('get optouturl error: ', err);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
const optoutTag = /{{optout}}/g;
|
|
69
|
+
const optoutTagLength = 14;
|
|
70
|
+
const contentOriginal = content;
|
|
71
|
+
const noOfOptout = (content.match(optoutTag) || []).length;
|
|
72
|
+
content = showOptoutCount ? content.replace(optoutTag, "") : content;
|
|
73
|
+
var chars_arr = contentOriginal.split("");
|
|
55
74
|
var coding = '7bit';
|
|
56
75
|
var parts = 1;
|
|
57
76
|
var part = 1;
|
|
58
|
-
var chars_used = 0;
|
|
77
|
+
var chars_used = showOptoutCount ? ((optoutUrl && optoutUrl.length || 0) * noOfOptout) : 0;
|
|
59
78
|
var chars_sms = 160;
|
|
60
79
|
var sms_parts_container = [];
|
|
61
80
|
var partc = [];
|
|
@@ -127,17 +146,20 @@ export function updateCharCount(content, isUnicodeEnabled) {
|
|
|
127
146
|
}
|
|
128
147
|
}
|
|
129
148
|
|
|
149
|
+
chars_used = showOptoutCount ? (chars_used - (optoutTagLength * noOfOptout)) : chars_used;
|
|
130
150
|
console.log('Type:', (coding == '7bit' ? '7bit' : 'Unicode'));
|
|
131
151
|
console.log('Parts:', parts);
|
|
132
152
|
console.log('SMS Chars:', chars_sms);
|
|
133
153
|
console.log('SMS Char total:', chars_used);
|
|
134
|
-
|
|
154
|
+
console.log('SMS optouturl: ', optoutUrl);
|
|
135
155
|
return {
|
|
136
156
|
unicode: (coding === '7bit' ? false : true),
|
|
137
157
|
parts,
|
|
138
158
|
chars_sms,
|
|
139
159
|
chars_used,
|
|
140
160
|
char_list: partc,
|
|
161
|
+
optouturlLength: (optoutUrl && optoutUrl.length) || 0,
|
|
162
|
+
optoutUrlPresent: noOfOptout > 0,
|
|
163
|
+
responseState,
|
|
141
164
|
};
|
|
142
165
|
}
|
|
143
|
-
|
|
@@ -7,7 +7,7 @@ import { defineMessages } from 'react-intl';
|
|
|
7
7
|
|
|
8
8
|
export default defineMessages({
|
|
9
9
|
header: {
|
|
10
|
-
id: '
|
|
10
|
+
id: 'creatives.componentsV2.CallTaskPreview.header',
|
|
11
11
|
defaultMessage: 'This is the CallTaskPreview component !',
|
|
12
12
|
},
|
|
13
13
|
});
|
|
@@ -139,6 +139,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
139
139
|
supportedTagsString += `${supportedTag} ,`;
|
|
140
140
|
});
|
|
141
141
|
supportedTagsString = supportedTagsString.replace(/,\s*$/, "");
|
|
142
|
+
console.log(supportedTagsString);
|
|
142
143
|
if (_.has(val, 'subtags')) {
|
|
143
144
|
const temp = this.renderTags(val.subtags);
|
|
144
145
|
list.push((
|
|
@@ -159,17 +160,17 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
159
160
|
const options = [
|
|
160
161
|
{
|
|
161
162
|
value: "All",
|
|
162
|
-
label:
|
|
163
|
+
label: this.props.intl.formatMessage(messages.all),
|
|
163
164
|
key: 'all',
|
|
164
165
|
},
|
|
165
166
|
{
|
|
166
167
|
value: "Outbound",
|
|
167
|
-
label:
|
|
168
|
+
label: this.props.intl.formatMessage(messages.outbound),
|
|
168
169
|
key: 'outbound',
|
|
169
170
|
},
|
|
170
171
|
{
|
|
171
172
|
value: "Loyalty",
|
|
172
|
-
label:
|
|
173
|
+
label: this.props.intl.formatMessage(messages.loyalty),
|
|
173
174
|
key: 'loyalty',
|
|
174
175
|
},
|
|
175
176
|
];
|
|
@@ -179,8 +180,8 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
179
180
|
visible={this.state.visible}
|
|
180
181
|
onVisibleChange={this.togglePopoverVisibility}
|
|
181
182
|
content={<div>
|
|
182
|
-
<CapSpin tip=
|
|
183
|
-
<Search style={{ marginBottom: 8, width: '250px'}} placeholder=
|
|
183
|
+
<CapSpin tip={this.props.intl.formatMessage(messages.gettingTags)} spinning={this.props.loading}>
|
|
184
|
+
<Search style={{ marginBottom: 8, width: '250px'}} placeholder={this.props.intl.formatMessage(messages.search)} onChange={this.onChange} />
|
|
184
185
|
{this.props.moduleFilterEnabled ? <CapSelect getPopupContainer={(triggerNode) => triggerNode.parentNode} style={{width: '250px', marginBottom: '16px', minWidth: 'initial', display: 'inherit'}} onChange={this.props.onContextChange} defaultValue="All" options={options}>
|
|
185
186
|
</CapSelect> : ''}
|
|
186
187
|
<CapTree
|
|
@@ -7,19 +7,39 @@ import { defineMessages } from 'react-intl';
|
|
|
7
7
|
|
|
8
8
|
export default defineMessages({
|
|
9
9
|
"Ok": {
|
|
10
|
-
id: '
|
|
10
|
+
id: 'creatives.componentsV2.CapTagList.Ok',
|
|
11
11
|
defaultMessage: 'Ok',
|
|
12
12
|
},
|
|
13
13
|
"numberOfDaysBeforeExpiry": {
|
|
14
|
-
id: '
|
|
14
|
+
id: 'creatives.componentsV2.CapTagList.numberOfDaysBeforeExpiry',
|
|
15
15
|
defaultMessage: 'Number of days before expiry',
|
|
16
16
|
},
|
|
17
17
|
"Cancel": {
|
|
18
|
-
id: '
|
|
18
|
+
id: 'creatives.componentsV2.CapTagList.Cancel',
|
|
19
19
|
defaultMessage: 'Cancel',
|
|
20
20
|
},
|
|
21
21
|
"Dynamic Days before Expiry": {
|
|
22
|
-
id: '
|
|
22
|
+
id: 'creatives.componentsV2.CapTagList.dynamic_days_before_expiry',
|
|
23
23
|
defaultMessage: 'Dynamic days before expiry',
|
|
24
24
|
},
|
|
25
|
+
"all": {
|
|
26
|
+
id: 'creatives.componentsV2.CapTagList.all',
|
|
27
|
+
defaultMessage: 'Dynamic days before expiry',
|
|
28
|
+
},
|
|
29
|
+
"outbound": {
|
|
30
|
+
id: 'creatives.componentsV2.CapTagList.outbound',
|
|
31
|
+
defaultMessage: 'Outbound',
|
|
32
|
+
},
|
|
33
|
+
"loyalty": {
|
|
34
|
+
id: 'creatives.componentsV2.CapTagList.loyalty',
|
|
35
|
+
defaultMessage: 'Loyalty',
|
|
36
|
+
},
|
|
37
|
+
"gettingTags": {
|
|
38
|
+
id: 'creatives.componentsV2.CapTagList.gettingTags',
|
|
39
|
+
defaultMessage: 'Getting tags...',
|
|
40
|
+
},
|
|
41
|
+
"search": {
|
|
42
|
+
id: 'creatives.componentsV2.CapTagList.search',
|
|
43
|
+
defaultMessage: 'Search',
|
|
44
|
+
},
|
|
25
45
|
});
|
|
@@ -7,11 +7,11 @@ import { defineMessages } from 'react-intl';
|
|
|
7
7
|
|
|
8
8
|
export default defineMessages({
|
|
9
9
|
header: {
|
|
10
|
-
id: '
|
|
10
|
+
id: 'creatives.componentsV2.CmsTemplatesComponent.header',
|
|
11
11
|
defaultMessage: 'This is the CmsTemplatesComponent component !',
|
|
12
12
|
},
|
|
13
13
|
select: {
|
|
14
|
-
id: '
|
|
14
|
+
id: 'creatives.componentsV2.CmsTemplatesComponent.select',
|
|
15
15
|
defaultMessage: 'Select',
|
|
16
16
|
},
|
|
17
17
|
});
|
|
@@ -9,10 +9,12 @@ import PropTypes from 'prop-types';
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
// import styled from 'styled-components';
|
|
11
11
|
import {CapPopover} from '@capillarytech/cap-ui-library';
|
|
12
|
-
|
|
12
|
+
import { FormattedMessage } from 'react-intl';
|
|
13
13
|
// import messages from './messages';
|
|
14
14
|
import _ from "lodash";
|
|
15
15
|
|
|
16
|
+
import messages from './messages';
|
|
17
|
+
|
|
16
18
|
class CustomPopOver extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
17
19
|
componentWillMount() {
|
|
18
20
|
console.log('popOver List ', this.props.popOverList, this.props.excludeList);
|
|
@@ -51,7 +53,7 @@ class CustomPopOver extends React.Component { // eslint-disable-line react/prefe
|
|
|
51
53
|
this.renderPopoverContent()
|
|
52
54
|
}
|
|
53
55
|
>
|
|
54
|
-
<p style={{fontFamily: "open-sans", fontWeight: '600', display: `${this.props.popOverList.length === this.props.excludeList.length ? 'none' : ''}`}}
|
|
56
|
+
<p style={{fontFamily: "open-sans", fontWeight: '600', display: `${this.props.popOverList.length === this.props.excludeList.length ? 'none' : ''}`}}><FormattedMessage {...messages.languages} /></p>
|
|
55
57
|
</CapPopover>
|
|
56
58
|
</div>
|
|
57
59
|
);
|
|
@@ -7,7 +7,11 @@ import { defineMessages } from 'react-intl';
|
|
|
7
7
|
|
|
8
8
|
export default defineMessages({
|
|
9
9
|
header: {
|
|
10
|
-
id: '
|
|
10
|
+
id: 'creatives.componentsV2.CustomPopOver.header',
|
|
11
11
|
defaultMessage: 'This is the CustomPopOver component !',
|
|
12
12
|
},
|
|
13
|
+
languages: {
|
|
14
|
+
id: 'creatives.componentsV2.CustomPopOver.languages',
|
|
15
|
+
defaultMessage: '+ Languages',
|
|
16
|
+
},
|
|
13
17
|
});
|
|
@@ -61,7 +61,7 @@ class EmailPreview extends React.Component { // eslint-disable-line react/prefer
|
|
|
61
61
|
const iframeDiv = (<div className={`${messageContainerName}`}>
|
|
62
62
|
{emailSubjectLabel}
|
|
63
63
|
<iframe srcDoc={copyContent} {...deviceAspectRatio[device](emailSubject)} >
|
|
64
|
-
<p
|
|
64
|
+
<p><FormattedMessage {...messages.browserDoesntSupportIframe} /></p>
|
|
65
65
|
</iframe>
|
|
66
66
|
</div>);
|
|
67
67
|
return (
|
|
@@ -72,7 +72,7 @@ class EmailPreview extends React.Component { // eslint-disable-line react/prefer
|
|
|
72
72
|
{this.props.header}
|
|
73
73
|
</div>
|
|
74
74
|
<div id="box-actions" style={{ float: 'right' }} onClick={this.props.handleClose}>
|
|
75
|
-
<i className="material-icons close-emailPreivew"
|
|
75
|
+
<i className="material-icons close-emailPreivew"><FormattedMessage {...messages.close} /></i>
|
|
76
76
|
</div>
|
|
77
77
|
</div>
|
|
78
78
|
|
|
@@ -7,15 +7,23 @@ import { defineMessages } from 'react-intl';
|
|
|
7
7
|
|
|
8
8
|
export default defineMessages({
|
|
9
9
|
lastModified: {
|
|
10
|
-
id: '
|
|
10
|
+
id: 'creatives.componentsV2.EmailPreview.lastModified',
|
|
11
11
|
defaultMessage: 'Last modified on',
|
|
12
12
|
},
|
|
13
13
|
uploadedBy: {
|
|
14
|
-
id: '
|
|
14
|
+
id: 'creatives.componentsV2.EmailPreview.uploadedBy',
|
|
15
15
|
defaultMessage: 'Last modified by',
|
|
16
16
|
},
|
|
17
17
|
subject: {
|
|
18
|
-
id: '
|
|
18
|
+
id: 'creatives.componentsV2.EmailPreview.subject',
|
|
19
19
|
defaultMessage: 'Subject:',
|
|
20
20
|
},
|
|
21
|
+
browserDoesntSupportIframe: {
|
|
22
|
+
id: 'creatives.componentsV2.EmailPreview.browserDoesntSupportIframe',
|
|
23
|
+
defaultMessage: 'Your browser does not support iframes.',
|
|
24
|
+
},
|
|
25
|
+
close: {
|
|
26
|
+
id: 'creatives.componentsV2.EmailPreview.close',
|
|
27
|
+
defaultMessage: 'close',
|
|
28
|
+
},
|
|
21
29
|
});
|
|
@@ -89,7 +89,7 @@ class EmailPreviewV2 extends React.Component {
|
|
|
89
89
|
const iframeDiv = (<div className={`${messageContainerName}`}>
|
|
90
90
|
{emailSubjectLabel}
|
|
91
91
|
<iframe srcDoc={copyContent} {...deviceAspectRatio[currentDevice](emailSubject)} >
|
|
92
|
-
<p
|
|
92
|
+
<p><FormattedMessage {...messages.browserDoesntSupportIframe} /></p>
|
|
93
93
|
</iframe>
|
|
94
94
|
</div>);
|
|
95
95
|
|
|
@@ -7,39 +7,43 @@ import { defineMessages } from 'react-intl';
|
|
|
7
7
|
|
|
8
8
|
export default defineMessages({
|
|
9
9
|
header: {
|
|
10
|
-
id: '
|
|
10
|
+
id: 'creatives.componentsV2.EmailPreviewV2.header',
|
|
11
11
|
defaultMessage: 'This is the EmailPreviewV2 component !',
|
|
12
12
|
},
|
|
13
13
|
desktop: {
|
|
14
|
-
id: '
|
|
14
|
+
id: 'creatives.componentsV2.EmailPreviewV2.desktop',
|
|
15
15
|
defaultMessage: 'Desktop',
|
|
16
16
|
},
|
|
17
17
|
tablet: {
|
|
18
|
-
id: '
|
|
18
|
+
id: 'creatives.componentsV2.EmailPreviewV2.tablet',
|
|
19
19
|
defaultMessage: 'Tablet',
|
|
20
20
|
},
|
|
21
21
|
mobile: {
|
|
22
|
-
id: '
|
|
22
|
+
id: 'creatives.componentsV2.EmailPreviewV2.mobile',
|
|
23
23
|
defaultMessage: 'Mobile',
|
|
24
24
|
},
|
|
25
25
|
noIframeSupport: {
|
|
26
|
-
id: '
|
|
26
|
+
id: 'creatives.componentsV2.EmailPreviewV2.noIframeSupport',
|
|
27
27
|
defaultMessage: 'Your browser does not support iframes.',
|
|
28
28
|
},
|
|
29
29
|
showAllDevices: {
|
|
30
|
-
id: '
|
|
30
|
+
id: 'creatives.componentsV2.EmailPreviewV2.showAllDevices',
|
|
31
31
|
defaultMessage: 'Show all devices',
|
|
32
32
|
},
|
|
33
33
|
lastModified: {
|
|
34
|
-
id: '
|
|
34
|
+
id: 'creatives.componentsV2.EmailPreviewV2.lastModified',
|
|
35
35
|
defaultMessage: 'Last modified on',
|
|
36
36
|
},
|
|
37
37
|
uploadedBy: {
|
|
38
|
-
id: '
|
|
38
|
+
id: 'creatives.componentsV2.EmailPreviewV2.uploadedBy',
|
|
39
39
|
defaultMessage: 'Last modified by',
|
|
40
40
|
},
|
|
41
41
|
subject: {
|
|
42
|
-
id: '
|
|
42
|
+
id: 'creatives.componentsV2.EmailPreviewV2.subject',
|
|
43
43
|
defaultMessage: 'Subject:',
|
|
44
44
|
},
|
|
45
|
+
browserDoesntSupportIframe: {
|
|
46
|
+
id: 'creatives.componentsV2.EmailPreviewV2.browserDoesntSupportIframe',
|
|
47
|
+
defaultMessage: 'Your browser does not support iframes.',
|
|
48
|
+
},
|
|
45
49
|
});
|
|
@@ -12,6 +12,7 @@ import React from 'react';
|
|
|
12
12
|
import _ from 'lodash';
|
|
13
13
|
import { Tabs, Table, Modal} from 'antd';
|
|
14
14
|
import { CapLabel, CapButton, CapInput, CapPopover, CapCheckbox, CapRadio, CapSelect, CapTable, CapRow, CapColumn, CapNotification} from '@capillarytech/cap-ui-library';
|
|
15
|
+
import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
|
|
15
16
|
import LabelHOC from '@capillarytech/cap-ui-library/assets/HOCs/ComponentWithLabelHOC';
|
|
16
17
|
import TemplatePreview from '../TemplatePreview';
|
|
17
18
|
import TagList from '../../v2Containers/TagList';
|
|
@@ -23,6 +24,7 @@ import CustomPopOver from '../CustomPopOver';
|
|
|
23
24
|
import './_formBuilder.scss';
|
|
24
25
|
import {updateCharCount, checkUnicode} from "../../utils/smsCharCountV2";
|
|
25
26
|
import {SMS} from '../../v2Containers/CreativesContainer/constants';
|
|
27
|
+
import messages from './messages';
|
|
26
28
|
const TabPane = Tabs.TabPane;
|
|
27
29
|
const {Column} = Table;
|
|
28
30
|
const {TextArea} = CapInput;
|
|
@@ -269,9 +271,9 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
269
271
|
onOk={this.handleOk}
|
|
270
272
|
onCancel={this.handleCancel}
|
|
271
273
|
footer={[
|
|
272
|
-
<CapButton key="back" onClick={this.handleCancel}
|
|
274
|
+
<CapButton key="back" onClick={this.handleCancel}><FormattedMessage {...messages.cancel} /></CapButton>,
|
|
273
275
|
<CapButton key="submit" type="primary" id={this.state.modal.id} onClick={this.handleOk}>
|
|
274
|
-
|
|
276
|
+
<FormattedMessage {...messages.yes} />
|
|
275
277
|
</CapButton>,
|
|
276
278
|
]}
|
|
277
279
|
>
|
|
@@ -284,7 +286,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
284
286
|
onOk={this.handleOk}
|
|
285
287
|
onCancel={this.handleCancel}
|
|
286
288
|
footer={[
|
|
287
|
-
<CapButton key="back" onClick={this.handleCancel}
|
|
289
|
+
<CapButton key="back" onClick={this.handleCancel}><FormattedMessage {...messages.ok} /></CapButton>,
|
|
288
290
|
]}
|
|
289
291
|
>
|
|
290
292
|
{this.state.modal.body}
|
|
@@ -883,13 +885,13 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
883
885
|
isValid = false;
|
|
884
886
|
if (showMessages && !isNaN(index)) {
|
|
885
887
|
if (tagValidationResponse.missingTags.length > 0 || tagValidationResponse.unsupportedTags.length > 0) {
|
|
886
|
-
errorString +=
|
|
888
|
+
errorString += `${this.props.intl.formatMessage(messages.contentNotValidLanguage)} ${currentLang}\n`;
|
|
887
889
|
}
|
|
888
890
|
if (tagValidationResponse.missingTags.length > 0) {
|
|
889
|
-
errorString +=
|
|
891
|
+
errorString += `${this.props.intl.formatMessage(messages.missingTags)} ${tagValidationResponse.missingTags.toString()}\n`;
|
|
890
892
|
}
|
|
891
893
|
if (tagValidationResponse.unsupportedTags.length > 0) {
|
|
892
|
-
errorString +=
|
|
894
|
+
errorString += `${this.props.intl.formatMessage(messages.unsupportedTags)} ${tagValidationResponse.unsupportedTags.toString()}\n`;
|
|
893
895
|
}
|
|
894
896
|
}
|
|
895
897
|
}
|
|
@@ -1882,15 +1884,15 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1882
1884
|
let activeTabIndex = '1';
|
|
1883
1885
|
let selector = ".ant-tabs-tab";
|
|
1884
1886
|
if (this.props.schema.channel.toUpperCase() === "MOBILEPUSH") {
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
+
selector = `.mobilepush-wrapper ${selector}`;
|
|
1888
|
+
}
|
|
1887
1889
|
const elems = document.querySelectorAll(selector);
|
|
1888
1890
|
|
|
1889
1891
|
for (let i = 0; i < elems.length; i += 1) {
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
}
|
|
1892
|
+
if (elems.item(i).classList.contains("ant-tabs-tab-active")) {
|
|
1893
|
+
activeTabIndex = i + 1;
|
|
1893
1894
|
}
|
|
1895
|
+
}
|
|
1894
1896
|
if (this.props.isNewVersionFlow) {
|
|
1895
1897
|
const formData = _.cloneDeep(this.state.formData);
|
|
1896
1898
|
formData[(this.state.currentTab - 1)].activeTab = formData[(this.state.currentTab - 1)].selectedLanguages[activeTabIndex - 1];
|
|
@@ -3250,12 +3252,12 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
3250
3252
|
this.props.schema ? this.renderForm() : ''
|
|
3251
3253
|
}
|
|
3252
3254
|
<SlideBox
|
|
3253
|
-
header={(<h3>
|
|
3255
|
+
header={(<h3>{this.props.intl.formatMessage(messages.layoutSelection)}</h3>)}
|
|
3254
3256
|
width={60}
|
|
3255
3257
|
content={cmsTemplateSelectionContent}
|
|
3256
3258
|
show={this.props.showEdmEmailTemplates}
|
|
3257
3259
|
handleClose={this.props.toggleEdmEmailTemplateSelection}
|
|
3258
|
-
loadingText={
|
|
3260
|
+
loadingText={this.props.intl.formatMessage(messages.loadingEDMTemplates)}
|
|
3259
3261
|
isLoading={this.props.getCmsTemplatesInProgress}
|
|
3260
3262
|
/>
|
|
3261
3263
|
</CapRow>
|
|
@@ -3306,6 +3308,7 @@ FormBuilder.propTypes = {
|
|
|
3306
3308
|
// saveForm: PropTypes.bool,
|
|
3307
3309
|
stopValidation: PropTypes.func,
|
|
3308
3310
|
handleDelete: PropTypes.func,
|
|
3311
|
+
intl: intlShape.isRequired,
|
|
3309
3312
|
};
|
|
3310
3313
|
|
|
3311
|
-
export default FormBuilder;
|
|
3314
|
+
export default injectIntl(FormBuilder);
|
|
@@ -7,7 +7,55 @@ import { defineMessages } from 'react-intl';
|
|
|
7
7
|
|
|
8
8
|
export default defineMessages({
|
|
9
9
|
header: {
|
|
10
|
-
id: '
|
|
10
|
+
id: 'creatives.componentsV2.FormBuilder.header',
|
|
11
11
|
defaultMessage: 'This is the FormBuilder component !',
|
|
12
12
|
},
|
|
13
|
+
cancel: {
|
|
14
|
+
id: 'creatives.componentsV2.FormBuilder.cancel',
|
|
15
|
+
defaultMessage: 'Cancel',
|
|
16
|
+
},
|
|
17
|
+
yes: {
|
|
18
|
+
id: 'creatives.componentsV2.FormBuilder.yes',
|
|
19
|
+
defaultMessage: 'Yes',
|
|
20
|
+
},
|
|
21
|
+
ok: {
|
|
22
|
+
id: 'creatives.componentsV2.FormBuilder.ok',
|
|
23
|
+
defaultMessage: 'Ok',
|
|
24
|
+
},
|
|
25
|
+
contentNotValidLanguage: {
|
|
26
|
+
id: 'creatives.componentsV2.FormBuilder.contentNotValidLanguage',
|
|
27
|
+
defaultMessage: 'Content is not valid for language:',
|
|
28
|
+
},
|
|
29
|
+
missingTags: {
|
|
30
|
+
id: 'creatives.componentsV2.FormBuilder.missingTags',
|
|
31
|
+
defaultMessage: 'Missing tags are:',
|
|
32
|
+
},
|
|
33
|
+
unsupportedTags: {
|
|
34
|
+
id: 'creatives.componentsV2.FormBuilder.unsupportedTags',
|
|
35
|
+
defaultMessage: 'Unsupported tags are:',
|
|
36
|
+
},
|
|
37
|
+
upload: {
|
|
38
|
+
id: 'creatives.componentsV2.FormBuilder.upload',
|
|
39
|
+
defaultMessage: 'Upload',
|
|
40
|
+
},
|
|
41
|
+
dragAndDrop: {
|
|
42
|
+
id: 'creatives.componentsV2.FormBuilder.dragAndDrop',
|
|
43
|
+
defaultMessage: 'Drag and drop image here',
|
|
44
|
+
},
|
|
45
|
+
or: {
|
|
46
|
+
id: 'creatives.componentsV2.FormBuilder.or',
|
|
47
|
+
defaultMessage: 'OR',
|
|
48
|
+
},
|
|
49
|
+
selectAFile: {
|
|
50
|
+
id: 'creatives.componentsV2.FormBuilder.selectAFile',
|
|
51
|
+
defaultMessage: 'Select a file from your computer',
|
|
52
|
+
},
|
|
53
|
+
layoutSelection: {
|
|
54
|
+
id: 'creatives.componentsV2.FormBuilder.layoutSelection',
|
|
55
|
+
defaultMessage: 'Layout Selection',
|
|
56
|
+
},
|
|
57
|
+
loadingEDMTemplates: {
|
|
58
|
+
id: 'creatives.componentsV2.FormBuilder.loadingEDMTemplates',
|
|
59
|
+
defaultMessage: 'Loading EDM Templates',
|
|
60
|
+
},
|
|
13
61
|
});
|
|
@@ -7,19 +7,19 @@ import { defineMessages } from 'react-intl';
|
|
|
7
7
|
|
|
8
8
|
export default defineMessages({
|
|
9
9
|
header: {
|
|
10
|
-
id: '
|
|
10
|
+
id: 'creatives.componentsV2.Header.header',
|
|
11
11
|
defaultMessage: 'This is the Header component !',
|
|
12
12
|
},
|
|
13
13
|
preview: {
|
|
14
|
-
id: '
|
|
14
|
+
id: 'creatives.componentsV2.Header.preview',
|
|
15
15
|
defaultMessage: 'Preview',
|
|
16
16
|
},
|
|
17
17
|
cancel: {
|
|
18
|
-
id: '
|
|
18
|
+
id: 'creatives.componentsV2.Header.cancel',
|
|
19
19
|
defaultMessage: 'Cancel',
|
|
20
20
|
},
|
|
21
21
|
save: {
|
|
22
|
-
id: '
|
|
22
|
+
id: 'creatives.componentsV2.Header.save',
|
|
23
23
|
defaultMessage: 'Save',
|
|
24
24
|
},
|
|
25
25
|
});
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import { injectIntl } from 'react-intl';
|
|
10
|
+
import { injectIntl, FormattedMessage } from 'react-intl';
|
|
11
11
|
import { Spin } from 'antd';
|
|
12
|
+
import messages from './messages';
|
|
12
13
|
import './_imagePreview.scss';
|
|
13
14
|
|
|
14
15
|
class ImagePreview extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
@@ -21,7 +22,7 @@ class ImagePreview extends React.Component { // eslint-disable-line react/prefer
|
|
|
21
22
|
{this.props.header}
|
|
22
23
|
</div>
|
|
23
24
|
<div id="box-actions" style={{ float: 'right' }} onClick={this.props.handleClose}>
|
|
24
|
-
<i className="material-icons close-image-preview"
|
|
25
|
+
<i className="material-icons close-image-preview"><FormattedMessage {...messages.close} /></i>
|
|
25
26
|
</div>
|
|
26
27
|
</div>
|
|
27
28
|
|
|
@@ -7,7 +7,11 @@ import { defineMessages } from 'react-intl';
|
|
|
7
7
|
|
|
8
8
|
export default defineMessages({
|
|
9
9
|
loadingImage: {
|
|
10
|
-
id: '
|
|
10
|
+
id: 'creatives.componentsV2.ImagePreview.loadingImage',
|
|
11
11
|
defaultMessage: 'Loading images !!!!',
|
|
12
12
|
},
|
|
13
|
+
close: {
|
|
14
|
+
id: 'creatives.componentsV2.ImagePreview.close',
|
|
15
|
+
defaultMessage: 'close',
|
|
16
|
+
},
|
|
13
17
|
});
|
|
@@ -85,8 +85,8 @@ class MobilePushPreviewV2 extends React.Component { // eslint-disable-line react
|
|
|
85
85
|
<div className="devices">
|
|
86
86
|
{!isEmpty(templateData) && hasAndroid && hasIos &&
|
|
87
87
|
<ButtonGroup onClick={this.changeDevice}>
|
|
88
|
-
<CapButton type={device === "android" ? "primary" : "secondary"} value={"android"}
|
|
89
|
-
<CapButton type={device === "iphone" ? "primary" : "secondary"} value={"iphone"}
|
|
88
|
+
<CapButton type={device === "android" ? "primary" : "secondary"} value={"android"}><FormattedMessage {...messages.android} /></CapButton>
|
|
89
|
+
<CapButton type={device === "iphone" ? "primary" : "secondary"} value={"iphone"}><FormattedMessage {...messages.ios} /></CapButton>
|
|
90
90
|
</ButtonGroup>}
|
|
91
91
|
</div>
|
|
92
92
|
<TemplatePreview
|
|
@@ -109,12 +109,9 @@ class MobilePushPreviewV2 extends React.Component { // eslint-disable-line react
|
|
|
109
109
|
MobilePushPreviewV2.propTypes = {
|
|
110
110
|
templateData: PropTypes.object.isRequired,
|
|
111
111
|
channel: PropTypes.string.isRequired,
|
|
112
|
-
showPreview: PropTypes.bool,
|
|
113
112
|
handleClose: PropTypes.func,
|
|
114
113
|
onEditClick: PropTypes.func,
|
|
115
114
|
onDuplicateClick: PropTypes.func,
|
|
116
|
-
location: PropTypes.object,
|
|
117
|
-
embedded: PropTypes.bool,
|
|
118
115
|
};
|
|
119
116
|
|
|
120
117
|
export default MobilePushPreviewV2;
|
|
@@ -7,7 +7,15 @@ import { defineMessages } from 'react-intl';
|
|
|
7
7
|
|
|
8
8
|
export default defineMessages({
|
|
9
9
|
header: {
|
|
10
|
-
id: '
|
|
10
|
+
id: 'creatives.componentsv2.MobilePushPreviewV2.header',
|
|
11
11
|
defaultMessage: 'This is the MobilePushPreviewV2 component !',
|
|
12
12
|
},
|
|
13
|
+
android: {
|
|
14
|
+
id: 'creatives.componentsv2.MobilePushPreviewV2.android',
|
|
15
|
+
defaultMessage: 'Android',
|
|
16
|
+
},
|
|
17
|
+
ios: {
|
|
18
|
+
id: 'creatives.componentsv2.MobilePushPreviewV2.ios',
|
|
19
|
+
defaultMessage: 'IOS',
|
|
20
|
+
},
|
|
13
21
|
});
|