diff --git a/app/controllers/submit_form_download_controller.rb b/app/controllers/submit_form_download_controller.rb
index 574d520a..d357019c 100644
--- a/app/controllers/submit_form_download_controller.rb
+++ b/app/controllers/submit_form_download_controller.rb
@@ -14,7 +14,10 @@ class SubmitFormDownloadController < ApplicationController
return head :unprocessable_entity if @submitter.declined_at? ||
@submitter.submission.archived_at? ||
@submitter.submission.expired? ||
- @submitter.submission.template&.archived_at?
+ @submitter.submission.template&.archived_at? ||
+ AccountConfig.exists?(account_id: @submitter.account_id,
+ key: AccountConfig::ALLOW_TO_PARTIAL_DOWNLOAD_KEY,
+ value: false)
last_completed_submitter = @submitter.submission.submitters
.where.not(id: @submitter.id)
diff --git a/app/models/account_config.rb b/app/models/account_config.rb
index d573ad0f..3fbfe20a 100644
--- a/app/models/account_config.rb
+++ b/app/models/account_config.rb
@@ -29,6 +29,7 @@ class AccountConfig < ApplicationRecord
ALLOW_TYPED_SIGNATURE = 'allow_typed_signature'
ALLOW_TO_RESUBMIT = 'allow_to_resubmit'
ALLOW_TO_DECLINE_KEY = 'allow_to_decline'
+ ALLOW_TO_PARTIAL_DOWNLOAD_KEY = 'allow_to_partial_download'
SUBMITTER_REMINDERS = 'submitter_reminders'
ENFORCE_SIGNING_ORDER_KEY = 'enforce_signing_order'
FORM_COMPLETED_BUTTON_KEY = 'form_completed_button'
diff --git a/app/views/submit_form/show.html.erb b/app/views/submit_form/show.html.erb
index 2a9f0dc7..bdd5351f 100644
--- a/app/views/submit_form/show.html.erb
+++ b/app/views/submit_form/show.html.erb
@@ -24,16 +24,18 @@
<% end %>
<% end %>
-
-
- <%= svg_icon('download', class: 'w-6 h-6 inline md:hidden') %>
- <%= t('download') %>
-
-
- <%= svg_icon('loader', class: 'w-6 h-6 animate-spin') %>
- <%= t('downloading') %>
-
-
+ <% if @form_configs[:with_partial_download] %>
+
+
+ <%= svg_icon('download', class: 'w-6 h-6 inline md:hidden') %>
+ <%= t('download') %>
+
+
+ <%= svg_icon('loader', class: 'w-6 h-6 animate-spin') %>
+ <%= t('downloading') %>
+
+
+ <% end %>
diff --git a/lib/submitters/form_configs.rb b/lib/submitters/form_configs.rb
index ef4077e5..9c1fa06f 100644
--- a/lib/submitters/form_configs.rb
+++ b/lib/submitters/form_configs.rb
@@ -11,6 +11,7 @@ module Submitters
AccountConfig::ENFORCE_SIGNING_ORDER_KEY,
AccountConfig::REQUIRE_SIGNING_REASON_KEY,
AccountConfig::REUSE_SIGNATURE_KEY,
+ AccountConfig::ALLOW_TO_PARTIAL_DOWNLOAD_KEY,
AccountConfig::ALLOW_TYPED_SIGNATURE,
*(Docuseal.multitenant? ? [] : [AccountConfig::POLICY_LINKS_KEY])].freeze
@@ -26,24 +27,24 @@ module Submitters
prefill_signature = find_safe_value(configs, AccountConfig::FORM_PREFILL_SIGNATURE_KEY) != false
reuse_signature = find_safe_value(configs, AccountConfig::REUSE_SIGNATURE_KEY) != false
with_decline = find_safe_value(configs, AccountConfig::ALLOW_TO_DECLINE_KEY) != false
+ with_partial_download = find_safe_value(configs, AccountConfig::ALLOW_TO_PARTIAL_DOWNLOAD_KEY) != false
with_signature_id = find_safe_value(configs, AccountConfig::WITH_SIGNATURE_ID) == true
require_signing_reason = find_safe_value(configs, AccountConfig::REQUIRE_SIGNING_REASON_KEY) == true
enforce_signing_order = find_safe_value(configs, AccountConfig::ENFORCE_SIGNING_ORDER_KEY) == true
policy_links = find_safe_value(configs, AccountConfig::POLICY_LINKS_KEY)
- attrs = {
- completed_button:,
- with_typed_signature:,
- with_confetti:,
- reuse_signature:,
- with_decline:,
- policy_links:,
- enforce_signing_order:,
- completed_message:,
- require_signing_reason:,
- prefill_signature:,
- with_signature_id:
- }
+ attrs = { completed_button:,
+ with_typed_signature:,
+ with_confetti:,
+ reuse_signature:,
+ with_decline:,
+ with_partial_download:,
+ policy_links:,
+ enforce_signing_order:,
+ completed_message:,
+ require_signing_reason:,
+ prefill_signature:,
+ with_signature_id: }
keys.each do |key|
attrs[key.to_sym] = configs.find { |e| e.key == key.to_s }&.value