@capillarytech/creatives-library 7.12.3 → 7.12.6
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 -0
- package/package.json +1 -1
- package/v2Components/TemplatePreview/assets/images/sms_mobile_ios.svg +18 -0
- package/v2Components/TemplatePreview/index.js +32 -32
- package/v2Containers/CreativesContainer/SlideBoxContent.js +1 -1
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +4 -2
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxHeader.test.js.snap +1 -1
- package/v2Containers/Rcs/constants.js +2 -1
- package/v2Containers/Rcs/index.js +45 -44
- package/v2Containers/Rcs/sagas.js +3 -3
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +135 -707
- package/v2Containers/Templates/index.js +1 -0
- package/v2Containers/Whatsapp/constants.js +287 -0
- package/v2Containers/Whatsapp/index.js +35 -23
- package/v2Containers/Whatsapp/index.scss +3 -2
- package/v2Containers/Whatsapp/messages.js +284 -0
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +35570 -1687
- package/v2Containers/Whatsapp/tests/index.test.js +13 -0
- package/v2Containers/Whatsapp/tests/utils.test.js +15 -8
- package/v2Containers/mockdata.js +1173 -1143
- package/v2Components/CallTaskPreview/tests/__snapshots__/index.test.js.snap +0 -30
package/config/app.js
CHANGED
|
@@ -17,6 +17,7 @@ const config = {
|
|
|
17
17
|
},
|
|
18
18
|
development: {
|
|
19
19
|
api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/creatives',
|
|
20
|
+
//api_endpoint: 'http://localhost:2022/arya/api/v1/creatives',
|
|
20
21
|
campaigns_api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/campaigns',
|
|
21
22
|
campaigns_api_org_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/org/campaign',
|
|
22
23
|
auth_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/auth',
|
package/package.json
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<svg width="228" height="472" viewBox="0 0 228 472" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g fill="none" fill-rule="evenodd">
|
|
3
|
+
<rect fill="#101211" width="228" height="472" rx="32"/>
|
|
4
|
+
<path d="M195 11c12.703 0 23 10.297 23 23v405c0 12.703-10.297 23-23 23H33c-12.703 0-23-10.297-23-23V34c0-12.703 10.297-23 23-23h25v3c0 7.077 5.655 12.833 12.693 12.996L71 27h86c7.18 0 13-5.82 13-13v-3h25z" fill="#F4F5F7"/>
|
|
5
|
+
<path d="M195 11c12.703 0 23 10.297 23 23v43.092H10V34c0-12.703 10.297-23 23-23h25v3c0 7.077 5.655 12.833 12.693 12.996L71 27h86c7.18 0 13-5.82 13-13v-3h25z" fill="#F8F8F8"/>
|
|
6
|
+
<rect stroke="#C8C7CC" stroke-width=".5" fill="#FAFAFA" x="44" y="421.072" width="168" height="20" rx="10"/>
|
|
7
|
+
<path d="M79.35 455h69.3c.72 0 1.35.467 1.35 1 0 .533-.63 1-1.35 1h-69.3c-.72 0-1.35-.467-1.35-1 0-.533.63-1 1.35-1z" fill="#2E2E2E" fill-rule="nonzero" opacity=".4"/>
|
|
8
|
+
<path fill="#E0E0E0" d="M10 77h208v1H10z"/>
|
|
9
|
+
<path d="m19.769 59.041-4.623-4.568a.487.487 0 0 1 0-.696l4.623-4.568a.728.728 0 0 1 1.02 0 .708.708 0 0 1 0 1.008l-3.954 3.908 3.954 3.908a.708.708 0 0 1 0 1.008.728.728 0 0 1-1.02 0M201 48a6 6 0 1 1 0 12 6 6 0 0 1 0-12zm0 .818a5.182 5.182 0 1 0 0 10.364 5.182 5.182 0 0 0 0-10.364zm.502 3.644v4.014h.502v.251h-2.008v-.25h.502v-3.764h-.502v-.251h1.506zm-.627-2.007a.627.627 0 1 1 0 1.254.627.627 0 0 1 0-1.254z" fill="#007AFF"/>
|
|
10
|
+
<path d="M198.7 21.3c-.5 0-.6 0-.8.1l-.3.3c-.1.2-.1.3-.1.8v2c0 .5 0 .6.1.8l.3.3c.2.1.3.1.8.1h6.8c.5 0 .6 0 .8-.1l.3-.3c.1-.2.1-.3.1-.8v-2c0-.5 0-.6-.1-.8l-.3-.3c-.2-.1-.3-.1-.8-.1h-6.8zm0-.4h6.8c.6 0 .8.1 1 .2.2.1.4.3.5.5.1.2.2.4.2 1v2c0 .6-.1.8-.2 1-.1.2-.3.4-.5.5-.2.1-.4.2-1 .2h-6.8c-.6 0-.8-.1-1-.2-.2-.1-.4-.3-.5-.5-.1-.2-.2-.4-.2-1v-2c0-.6.1-.8.2-1 .1-.2.3-.4.5-.5.2-.2.4-.2 1-.2zm8.9 1.7c.5.2.7.5.7.9s-.2.7-.7.9v-1.8z" fill-opacity=".36" fill="#000" fill-rule="nonzero"/>
|
|
11
|
+
<path d="M198.6 21.7h7c.2 0 .3 0 .4.1.1 0 .1.1.2.2s.1.2.1.4v2.3c0 .2 0 .3-.1.4l-.2.2c-.1.1-.2.1-.4.1h-7c-.2 0-.3 0-.4-.1-.1-.1-.2-.2-.2-.3 0-.1-.1-.2-.1-.4v-2.3c0-.2 0-.3.1-.4 0-.1.1-.1.2-.2.1.1.1 0 .4 0zM173.3 24.4c.5 0 .8.4.8.8v.6c0 .5-.4.8-.8.8s-.8-.4-.8-.8v-.6c0-.5.4-.8.8-.8zm2.7-1.2c.5 0 .8.4.8.8v1.7c0 .5-.4.8-.8.8s-.8-.4-.8-.8V24c0-.4.4-.8.8-.8zm2.6-1.3c.5 0 .8.4.8.8v3c0 .5-.4.8-.8.8s-.8-.4-.8-.8v-3c0-.4.3-.8.8-.8zm2.6-1.3c.5 0 .8.4.8.8v4.3c0 .5-.4.8-.8.8s-.8-.4-.8-.8v-4.3c0-.4.4-.8.8-.8zM189.8 21.6c1.2 0 2.4.5 3.3 1.3.1.1.2.1.2 0l.6-.6.1-.1s0-.1-.1-.1c-2.3-2.2-5.9-2.2-8.3 0l-.1.1s0 .1.1.1l.6.6c.1.1.2.1.2 0 1-.8 2.2-1.3 3.4-1.3zm0 2.1c.7 0 1.3.2 1.8.7.1.1.2.1.2 0l.6-.6.1-.1s0-.1-.1-.1c-1.5-1.4-3.8-1.4-5.3 0l-.1.1s0 .1.1.1l.6.6c.1.1.2.1.2 0 .6-.4 1.2-.7 1.9-.7zm1.2 1.5.1-.1s0-.1-.1-.1c-.7-.6-1.7-.6-2.4 0l-.1.1s0 .1.1.1l1.1 1.1.1.1s.1 0 .1-.1l1.1-1.1zM29.063 24.648c.02.388.17.657.449.805a.995.995 0 0 0 .484.117c.336 0 .622-.14.86-.42.236-.28.404-.848.503-1.705-.156.248-.35.422-.58.522-.23.1-.478.15-.744.15-.539 0-.965-.168-1.28-.504-.313-.336-.47-.768-.47-1.297 0-.507.155-.954.465-1.34.31-.385.767-.578 1.371-.578.815 0 1.378.368 1.688 1.102.171.404.257.909.257 1.516 0 .685-.102 1.291-.308 1.82-.341.88-.92 1.32-1.735 1.32-.546 0-.962-.143-1.246-.43-.284-.286-.425-.645-.425-1.078h.71zm1.066-1.148c.279 0 .533-.092.764-.275.23-.184.345-.505.345-.963 0-.412-.103-.718-.31-.92a1.086 1.086 0 0 0-.791-.303c-.344 0-.617.115-.819.346-.201.23-.302.538-.302.924 0 .364.088.654.265.869.177.215.46.322.848.322zm3.207-1.629h.816v.852h-.816v-.852zm0 3.277h.816V26h-.816v-.852zm3.98-1.128v-2.536l-1.793 2.536h1.793zm.012 1.98v-1.367h-2.453v-.688l2.563-3.554h.593v3.629h.824v.613h-.824V26h-.703zm2.559-3.96v-.54c.508-.05.862-.132 1.062-.248.2-.116.35-.39.45-.822h.554V26h-.75v-3.96h-1.316z" fill="#000" fill-rule="nonzero"/>
|
|
12
|
+
<path d="M27.304 424h4.393c.3 0 .696.196.881.438l1.207 1.78a.635.635 0 0 0 .524.278h2.596A1.1 1.1 0 0 1 38 427.603v8.04a1.1 1.1 0 0 1-1.095 1.108H22.096A1.1 1.1 0 0 1 21 435.644v-8.041a1.1 1.1 0 0 1 1.096-1.107h2.606c.203 0 .392-.101.507-.269l1.213-1.79c.186-.24.582-.437.882-.437zm6.31 3.881c0 .306.245.555.548.555a.55.55 0 0 0 .548-.555.551.551 0 0 0-.548-.554.552.552 0 0 0-.549.554zm-7.953 3.603c0 2.144 1.719 3.88 3.84 3.88 2.12 0 3.838-1.736 3.838-3.88 0-2.143-1.718-3.88-3.839-3.88-2.12 0-3.839 1.737-3.839 3.88zm-3.016-6.93h1.097a.55.55 0 0 1 .548.555v.554h-2.193v-.554a.55.55 0 0 1 .548-.554zm3.84 6.93c0-1.684 1.35-3.048 3.015-3.048 1.666 0 3.016 1.364 3.016 3.048 0 1.685-1.35 3.05-3.016 3.05s-3.016-1.365-3.016-3.05zM202 423a8 8 0 1 1 0 16 8 8 0 0 1 0-16zm3.06 6.251a.437.437 0 0 0-.437.437v1.603a2.623 2.623 0 0 1-5.246 0v-1.603a.437.437 0 1 0-.875 0v1.603a3.498 3.498 0 0 0 3.06 3.47v.903h-1.165a.437.437 0 1 0 0 .874h3.206a.437.437 0 0 0 0-.874h-1.166v-.904a3.498 3.498 0 0 0 3.061-3.469v-1.603a.437.437 0 0 0-.437-.437zm-3.06-3.79-.143.006a1.75 1.75 0 0 0-1.606 1.744v4.08c0 .966.783 1.75 1.749 1.75l.143-.006a1.75 1.75 0 0 0 1.606-1.744v-4.08c0-.966-.783-1.75-1.749-1.75z" fill="#8A8A8F"/>
|
|
13
|
+
<text font-family="Roboto-Regular, Roboto" font-size="7" letter-spacing="-.169" fill="#0A0A0A">
|
|
14
|
+
<tspan x="100" y="70">Sender ID</tspan>
|
|
15
|
+
</text>
|
|
16
|
+
<path d="M115 40c6.075 0 11 4.925 11 11s-4.925 11-11 11-11-4.925-11-11 4.925-11 11-11zm0 .88c-5.59 0-10.12 4.53-10.12 10.12 0 2.935 1.25 5.579 3.246 7.427 1.669-1.206 4.206-1.396 4.726-2.795.065-.709.04-1.204.04-1.852-.322-.169-.92-1.244-1.017-2.15-.252-.021-.65-.268-.767-1.24-.063-.523.187-.817.339-.91-.854-3.286-.384-6.156 3.512-6.228.973 0 1.723.26 2.015.774 2.844.395 1.99 4.219 1.579 5.455.152.092.402.386.34.908-.117.973-.516 1.22-.768 1.24-.097.908-.673 1.982-.994 2.15 0 .649-.025 1.144.04 1.853.519 1.398 3.044 1.589 4.706 2.79A10.085 10.085 0 0 0 125.12 51c0-5.59-4.53-10.12-10.12-10.12z" fill="#959BA9" fill-rule="nonzero"/>
|
|
17
|
+
</g>
|
|
18
|
+
</svg>
|
|
@@ -25,6 +25,7 @@ import { UNSUBSCRIBE_TEXT_LENGTH } from '../../v2Containers/Whatsapp/constants';
|
|
|
25
25
|
import whatsappMobileAndroid from './assets/images/whatsapp_mobile_android.svg'
|
|
26
26
|
const wechatBodyNew = require('./assets/images/wechat_mobile_android.svg');
|
|
27
27
|
const smsMobileAndroid = require('./assets/images/sms_mobile_android.svg');
|
|
28
|
+
const smsMobileIos = require('./assets/images/sms_mobile_ios.svg');
|
|
28
29
|
const lineMobileAndroid = require('../../assets/line.png');
|
|
29
30
|
const viberMobileAndroid = require('./assets/images/viberMobile.svg');
|
|
30
31
|
|
|
@@ -159,6 +160,7 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
159
160
|
whatsappContentLen,
|
|
160
161
|
intl,
|
|
161
162
|
templateData,
|
|
163
|
+
rcsIosPreview,
|
|
162
164
|
} = this.props;
|
|
163
165
|
const { formatMessage } = intl;
|
|
164
166
|
const { buttonText, imageURL, rcsPreviewContent, messageContent: viberMessageContent } = content || {};
|
|
@@ -726,40 +728,38 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
726
728
|
}
|
|
727
729
|
{
|
|
728
730
|
channel?.toUpperCase() === RCS && (
|
|
729
|
-
|
|
730
|
-
<
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
<div className='
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
)}
|
|
759
|
-
</div>
|
|
731
|
+
<div className='shell-v2 align-center'>
|
|
732
|
+
<CapImage
|
|
733
|
+
className='preview-image'
|
|
734
|
+
src={rcsIosPreview ? smsMobileIos : smsMobileAndroid}
|
|
735
|
+
alt={formatMessage(messages.previewGenerated)}
|
|
736
|
+
/>
|
|
737
|
+
<div className='msg-container sms'>
|
|
738
|
+
<div className='message-pop sms'>
|
|
739
|
+
{rcsImageSrc && (
|
|
740
|
+
<CapImage
|
|
741
|
+
src={rcsImageSrc}
|
|
742
|
+
className='rcs-image'
|
|
743
|
+
alt={formatMessage(messages.previewGenerated)}
|
|
744
|
+
/>
|
|
745
|
+
)}
|
|
746
|
+
{rcsTitle && (
|
|
747
|
+
<CapLabel
|
|
748
|
+
type="label5"
|
|
749
|
+
className='message-pop-item align-left rcs-content'
|
|
750
|
+
fontWeight='bold'
|
|
751
|
+
>
|
|
752
|
+
{rcsTitle}
|
|
753
|
+
</CapLabel>
|
|
754
|
+
)}
|
|
755
|
+
{rcsDesc && (
|
|
756
|
+
<CapLabel type="label5" className='message-pop-item align-left rcs-content rcs-desc'>
|
|
757
|
+
{rcsDesc}
|
|
758
|
+
</CapLabel>
|
|
759
|
+
)}
|
|
760
760
|
</div>
|
|
761
761
|
</div>
|
|
762
|
-
|
|
762
|
+
</div>
|
|
763
763
|
)
|
|
764
764
|
}
|
|
765
765
|
{channel && channel.toLowerCase() === FACEBOOK && (
|
|
@@ -339,7 +339,7 @@ export function SlideBoxContent(props) {
|
|
|
339
339
|
}
|
|
340
340
|
case constants.RCS: {
|
|
341
341
|
const template = cloneDeep(templateDataObject);
|
|
342
|
-
const { description = "", media: {mediaUrl = ""}, title} = get(template, 'versions.base.content.RCS.cardContent[0]', {});
|
|
342
|
+
const { description = "", media: { mediaUrl = "" } = {}, title = "" } = get(template, 'versions.base.content.RCS.cardContent[0]', {});
|
|
343
343
|
return {
|
|
344
344
|
rcsPreviewContent: {
|
|
345
345
|
rcsImageSrc: mediaUrl,
|
|
@@ -7,6 +7,7 @@ import moment from 'moment';
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import messages from './messages';
|
|
9
9
|
import whatsppMsg from '../Whatsapp/messages';
|
|
10
|
+
import { LANGUAGE_OPTIONS } from '../Whatsapp/constants'
|
|
10
11
|
import globalMessages from '../Cap/messages'
|
|
11
12
|
import { MAP_TEMPLATE } from '../WeChat/Wrapper/constants';
|
|
12
13
|
import { NO_COMMUNICATION, FTP, WHATSAPP } from '../App/constants';
|
|
@@ -43,10 +44,11 @@ export function SlideBoxHeader(props) {
|
|
|
43
44
|
const {
|
|
44
45
|
whatsappTemplateName,
|
|
45
46
|
whatsappTemplateCategory,
|
|
47
|
+
whatsappTemplateLanguageCode,
|
|
46
48
|
} = templateData || {};
|
|
47
49
|
const whatsappName = whatsappTemplateName || templateData?.name;
|
|
48
50
|
const whatsappCategory = whatsappTemplateCategory || get(templateData, `versions.base.content.whatsapp.category`, '');
|
|
49
|
-
|
|
51
|
+
const whatsappLanguageCode = whatsappTemplateLanguageCode || get(templateData, `versions.base.content.whatsapp.languages[0].language`, '');
|
|
50
52
|
|
|
51
53
|
const getChannelLabel = (currentChannel = '') => {
|
|
52
54
|
const labels = {
|
|
@@ -103,7 +105,7 @@ export function SlideBoxHeader(props) {
|
|
|
103
105
|
{renderWhatsappData("label2", formatString(whatsappCategory))}
|
|
104
106
|
{renderWhatsappData("label3", <FormattedMessage {...whatsppMsg.labelSeperator} />)}
|
|
105
107
|
{renderWhatsappData("label1", <FormattedMessage {...whatsppMsg.languageLabel} />)}
|
|
106
|
-
{renderWhatsappData("label2",
|
|
108
|
+
{renderWhatsappData("label2", LANGUAGE_OPTIONS?.find(option => option.value === whatsappLanguageCode)?.label)}
|
|
107
109
|
</>)
|
|
108
110
|
}
|
|
109
111
|
prefix={creativesMode !== 'edit' && !isFullMode && showPrefix &&
|
|
@@ -190,7 +190,7 @@ exports[`Test SlideBoxHeader container Should render correct component for whats
|
|
|
190
190
|
>
|
|
191
191
|
<FormattedMessage
|
|
192
192
|
defaultMessage="English"
|
|
193
|
-
id="creatives.containersV2.Whatsapp.
|
|
193
|
+
id="creatives.containersV2.Whatsapp.english"
|
|
194
194
|
values={Object {}}
|
|
195
195
|
/>
|
|
196
196
|
</SlideBoxHeader__StyledLabel>
|
|
@@ -14,8 +14,9 @@ export const RCS_DLT_MODE = {
|
|
|
14
14
|
TEMPLATES: 'templates',
|
|
15
15
|
EDIT: 'editTemplate',
|
|
16
16
|
};
|
|
17
|
-
export const
|
|
17
|
+
export const TEMPLATE_DESC_MAX_LENGTH = 1000;
|
|
18
18
|
export const FALLBACK_MESSAGE_MAX_LENGTH = 160;
|
|
19
|
+
export const TEMPLATE_TITLE_MAX_LENGTH = 200;
|
|
19
20
|
export const TAG = 'TAG';
|
|
20
21
|
export const EMBEDDED = 'embedded';
|
|
21
22
|
export const DEFAULT = 'default';
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
/* eslint-disable no-unused-expressions */
|
|
2
|
-
/* eslint-disable indent */
|
|
3
|
-
/* eslint-disable no-unused-vars */
|
|
4
2
|
import React, { useState, useEffect, useCallback } from 'react';
|
|
5
3
|
import { bindActionCreators } from 'redux';
|
|
6
4
|
import { createStructuredSelector } from 'reselect';
|
|
@@ -44,13 +42,14 @@ import {
|
|
|
44
42
|
setInjectedTags,
|
|
45
43
|
} from '../Cap/selectors';
|
|
46
44
|
import * as RcsActions from './actions';
|
|
47
|
-
import * as TemplatesActions from '../Templates/actions'
|
|
45
|
+
import * as TemplatesActions from '../Templates/actions';
|
|
48
46
|
import './index.scss';
|
|
49
47
|
import {
|
|
50
48
|
RCS,
|
|
51
49
|
SMS,
|
|
52
50
|
RCS_MEDIA_TYPES,
|
|
53
|
-
|
|
51
|
+
TEMPLATE_TITLE_MAX_LENGTH,
|
|
52
|
+
TEMPLATE_DESC_MAX_LENGTH,
|
|
54
53
|
FALLBACK_MESSAGE_MAX_LENGTH,
|
|
55
54
|
TAG,
|
|
56
55
|
EMBEDDED,
|
|
@@ -172,11 +171,9 @@ export const Rcs = (props) => {
|
|
|
172
171
|
const paramObj = params || {};
|
|
173
172
|
useEffect(() => {
|
|
174
173
|
const { id } = paramObj;
|
|
175
|
-
if (id) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
actions.getTemplateDetails(id, setSpin);
|
|
179
|
-
}
|
|
174
|
+
if (id && isFullMode) {
|
|
175
|
+
setSpin(true);
|
|
176
|
+
actions.getTemplateDetails(id, setSpin);
|
|
180
177
|
}
|
|
181
178
|
//cleanup code
|
|
182
179
|
return () => {
|
|
@@ -189,21 +186,21 @@ export const Rcs = (props) => {
|
|
|
189
186
|
? rcsData.templateDetails || {}
|
|
190
187
|
: templateData || {};
|
|
191
188
|
const editContent = get(versions, `base.content.RCS`, {});
|
|
192
|
-
if (
|
|
189
|
+
if (!isEmpty(editContent)) {
|
|
193
190
|
const { cardContent = [], smsFallBackContent = {} } = editContent;
|
|
194
191
|
const {
|
|
195
|
-
media
|
|
196
|
-
mediaType,
|
|
197
|
-
title,
|
|
198
|
-
description,
|
|
192
|
+
media: { mediaUrl = '' } = {},
|
|
193
|
+
mediaType = '',
|
|
194
|
+
title = '',
|
|
195
|
+
description = '',
|
|
199
196
|
} = cardContent[0] || {};
|
|
200
197
|
const { message, templateConfigs = {} } = smsFallBackContent;
|
|
201
198
|
setTemplateName(name);
|
|
202
|
-
setFallbackMessage(message);
|
|
203
|
-
setTemplateDesc(description);
|
|
204
|
-
setTemplateTitle(title);
|
|
205
199
|
setTemplateMediaType(mediaType);
|
|
206
|
-
updateRcsImageSrc(
|
|
200
|
+
updateRcsImageSrc(mediaUrl);
|
|
201
|
+
setTemplateTitle(title);
|
|
202
|
+
setTemplateDesc(description);
|
|
203
|
+
setFallbackMessage(message);
|
|
207
204
|
setEditFlow(true);
|
|
208
205
|
// for DLT Fallback message
|
|
209
206
|
if (isDltEnabled) {
|
|
@@ -217,11 +214,10 @@ export const Rcs = (props) => {
|
|
|
217
214
|
if (header.length > 0) {
|
|
218
215
|
const tempData = {
|
|
219
216
|
versions: {
|
|
220
|
-
// eslint-disable-next-line no-undef
|
|
221
217
|
base: {
|
|
222
218
|
header,
|
|
223
|
-
|
|
224
|
-
|
|
219
|
+
'template_id': templateId,
|
|
220
|
+
'template_name': tmpName,
|
|
225
221
|
'sms-editor': template,
|
|
226
222
|
'var-mapped': templateVariableMapping,
|
|
227
223
|
},
|
|
@@ -361,7 +357,7 @@ export const Rcs = (props) => {
|
|
|
361
357
|
}) || {};
|
|
362
358
|
if (value === '' && isMediaTypeNone) {
|
|
363
359
|
errorMessage = formatMessage(messages.emptyTemplateDescErrorMessage);
|
|
364
|
-
} else if (value?.length >
|
|
360
|
+
} else if (value?.length > TEMPLATE_DESC_MAX_LENGTH) {
|
|
365
361
|
errorMessage = formatMessage(messages.templateDescLengthError);
|
|
366
362
|
} else if (unsupportedTags?.length > 0) {
|
|
367
363
|
errorMessage = formatMessage(
|
|
@@ -408,21 +404,21 @@ export const Rcs = (props) => {
|
|
|
408
404
|
{/* template title */}
|
|
409
405
|
{renderLabel('templateTitle', true)}
|
|
410
406
|
<CapInput
|
|
411
|
-
id=
|
|
407
|
+
id="rcs-template-title-input"
|
|
412
408
|
onChange={onTemplateTitleChange}
|
|
413
409
|
placeholder={formatMessage(messages.templateTitlePlaceholder)}
|
|
414
410
|
value={templateTitle || ''}
|
|
415
411
|
size="default"
|
|
416
|
-
maxLength={
|
|
412
|
+
maxLength={TEMPLATE_TITLE_MAX_LENGTH}
|
|
417
413
|
suffix={
|
|
418
|
-
<CapLabel type="label1">{`${templateTitle.length} /
|
|
414
|
+
<CapLabel type="label1">{`${templateTitle.length} / ${TEMPLATE_TITLE_MAX_LENGTH}`}</CapLabel>
|
|
419
415
|
}
|
|
420
416
|
/>
|
|
421
417
|
{/* template message */}
|
|
422
|
-
<CapRow id=
|
|
418
|
+
<CapRow id="rcs-template-message-label">
|
|
423
419
|
<CapHeader
|
|
424
420
|
title={
|
|
425
|
-
<CapRow
|
|
421
|
+
<CapRow type="flex">
|
|
426
422
|
<CapHeading type="h4">
|
|
427
423
|
{formatMessage(messages.templateDescLabel)}
|
|
428
424
|
</CapHeading>
|
|
@@ -446,7 +442,7 @@ export const Rcs = (props) => {
|
|
|
446
442
|
/>
|
|
447
443
|
</CapRow>
|
|
448
444
|
<TextArea
|
|
449
|
-
id=
|
|
445
|
+
id="rcs_template_message_textarea"
|
|
450
446
|
autosize={{ minRows: 3, maxRows: 5 }}
|
|
451
447
|
placeholder={formatMessage(messages.templateDescPlaceholder)}
|
|
452
448
|
onChange={onTemplateDescChange}
|
|
@@ -460,7 +456,9 @@ export const Rcs = (props) => {
|
|
|
460
456
|
const fallbackSmsLength = () => (
|
|
461
457
|
<CapLabel type="label1" className="fallback-sms-length">
|
|
462
458
|
{formatMessage(messages.totalCharacters, {
|
|
463
|
-
smsCount: Math.ceil(
|
|
459
|
+
smsCount: Math.ceil(
|
|
460
|
+
fallbackMessage.length / FALLBACK_MESSAGE_MAX_LENGTH,
|
|
461
|
+
),
|
|
464
462
|
number: fallbackMessage.length,
|
|
465
463
|
})}
|
|
466
464
|
</CapLabel>
|
|
@@ -477,7 +475,7 @@ export const Rcs = (props) => {
|
|
|
477
475
|
const closeDltContainerHandler = () => {
|
|
478
476
|
setShowDltContainer(false);
|
|
479
477
|
setDltMode('');
|
|
480
|
-
templatesActions.getAllTemplates('Rcs', { page: 1, perPage: 25 })
|
|
478
|
+
templatesActions.getAllTemplates('Rcs', { page: 1, perPage: 25 });
|
|
481
479
|
};
|
|
482
480
|
|
|
483
481
|
const rcsDltEditSelectHandler = (data) => {
|
|
@@ -618,7 +616,7 @@ export const Rcs = (props) => {
|
|
|
618
616
|
>
|
|
619
617
|
<CapHeader
|
|
620
618
|
title={
|
|
621
|
-
<CapRow
|
|
619
|
+
<CapRow type="flex">
|
|
622
620
|
<CapHeading type="h4">
|
|
623
621
|
{formatMessage(messages.fallbackLabel)}
|
|
624
622
|
</CapHeading>
|
|
@@ -712,7 +710,7 @@ export const Rcs = (props) => {
|
|
|
712
710
|
/>
|
|
713
711
|
</CapRow>
|
|
714
712
|
<TextArea
|
|
715
|
-
id=
|
|
713
|
+
id="rcs_fallback_message_textarea"
|
|
716
714
|
autosize={{ minRows: 3, maxRows: 5 }}
|
|
717
715
|
placeholder={formatMessage(messages.fallbackMsgPlaceholder)}
|
|
718
716
|
onChange={onFallbackMessageChange}
|
|
@@ -762,8 +760,8 @@ export const Rcs = (props) => {
|
|
|
762
760
|
updateImageSrc={setUpdateRcsImageSrc}
|
|
763
761
|
updateOnReUpload={updateOnRcsImageReUpload}
|
|
764
762
|
index={0}
|
|
765
|
-
className=
|
|
766
|
-
key=
|
|
763
|
+
className="cap-custom-image-upload"
|
|
764
|
+
key="rcs-uploaded-image"
|
|
767
765
|
imageData={rcsData}
|
|
768
766
|
channel={RCS}
|
|
769
767
|
/>
|
|
@@ -801,7 +799,6 @@ export const Rcs = (props) => {
|
|
|
801
799
|
header: registeredSenderIds = [],
|
|
802
800
|
'var-mapped': templateVariableMapping = {},
|
|
803
801
|
} = base;
|
|
804
|
-
const tempMediaSrc = !isMediaTypeNone ? rcsImageSrc : '';
|
|
805
802
|
|
|
806
803
|
return {
|
|
807
804
|
name: templateName,
|
|
@@ -814,10 +811,12 @@ export const Rcs = (props) => {
|
|
|
814
811
|
title: templateTitle,
|
|
815
812
|
description: templateDesc,
|
|
816
813
|
mediaType: templateMediaType,
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
814
|
+
...(!isMediaTypeNone && {
|
|
815
|
+
media: {
|
|
816
|
+
mediaUrl: rcsImageSrc,
|
|
817
|
+
height: MEDIUM,
|
|
818
|
+
},
|
|
819
|
+
}),
|
|
821
820
|
},
|
|
822
821
|
],
|
|
823
822
|
cardSettings: {
|
|
@@ -949,7 +948,7 @@ export const Rcs = (props) => {
|
|
|
949
948
|
{/* template name */}
|
|
950
949
|
{isFullMode && (
|
|
951
950
|
<CapInput
|
|
952
|
-
id=
|
|
951
|
+
id="rcs_template_name_input"
|
|
953
952
|
onChange={onTemplateNameChange}
|
|
954
953
|
errorMessage={templateNameError}
|
|
955
954
|
placeholder={formatMessage(
|
|
@@ -966,7 +965,7 @@ export const Rcs = (props) => {
|
|
|
966
965
|
options={mediaRadioOptions || []}
|
|
967
966
|
value={templateMediaType}
|
|
968
967
|
onChange={onTemplateMediaTypeChange}
|
|
969
|
-
className=
|
|
968
|
+
className="rcs-radio"
|
|
970
969
|
/>
|
|
971
970
|
{getMediaBasedComponent()}
|
|
972
971
|
<CapDivider style={{ margin: `${CAP_SPACE_28} 0` }} />
|
|
@@ -983,8 +982,8 @@ export const Rcs = (props) => {
|
|
|
983
982
|
title={
|
|
984
983
|
isDisableDone()
|
|
985
984
|
? formatMessage(messages.rcsDoneBtnToolTip, {
|
|
986
|
-
|
|
987
|
-
|
|
985
|
+
type: formatMessage(messages[mediaTypeMsg]),
|
|
986
|
+
})
|
|
988
987
|
: ''
|
|
989
988
|
}
|
|
990
989
|
placement={'right'}
|
|
@@ -1026,7 +1025,9 @@ export const Rcs = (props) => {
|
|
|
1026
1025
|
className="margin-t-16"
|
|
1027
1026
|
>
|
|
1028
1027
|
{formatMessage(messages.totalCharacters, {
|
|
1029
|
-
smsCount: Math.ceil(
|
|
1028
|
+
smsCount: Math.ceil(
|
|
1029
|
+
tempMsg.length / FALLBACK_MESSAGE_MAX_LENGTH,
|
|
1030
|
+
),
|
|
1030
1031
|
number: tempMsg.length,
|
|
1031
1032
|
})}
|
|
1032
1033
|
</CapHeading>
|
|
@@ -23,7 +23,7 @@ export function* uploadRcsAsset(file, assetType, fileParams) {
|
|
|
23
23
|
yield put({
|
|
24
24
|
type: UPLOAD_RCS_ASSET_SUCCESS,
|
|
25
25
|
data: result.response.asset,
|
|
26
|
-
statusCode: result
|
|
26
|
+
statusCode: result?.status?.code || '',
|
|
27
27
|
templateType: file.templateType,
|
|
28
28
|
});
|
|
29
29
|
} catch (error) {
|
|
@@ -50,7 +50,7 @@ export function* createRCSTemplate({ template, callback }) {
|
|
|
50
50
|
yield put({
|
|
51
51
|
type: CREATE_RCS_TEMPLATE_SUCCESS,
|
|
52
52
|
data: result.response,
|
|
53
|
-
statusCode: result
|
|
53
|
+
statusCode: result?.status?.code || '',
|
|
54
54
|
errorMsg,
|
|
55
55
|
});
|
|
56
56
|
if (callback) {
|
|
@@ -87,7 +87,7 @@ export function* editTemplate({ template, callback }) {
|
|
|
87
87
|
yield put({
|
|
88
88
|
type: EDIT_RCS_TEMPLATE_SUCCESS,
|
|
89
89
|
data: result.response,
|
|
90
|
-
statusCode: result
|
|
90
|
+
statusCode: result?.status?.code || '',
|
|
91
91
|
errorMsg,
|
|
92
92
|
});
|
|
93
93
|
if (callback) {
|