diff --git a/Gemfile b/Gemfile index d0e64233..3a704a0d 100644 --- a/Gemfile +++ b/Gemfile @@ -11,6 +11,7 @@ gem 'azure-storage-blob', require: false gem 'bootsnap', require: false gem 'cancancan' gem 'csv' +gem 'csv-safe' gem 'devise' gem 'devise-two-factor' gem 'dotenv', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 493b46bb..efd18cf6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -150,6 +150,8 @@ GEM css_parser (1.21.0) addressable csv (3.3.2) + csv-safe (3.3.1) + csv (~> 3.0) cuprite (0.15.1) capybara (~> 3.0) ferrum (~> 0.15.0) @@ -271,10 +273,11 @@ GEM os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) hashdiff (1.1.2) - hexapdf (1.0.3) + hexapdf (1.4.0) cmdparse (~> 3.0, >= 3.0.3) geom2d (~> 0.4, >= 0.4.1) openssl (>= 2.2.1) + strscan (>= 3.1.2) htmlentities (4.3.4) httpclient (2.8.3) i18n (1.14.7) @@ -288,7 +291,7 @@ GEM rdoc (>= 4.0.0) reline (>= 0.4.2) jmespath (1.6.2) - json (2.9.1) + json (2.13.2) jwt (2.9.3) base64 language_server-protocol (3.17.0.3) @@ -353,13 +356,13 @@ GEM racc (~> 1.4) nokogiri (1.18.9-x86_64-linux-musl) racc (~> 1.4) - oj (3.16.8) + oj (3.16.11) bigdecimal (>= 3.0) ostruct (>= 0.2) openssl (3.3.0) orm_adapter (0.5.0) os (1.1.4) - ostruct (0.6.1) + ostruct (0.6.3) package_json (0.1.0) pagy (9.3.3) parallel (1.26.3) @@ -548,6 +551,7 @@ GEM stringio (3.1.7) strip_attributes (1.14.1) activemodel (>= 3.0, < 9.0) + strscan (3.1.5) thor (1.4.0) timeout (0.4.3) trailblazer-option (0.1.2) @@ -610,6 +614,7 @@ DEPENDENCIES cancancan capybara csv + csv-safe cuprite debug devise diff --git a/app/controllers/api/submissions_controller.rb b/app/controllers/api/submissions_controller.rb index 95ab2bda..82839f05 100644 --- a/app/controllers/api/submissions_controller.rb +++ b/app/controllers/api/submissions_controller.rb @@ -189,7 +189,7 @@ module Api { metadata: {}, values: {}, roles: [], readonly_fields: [], message: %i[subject body], fields: [:name, :uuid, :default_value, :value, :title, :description, :readonly, :required, :validation_pattern, :invalid_message, - { default_value: [], value: [], preferences: {} }] }]] + { default_value: [], value: [], preferences: {}, validation: {} }] }]] } ] diff --git a/app/controllers/api/templates_controller.rb b/app/controllers/api/templates_controller.rb index 7847e599..a098573d 100644 --- a/app/controllers/api/templates_controller.rb +++ b/app/controllers/api/templates_controller.rb @@ -111,9 +111,10 @@ module Api :required, :readonly, :default_value, :title, :description, :prefillable, { preferences: {}, + default_value: [], conditions: [%i[field_uuid value action operation]], options: [%i[value uuid]], - validation: %i[message pattern], + validation: %i[message pattern min max step], areas: [%i[x y w h cell_w attachment_uuid option_uuid page]] }]] } ] diff --git a/app/controllers/templates_controller.rb b/app/controllers/templates_controller.rb index 3af0a0f2..6b8f3b7a 100644 --- a/app/controllers/templates_controller.rb +++ b/app/controllers/templates_controller.rb @@ -122,9 +122,10 @@ class TemplatesController < ApplicationController :required, :readonly, :default_value, :title, :description, :prefillable, { preferences: {}, + default_value: [], conditions: [%i[field_uuid value action operation]], options: [%i[value uuid]], - validation: %i[message pattern], + validation: %i[message pattern min max step], areas: [%i[x y w h cell_w attachment_uuid option_uuid page]] }]] } ) end diff --git a/app/javascript/submission_form/area.vue b/app/javascript/submission_form/area.vue index e5560800..784818b6 100644 --- a/app/javascript/submission_form/area.vue +++ b/app/javascript/submission_form/area.vue @@ -29,8 +29,15 @@ {{ optionValue(option) }}