@capillarytech/creatives-library 7.17.193 → 7.17.194-alpha.1

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/config/app.js CHANGED
@@ -6,7 +6,7 @@ const config = {
6
6
  api_endpoint: '/arya/api/v1/creatives',
7
7
  campaigns_api_endpoint: '/iris/v2/campaigns',
8
8
  campaigns_api_org_endpoint: '/iris/v2/org/campaign',
9
- liquid_endpoint:'/iris/v2/liquid',
9
+ liquid_endpoint:'/iris/v2/template',
10
10
  auth_endpoint: '/arya/api/v1/auth',
11
11
  arya_endpoint: '/arya/api/v1',
12
12
  login_url: '/auth/login',
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.1",
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 {
@@ -3750,7 +3749,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
3750
3749
 
3751
3750
 
3752
3751
  return (
3753
- <CapSpin spinning={this.liquidFlow && this.props.liquidExtractionInProgress}>
3752
+ <CapSpin spinning={this.liquidFlow && this.props.liquidExtractionInProgress} tip={this.props.intl.formatMessage(messages.liquidSpinText)} >
3754
3753
  <CapRow>
3755
3754
  {this.props.schema ? this.renderForm() : ""}
3756
3755
  <SlideBox
@@ -94,4 +94,8 @@ export default defineMessages({
94
94
  id: 'creatives.componentsV2.FormBuilder.somethingWentWrong',
95
95
  defaultMessage: 'Something went wrong while validating content , pls try again later',
96
96
  },
97
+ liquidSpinText:{
98
+ id: 'creatives.componentsV2.FormBuilder.liquidSpinText',
99
+ defaultMessage: 'Validating the template, it might take a few seconds',
100
+ },
97
101
  });
@@ -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) => {
@@ -64,7 +64,7 @@ describe('should handle GET_SUPPORT_VIDEOS_CONFIG', () => {
64
64
  const action = {
65
65
  type: GET_LIQUID_TAGS_REQUEST,
66
66
  };
67
- const expectedState = {"fetchingLiquidTags": true, "fetchingSchema": true, "fetchingSchemaError": false, "liquidTags": [], "messages": [], "metaEntities": {"layouts": [], "tagMap": {}, "tags": []}, "orgID": "", "token": ""};
67
+ const expectedState = {"fetchingLiquidTags": true, "fetchingSchema": true, "fetchingSchemaError": "", "liquidTags": [], "messages": [], "metaEntities": {"layouts": [], "tagMap": {}, "tags": []}, "orgID": "", "token": ""};
68
68
  expect(reducer(mockedInitialState, action).toJS()).toEqual(expectedState);
69
69
  });
70
70
 
@@ -72,7 +72,7 @@ describe('should handle GET_SUPPORT_VIDEOS_CONFIG', () => {
72
72
  const action = {
73
73
  type: GET_LIQUID_TAGS_FAILURE,
74
74
  };
75
- const expectedState ={"fetchingLiquidTags": false, "fetchingSchema": true, "fetchingSchemaError": true, "liquidTags": [], "messages": [], "metaEntities": {"layouts": [], "tagMap": {}, "tags": []}, "orgID": "", "token": ""}
75
+ const expectedState ={"fetchingLiquidTags": false, "fetchingSchema": true, "fetchingSchemaError": "", "liquidTags": [], "messages": [], "metaEntities": {"layouts": [], "tagMap": {}, "tags": []}, "orgID": "", "token": ""}
76
76
  expect(reducer(mockedInitialState, action).toJS()).toEqual(expectedState);
77
77
  });
78
78
 
@@ -80,11 +80,7 @@ describe('should handle GET_SUPPORT_VIDEOS_CONFIG', () => {
80
80
  const action = {
81
81
  type: GET_LIQUID_TAGS_SUCCESS,
82
82
  };
83
- const initialState = fromJS({
84
- fetchingLiquidTags: true,
85
- fetchingSchemaError: false,
86
- });
87
- const expectedState ={"fetchingLiquidTags": false, "fetchingSchema": true, "fetchingSchemaError": false, "liquidTags": [], "messages": [], "metaEntities": {"layouts": [], "tagMap": {}, "tags": []}, "orgID": "", "token": ""}
83
+ const expectedState ={"fetchingLiquidTags": false, "fetchingSchema": true, "fetchingSchemaError": "", "liquidTags": [], "messages": [], "metaEntities": {"layouts": [], "tagMap": {}, "tags": []}, "orgID": "", "token": ""}
88
84
  expect(reducer(mockedInitialState, action).toJS()).toEqual(expectedState);
89
85
  });
90
86
 
@@ -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
  }