allow to disable text signature via account prefs

This commit is contained in:
Pete Matsyburka committed 2023-12-02 16:26:37 +02:00
1 parent 489f9859be
commit c5d71505ef
12 files changed
+98 -38

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
# frozen_string_literal: true
module Submitters
module FormConfigs
module_function
def call(submitter)
configs = submitter.submission.template.account.account_configs
.where(key: [AccountConfig::FORM_COMPLETED_BUTTON_KEY,
AccountConfig::ALLOW_TYPED_SIGNATURE])
completed_button = configs.find { |e| e.key == AccountConfig::FORM_COMPLETED_BUTTON_KEY }&.value || {}
with_typed_signature = configs.find { |e| e.key == AccountConfig::ALLOW_TYPED_SIGNATURE }&.value != false
{ completed_button:, with_typed_signature: }
end
end
end