@capillarytech/creatives-library 7.0.6 → 7.0.7

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.0.6",
4
+ "version": "7.0.7",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -122,14 +122,13 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
122
122
  }
123
123
  if (nextProps.startValidation && nextProps.startValidation !== false && this.props.startValidation !== nextProps.startValidation) {
124
124
  this.setState({checkValidation: true});
125
- this.validateForm(null, null, true, true, () => {
125
+ this.validateForm(null, null, true, true);
126
126
  //triggering the saveFormData or onSubmit when validation sets isFormValid to TRUE
127
- if (this.state.isFormValid) {
127
+ if (this.state.isFormValid) {
128
128
  this.saveForm(true);
129
- } else {
129
+ this.setState({isFormValid:false});
130
+ }
130
131
  this.props.stopValidation();
131
- }
132
- });
133
132
  }
134
133
  // if (nextProps.saveForm && this.props.saveForm !== nextProps.saveForm) {
135
134
  // this.saveForm(saveForm);
@@ -614,13 +614,17 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
614
614
  'background-color': CAP_PURPLE01,
615
615
  "margin-top": '14px',
616
616
  'text-align': 'center',
617
- "width": '132px',
617
+ "width": '143px',
618
618
  "height": '20px',
619
619
  "margin-left": "5px",
620
620
  }}>
621
621
  <p
622
622
  style={{ 'font-size': '12px',
623
623
  'font-weight': '500',
624
+ "display": '-webkit-box',
625
+ '-webkit-line-clamp': '1',
626
+ '-webkit-box-orient': 'vertical',
627
+ 'overflow': 'hidden',
624
628
  "color": CAP_WHITE }}
625
629
  >
626
630
  {buttonText || ''}</p>
@@ -351,10 +351,11 @@ class Creatives extends React.Component {
351
351
  break;
352
352
  case constants.VIBER:
353
353
  if (template.value) {
354
- const { Templates = {} } = this.props || {};
354
+ const { Templates, templateData: templateDataProps } = this.props;
355
+ const { accountDetails: selectedAccountDetails, accountId: selectedAccountId } = templateDataProps || {};
355
356
  const selectedViberAccount = Templates && Templates.selectedViberAccount;
356
- const accountDetails = selectedViberAccount ? JSON.stringify(selectedViberAccount) : '';
357
- const accountId = selectedViberAccount ? selectedViberAccount.id : '';
357
+ const accountDetails = selectedAccountDetails || (selectedViberAccount ? JSON.stringify(selectedViberAccount) : '');
358
+ const accountId = selectedAccountId || (selectedViberAccount ? selectedViberAccount.id : '');
358
359
  const { versions } = template.value;
359
360
  const content = cloneDeep(versions.base.content);
360
361
  content.scenarioKey = get(accountDetails, 'configs.scenario_key');
@@ -709,4 +710,4 @@ function mapDispatchToProps(dispatch) {
709
710
  actions: bindActionCreators(actions, dispatch),
710
711
  };
711
712
  }
712
- export default connect(mapStatesToProps, mapDispatchToProps)(injectIntl(Creatives));
713
+ export default connect(mapStatesToProps, mapDispatchToProps)(injectIntl(Creatives));
@@ -11,8 +11,11 @@ export function* createTemplate(template) {
11
11
  try {
12
12
  console.log('saga createTemplate mobilepush', template);
13
13
  const result = yield call(Api.createMobilePushTemplate, template);
14
- if (result.message || result.status.code === 500) {
14
+ if (result.message) {
15
15
  errorMsg = result.message;
16
+ if(result.status.code>=400){
17
+ throw errorMsg;
18
+ }
16
19
  }
17
20
  if (template.callback) {
18
21
  yield call(template.callback, result.response);
@@ -54,9 +54,9 @@
54
54
  .button-content {
55
55
  .ant-card-meta-description {
56
56
  min-width: 108px;
57
- max-width: 160px;
57
+ max-width: 215px;
58
58
  height: 24px;
59
- padding: 1px 23px 2px 22px;
59
+ padding: 2px 0px;
60
60
  border-radius: 16px;
61
61
  font-size: 14px;
62
62
  font-weight: 500;
@@ -516,6 +516,7 @@ const Viber = (props) => {
516
516
  defaultValue={buttonText}
517
517
  value={buttonText}
518
518
  style={{paddingBottom: '11px'}}
519
+ maxLength={20}
519
520
  />
520
521
  <CapInput
521
522
  id="viber-button-url"
@@ -626,7 +627,7 @@ const Viber = (props) => {
626
627
  return true;
627
628
  }
628
629
  // if button is being added than button url and button Text both are mandatory
629
- if (( trimedButtonText === '' && trimedButtonUrl !== '') || ( trimedButtonUrl !== '' && trimedButtonUrl === '')) {
630
+ if (( trimedButtonText === '' && trimedButtonUrl !== '') || ( trimedButtonText !== '' && trimedButtonUrl === '')) {
630
631
  return true;
631
632
  }
632
633
  // if button url is not valid url