single digital signature by default
This commit is contained in:
@@ -123,7 +123,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% account_config = AccountConfig.where(account: current_account, key: AccountConfig::ESIGNING_PREFERENCE_KEY).first_or_initialize(value: 'multiple') %>
|
<% account_config = AccountConfig.where(account: current_account, key: AccountConfig::ESIGNING_PREFERENCE_KEY).first_or_initialize(value: 'single') %>
|
||||||
<% if can?(:manage, account_config) %>
|
<% if can?(:manage, account_config) %>
|
||||||
<div class="px-1 mt-8 max-w-xl">
|
<div class="px-1 mt-8 max-w-xl">
|
||||||
<div class="flex justify-between items-end mb-4 mt-8">
|
<div class="flex justify-between items-end mb-4 mt-8">
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ module Submissions
|
|||||||
end
|
end
|
||||||
|
|
||||||
SIGN_REASON = 'Signed by %<name>s with DocuSeal.co'
|
SIGN_REASON = 'Signed by %<name>s with DocuSeal.co'
|
||||||
SIGN_SIGNLE_REASON = 'Digitally signed with DocuSeal.co'
|
|
||||||
|
|
||||||
RTL_REGEXP = TextUtils::RTL_REGEXP
|
RTL_REGEXP = TextUtils::RTL_REGEXP
|
||||||
|
|
||||||
@@ -453,8 +452,10 @@ module Submissions
|
|||||||
format(SIGN_REASON, name:)
|
format(SIGN_REASON, name:)
|
||||||
end
|
end
|
||||||
|
|
||||||
def single_sign_reason
|
def single_sign_reason(submitter)
|
||||||
SIGN_SIGNLE_REASON
|
signers = submitter.submission.submitters.sort_by(&:completed_at).map { |s| s.email || s.name || s.phone }
|
||||||
|
|
||||||
|
format(SIGN_REASON, name: signers.reverse.join(', '))
|
||||||
end
|
end
|
||||||
|
|
||||||
def fetch_sign_reason(submitter)
|
def fetch_sign_reason(submitter)
|
||||||
@@ -463,16 +464,18 @@ module Submissions
|
|||||||
config =
|
config =
|
||||||
if Docuseal.multitenant?
|
if Docuseal.multitenant?
|
||||||
AccountConfig.where(account: submitter.account, key: AccountConfig::ESIGNING_PREFERENCE_KEY)
|
AccountConfig.where(account: submitter.account, key: AccountConfig::ESIGNING_PREFERENCE_KEY)
|
||||||
.first_or_initialize(value: 'multiple')
|
.first_or_initialize(value: 'single')
|
||||||
else
|
else
|
||||||
AccountConfig.where(key: AccountConfig::ESIGNING_PREFERENCE_KEY)
|
AccountConfig.where(key: AccountConfig::ESIGNING_PREFERENCE_KEY)
|
||||||
.first_or_initialize(value: 'multiple')
|
.first_or_initialize(value: 'single')
|
||||||
end
|
end
|
||||||
|
|
||||||
return sign_reason(reason_name) if config.value == 'multiple'
|
return sign_reason(reason_name) if config.value == 'multiple'
|
||||||
|
|
||||||
return single_sign_reason if !submitter.submission.submitters.exists?(completed_at: nil) &&
|
if !submitter.submission.submitters.exists?(completed_at: nil) &&
|
||||||
submitter.completed_at == submitter.submission.submitters.maximum(:completed_at)
|
submitter.completed_at == submitter.submission.submitters.maximum(:completed_at)
|
||||||
|
return single_sign_reason(submitter)
|
||||||
|
end
|
||||||
|
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user