Skip to content

Commit

Permalink
skip field description
Browse files Browse the repository at this point in the history
  • Loading branch information
omohokcoj committed Jul 7, 2024
1 parent e55c8f2 commit edb2997
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/templates/find_acro_fields.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module FindAcroFields
PDF_CONTENT_TYPE = 'application/pdf'

FIELD_NAME_REGEXP = /\A(?=.*\p{L})[\p{L}\d\s]+\z/
SKIP_FIELD_DESCRIPTION = %w[undefined].freeze

module_function

Expand Down Expand Up @@ -103,7 +104,9 @@ def build_field_properties(field)
field_name = field_name&.encode('utf-8', invalid: :replace, undef: :replace, replace: '')

attrs = { name: field_name.to_s }
attrs[:description] = field[:TU] if field[:TU].present? && field[:TU] != field.full_field_name
attrs[:description] = field[:TU] if field[:TU].present? &&
field[:TU] != field.full_field_name &&
!field[:TU].in?(SKIP_FIELD_DESCRIPTION)

if field.field_type == :Btn && field.concrete_field_type == :radio_button && field[:Opt].present?
selected_option_index = (field.allowed_values || []).find_index(field.field_value)
Expand Down

0 comments on commit edb2997

Please sign in to comment.