From 67ce6f57047f4e756ae8f25c90eeeb2bf7195b48 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Tue, 8 Jun 2021 16:32:01 +0530 Subject: [PATCH] feat: Add regex validation on form message inputs (#2317) Co-authored-by: Nithin David Thomas Co-authored-by: Sojan --- .rubocop.yml | 3 + app/javascript/shared/components/ChatForm.vue | 61 ++++++++++++++++++- app/javascript/widget/i18n/locale/en.json | 7 ++- .../concerns/content_attribute_validator.rb | 2 +- lib/woot_message_seeder.rb | 25 +++++--- 5 files changed, 84 insertions(+), 14 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 668951de2..77bd4ad18 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -44,6 +44,9 @@ Metrics/BlockLength: - '**/routes.rb' - 'config/environments/*' - db/schema.rb +Metrics/ModuleLength: + Exclude: + - lib/woot_message_seeder.rb Rails/ApplicationController: Exclude: - 'app/controllers/api/v1/widget/messages_controller.rb' diff --git a/app/javascript/shared/components/ChatForm.vue b/app/javascript/shared/components/ChatForm.vue index 56391fdb8..f943f23c1 100644 --- a/app/javascript/shared/components/ChatForm.vue +++ b/app/javascript/shared/components/ChatForm.vue @@ -1,12 +1,33 @@