@capillarytech/creatives-library 8.0.290-alpha.1 → 8.0.290-alpha.3
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
|
@@ -2801,6 +2801,11 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2801
2801
|
if (this.props.restrictPersonalization && hasPersonalizationTags(messageContent)) {
|
|
2802
2802
|
errorMessageText = formatMessage(messages.personalizationTagsErrorMessage);
|
|
2803
2803
|
}
|
|
2804
|
+
// Empty/required error: only show after user has triggered validation (ifError / "Done").
|
|
2805
|
+
// All other errors (brace, personalization, missing tags, generic): show in real time while typing.
|
|
2806
|
+
const isContentEmpty = !messageContent || !/\S/.test(String(messageContent).trim());
|
|
2807
|
+
const isEmptyError = errorType && isContentEmpty;
|
|
2808
|
+
const showError = errorType && (isEmptyError ? ifError : true);
|
|
2804
2809
|
const prevErrorMessage = this.state.liquidErrorMessage?.STANDARD_ERROR_MSG?.[0];
|
|
2805
2810
|
if (prevErrorMessage !== errorMessageText && errorMessageText && this.isLiquidFlowSupportedByChannel()) {
|
|
2806
2811
|
this.setState((prevState) => ({
|
|
@@ -2823,9 +2828,9 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2823
2828
|
<TextArea
|
|
2824
2829
|
id={val.id}
|
|
2825
2830
|
placeholder={val.placeholder ? val.placeholder : ''}
|
|
2826
|
-
className={`${
|
|
2831
|
+
className={`${showError ? 'error-form-builder' : ''}`}
|
|
2827
2832
|
errorMessage={
|
|
2828
|
-
|
|
2833
|
+
showError && errorMessageText && (
|
|
2829
2834
|
!this.isLiquidFlowSupportedByChannel() ||
|
|
2830
2835
|
[MOBILE_PUSH, INAPP].includes(this.props.schema?.channel?.toUpperCase())
|
|
2831
2836
|
)
|