@capillarytech/creatives-library 0.1.18 → 0.1.20

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.
@@ -939,7 +939,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
939
939
  }
940
940
 
941
941
  skipTags(tag) {
942
- const regexGroups = ["dynamic_expiry_date_after_\\d+_days.FORMAT_\\d", "user_id_b64", "outbox_id_b64", "unsubscribe\\(#[a-zA-Z\\d]{6}\\)","Link_to_[a-zA-z]"];
942
+ const regexGroups = ["dynamic_expiry_date_after_\\d+_days.FORMAT_\\d", "unsubscribe\\(#[a-zA-Z\\d]{6}\\)","Link_to_[a-zA-z]"];
943
943
 
944
944
  //const regexGroups = [];
945
945
  let skipped = false;
@@ -772,6 +772,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
772
772
  context: this.props.location.query.type === 'embedded' ? this.props.location.query.module : 'default',
773
773
  embedded: this.props.location.query.type === 'embedded' ? this.props.location.query.type : 'full',
774
774
  };
775
+ if (this.props.getDefaultTags) {
776
+ query.context = this.props.getDefaultTags;
777
+ }
775
778
  this.props.globalActions.fetchSchemaForEntity(query);
776
779
  }
777
780
  setTimeout(() => {
@@ -3129,7 +3132,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
3129
3132
  loaderText = this.props.intl.formatMessage(messages.uploadingImage);
3130
3133
  }
3131
3134
  let tags = this.props.metaEntities && this.props.metaEntities.tags ? this.props.metaEntities.tags.standard : [];
3132
- if (this.props.location.query.type === 'embedded' && this.props.location.query.module === 'library') {
3135
+ if (this.props.location.query.type === 'embedded' && this.props.location.query.module === 'library' && !this.props.getDefaultTags) {
3133
3136
  tags = this.props.supportedTags;
3134
3137
  }
3135
3138
  return (
@@ -3247,7 +3250,7 @@ Email.propTypes = {
3247
3250
  isGetFormData: PropTypes.bool,
3248
3251
  getFormSubscriptionData: PropTypes.func,
3249
3252
  supportedTags: PropTypes.array,
3250
- getDefaultTags: PropTypes.bool,
3253
+ getDefaultTags: PropTypes.string,
3251
3254
  };
3252
3255
 
3253
3256
  const mapStateToProps = createStructuredSelector({
@@ -154,6 +154,9 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
154
154
  context: this.props.location.query.type === 'embedded' ? this.props.location.query.module : 'default',
155
155
  embedded: this.props.location.query.type === 'embedded' ? this.props.location.query.type : 'full',
156
156
  };
157
+ if (this.props.getDefaultTags) {
158
+ query.context = this.props.getDefaultTags;
159
+ }
157
160
  this.props.globalActions.fetchSchemaForEntity(query);
158
161
  if (this.props.location.query.type === 'embedded') {
159
162
  this.showNext();
@@ -1406,8 +1409,8 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
1406
1409
  const schema = this.state.schema;
1407
1410
  const spinning = this.state.loading || (this.props.Create && "createTemplateInProgress" in this.props.Create && this.props.Create.createTemplateInProgress);
1408
1411
  let tags = this.props.metaEntities && this.props.metaEntities.tags ? this.props.metaEntities.tags.standard : [];
1409
- if (this.props.location.query.type === 'embedded' && this.props.location.query.module === 'library') {
1410
- tags = this.props.supportedTags;
1412
+ if (this.props.location.query.type === 'embedded' && this.props.location.query.module === 'library' && !this.props.getDefaultTags) {
1413
+ tags = this.props.supportedTags; // if get default tags is not present and supported tags is present use that inlbrary mode
1411
1414
  }
1412
1415
  return (
1413
1416
  <div>
@@ -1462,7 +1465,7 @@ Create.propTypes = {
1462
1465
  metaEntities: PropTypes.object,
1463
1466
  intl: intlShape.isRequired,
1464
1467
  supportedTags: PropTypes.array,
1465
- getDefaultTags: PropTypes.bool,
1468
+ getDefaultTags: PropTypes.string,
1466
1469
  };
1467
1470
 
1468
1471
  const mapStateToProps = createStructuredSelector({
@@ -134,6 +134,9 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
134
134
  context: this.props.location.query.type === 'embedded' ? this.props.location.query.module : 'default',
135
135
  embedded: this.props.location.query.type === 'embedded' ? this.props.location.query.type : 'full',
136
136
  };
137
+ if (this.props.getDefaultTags) {
138
+ query.context = this.props.getDefaultTags;
139
+ }
137
140
  this.props.globalActions.fetchSchemaForEntity(query);
138
141
  if (this.props.location.query.type === 'embedded') {
139
142
  this.showNext();
@@ -1387,7 +1390,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
1387
1390
  tipText = this.props.Edit && ("editTemplateInProgress" in this.props.Edit && this.props.Edit.editTemplateInProgress) ? this.props.intl.formatMessage(messages.saveTemplateLoader) : '';
1388
1391
  const spinning = this.state.loading || (this.props.Edit && (("getTemplateDetailsInProgress" in this.props.Edit && this.props.Edit.getTemplateDetailsInProgress) || ("editTemplateInProgress" in this.props.Edit && this.props.Edit.editTemplateInProgress)));
1389
1392
  let tags = this.props.metaEntities && this.props.metaEntities.tags ? this.props.metaEntities.tags.standard : [];
1390
- if (this.props.location.query.type === 'embedded' && this.props.location.query.module === 'library') {
1393
+ if (this.props.location.query.type === 'embedded' && this.props.location.query.module === 'library' && !this.props.getDefaultTags) {
1391
1394
  tags = this.props.supportedTags;
1392
1395
  }
1393
1396
  return (
@@ -1445,7 +1448,7 @@ Edit.propTypes = {
1445
1448
  intl: intlShape.isRequired,
1446
1449
  templateData: PropTypes.object,
1447
1450
  supportedTags: PropTypes.array,
1448
- getDefaultTags: PropTypes.bool,
1451
+ getDefaultTags: PropTypes.string,
1449
1452
  // route: PropTypes.object,
1450
1453
  };
1451
1454
 
@@ -468,11 +468,12 @@ export class WeChat extends React.Component { // eslint-disable-line react/prefe
468
468
  }
469
469
  });
470
470
  }
471
- if (nextProps.location.query.type === "embedded" && nextProps.location.query.module === "library" && nextProps.templateData && nextProps.templateData.versions) { // Edit of already added message in library mode
472
- this.setState({editTemplateData: nextProps.templateData}, () => {
473
- this.setEditData();
474
- });
475
- }
471
+ // has to be un commented when wechat edit is implemented in embedded mode.
472
+ // if (nextProps.location.query.type === "embedded" && nextProps.location.query.module === "library" && nextProps.templateData && nextProps.templateData.versions) { // Edit of already added message in library mode
473
+ // this.setState({editTemplateData: nextProps.templateData}, () => {
474
+ // this.setEditData();
475
+ // });
476
+ // }
476
477
  if (nextProps.params.id && !_.isEqual(nextProps.params.id, this.props.params.id)) {
477
478
  this.setState({isEdit: true});
478
479
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "0.1.18",
4
+ "version": "0.1.20",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
File without changes