diff --git a/src/components/BaseInput.vue b/src/components/BaseInput.vue index 111593ce..80545c2e 100644 --- a/src/components/BaseInput.vue +++ b/src/components/BaseInput.vue @@ -6,6 +6,8 @@ :label="label" :placeholder="placeholder" :maxlength="maxlength" + :message="message" + :type="type" /> @@ -33,6 +35,17 @@ type: Number, default: 25, }, + message: { + type: String, + default: null, + }, + type: { + type: String, + default: 'normal', + validator(value) { + return ['normal', 'error'].indexOf(value) !== -1; + }, + }, replaceRegex: { type: RegExp, default: null, diff --git a/src/components/whatsAppTemplates/FormTabContent.vue b/src/components/whatsAppTemplates/FormTabContent.vue index dc293d52..cc93dc0d 100644 --- a/src/components/whatsAppTemplates/FormTabContent.vue +++ b/src/components/whatsAppTemplates/FormTabContent.vue @@ -172,6 +172,10 @@ value: false, message: '', }, + buttons: { + value: false, + message: '', + }, }, }; }, @@ -242,7 +246,11 @@ } this.updateTemplateForm({ fieldName, fieldValue }); }, - handleGenericInput({ fieldName, fieldValue }) { + handleGenericInput({ fieldName, fieldValue, hasIssue = false }) { + if (hasIssue) { + this.errorStates[fieldName].value = true; + } + this.updateTemplateTranslationForm({ formName: this.selectedForm, fieldName, diff --git a/src/components/whatsAppTemplates/FormTabContentButtons.vue b/src/components/whatsAppTemplates/FormTabContentButtons.vue index 2c429875..893e385a 100644 --- a/src/components/whatsAppTemplates/FormTabContentButtons.vue +++ b/src/components/whatsAppTemplates/FormTabContentButtons.vue @@ -57,6 +57,8 @@ :placeholder="$t('WhatsApp.templates.form_field.button_text_placeholder')" :maxlength="25" :replaceRegex="EMOJI_REGEX" + :message="errors[index] || null" + :type="errors[index] ? 'error' : 'normal'" @input="handleRepliesInput($event, index)" /> @@ -201,6 +203,7 @@