@capillarytech/creatives-library 7.17.200 → 7.17.202-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.200",
4
+ "version": "7.17.202-alpha.0",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -25,4 +25,4 @@ export const addBaseToTemplate = (template) => {
25
25
  };
26
26
 
27
27
  export const isEmbeddedEditOrPreview = (queryType, creativesMode) => queryType === EMBEDDED &&
28
- [EDIT, PREVIEW].include(creativesMode);
28
+ [EDIT, PREVIEW].includes(creativesMode);
@@ -990,6 +990,9 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
990
990
  }
991
991
  if (tagValidationResponse?.missingTags?.length > 0) {
992
992
  errorString += `${this.props.intl.formatMessage(messages.missingTags)} ${tagValidationResponse.missingTags.toString()}\n`;
993
+ if(this.liquidFlow && this.props.isEdit){
994
+ isLiquidValid = true;
995
+ }
993
996
  }
994
997
  if (tagValidationResponse?.unsupportedTags?.length > 0) {
995
998
  errorString += `${this.props.intl.formatMessage(messages.unsupportedTags)} ${tagValidationResponse.unsupportedTags.toString()}\n`;
@@ -1036,15 +1039,17 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
1036
1039
  }
1037
1040
  });
1038
1041
  }
1042
+
1043
+ const masterValidator = this.liquidFlow ? isLiquidValid : isValid;
1039
1044
  //Updating the state with the error data
1040
1045
  this.setState((prevState) => ({
1041
- isFormValid: isValid,
1046
+ isFormValid: masterValidator,
1042
1047
  showLiquidValidation: prevState.liquidErrorMessage?.LIQUID_ERROR_MSG?.length > 0 ? true : !isLiquidValid,
1043
1048
  liquidErrorMessage: {
1044
1049
  //Do not update the LIQUID_ERROR_MSG validation error message
1045
1050
  ...prevState.liquidErrorMessage,
1046
1051
  //update Standard error message based on the updated content
1047
- STANDARD_ERROR_MSG: isValid ? [] : prevState.liquidErrorMessage?.STANDARD_ERROR_MSG,
1052
+ STANDARD_ERROR_MSG: masterValidator ? [] : prevState.liquidErrorMessage?.STANDARD_ERROR_MSG,
1048
1053
  },
1049
1054
  errorData,
1050
1055
  }), () => {
@@ -1054,8 +1059,8 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
1054
1059
  }
1055
1060
  });
1056
1061
 
1057
- this.props.onFormValidityChange(isValid, errorData);
1058
- return isValid;
1062
+ this.props.onFormValidityChange(masterValidator, errorData);
1063
+ return masterValidator;
1059
1064
  }
1060
1065
 
1061
1066
  indexOfEnd(targetString, string) {
@@ -1096,13 +1101,14 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
1096
1101
  this.props.stopValidation();
1097
1102
  return;
1098
1103
  }
1099
- else if (result?.data?.length > 0) {
1100
- const extractedLiquidTags = extractNames(result?.data);
1104
+ else {
1105
+ const extractedLiquidTags = extractNames(result?.data || []);
1101
1106
  // Extracts the supported liquid tags from the given content.
1102
1107
  const supportedLiquidTags = checkSupport(
1103
1108
  result,
1104
1109
  this.props?.metaEntities?.tagLookupMap
1105
1110
  );
1111
+
1106
1112
  const unsupportedLiquidTags = extractedLiquidTags?.filter(
1107
1113
  (tag) => !supportedLiquidTags?.includes(tag)
1108
1114
  );