@capillarytech/creatives-library 6.1.0 → 6.3.0

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.
@@ -29,6 +29,18 @@ import * as templateActions from '../../Templates/actions';
29
29
  // import PageHeader from '../../components/PageHeader';
30
30
  import './_mapTemplates.scss';
31
31
  // const Option = Select.Option;
32
+ const URL = "URL";
33
+ const MINI_PROGRAM = "Mini-Program";
34
+ const labelStyle = {
35
+ backgroundColor: 'white',
36
+ textAlign: 'left',
37
+ color: '#333333',
38
+ lineHeight: '24px',
39
+ fontSize: '14px',
40
+ fontFamily: 'open-sans',
41
+ fontStyle: 'normal',
42
+ padding: '1em .833em',
43
+ };
32
44
 
33
45
  export class MapTemplates extends React.Component { // eslint-disable-line react/prefer-stateless-function
34
46
  constructor(props) {
@@ -59,6 +71,9 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
59
71
  "is-internal-url": {
60
72
  onChange: this.internalUrlChecked,
61
73
  },
74
+ "template-redirect-options-radio": {
75
+ onChange: this.onRedirectOptionSelection,
76
+ },
62
77
  },
63
78
  selectedTemplateTags: [],
64
79
  isEdit: false,
@@ -445,6 +460,8 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
445
460
  Title: this.state.editTemplateData.versions.base.Title,
446
461
  Tag: [],
447
462
  url: this.state.formData['is-internal-url'] ? this.maskTemplateUrl(this.state.formData['template-link']) : this.state.formData['template-link'],
463
+ userName: this.state.formData['template-mini-program-id'] ? this.state.formData['template-mini-program-id'] : '',
464
+ path: this.state.formData['template-mini-program-page-path'] ? this.state.formData['template-mini-program-page-path'] : '',
448
465
  TopColor: "#000000",
449
466
  data: {},
450
467
  preview: '',
@@ -587,6 +604,7 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
587
604
 
588
605
  setSelectedTemplateData(weChatData) {
589
606
  let schema = _.cloneDeep(this.state.baseSchema);
607
+ const { intl: {formatMessage}} = this.props;
590
608
  schema.standalone.sections[0].childSections[1].childSections[0].childSections[1].inputFields = [];
591
609
  if (_.isEmpty(weChatData)) {
592
610
  // schema.standalone.sections[0].childSections[1].childSections[0].childSections[1].inputFields = [];
@@ -719,101 +737,59 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
719
737
  schema.standalone.sections[0].childSections[1].childSections[0].childSections[1].inputFields.push(colsData);
720
738
  });
721
739
 
722
- schema.standalone.sections[0].childSections[1].childSections[0].childSections[1].inputFields.push(
723
- {
724
- cols: [
740
+ schema.standalone.sections[0].childSections[1].childSections[0].childSections.push({
741
+ type: "multicols",
742
+ inputFields: [
725
743
  {
726
- id: "template-label-link",
727
- metaType: "label",
728
- value: this.props.intl.formatMessage(messages.loadingEDMTemplates),
729
- primitive: true,
730
- type: "div",
731
- width: 4,
732
- offset: 0,
733
- onlyDisplay: true,
734
- colStyle: {
735
- flex: 1,
736
- textAlign: 'left',
737
- color: '#333333',
738
- lineHeight: '24px',
739
- fontSize: '14px',
740
- fontWeight: '400',
741
- fontFamily: 'open-sans',
742
- fontStyle: 'normal',
743
- textTransform: 'capitalize',
744
- padding: '.5em .833em',
744
+ rowClassName: 'redirect-options-row',
745
+ cols: [
746
+ {
747
+ id: "redirect-options-heading",
748
+ metaType: "label",
749
+ value: formatMessage(messages.redirectOptionsHeadingValue),
750
+ primitive: true,
751
+ dynamicTab: false,
752
+ type: "div",
753
+ width: 4,
754
+ style: {
755
+ backgroundColor: 'white',
756
+ textAlign: 'left',
757
+ color: '#333333',
758
+ lineHeight: '24px',
759
+ fontSize: '14px',
760
+ fontFamily: 'open-sans',
761
+ fontStyle: 'normal',
762
+ padding: '1em .833em',
763
+ },
764
+ offset: 0,
765
+ onlyDisplay: true,
766
+ colStyle: {
767
+ flex: 1,
768
+ },
745
769
  },
746
- },
747
- {
748
- id: 'template-link',
749
- placeholder: this.props.intl.formatMessage(messages.Link),
750
- type: "input", //Resembles component to be used
751
- metaType: "text",
752
- datatype: "string",
753
- errorMessage: this.props.intl.formatMessage(messages.linkCantEmpty),
754
- required: true,
755
- fluid: true,
756
- disabled: (this.props.location.query.type === 'embedded'),
757
- style: {
758
- fontSize: '14px',
759
- fontFamily: 'open-sans',
760
- fontStyle: 'normal',
761
- // fontWeight: 600,
762
- // marginBottom: '16px',
770
+ {
771
+ id: 'template-redirect-options-radio',
772
+ type: "radioGroup",
773
+ metaType: "text",
774
+ datatype: "string",
775
+ options: [formatMessage(messages.redirectOptionURL), formatMessage(messages.redirectOptionMiniProgram)],
776
+ errorMessage: formatMessage(messages.redirectionOptionError),
777
+ required: true,
778
+ fluid: true,
779
+ disabled: (this.props.location.query.type === 'embedded' && this.state.isEdit),
780
+ style: {
781
+ marginTop: 8,
782
+ },
783
+ styling: "semantic",
784
+ customComponent: false,
785
+ standalone: true,
786
+ supportedEvents: [
787
+ 'onChange'
788
+ ],
763
789
  },
764
- styling: "semantic",
765
- order: 1,
766
- width: 15,
767
- // offSet: 6,
768
- customComponent: false,
769
- standalone: true,
770
- supportedEvents: [
771
- 'onChange',
772
- ],
773
- },
774
- ],
775
- },
776
- {
777
- cols: [
778
- {
779
- id: "is-internal-url",
780
- label: this.props.intl.formatMessage(messages.isInternalUrl),
781
- standalone: true,
782
- labelStyle: {
783
- backgroundColor: "white",
784
- },
785
- colStyle: {
786
- marginBottom: '24px',
787
- },
788
- style: {
789
- textAlign: 'left',
790
- color: '#262626',
791
- fontFamily: 'Open-Sans',
792
- lineHeight: '24px',
793
- fontSize: '14px',
794
- padding: '.5833em .833em',
795
- marginBottom: '24px',
796
- paddingLeft: '0',
797
- },
798
- type: "checkbox",
799
- disabled: (this.props.location.query.type === 'embedded'),
800
- metaType: "text",
801
- datatype: "boolean",
802
- required: true,
803
- fluid: true,
804
- styling: "semantic",
805
- order: 1,
806
- width: 10,
807
- offset: 4,
808
- onlyDisplay: false,
809
- customComponent: false,
810
- supportedEvents: [
811
- 'onChange',
812
- ],
813
- },
814
- ],
815
- }
816
- );
790
+ ],
791
+ },
792
+ ]});
817
793
  if (this.state.isEdit) {
818
794
  _.forEach(this.state.editTemplateData.versions.base.Tag, (tag) => {
819
795
  let tagName = tag;
@@ -826,11 +802,19 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
826
802
  formData[`template-${tagName}`] = this.state.editTemplateData.versions.base.data[tag].value;
827
803
  });
828
804
  if (this.state.editTemplateData.versions.base.url) {
805
+ formData['template-redirect-options-radio'] = URL;
829
806
  formData[`template-link`] = this.state.editTemplateData.versions.base.isInternalUrl ? this.unMaskTemplateUrl(this.state.editTemplateData.versions.base.url) : this.state.editTemplateData.versions.base.url;
807
+ schema.standalone.sections[0].childSections[1].childSections[0].childSections.push(this.getURLSchema());
830
808
  }
831
809
  if (this.state.editTemplateData.versions.base.isInternalUrl) {
832
810
  formData['is-internal-url'] = this.state.editTemplateData.versions.base.isInternalUrl;
833
811
  }
812
+ if (this.state.editTemplateData.versions.base.userName && this.state.editTemplateData.versions.base.path) {
813
+ formData['template-redirect-options-radio'] = MINI_PROGRAM;
814
+ formData['template-mini-program-id'] = this.state.editTemplateData.versions.base.userName;
815
+ formData['template-mini-program-page-path'] = this.state.editTemplateData.versions.base.path;
816
+ schema.standalone.sections[0].childSections[1].childSections[0].childSections.push(this.getMiniProgramSchema());
817
+ }
834
818
  // schema.standalone.sections[0].childSections[1].childSections[1].inputFields[0].cols[0].content = weChatData.content;
835
819
  } else {
836
820
  // schema.standalone.sections[0].childSections[1].childSections[1].inputFields[0].cols[0].content = weChatData.content;
@@ -1053,6 +1037,195 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
1053
1037
 
1054
1038
  }
1055
1039
 
1040
+ getURLSchema = () => ({
1041
+ type: "multicols",
1042
+ inputFields: [{
1043
+ rowClassName: 'link-row',
1044
+ cols: [
1045
+ {
1046
+ id: "template-label-link",
1047
+ metaType: "label",
1048
+ value: this.props.intl.formatMessage(messages.link),
1049
+ primitive: true,
1050
+ dynamicTab: false,
1051
+ type: "div",
1052
+ width: 4,
1053
+ style: labelStyle,
1054
+ onlyDisplay: true,
1055
+ colStyle: {
1056
+ flex: 1,
1057
+ },
1058
+ },
1059
+ {
1060
+ id: 'template-link',
1061
+ placeholder: this.props.intl.formatMessage(messages.link),
1062
+ type: "input",
1063
+ metaType: "text",
1064
+ datatype: "string",
1065
+ errorMessage: this.props.intl.formatMessage(messages.linkCantEmpty),
1066
+ required: true,
1067
+ fluid: true,
1068
+ disabled: (this.props.location.query.type === 'embedded' && this.state.isEdit),
1069
+ style: {
1070
+ fontSize: '14px',
1071
+ fontStyle: 'normal',
1072
+ },
1073
+ styling: "semantic",
1074
+ order: 1,
1075
+ width: 15,
1076
+ customComponent: false,
1077
+ standalone: true,
1078
+ supportedEvents: [
1079
+ 'onChange',
1080
+ ],
1081
+ size: "large",
1082
+ },
1083
+ ],
1084
+ },
1085
+ {
1086
+ cols: [
1087
+ {
1088
+ id: "is-internal-url",
1089
+ label: this.props.intl.formatMessage(messages.isInternalUrl),
1090
+ standalone: true,
1091
+ labelStyle: {
1092
+ backgroundColor: "white",
1093
+ },
1094
+ colStyle: {
1095
+ marginBottom: '24px',
1096
+ },
1097
+ style: {
1098
+ textAlign: 'left',
1099
+ color: '#262626',
1100
+ fontFamily: 'Open-Sans',
1101
+ lineHeight: '24px',
1102
+ fontSize: '14px',
1103
+ padding: '.5833em .833em',
1104
+ marginBottom: '24px',
1105
+ paddingLeft: '0',
1106
+ },
1107
+ type: "checkbox",
1108
+ disabled: (this.props.location.query.type === 'embedded' && this.state.isEdit),
1109
+ metaType: "text",
1110
+ datatype: "boolean",
1111
+ required: true,
1112
+ fluid: true,
1113
+ styling: "semantic",
1114
+ order: 1,
1115
+ width: 10,
1116
+ offset: 4,
1117
+ onlyDisplay: false,
1118
+ customComponent: false,
1119
+ supportedEvents: [
1120
+ 'onChange',
1121
+ ],
1122
+ },
1123
+ ],
1124
+ }],
1125
+ })
1126
+
1127
+ getMiniProgramSchema = () => ({
1128
+ type: "multicols",
1129
+ inputFields: [{
1130
+ rowClassName: 'mini-program-row',
1131
+ cols: [
1132
+ {
1133
+ id: "template-mini-program-id-heading",
1134
+ metaType: "label",
1135
+ value: this.props.intl.formatMessage(messages.miniWechatIdLabel),
1136
+ primitive: true,
1137
+ dynamicTab: false,
1138
+ type: "div",
1139
+ width: 4,
1140
+ style: labelStyle,
1141
+ onlyDisplay: true,
1142
+ colStyle: {
1143
+ flex: 1,
1144
+ },
1145
+ },
1146
+ {
1147
+ id: 'template-mini-program-id',
1148
+ placeholder: this.props.intl.formatMessage(messages.miniWeChatPlaceholder),
1149
+ inductiveText: this.props.intl.formatMessage(messages.miniWechatIdInductive),
1150
+ type: "input",
1151
+ metaType: "text",
1152
+ datatype: "string",
1153
+ errorMessage: this.props.intl.formatMessage(messages.miniWechatIdError),
1154
+ required: true,
1155
+ fluid: true,
1156
+ disabled: (this.props.location.query.type === 'embedded' && this.state.isEdit),
1157
+ styling: "semantic",
1158
+ order: 1,
1159
+ width: 15,
1160
+ customComponent: false,
1161
+ standalone: true,
1162
+ },
1163
+ ],
1164
+ },
1165
+ {
1166
+ rowClassName: 'mini-program-row',
1167
+ cols: [
1168
+ {
1169
+ id: "template-mini-program-page-path-heading",
1170
+ metaType: "label",
1171
+ value: this.props.intl.formatMessage(messages.pagePathLabel),
1172
+ primitive: true,
1173
+ dynamicTab: false,
1174
+ type: "div",
1175
+ width: 4,
1176
+ style: labelStyle,
1177
+ onlyDisplay: true,
1178
+ colStyle: {
1179
+ flex: 1,
1180
+ },
1181
+ },
1182
+ {
1183
+ id: 'template-mini-program-page-path',
1184
+ placeholder: this.props.intl.formatMessage(messages.pagePathPlaceholder),
1185
+ inductiveText: this.props.intl.formatMessage(messages.pagePathInductive),
1186
+ type: "input",
1187
+ metaType: "text",
1188
+ datatype: "string",
1189
+ errorMessage: this.props.intl.formatMessage(messages.pagePathError),
1190
+ required: true,
1191
+ fluid: true,
1192
+ disabled: (this.props.location.query.type === 'embedded' && this.state.isEdit),
1193
+ styling: "semantic",
1194
+ order: 1,
1195
+ width: 15,
1196
+ customComponent: false,
1197
+ standalone: true,
1198
+ }
1199
+ ],
1200
+ }],
1201
+ })
1202
+
1203
+ deletePreviousRedirectOptionSelection = () => {
1204
+ let schema = _.cloneDeep(this.state.schema);
1205
+ const formChildSections = _.get(schema, 'standalone.sections[0].childSections[1].childSections[0].childSections', []);
1206
+ const lastChildSection = formChildSections[formChildSections.length - 1];
1207
+ const lastInputField = _.get(lastChildSection, 'inputFields[0].rowClassName', '');
1208
+ if(lastInputField === 'mini-program-row' || lastInputField === 'link-row') {
1209
+ schema.standalone.sections[0].childSections[1].childSections[0].childSections.pop();
1210
+ }
1211
+ return schema;
1212
+ }
1213
+
1214
+ onRedirectOptionSelection = (paramOne, formData) => {
1215
+ let schema = this.deletePreviousRedirectOptionSelection();
1216
+ switch (formData['template-redirect-options-radio']) {
1217
+ case URL: {
1218
+ schema.standalone.sections[0].childSections[1].childSections[0].childSections.push(this.getURLSchema());
1219
+ break;
1220
+ }
1221
+ case MINI_PROGRAM: {
1222
+ schema.standalone.sections[0].childSections[1].childSections[0].childSections.push(this.getMiniProgramSchema());
1223
+ break;
1224
+ }
1225
+ }
1226
+ this.setState({schema});
1227
+ }
1228
+
1056
1229
  discardValues() {
1057
1230
  // this.setState({ schema: this.state.baseSchema, formData: {}});
1058
1231
  this.resetSchema();
@@ -1092,6 +1265,8 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
1092
1265
  "Title": selectedWechatData.title,
1093
1266
  Tag: [],
1094
1267
  url: this.state.formData['is-internal-url'] ? this.maskTemplateUrl(this.state.formData['template-link']) : this.state.formData['template-link'],
1268
+ userName: this.state.formData['template-mini-program-id'] ? this.state.formData['template-mini-program-id'] : '',
1269
+ path: this.state.formData['template-mini-program-page-path'] ? this.state.formData['template-mini-program-page-path'] : '',
1095
1270
  TopColor: "#000000",
1096
1271
  data: {},
1097
1272
  preview: '',
@@ -106,4 +106,52 @@ export default defineMessages({
106
106
  id: 'creatives.containers.WeChat.loadingEDMTemplates',
107
107
  defaultMessage: "loading EDM Templates",
108
108
  },
109
+ "redirectOptionsHeadingValue": {
110
+ id: 'creatives.containers.WeChat.redirectOptionsHeadingValue',
111
+ defaultMessage: 'URL or Mini-Program',
112
+ },
113
+ "redirectOptionURL": {
114
+ id: 'creatives.containers.WeChat.redirectOptionURL',
115
+ defaultMessage: 'URL',
116
+ },
117
+ "redirectOptionMiniProgram": {
118
+ id: 'creatives.containers.WeChat.redirectOptionMiniProgram',
119
+ defaultMessage: 'Mini-Program',
120
+ },
121
+ "redirectionOptionError": {
122
+ id: 'creatives.containers.WeChat.redirectionOptionError',
123
+ defaultMessage: 'Please select a redirect option',
124
+ },
125
+ "miniWechatIdLabel": {
126
+ id: 'creatives.containers.WeChat.miniWechatIdLabel',
127
+ defaultMessage: 'Mini-Program ID',
128
+ },
129
+ "miniWeChatPlaceholder": {
130
+ id: 'creatives.containers.WeChat.miniWeChatPlaceholder',
131
+ defaultMessage: 'E.g. ab4892njkl4l2op',
132
+ },
133
+ "miniWechatIdInductive": {
134
+ id: 'creatives.containers.WeChat.miniWechatIdInductive',
135
+ defaultMessage: 'Unique alpha numeric code for this specific app',
136
+ },
137
+ "miniWechatIdError": {
138
+ id: 'creatives.containers.WeChat.miniWechatIdError',
139
+ defaultMessage: 'Mini-Program ID cannot be empty',
140
+ },
141
+ "pagePathLabel": {
142
+ id: 'creatives.containers.WeChat.pagePathLabel',
143
+ defaultMessage: 'Page path',
144
+ },
145
+ "pagePathError": {
146
+ id: 'creatives.containers.WeChat.pagePathError',
147
+ defaultMessage: 'Page path cannot be empty.',
148
+ },
149
+ "pagePathPlaceholder": {
150
+ id: 'creatives.containers.WeChat.pagePathPlaceholder',
151
+ defaultMessage: 'E.g. pages/user/profile',
152
+ },
153
+ "pagePathInductive": {
154
+ id: 'creatives.containers.WeChat.pagePathInductive',
155
+ defaultMessage: 'Provide the path within the Mini-Program user will taken to',
156
+ },
109
157
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "6.1.0",
4
+ "version": "6.3.0",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -1,12 +1,12 @@
1
1
  .call-task-preview {
2
- .call-task-subject-container {
2
+ .call-task-subject-container-CALL {
3
3
  padding: 8px;
4
4
  background: #444;
5
5
  color: white;
6
6
  font-size: 12px;
7
7
  font-weight: 500;
8
8
  }
9
- .call-task-message-container {
9
+ .call-task-message-container-CALL {
10
10
  overflow-y: auto;
11
11
  height: 150px;
12
12
  width: 100%;
@@ -14,4 +14,19 @@
14
14
  background: #eee;
15
15
  padding: 8px;
16
16
  }
17
+ .call-task-image-CALL {
18
+ width: 100%;
19
+ }
20
+ .call-task-image-STOREMAX_WHATSAPP {
21
+ width: 220px;
22
+ margin-left: 92px;
23
+ }
24
+ .call-task-message-container-STOREMAX_WHATSAPP {
25
+ position: absolute;
26
+ overflow-y: auto;
27
+ left: 118px;
28
+ top: 190px;
29
+ font-size: 12px;
30
+ width: 172px;
31
+ }
17
32
  }
@@ -8,22 +8,24 @@ import React from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import HeaderPng from './images/Header.png';
10
10
  import FooterPng from './images/Footer.png';
11
+ import WhatsAppPng from './images/Whatsapp.png';
11
12
 
12
13
  import './_callTaskPreview.scss';
13
14
 
15
+ const STOREMAX_WHATSAPP = 'STOREMAX_WHATSAPP';
14
16
  class CallTaskPreview extends React.Component { // eslint-disable-line react/prefer-stateless-function
15
17
  render() {
16
- const { subject, messageBody } = this.props;
18
+ const { subject, messageBody, callTaskActionType } = this.props;
17
19
  return (
18
20
  <div className="call-task-preview">
19
- <img style={{ width: '100%' }} src={HeaderPng} alt="header" />
20
- <div className="call-task-subject-container">
21
+ <img className={`call-task-image-${callTaskActionType}`} src={callTaskActionType === STOREMAX_WHATSAPP ? WhatsAppPng : HeaderPng} alt="header" />
22
+ {callTaskActionType !== STOREMAX_WHATSAPP && <div className={`call-task-subject-container-${callTaskActionType}`}>
21
23
  {subject}
22
- </div>
23
- <div className="call-task-message-container">
24
+ </div>}
25
+ <div className={`call-task-message-container-${callTaskActionType}`}>
24
26
  {messageBody}
25
27
  </div>
26
- <img style={{ width: '100%' }} src={FooterPng} alt="footer" />
28
+ {callTaskActionType !== STOREMAX_WHATSAPP && <img style={{ width: '100%' }} src={FooterPng} alt="footer" />}
27
29
  </div>
28
30
  );
29
31
  }
@@ -32,6 +34,7 @@ class CallTaskPreview extends React.Component { // eslint-disable-line react/pre
32
34
  CallTaskPreview.propTypes = {
33
35
  subject: PropTypes.string,
34
36
  messageBody: PropTypes.string,
37
+ callTaskActionType: PropTypes.string,
35
38
  };
36
39
 
37
40
  export default CallTaskPreview;
@@ -1094,7 +1094,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
1094
1094
  }
1095
1095
  });
1096
1096
  });
1097
- const regex = /{{[(A-Z\w\(\)@!#$%^&*~.,/\\]+}}/g;
1097
+ const regex = /{{[(A-Z\w+(\s\w+)*$\(\)@!#$%^&*~.,/\\]+}}/g;
1098
1098
  let match = regex.exec(content);
1099
1099
  while (match !== null) {
1100
1100
  const tagValue = match[0].substring(this.indexOfEnd(match[0], '{{'), match[0].indexOf('}}'));
@@ -25,12 +25,13 @@ class NewCallTask extends React.Component { // eslint-disable-line react/prefer-
25
25
  }
26
26
 
27
27
  getInitialState = () => {
28
- const { templateData } = this.props;
28
+ const { templateData, messageDetails, mode } = this.props;
29
+ const actionType = mode === 'edit' ? messageDetails.messageContent.message_content_id_1.callTaskActionType : CALL;
29
30
  return {
30
31
  subject: templateData && templateData.subject ? templateData.subject : '',
31
32
  messageBody: templateData && templateData.messageBody ? templateData.messageBody : '',
32
33
  description: templateData && templateData.description ? templateData.description : '',
33
- callTaskActionType: CALL,
34
+ callTaskActionType: actionType,
34
35
  };
35
36
  }
36
37
 
@@ -99,7 +100,7 @@ class NewCallTask extends React.Component { // eslint-disable-line react/prefer-
99
100
  render() {
100
101
  const { intl, isLoading, metaEntities, selectedOfferDetails } = this.props;
101
102
  const { formatMessage } = intl;
102
- const { subject, messageBody, description } = this.state;
103
+ const { subject, messageBody, description, callTaskActionType } = this.state;
103
104
  const tags = metaEntities && metaEntities.tags ? metaEntities.tags.standard : [];
104
105
  return (
105
106
  <CapSpin spinning={isLoading}>
@@ -139,7 +140,7 @@ class NewCallTask extends React.Component { // eslint-disable-line react/prefer-
139
140
  />
140
141
  <CapCheckbox
141
142
  onChange={this.onS2DCheckChange}
142
- checked={this.state.callTaskActionType !== CALL}
143
+ checked={callTaskActionType === STOREMAX_WHATSAPP}
143
144
  style={{marginTop: FONT_SIZE_S}}
144
145
  >
145
146
  <FormattedMessage {...messages.useInS2D}/>
@@ -156,6 +157,7 @@ class NewCallTask extends React.Component { // eslint-disable-line react/prefer-
156
157
  <CallTaskPreview
157
158
  subject={subject}
158
159
  messageBody={messageBody}
160
+ callTaskActionType={callTaskActionType}
159
161
  />
160
162
  </CapColumn>
161
163
  </CapRow>
@@ -171,6 +173,8 @@ NewCallTask.propTypes = {
171
173
  isLoading: PropTypes.bool,
172
174
  metaEntities: PropTypes.object,
173
175
  selectedOfferDetails: PropTypes.array,
176
+ messageDetails: PropTypes.object,
177
+ mode: PropTypes.string,
174
178
  };
175
179
 
176
180
  export default injectIntl(NewCallTask);
@@ -71,7 +71,7 @@ export class CallTask extends React.Component { // eslint-disable-line react/pre
71
71
  };
72
72
  }
73
73
  render() {
74
- const { intl, onCallTaskSubmit, templateData, loadingMetaEntities, metaEntities, selectedOfferDetails } = this.props;
74
+ const { intl, onCallTaskSubmit, templateData, loadingMetaEntities, metaEntities, selectedOfferDetails, messageDetails } = this.props;
75
75
  const { formatMessage } = intl;
76
76
  const { mode } = this.state;
77
77
  return (
@@ -84,6 +84,7 @@ export class CallTask extends React.Component { // eslint-disable-line react/pre
84
84
  templateData={templateData}
85
85
  onCallTaskSubmit={onCallTaskSubmit}
86
86
  selectedOfferDetails={selectedOfferDetails}
87
+ messageDetails={messageDetails}
87
88
  />
88
89
  :
89
90
  <div>
@@ -135,6 +136,7 @@ CallTask.propTypes = {
135
136
  onCreateNew: PropTypes.func,
136
137
  isFullMode: PropTypes.bool,
137
138
  selectedOfferDetails: PropTypes.array,
139
+ messageDetails: PropTypes.object,
138
140
  };
139
141
 
140
142
 
@@ -276,6 +276,7 @@ function SlideBoxContent(props) {
276
276
  onCallTaskSubmit={onCallTaskSubmit}
277
277
  forwardedTags={forwardedTags}
278
278
  selectedOfferDetails={selectedOfferDetails}
279
+ messageDetails={messageDetails}
279
280
  />
280
281
  }
281
282
  {
@@ -285,6 +286,7 @@ function SlideBoxContent(props) {
285
286
  onCallTaskSubmit={onCallTaskSubmit}
286
287
  forwardedTags={forwardedTags}
287
288
  selectedOfferDetails={selectedOfferDetails}
289
+ messageDetails={messageDetails}
288
290
  />
289
291
  }
290
292
  {isCreateSms && (