@capillarytech/creatives-library 7.17.193 → 7.17.194-alpha.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.17.193",
4
+ "version": "7.17.194-alpha.0",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -2,8 +2,6 @@ import React from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import {
4
4
  CapButton,
5
- CapDivider,
6
- CapHeader,
7
5
  CapIcon,
8
6
  CapLabel,
9
7
  CapList,
@@ -2,7 +2,6 @@
2
2
 
3
3
  .error-container {
4
4
  margin-bottom: $CAP_SPACE_08;
5
- width: 68rem;
6
5
  margin-top: $CAP_SPACE_12;
7
6
  background-color: $CAP_COLOR_05;
8
7
  border-radius: $CAP_SPACE_04;
@@ -1090,8 +1090,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
1090
1090
  this.props.stopValidation();
1091
1091
  return;
1092
1092
  }
1093
-
1094
- if (result?.data?.length > 0) {
1093
+ else if (result?.data?.length > 0) {
1095
1094
  const extractedLiquidTags = extractNames(result?.data);
1096
1095
  // Extracts the supported liquid tags from the given content.
1097
1096
  const supportedLiquidTags = checkSupport(
@@ -1122,8 +1121,8 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
1122
1121
  this.props.stopValidation();
1123
1122
  return;
1124
1123
  }
1124
+ this.props.onSubmit(this.state.formData);
1125
1125
  }
1126
- this.props.onSubmit(this.state.formData);
1127
1126
  };
1128
1127
  this.props.actions.getLiquidTags(preprocessHtml(content), handleResult);
1129
1128
  } else {
@@ -88,15 +88,12 @@ function capReducer(state = fromJS(initialState.cap), action) {
88
88
  case types.GET_LIQUID_TAGS_REQUEST:
89
89
  return state
90
90
  .set('fetchingLiquidTags', true)
91
- .set('fetchingSchemaError', false);
92
91
  case types.GET_LIQUID_TAGS_FAILURE:
93
92
  return state
94
93
  .set('fetchingLiquidTags', false)
95
- .set('fetchingSchemaError', true);
96
94
  case types.GET_LIQUID_TAGS_SUCCESS:
97
95
  return state
98
96
  .set('fetchingLiquidTags', false)
99
- .set('fetchingSchemaError', false);
100
97
  case types.GET_SCHEMA_FOR_ENTITY_SUCCESS: {
101
98
  const stateMeta = state.get('metaEntities');
102
99
  const standardTagMap = _.keyBy(action?.data?.metaEntities?.standard, item => item?.definition?.value);
@@ -801,24 +801,26 @@ export function* fetchSchemaForEntity(queryParams) {
801
801
 
802
802
  export function* getLiquidTags(action) {
803
803
  try {
804
- let result = yield call(Api.getLiquidTags, String(action?.data));
804
+ let result = yield call(Api.getLiquidTags, action?.data);
805
805
  if (result) {
806
- if(result?.errors?.length > 0) {
807
- const getAskAiraErrorResponse = yield call(Api.askAiraForLiquid, {templateContent: action?.data,errorMessage: result?.errors?.[0]?.message});
808
- if(getAskAiraErrorResponse?.result?.errors?.length > 0){
806
+ if (result?.errors?.length > 0) {
807
+ const getAskAiraErrorResponse = yield call(Api.askAiraForLiquid, {
808
+ templateContent: action?.data,
809
+ errorMessage: result?.errors?.[0]?.message,
810
+ });
811
+ if (getAskAiraErrorResponse?.result?.errors?.length > 0) {
809
812
  result = getAskAiraErrorResponse?.result;
810
813
  }
811
814
  }
812
815
  if (action?.callback) {
813
816
  yield call(action?.callback, result);
814
817
  }
815
- yield put({ type: types.GET_LIQUID_TAGS_SUCCESS});
818
+ yield put({ type: types.GET_LIQUID_TAGS_SUCCESS });
816
819
  } else {
817
- yield put({ type: types.GET_LIQUID_TAGS_FAILURE, error: true });
820
+ yield put({ type: types.GET_LIQUID_TAGS_FAILURE });
818
821
  }
819
-
820
822
  } catch (error) {
821
- yield put({ type: types.GET_LIQUID_TAGS_FAILURE, error});
823
+ yield put({ type: types.GET_LIQUID_TAGS_FAILURE });
822
824
  }
823
825
  }
824
826
  const getTopbarData = (parentModule) => {
@@ -15,7 +15,7 @@ function getFullModeSaveBtn(slidBoxContent) {
15
15
  function SlideBoxFooter(props) {
16
16
  const { slidBoxContent, onSave, onEditTemplate, onCreateNextStep, isFullMode, fetchingCmsData, isTemplateNameEmpty, errorMessages, isLiquidValidationError} = props;
17
17
  return (
18
- <div>
18
+ <div className='footer-width'>
19
19
  {isLiquidValidationError && (<ErrorInfoNote errorMessages={errorMessages} />)}
20
20
  <div>
21
21
  {props.shouldShowDoneFooter() && (
@@ -25,7 +25,7 @@ function SlideBoxFooter(props) {
25
25
  <FormattedMessage {...messages.templateNameEmpty} />
26
26
  </CapError>
27
27
  )}
28
- <CapRow className={isLiquidValidationError && "liquid-flex"}>
28
+ <CapRow>
29
29
  <CapButton
30
30
  onClick={onSave}
31
31
  disabled={isTemplateNameEmpty || fetchingCmsData || false}
@@ -79,8 +79,6 @@ $classPrefix: add-creatives-section;
79
79
  margin-left: $CAP_SPACE_24;
80
80
  }
81
81
 
82
- .liquid-flex {
83
- display: flex;
84
- vertical-align: sub;
85
- align-items: center;
82
+ .footer-width {
83
+ width: 100%;;
86
84
  }