diff --git a/app/assets/stylesheets/tailwind/inputs.css b/app/assets/stylesheets/tailwind/inputs.css index a5b9104d2..e72724e12 100644 --- a/app/assets/stylesheets/tailwind/inputs.css +++ b/app/assets/stylesheets/tailwind/inputs.css @@ -101,7 +101,8 @@ @apply bg-sn-super-light-grey; } - .sci-input-container-v2.error input { + .sci-input-container-v2.error input, + .sci-input-container-v2.error textarea{ @apply border-sn-alert-passion; } diff --git a/app/javascript/vue/forms/edit_field.vue b/app/javascript/vue/forms/edit_field.vue index 76bcc0e63..0307b3782 100644 --- a/app/javascript/vue/forms/edit_field.vue +++ b/app/javascript/vue/forms/edit_field.vue @@ -115,14 +115,14 @@ export default { } if (this.editField.attributes.name.length > GLOBAL_CONSTANTS.NAME_MAX_LENGTH) { - return this.i18n.t('forms.show.title_too_long_error'); + return this.i18n.t('forms.show.title_too_long_error', { limit: GLOBAL_CONSTANTS.NAME_MAX_LENGTH }); } return ''; }, descriptionFieldError() { if (this.editField.attributes.description.length > GLOBAL_CONSTANTS.TEXT_MAX_LENGTH) { - return this.i18n.t('forms.show.description_too_long_error'); + return this.i18n.t('forms.show.description_too_long_error', { limit: GLOBAL_CONSTANTS.TEXT_MAX_LENGTH }); } return ''; diff --git a/app/javascript/vue/forms/edit_fields/number.vue b/app/javascript/vue/forms/edit_fields/number.vue index 722608ec0..5fed314e5 100644 --- a/app/javascript/vue/forms/edit_fields/number.vue +++ b/app/javascript/vue/forms/edit_fields/number.vue @@ -96,8 +96,8 @@ export default { return !this.editField.attributes.data.unit || this.editField.attributes.data.unit.length <= GLOBAL_CONSTANTS.NAME_MAX_LENGTH; }, unitFieldError() { - if (this.editField.attributes.data.unit.length > GLOBAL_CONSTANTS.NAME_MAX_LENGTH) { - return this.i18n.t('forms.show.field_too_long_error'); + if (this.editField.attributes.data.unit && this.editField.attributes.data.unit.length > GLOBAL_CONSTANTS.NAME_MAX_LENGTH) { + return this.i18n.t('forms.show.field_too_long_error', { limit: GLOBAL_CONSTANTS.NAME_MAX_LENGTH }); } return ''; diff --git a/app/javascript/vue/forms/edit_fields/options_mixin.js b/app/javascript/vue/forms/edit_fields/options_mixin.js index 6d2e529e1..f5cdd5b11 100644 --- a/app/javascript/vue/forms/edit_fields/options_mixin.js +++ b/app/javascript/vue/forms/edit_fields/options_mixin.js @@ -12,7 +12,7 @@ export default { }, optionFieldErrors() { if (!this.validField) { - return this.i18n.t('forms.show.options_too_many_error'); + return this.i18n.t('forms.show.options_too_many_error', { limit: GLOBAL_CONSTANTS.NAME_MAX_LENGTH }); } return ''; diff --git a/app/javascript/vue/forms/fields/text.vue b/app/javascript/vue/forms/fields/text.vue index 711ad5e16..e5e829da3 100644 --- a/app/javascript/vue/forms/fields/text.vue +++ b/app/javascript/vue/forms/fields/text.vue @@ -1,8 +1,9 @@