diff --git a/Gemfile.lock b/Gemfile.lock index bf6f2456..43018559 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -338,18 +338,18 @@ GEM net-smtp (0.5.0) net-protocol nio4r (2.7.4) - nokogiri (1.18.3) + nokogiri (1.18.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.18.3-aarch64-linux-gnu) + nokogiri (1.18.5-aarch64-linux-gnu) racc (~> 1.4) - nokogiri (1.18.3-aarch64-linux-musl) + nokogiri (1.18.5-aarch64-linux-musl) racc (~> 1.4) - nokogiri (1.18.3-arm64-darwin) + nokogiri (1.18.5-arm64-darwin) racc (~> 1.4) - nokogiri (1.18.3-x86_64-linux-gnu) + nokogiri (1.18.5-x86_64-linux-gnu) racc (~> 1.4) - nokogiri (1.18.3-x86_64-linux-musl) + nokogiri (1.18.5-x86_64-linux-musl) racc (~> 1.4) oj (3.16.8) bigdecimal (>= 3.0) @@ -387,7 +387,7 @@ GEM puma (6.5.0) nio4r (~> 2.0) racc (1.8.1) - rack (3.1.10) + rack (3.1.12) rack-proxy (0.7.7) rack rack-session (2.0.0) diff --git a/app/controllers/api/submissions_controller.rb b/app/controllers/api/submissions_controller.rb index d1c3fdb8..51a8e43e 100644 --- a/app/controllers/api/submissions_controller.rb +++ b/app/controllers/api/submissions_controller.rb @@ -179,7 +179,7 @@ module Api message: %i[subject body], submitters: [[:send_email, :send_sms, :completed_redirect_url, :uuid, :name, :email, :role, :completed, :phone, :application_key, :external_id, :reply_to, :go_to_last, - { metadata: {}, values: {}, readonly_fields: [], message: %i[subject body], + { metadata: {}, values: {}, roles: [], readonly_fields: [], message: %i[subject body], fields: [:name, :uuid, :default_value, :value, :title, :description, :readonly, :validation_pattern, :invalid_message, { default_value: [], value: [], preferences: {} }] }]] diff --git a/app/controllers/start_form_controller.rb b/app/controllers/start_form_controller.rb index ee05ff28..a0a72044 100644 --- a/app/controllers/start_form_controller.rb +++ b/app/controllers/start_form_controller.rb @@ -25,7 +25,7 @@ class StartFormController < ApplicationController redirect_to start_form_completed_path(@template.slug, email: submitter_params[:email]) else if filter_undefined_submitters(@template).size > 1 && @submitter.new_record? - @error_message = I18n.t('not_found') + @error_message = multiple_submitters_error_message return render :show end @@ -117,4 +117,12 @@ class StartFormController < ApplicationController @template = Template.find_by!(slug:) end + + def multiple_submitters_error_message + if current_user&.account_id == @template.account_id + helpers.t('this_submission_has_multiple_signers_which_prevents_the_use_of_a_sharing_link_html') + else + I18n.t('not_found') + end + end end diff --git a/app/controllers/templates_debug_controller.rb b/app/controllers/templates_debug_controller.rb index 02d3d8b0..810c042a 100644 --- a/app/controllers/templates_debug_controller.rb +++ b/app/controllers/templates_debug_controller.rb @@ -6,9 +6,10 @@ class TemplatesDebugController < ApplicationController def show attachment = @template.documents.first - pdf = HexaPDF::Document.new(io: StringIO.new(attachment.download)) + data = attachment.download + pdf = HexaPDF::Document.new(io: StringIO.new(data)) - fields = Templates::FindAcroFields.call(pdf, attachment) + fields = Templates::FindAcroFields.call(pdf, attachment, data) attachment.metadata['pdf'] ||= {} attachment.metadata['pdf']['fields'] = fields diff --git a/app/javascript/submission_form/area.vue b/app/javascript/submission_form/area.vue index 9066684e..ce212a4f 100644 --- a/app/javascript/submission_form/area.vue +++ b/app/javascript/submission_form/area.vue @@ -1,9 +1,9 @@