@capillarytech/creatives-library 3.0.33 → 3.0.35
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/components/TemplatePreview/index.js +3 -7
- package/components/TemplatePreview/messages.js +6 -14
- package/package.json +1 -1
- package/utils/smsCharCountV2.js +0 -6
- package/v2Components/TemplatePreview/_templatePreview.scss +2 -1
- package/v2Components/TemplatePreview/index.js +1 -1
- package/v2Containers/Email/messages.js +4 -0
|
@@ -9,7 +9,6 @@ import PropTypes from 'prop-types';
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import _ from 'lodash';
|
|
11
11
|
import { injectIntl, intlShape} from 'react-intl';
|
|
12
|
-
// import styled from 'styled-components';
|
|
13
12
|
import {CapColumn} from '@capillarytech/cap-react-ui-library';
|
|
14
13
|
import './_templatePreview.scss';
|
|
15
14
|
import {updateCharCount} from '../../utils/smsCharCountV2';
|
|
@@ -150,12 +149,9 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
150
149
|
{smsDetails.unicode &&
|
|
151
150
|
<div style={{fontSize: '16px'}}>{`${this.props.intl.formatMessage(messages.smsFormatType)}`}</div>
|
|
152
151
|
}
|
|
153
|
-
<div style={{marginTop: '8px', fontSize: '16px'}} >{`${this.props.intl.formatMessage(messages.sms)}
|
|
154
|
-
<div style={{
|
|
155
|
-
|
|
156
|
-
<span style={{fontWeight: '100', fontSize: '12px'}}>{this.props.intl.formatMessage(messages.includes)}</span>
|
|
157
|
-
<span style={{fontSize: '12px'}}>{this.props.intl.formatMessage(messages.optout)}</span>
|
|
158
|
-
<span style={{fontWeight: '100', fontSize: '12px'}}>{this.props.intl.formatMessage(messages.tag)}</span>: {smsDetails.optouturlLength}
|
|
152
|
+
<div style={{marginTop: '8px', fontSize: '16px'}} >{`${smsDetails.parts} ${this.props.intl.formatMessage(messages.sms)} (${smsDetails.chars_used} ${this.props.intl.formatMessage(messages.characters)})`}</div>
|
|
153
|
+
{smsDetails.optoutUrlPresent && <div style={{fontWeight: '100', fontSize: '12px'}}>
|
|
154
|
+
{`${this.props.intl.formatMessage(messages.includesOptoutTag)} (${smsDetails.optouturlLength} ${this.props.intl.formatMessage(messages.characters)})`}
|
|
159
155
|
</div>}
|
|
160
156
|
</p>
|
|
161
157
|
</div>
|
|
@@ -14,9 +14,9 @@ export default defineMessages({
|
|
|
14
14
|
id: 'creatives.components.TemplatePreview.sms',
|
|
15
15
|
defaultMessage: "SMS",
|
|
16
16
|
},
|
|
17
|
-
|
|
18
|
-
id: 'creatives.components.TemplatePreview.
|
|
19
|
-
defaultMessage: "
|
|
17
|
+
characters: {
|
|
18
|
+
id: 'creatives.components.TemplatePreview.characters',
|
|
19
|
+
defaultMessage: "characters",
|
|
20
20
|
},
|
|
21
21
|
charactersTotal: {
|
|
22
22
|
id: 'creatives.components.TemplatePreview.charactersTotal',
|
|
@@ -26,17 +26,9 @@ export default defineMessages({
|
|
|
26
26
|
id: 'creatives.components.TemplatePreview.smsFormatType',
|
|
27
27
|
defaultMessage: 'Message has unicode characters',
|
|
28
28
|
},
|
|
29
|
-
|
|
30
|
-
id: 'app.components.TemplatePreview.
|
|
31
|
-
defaultMessage: 'Includes ',
|
|
32
|
-
},
|
|
33
|
-
optout: {
|
|
34
|
-
id: 'app.components.TemplatePreview.optout',
|
|
35
|
-
defaultMessage: 'Optout ',
|
|
36
|
-
},
|
|
37
|
-
tag: {
|
|
38
|
-
id: 'app.components.TemplatePreview.tag',
|
|
39
|
-
defaultMessage: 'tag ',
|
|
29
|
+
includesOptoutTag: {
|
|
30
|
+
id: 'app.components.TemplatePreview.includesOptoutTag',
|
|
31
|
+
defaultMessage: 'Includes Optout tag',
|
|
40
32
|
},
|
|
41
33
|
previewGenerated: {
|
|
42
34
|
id: 'creatives.components.TemplatePreview.previewGenerated',
|
package/package.json
CHANGED
package/utils/smsCharCountV2.js
CHANGED
|
@@ -62,7 +62,6 @@ export function updateCharCount(content, isUnicodeEnabled) {
|
|
|
62
62
|
showOptoutCount = false;
|
|
63
63
|
responseState = "FAIL";
|
|
64
64
|
optoutUrl = undefined;
|
|
65
|
-
console.log('get optouturl error: ', err);
|
|
66
65
|
});
|
|
67
66
|
}
|
|
68
67
|
const optoutTag = /{{optout}}/g;
|
|
@@ -147,11 +146,6 @@ export function updateCharCount(content, isUnicodeEnabled) {
|
|
|
147
146
|
}
|
|
148
147
|
|
|
149
148
|
chars_used = showOptoutCount ? (chars_used - (optoutTagLength * noOfOptout)) : chars_used;
|
|
150
|
-
console.log('Type:', (coding == '7bit' ? '7bit' : 'Unicode'));
|
|
151
|
-
console.log('Parts:', parts);
|
|
152
|
-
console.log('SMS Chars:', chars_sms);
|
|
153
|
-
console.log('SMS Char total:', chars_used);
|
|
154
|
-
console.log('SMS optouturl: ', optoutUrl);
|
|
155
149
|
return {
|
|
156
150
|
unicode: (coding === '7bit' ? false : true),
|
|
157
151
|
parts,
|
|
@@ -81,7 +81,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
81
81
|
</div>
|
|
82
82
|
</div>
|
|
83
83
|
{!this.props.showCount && <div>
|
|
84
|
-
<CapColumn className="character-count-col" span={
|
|
84
|
+
<CapColumn className="character-count-col" span={22}>
|
|
85
85
|
{channel && channel.toLowerCase() === 'sms' && <CapHeading type="h3">
|
|
86
86
|
<FormattedMessage {...messages.charactersTotal} values={{smsCount: smsDetails.parts, charCount: smsDetails.chars_used}}/>
|
|
87
87
|
{smsDetails.unicode &&
|
|
@@ -274,4 +274,8 @@ export default defineMessages({
|
|
|
274
274
|
id: 'creatives.containersV2.Email.goBackTemporaryChangesLost',
|
|
275
275
|
defaultMessage: "Do you really want to go back? All your temporary changes will be lost!",
|
|
276
276
|
},
|
|
277
|
+
"alertMessage": {
|
|
278
|
+
id: 'creatives.containersV2.Email.alertMessage',
|
|
279
|
+
defaultMessage: 'Alert',
|
|
280
|
+
},
|
|
277
281
|
});
|