@capillarytech/creatives-library 3.0.24 → 3.0.27

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.
@@ -2638,22 +2638,20 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2638
2638
  const formData = _.cloneDeep(this.state.formData);
2639
2639
  formData[0].selectedLanguages = [];
2640
2640
  let tabKey;
2641
- const isDragDrop = _.get(data, 'base.is_drag_drop');
2642
2641
  if (this.props.location.query.type === 'embedded' && (this.props.location.query.isLanguageSupport === undefined || this.props.location.query.isLanguageSupport === 'false')) {
2643
- formData['template-subject'] = _.get(data, 'base.subject', '');
2642
+ formData['template-subject'] = data.base.subject ? data.base.subject : '';
2644
2643
  const baseLanguage = this.props.Global.currentOrgDetails.basic_details.base_language;
2645
2644
  let languageIndex = _.findIndex(this.supportedLanguages, {iso_code: baseLanguage});
2646
2645
  console.log("startTemplatecreation before index", languageIndex, this.supportedLanguages, baseLanguage, formData);
2647
2646
  if (languageIndex === -1) {
2648
2647
  languageIndex = 0;
2649
2648
  }
2650
- const isDragDrop = _.get(data, 'base.is_drag_drop');
2651
2649
  const tempData = {
2652
- "is_drag_drop": isDragDrop,
2650
+ "is_drag_drop": data.base.is_drag_drop,
2653
2651
  "lang_id": this.supportedLanguages[languageIndex].lang_id,
2654
2652
  "iso_code": this.supportedLanguages[languageIndex].iso_code,
2655
2653
  "language": this.supportedLanguages[languageIndex].language,
2656
- "template-content": !isDragDrop && isDragDrop !== 1 ? _.get(data, 'base.html_content') : "",
2654
+ "template-content": !data.base.is_drag_drop && data.base.is_drag_drop !== 1 ? data.base.html_content : "",
2657
2655
  };
2658
2656
  formData[0].base = true;
2659
2657
  formData[0].selectedLanguages.push(this.supportedLanguages[languageIndex].iso_code);
@@ -2702,7 +2700,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2702
2700
  }
2703
2701
  formData.base = _.cloneDeep(formData[0]);
2704
2702
  console.log('startTemplateCreation final ', formData);
2705
- this.setState({formData, loading: false, injectedTags: data.tags, tabKey, isDragDrop: (isDragDrop !== 0 )}, () => {
2703
+ this.setState({formData, loading: false, injectedTags: data.tags, tabKey, isDragDrop: (data.base.is_drag_drop !== 0 )}, () => {
2706
2704
  // this.setState({tabKey: ''});
2707
2705
  _.forEach(formData[0].selectedLanguages, (language) => {
2708
2706
  if (formData[0][language].is_drag_drop) {
@@ -222,15 +222,13 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
222
222
  }
223
223
  }
224
224
  });
225
- if (!_.isEmpty(selectedAccount)) {
226
- this.setState({selectedAccount: selectedAccount.name}, () => {
227
- params.wecrmId = selectedAccount.configs.wecrm_app_id;
228
- params.wecrmToken = selectedAccount.configs.wecrm_token;
229
- params.originalId = selectedAccount.sourceAccountIdentifier;
230
- nextProps.actions.setWeChatAccount(selectedAccount);
231
- this.getAllTemplates({params});
232
- });
233
- }
225
+ this.setState({selectedAccount: selectedAccount.name}, () => {
226
+ params.wecrmId = selectedAccount.configs.wecrm_app_id;
227
+ params.wecrmToken = selectedAccount.configs.wecrm_token;
228
+ params.originalId = selectedAccount.sourceAccountIdentifier;
229
+ nextProps.actions.setWeChatAccount(selectedAccount);
230
+ this.getAllTemplates({params});
231
+ });
234
232
  } else if (this.state.channel.toLowerCase() === 'mobilepush' && (nextProps.location.query.account_id || nextProps.location.query.source_account_id)) {
235
233
  _.forEach(nextProps.Templates.weCrmAccounts, (account) => {
236
234
  if ((nextProps.location.query.account_id && account.id === Number(nextProps.location.query.account_id)) || (nextProps.location.query.source_account_id && account.sourceAccountIdentifier && account.sourceAccountIdentifier === nextProps.location.query.source_account_id)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "3.0.24",
4
+ "version": "3.0.27",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -25,7 +25,7 @@ import * as templateActions from '../../containers/Templates/actions';
25
25
  const deviceAspectRatio = {
26
26
  mobile: {
27
27
  height: "415",
28
- width: "227",
28
+ width: "238",
29
29
  },
30
30
  };
31
31
 
@@ -93,9 +93,10 @@ class EmailMobilePreview extends React.Component {
93
93
  </CapButton>
94
94
  )}
95
95
  <div className={"shell align-center"}>
96
- {emailSubjectLabel}
97
- <img src={mobileBody} alt="capillary" width="60%" />
96
+
97
+ <img src={mobileBody} alt="capillary" width="270" />
98
98
  <div className={`${messageContainerName} ${emailSubjectLabel ? 'with-subject' : ''}`}>
99
+ {emailSubjectLabel}
99
100
  <iframe srcDoc={templateContent} {...deviceAspectRatio.mobile} >
100
101
  <p><FormattedMessage {...messages.noIframeSupport}/></p>
101
102
  </iframe>
@@ -33,22 +33,39 @@ $classPrefix: email-mobile-preview-container;
33
33
 
34
34
  }
35
35
  .email-preview-container{
36
+ .shell {
37
+ position: relative;
38
+ -webkit-transform: unset;
39
+ transform: unset;
40
+ left: unset;
41
+ padding: unset;
42
+ width: unset;
43
+ display: flex;
44
+ justify-content: center;
45
+ }
36
46
  .email-subject-mobile {
37
- position: absolute;
38
- top: 11.5%;
39
- left: 26%;
47
+ width: 227px;
48
+ text-align: left;
49
+ margin: 8px 0;
50
+ margin-left: 4px;
40
51
  }
52
+ // .mobile-message-container {
53
+ // position: absolute;
54
+ // top: 10.3%;
55
+ // left: 24.8%;
56
+ // overflow: auto;
57
+ // display: -webkit-box;
58
+ // display: -ms-flexbox;
59
+ // display: flex;
60
+ // &.with-subject {
61
+ // top: 15%;
62
+ // }
63
+ // }
41
64
  .mobile-message-container {
42
65
  position: absolute;
43
66
  top: 10.3%;
44
- left: 24.8%;
45
- overflow: auto;
46
- display: -webkit-box;
47
- display: -ms-flexbox;
48
- display: flex;
49
- &.with-subject {
50
- top: 15%;
51
- }
67
+ height: 100%;
68
+ left: unset;
52
69
  }
53
70
  }
54
71
  padding: 0 0px 0 24px;