@capillarytech/creatives-library 7.10.51 → 7.10.53

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.
@@ -1,3 +1,5 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
1
3
  exports[`galleryReducer Initial State should match snapshot returns the initial state 1`] = `
2
4
  Object {
3
5
  "assetList": Array [],
@@ -2733,11 +2733,12 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2733
2733
  } else {
2734
2734
  this.setState({injectedTags: data.tags});
2735
2735
  }
2736
- this.props.globalActions.setInjectedTags(data.tags);
2736
+ if (data.tags) {
2737
+ this.props.globalActions.setInjectedTags(data.tags);
2738
+ }
2737
2739
  }
2738
2740
 
2739
2741
  startLoading = (ifEdit) => {
2740
-
2741
2742
  if (ifEdit) {
2742
2743
  this.setState({loading: true});
2743
2744
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.10.51",
4
+ "version": "7.10.53",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -15,7 +15,7 @@
15
15
  }
16
16
  }
17
17
 
18
- .msgContainer {
18
+ .msg-container {
19
19
  position: absolute;
20
20
  top: 20%;
21
21
  left: 23%;
@@ -238,6 +238,21 @@
238
238
  }
239
239
  }
240
240
  }
241
+
242
+ .whatsapp-brand-name {
243
+ position: absolute;
244
+ top: 11%;
245
+ left: 38%;
246
+ color: white;
247
+ font-size: small;
248
+ }
249
+ .whatsapp-message-container{
250
+ max-height: 292px;
251
+ margin-left: 28px;
252
+ }
253
+ .whatsapp-content{
254
+ margin: 2px 6px 1px 7px;
255
+ }
241
256
  }
242
257
 
243
258
  .align-center {
@@ -291,7 +306,7 @@
291
306
  }
292
307
 
293
308
 
294
- .msgContainer {
309
+ .msg-container {
295
310
  position: absolute;
296
311
  top: 14%;
297
312
  left: 29%;
@@ -399,11 +414,4 @@
399
414
  span {
400
415
  font-size: $FONT_SIZE_VS;
401
416
  }
402
- }
403
- .whatsapp-brand-name{
404
- position: absolute;
405
- top: 11%;
406
- left: 38%;
407
- color: white;
408
- font-size: small;
409
417
  }
@@ -10,7 +10,7 @@ import React from 'react';
10
10
  import _ from 'lodash';
11
11
  import { injectIntl, FormattedMessage, intlShape } from 'react-intl';
12
12
  // import styled from 'styled-components';
13
- import {CapColumn, CapRow, CapHeading, CapIcon, CapButton, CapImage} from '@capillarytech/cap-ui-library';
13
+ import { CapColumn, CapRow, CapHeading, CapIcon, CapButton, CapImage, CapLabel } from '@capillarytech/cap-ui-library';
14
14
  import './_templatePreview.scss';
15
15
  import {updateCharCount} from '../../utils/smsCharCountV2';
16
16
  import messages from './messages';
@@ -20,11 +20,11 @@ import {
20
20
  } from '../../v2Containers/CreativesContainer/constants';
21
21
  import Carousel from '../Carousel';
22
22
  import { VIBER, FACEBOOK } from '../../v2Containers/App/constants';
23
+ import whatsappMobileAndroid from './assets/images/whatsapp_mobile_android.svg'
23
24
  const wechatBodyNew = require('./assets/images/wechat_mobile_android.svg');
24
25
  const smsMobileAndroid = require('./assets/images/sms_mobile_android.svg');
25
26
  const lineMobileAndroid = require('../../assets/line.png');
26
27
  const viberMobileAndroid = require('./assets/images/viberMobile.svg');
27
- const whatsappMobileAndroid = require('./assets/images/whatsapp_mobile_android.svg');
28
28
 
29
29
  const lineImgPlaceholder = require('../../assets/line-image-placeholder.svg');
30
30
  const lineStickerPlaceholder = require('../../assets/smiley-placeholder.svg');
@@ -32,10 +32,20 @@ const lineVideoPlaceholder = require('../../assets/rich-video-placeholder.svg');
32
32
  const androidPushMessagePhone = require('./assets/images/androidPushMessage.svg');
33
33
  const iPhonePushMessagePhone = require('./assets/images/iPhonePushMessage.svg');
34
34
 
35
- import { CAP_COLOR_03, CAP_WHITE, FONT_COLOR_01, CAP_G08, CAP_G06, CAP_G15, CAP_PURPLE01, CAP_G16, CAP_SPACE_08, CAP_SPACE_16 } from '@capillarytech/cap-ui-library/styled/variables';
35
+ import {
36
+ CAP_COLOR_03,
37
+ CAP_WHITE,
38
+ FONT_COLOR_01,
39
+ CAP_G06,
40
+ CAP_G15,
41
+ CAP_PURPLE01,
42
+ CAP_G16,
43
+ CAP_SPACE_08,
44
+ CAP_SPACE_16,
45
+ } from '@capillarytech/cap-ui-library/styled/variables';
36
46
  import { TEMPLATE, IMAGE_CAROUSEL, IMAGE, STICKER, TEXT, IMAGE_MAP, VIDEO } from '../../v2Containers/Line/Container/constants';
37
47
  import CapFacebookPreview from '../../v2Containers/CapFacebookPreview';
38
- import { getWhatsappStatusContainer } from '../../v2Containers/Whatsapp/utils';
48
+ import WhatsappStatusContainer from '../WhatsappStatusContainer';
39
49
 
40
50
  class TemplatePreview extends React.Component { // eslint-disable-line react/prefer-stateless-function
41
51
  onPreviewContentClicked = (channel) => {
@@ -137,7 +147,17 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
137
147
 
138
148
  render() {
139
149
  let content = channel && channel.toLowerCase() === 'sms' ? [this.props.content] : this.props.content;
140
- const { channel, showTestAndPreviewIcon, module, viberBrandName, viberAccountName, whatsappAccountName, whatsappContentLen = 0, intl, templateData } = this.props;
150
+ const {
151
+ channel,
152
+ showTestAndPreviewIcon,
153
+ module,
154
+ viberBrandName,
155
+ viberAccountName,
156
+ whatsappAccountName,
157
+ whatsappContentLen = 0,
158
+ intl,
159
+ templateData,
160
+ } = this.props;
141
161
  const { formatMessage } = intl;
142
162
  const { buttonText, imageURL, messageContent: viberMessageContent } = content || {};
143
163
  let smsDetails = {};
@@ -194,7 +214,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
194
214
  'width': '81%',
195
215
  };
196
216
  const whatsappSectionStyle = {
197
- "padding": '3.5px 0 0',
217
+ 'padding': `4px 0 ${CAP_SPACE_08}`,
198
218
  'border-radius': '6px',
199
219
  'background-color': CAP_G15,
200
220
  'width': '88%',
@@ -284,10 +304,10 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
284
304
  {smsDetails.optoutUrlPresent && <CapHeading type="h6">
285
305
  <FormattedMessage {...messages.optoutCharactersTotal} values={{optoutUrlLength: smsDetails.optouturlLength}} />
286
306
  </CapHeading>}
287
- {channel && channel.toLowerCase() === WHATSAPP.toLowerCase() ? (
307
+ {channel?.toLowerCase() === WHATSAPP.toLowerCase() ? (
288
308
  <>
289
- {getWhatsappStatusContainer(templateData)}
290
- <CapHeading type="h3" style={{ marginTop: '12px' }}>
309
+ <WhatsappStatusContainer template={templateData} />
310
+ <CapHeading type="h3" className='margin-t-12'>
291
311
  <FormattedMessage {...messages.whatsappCharactersTotal} values={{charCount: content?.templateMsg?.length}} />
292
312
  </CapHeading>
293
313
  <CapHeading type="h6">
@@ -332,7 +352,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
332
352
  <div>
333
353
  <div className="shell-v2 align-center" id="sms-preview">
334
354
  <CapImage className="preview-image sms" src={smsMobileAndroid} alt="Preview is being generated"/>
335
- <div className="msgContainer sms">
355
+ <div className="msg-container sms">
336
356
  <div className={"message-pop sms"}>
337
357
  {content && content.length && content.map((msg, index) =>
338
358
  <CapColumn key={`"message-pop-content-${index}`} className="message-pop-item align-left" style={{ background: '#FFFFFF', color: '#091e42'}}>
@@ -360,7 +380,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
360
380
  {channel && channel.toLowerCase() === 'wechat' ?
361
381
  ( <div className="shell-v2 align-center" id="sms-preview">
362
382
  <CapImage className="preview-image" src={(channel || '').toLowerCase() === 'wechat' ? wechatBodyNew : smsMobileAndroid} alt="Preview is being generated"/>
363
- <div className="msgContainer wechat">
383
+ <div className="msg-container wechat">
364
384
  <div className="message-pop align-left" style={{ background: `${this.props.channel.toLowerCase() === 'wechat' ? '#ffffff' : '#3F51B5'}`, color: `${this.props.channel.toLowerCase() === 'wechat' ? '#333333' : '#ffffff'}`}}>{content}
365
385
  </div>
366
386
  </div>
@@ -420,7 +440,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
420
440
  <div className="shell-v2 align-center" id="sms-preview">
421
441
  <CapImage className="preview-image" src={lineMobileAndroid} alt={this.props.intl.formatMessage(messages.previewGenerated)}/>
422
442
  <div
423
- className="msgContainer line-preview"
443
+ className="msg-container line-preview"
424
444
  style={{
425
445
  maxHeight: 330,
426
446
  overflow: 'scroll',
@@ -588,7 +608,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
588
608
  <CapImage className="preview-image" src={viberMobileAndroid} alt={this.props.intl.formatMessage(messages.previewGenerated)}/>
589
609
  <div style={{ position: 'absolute', top: '12%', left: '36%'}}>{viberBrandName}</div>
590
610
  <div
591
- className="msgContainer viber-preview"
611
+ className="msg-container viber-preview"
592
612
  style={{
593
613
  maxHeight: 292,
594
614
  marginLeft: 28,
@@ -662,47 +682,41 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
662
682
  </div>
663
683
  ) : ''
664
684
  }
665
- {channel && channel?.toUpperCase() === WHATSAPP ? (
666
- <>
667
- <div className="shell-v2 align-center" id="sms-preview">
668
- <CapImage
669
- className="preview-image"
670
- src={whatsappMobileAndroid}
671
- alt={formatMessage(messages.previewGenerated)}
672
- />
673
- <div className="whatsapp-brand-name">
674
- {whatsappAccountName || ''}
675
- </div>
676
- <div
677
- className="msgContainer"
678
- style={{
679
- maxHeight: 292,
680
- marginLeft: 28,
681
- }}
682
- >
683
- <div
684
- className="message-pop align-left"
685
- style={whatsappSectionStyle}
686
- >
687
- <p
688
- style={{
689
- color: CAP_G16,
690
- margin: '1.5px 6px 1px 7px',
691
- }}
692
- >
693
- {content?.templateMsg || ''}
694
- </p>
695
- <div style={{ paddingBottom: CAP_SPACE_08 }}></div>
685
+ {
686
+ channel?.toUpperCase() === WHATSAPP ? (
687
+ <>
688
+ <div className='shell-v2 align-center'>
689
+ <CapImage
690
+ className='preview-image'
691
+ src={whatsappMobileAndroid}
692
+ alt={formatMessage(messages.previewGenerated)}
693
+ />
694
+ <CapLabel className='whatsapp-brand-name'>
695
+ {whatsappAccountName || ''}
696
+ </CapLabel>
697
+ <div className='msg-container whatsapp-message-container'>
698
+ <div className='message-pop align-left' style={whatsappSectionStyle}>
699
+ <CapLabel className='whatsapp-content'>
700
+ {content?.templateMsg || ''}
701
+ </CapLabel>
702
+ </div>
696
703
  </div>
697
704
  </div>
698
- </div>
699
- <CapHeading type="h3" style={{ textAlign: "center", marginTop: CAP_SPACE_16 }}>
700
- <FormattedMessage {...messages.whatsappMessageLength} values={{ length: 36 + whatsappContentLen }} />
701
- </CapHeading>
702
- </>
703
- ) : (
704
- ''
705
- )}
705
+ <CapHeading
706
+ type='h3'
707
+ style={{ textAlign: 'center' }}
708
+ className='margin-t-16'
709
+ >
710
+ <FormattedMessage
711
+ {...messages.whatsappMessageLength}
712
+ values={{ length: 36 + whatsappContentLen }}
713
+ />
714
+ </CapHeading>
715
+ </>
716
+ ) : (
717
+ ''
718
+ )
719
+ }
706
720
  {channel && channel.toLowerCase() === FACEBOOK && (
707
721
  <div style={{position: 'absolute', left: '80%'}} id="facebook-preview">
708
722
  <CapFacebookPreview
@@ -0,0 +1,15 @@
1
+ @import '~@capillarytech/cap-ui-library/styles/_variables.scss';
2
+
3
+ .whatsapp-status-container {
4
+ margin-top: $CAP_SPACE_12;
5
+ width: 150%;
6
+ height: 20px;
7
+
8
+ .cap-colored-tag-v2 {
9
+ font-weight: normal;
10
+ }
11
+
12
+ .whatsapp-category-tag {
13
+ margin-left: $CAP_SPACE_08;
14
+ }
15
+ }
@@ -0,0 +1,58 @@
1
+ import React from 'react';
2
+ import { CapRow, CapStatus, CapColoredTag } from '@capillarytech/cap-ui-library';
3
+ import { WHATSAPP } from '../../v2Containers/CreativesContainer/constants';
4
+ import {
5
+ CATEGORY as WHATSAPP_CATEGORY,
6
+ STATUS as WHATSAPP_STATUS,
7
+ } from '../../v2Containers/Whatsapp/constants';
8
+ import { getWhatsappCategory, getWhatsappStatus } from '../../v2Containers/Whatsapp/utils';
9
+ import './_whatsappStatusContainer.scss';
10
+
11
+ export const WhatsappStatusContainer = (props) => {
12
+
13
+ const { template } = props;
14
+
15
+ const {
16
+ versions: {
17
+ base: {
18
+ content: {
19
+ [WHATSAPP.toLowerCase()]: {
20
+ [WHATSAPP_STATUS]: status,
21
+ [WHATSAPP_CATEGORY]: category,
22
+ } = {},
23
+ } = {},
24
+ } = {},
25
+ } = {},
26
+ } = template;
27
+
28
+ const categoryObj = getWhatsappCategory(category) || {};
29
+ const {
30
+ label: categoryLabel,
31
+ tagColor: categoryTagColor,
32
+ tagTextColor: categoryTextColor,
33
+ } = categoryObj;
34
+ return (
35
+ <CapRow type="flex" align="middle" className="whatsapp-status-container">
36
+ <CapStatus
37
+ type={status}
38
+ text={getWhatsappStatus(status)?.label}
39
+ labelType="label3"
40
+ />
41
+ {
42
+ categoryLabel ? (
43
+ <CapColoredTag
44
+ tagColor={categoryTagColor}
45
+ tagTextColor={categoryTextColor}
46
+ tagHeight="20px"
47
+ tagFontSize="12px"
48
+ className="whatsapp-category-tag"
49
+ >
50
+ {categoryLabel}
51
+ </CapColoredTag>
52
+ ) : null
53
+ }
54
+ </CapRow>
55
+ )
56
+ }
57
+
58
+ export default WhatsappStatusContainer;
@@ -1,3 +1,5 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
1
3
  exports[`galleryReducer Initial State should match snapshot returns the initial state 1`] = `
2
4
  Object {
3
5
  "assetList": Array [],
@@ -80,6 +80,14 @@ export default defineMessages({
80
80
  id: `creatives.containersV2.promotions`,
81
81
  defaultMessage: 'Promotions',
82
82
  },
83
+ "templateNameLabel": {
84
+ id: `creatives.containersV2.templateNameLabel`,
85
+ defaultMessage: 'Template name',
86
+ },
87
+ "templateNamePlaceholder": {
88
+ id: `creatives.containersV2.templateNamePlaceholder`,
89
+ defaultMessage: 'Enter template name',
90
+ },
83
91
 
84
92
  //refresh due to org change messages
85
93
 
@@ -173,11 +173,12 @@ function SlideBoxContent(props) {
173
173
  });
174
174
 
175
175
 
176
- const isCreateSms = slidBoxContent === 'createTemplate' && channel === constants.SMS;
177
- const isCreateFacebook = slidBoxContent === 'createTemplate' && channel === constants.FACEBOOK;
178
- const isCreateWhatsapp = slidBoxContent === 'createTemplate' && channel === constants.WHATSAPP;
179
- const isCreateMPush = slidBoxContent === 'createTemplate' && channel === constants.MOBILE_PUSH;
180
- const isCreateCallTask = slidBoxContent === 'createTemplate' && channel === constants.CALL_TASK;
176
+ const isCreate = slidBoxContent === 'createTemplate';
177
+ const isCreateSms = isCreate && channel === constants.SMS;
178
+ const isCreateFacebook = isCreate && channel === constants.FACEBOOK;
179
+ const isCreateWhatsapp = isCreate && channel === constants.WHATSAPP;
180
+ const isCreateMPush = isCreate && channel === constants.MOBILE_PUSH;
181
+ const isCreateCallTask = isCreate && channel === constants.CALL_TASK;
181
182
  let isEditSms = false;
182
183
  let isEditEmailWithId = false;
183
184
  let isEmailEditWithContent = false;
@@ -189,7 +190,7 @@ function SlideBoxContent(props) {
189
190
  let isEditFacebook = false;
190
191
  let isEditFTP = false;
191
192
  let isEditWhatsapp = false;
192
- const isEmailCreate = slidBoxContent === 'createTemplate' && channel === constants.EMAIL;
193
+ const isEmailCreate = isCreate && channel === constants.EMAIL;
193
194
  if (templateData && channel) {
194
195
  channel = templateData.type;// for edit mode with template data
195
196
  isEditSms = slidBoxContent === 'editTemplate' && channel === constants.SMS;
@@ -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 globalMessages from '../Cap/messages'
10
11
  import { MAP_TEMPLATE } from '../WeChat/Wrapper/constants';
11
12
  import { NO_COMMUNICATION, FTP, WHATSAPP } from '../App/constants';
12
13
  import { isTraiDLTEnable } from '../../utils/common';
@@ -21,24 +22,15 @@ const StyledLabel = styled(CapLabelInline)`
21
22
  const PrefixWrapper = styled.div`
22
23
  margin-right: 16px;
23
24
  `;
24
- function getChannelLabel(channel = '') {
25
- const labels = {
26
- sms: 'SMS',
27
- email: 'Email',
28
- mobilepush: 'Push notification',
29
- wechat: 'Wechat',
30
- no_communication: 'NO_COMMUNICATION',
31
- ftp: 'FTP',
32
- whatsapp: 'WhatsApp template',
33
- };
34
- return labels[channel.toLowerCase()];
35
- }
25
+
36
26
  const renderWhatsappData = (type, value) => (
37
27
  <StyledLabel type={type}>
38
28
  {value}
39
29
  </StyledLabel>
40
30
  )
41
31
  function SlideBoxHeader(props) {
32
+
33
+
42
34
  const { slidBoxContent, templateData, onShowTemplates, creativesMode, isFullMode, showPrefix, shouldShowTemplateName, channel, templateNameRenderProp, weChatTemplateType, onWeChatMaptemplateStepChange, weChatMaptemplateStep, templateStep, smsRegister } = props;
43
35
  const showTemplateNameHeader = isFullMode && shouldShowTemplateName;
44
36
  const mapTemplateCreate = !showTemplateNameHeader && slidBoxContent === 'createTemplate' && weChatTemplateType === MAP_TEMPLATE && templateStep !== 'modeSelection';
@@ -54,6 +46,20 @@ function SlideBoxHeader(props) {
54
46
  const whatsappName = whatsappTemplateName || templateData?.name;
55
47
  const whatsappCategory = whatsappTemplateCategory || get(templateData, `versions.base.content.whatsapp.category`, '');
56
48
 
49
+
50
+ const getChannelLabel = (currentChannel = '') => {
51
+ const labels = {
52
+ sms: 'SMS',
53
+ email: 'Email',
54
+ mobilepush: 'Push notification',
55
+ wechat: 'Wechat',
56
+ no_communication: 'NO_COMMUNICATION',
57
+ ftp: 'FTP',
58
+ whatsapp: <FormattedMessage {...messages.whatsappTemplate} />,
59
+ };
60
+ return labels[currentChannel.toLowerCase()];
61
+ };
62
+
57
63
  return (
58
64
  <div key="creatives-container-slidebox-header-content">
59
65
  {slidBoxContent === 'templates' && !showTemplateNameHeader && (
@@ -84,7 +90,7 @@ function SlideBoxHeader(props) {
84
90
  description={
85
91
  isWhatsappEdit && (
86
92
  <>
87
- {renderWhatsappData("label1", <FormattedMessage {...whatsppMsg.templateNameLabel} />)}
93
+ {renderWhatsappData("label1", <FormattedMessage {...globalMessages.templateNameLabel} />)}
88
94
  {renderWhatsappData("label2", whatsappName)}
89
95
  {renderWhatsappData("label3", <FormattedMessage {...whatsppMsg.labelSeperator} />)}
90
96
  {renderWhatsappData("label1", <FormattedMessage {...whatsppMsg.templateCategoryLabel} />)}
@@ -821,7 +821,24 @@ class Creatives extends React.Component {
821
821
  }
822
822
  render() {
823
823
  const {slidBoxContent, isGetFormData, showSlideBox, templateData, currentChannel, emailCreateMode, templateStep, isLoadingContent, mobilePushCreateMode, isDiscardMessage, weChatTemplateType, weChatMaptemplateStep} = this.state;
824
- const {isFullMode, creativesMode, cap, isUploading, channelsToHide, selectedWeChatAccount, forwardedTags, channelsToDisable, selectedOfferDetails, onTestContentClicked, onPreviewContentClicked, getCreativesData, fetchingCmsData, editor, smsRegister, enableNewChannels} = this.props;
824
+ const {
825
+ isFullMode,
826
+ creativesMode,
827
+ cap,
828
+ isUploading,
829
+ channelsToHide,
830
+ selectedWeChatAccount,
831
+ forwardedTags,
832
+ channelsToDisable,
833
+ selectedOfferDetails,
834
+ onTestContentClicked,
835
+ onPreviewContentClicked,
836
+ getCreativesData,
837
+ fetchingCmsData,
838
+ editor,
839
+ smsRegister,
840
+ enableNewChannels,
841
+ } = this.props;
825
842
  const mapTemplateCreate = slidBoxContent === 'createTemplate' && weChatTemplateType === MAP_TEMPLATE && templateStep !== 'modeSelection';
826
843
  /* TODO: Instead of passing down same props separately to each component down, write common function to these props and pass it accordingly */
827
844
  return (
@@ -310,4 +310,8 @@ export default defineMessages({
310
310
  id: `${scope}.whatsappOverview`,
311
311
  defaultMessage: `WhatsApp template overview`,
312
312
  },
313
+ "whatsappTemplate": {
314
+ id: `${scope}.whatsappTemplate`,
315
+ defaultMessage: `WhatsApp template`,
316
+ },
313
317
  });
@@ -2179,7 +2179,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2179
2179
  } else {
2180
2180
  this.setState({injectedTags: data.tags});
2181
2181
  }
2182
- this.props.globalActions.setInjectedTags(data.tags);
2182
+ if (data.tags) {
2183
+ this.props.globalActions.setInjectedTags(data.tags);
2184
+ }
2183
2185
  }
2184
2186
 
2185
2187
  startLoading = (ifEdit) => {
@@ -1,8 +1,4 @@
1
- export const DEFAULT_ACTION = 'app/SmsTrai/DEFAULT_ACTION';
2
- export const STATUS = 'status';
3
1
  export const TEMPLATE_NAME = 'template name';
4
- export const HEADER = 'header';
5
- export const TEMPLATE_ID = 'template id';
6
2
  export const SMS = 'SMS';
7
3
  export const MAPPED_SAVED_COLUMN = {
8
4
  'TEMPLATE ID': 'template_id',
@@ -22,12 +18,12 @@ export const MAPPED_SAVED_COLUMN = {
22
18
  'CONSENT TYPE': 'consent-type',
23
19
  };
24
20
  export const HEADER_ALIASES = [
25
- HEADER,
21
+ 'header',
26
22
  'sender id',
27
23
  'senders',
28
24
  'header id',
29
25
  'headers',
30
- 'linked headers'
26
+ 'linked headers',
31
27
  ];
32
28
  export const TEMPLATE_ID_ALIASES = [
33
29
  'template id',
@@ -76,4 +72,4 @@ export const CHECK_TRAI_SMS_DUPLICATE_TEMPLATE_NAME_FAILURE =
76
72
  export const REQUEST = 'REQUEST';
77
73
  export const SUCCESS = 'SUCCESS';
78
74
  export const FAILURE = 'FAILURE';
79
- export const DUPLICATE = 'Duplicate';
75
+ export const DUPLICATE = 'Duplicate';