@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
package/utils/commonUtils.js
CHANGED
|
@@ -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:
|
|
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:
|
|
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(
|
|
1058
|
-
return
|
|
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
|
|
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
|
);
|