make confetti configurable

This commit is contained in:
Pete Matsyburka
2024-01-26 17:43:52 +02:00
parent 1d7c84302e
commit 6c35ff6d1c
4 changed files with 6 additions and 3 deletions
+3 -1
View File
@@ -7,13 +7,15 @@ module Submitters
def call(submitter)
configs = submitter.submission.template.account.account_configs
.where(key: [AccountConfig::FORM_COMPLETED_BUTTON_KEY,
AccountConfig::FORM_WITH_CONFETTI_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
with_confetti = configs.find { |e| e.key == AccountConfig::FORM_WITH_CONFETTI_KEY }&.value != false
{ completed_button:, with_typed_signature: }
{ completed_button:, with_typed_signature:, with_confetti: }
end
end
end