Browse Source

CLDC-3917: Sales BU numstair question range error message (#2984)

* Calculate legend size of date question

* Add numeric error message to numstair question
pull/2993/head
Manny Dinssa 1 week ago committed by GitHub
parent
commit
1bc39f0ed1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 9
      app/services/bulk_upload/sales/year2025/row_parser.rb
  2. 3
      app/views/form/_date_question.html.erb

9
app/services/bulk_upload/sales/year2025/row_parser.rb

@ -393,6 +393,15 @@ class BulkUpload::Sales::Year2025::RowParser
},
on: :after_log
validates :field_103,
numericality: {
greater_than_or_equal_to: 2,
less_than_or_equal_to: 10,
message: I18n.t("#{ERROR_BASE_KEY}.numeric.within_range", field: "Number of staircasing transactions", min: "2", max: "10"),
allow_blank: true,
},
on: :before_log
validate :validate_buyer1_economic_status, on: :before_log
validate :validate_buyer2_economic_status, on: :before_log
validate :validate_valid_radio_option, on: :before_log

3
app/views/form/_date_question.html.erb

@ -1,9 +1,10 @@
<%= render partial: "form/guidance/#{question.top_guidance_partial}" if question.top_guidance? %>
<% legend = legend(question, page_header, conditional) %>
<%= render partial: "components/date_picker", locals:
{
resource: @log,
question_id: question.id,
legend: { text: legend(question, page_header, conditional)[:text], size: "l", caption: caption(caption_text, page_header, conditional) },
legend: { text: legend[:text], size: legend[:size], caption: caption(caption_text, page_header, conditional) },
resource_type: @log.log_type,
hint: (question.hint_text.blank? ? "" : (question.hint_text.html_safe + "</br></br>".html_safe)) + "For example, #{date_mid_collection_year_formatted(@log.startdate).tr(' ', '/')}",
f:,

Loading…
Cancel
Save