fix generation

This commit is contained in:
Pete Matsyburka committed 2026-08-28 19:15:48 +03:00
1 parent 99b3247cf7
commit 2a1a2cbd82
2 files changed
+9 -4

No files matched your search

+4 -2
View File
@@ -19,6 +19,7 @@ module Submissions
}.freeze
TESTING_FOOTER = GenerateResultAttachments::TESTING_FOOTER
UNSUPPORTED_IMAGE_TYPES = GenerateResultAttachments::UNSUPPORTED_IMAGE_TYPES
RTL_REGEXP = TextUtils::RTL_REGEXP
MAX_IMAGE_HEIGHT = 100
@@ -354,8 +355,9 @@ module Submissions
field_type = field['type']
if field_type == 'image' &&
submitter.attachments.find { |a| a.uuid == value }.then { |a| !a.image? || a.content_type == 'image/heic' }
if (field_type == 'image' || field_type == 'stamp') &&
submitter.attachments.find { |a| a.uuid == value }
.then { |a| !a.image? || a.content_type.in?(UNSUPPORTED_IMAGE_TYPES) }
field_type = 'file'
end
@@ -36,6 +36,8 @@ module Submissions
SIGN_REASON = 'Signed with DocuSeal.com'
UNSUPPORTED_IMAGE_TYPES = ['image/heic', 'image/avif'].freeze
RTL_REGEXP = TextUtils::RTL_REGEXP
TEXT_LEFT_MARGIN = 1
@@ -300,8 +302,9 @@ module Submissions
field_type = field['type']
if field_type == 'image' &&
submitter.attachments.find { |a| a.uuid == value }.then { |a| !a.image? || a.content_type == 'image/heic' }
if (field_type == 'image' || field_type == 'stamp') &&
submitter.attachments.find { |a| a.uuid == value }
.then { |a| !a.image? || a.content_type.in?(UNSUPPORTED_IMAGE_TYPES) }
field_type = 'file'
end