Skip to content

Commit

Permalink
Moar fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-laa committed Oct 9, 2024
1 parent cac2df9 commit 5b2449d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app/presenters/nsm/check_answers/application_status_card.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def row_data
{
head_key: 'laa_response',
text: join_strings(*response, *edit_links, appeal_info,
*(claim.sent_back? && !claim.pending_further_information ? update_claim : []))
*(claim.sent_back? && !further_information ? update_claim : []))
}
end)
].compact
Expand Down Expand Up @@ -120,25 +120,23 @@ def update_claim
].compact
end

# rubocop:disable Metrics/AbcSize
def response
@response ||= if claim.submitted?
[]
elsif claim.granted? && claim.assessment_comment.blank?
[I18n.t('nsm.steps.view_claim.granted_response')]
elsif claim.expired?
expiry_response
elsif claim.sent_back? && claim.pending_further_information.present?
elsif claim.sent_back? && further_information.present?
further_information_response + [update_claim_button]
else
claim.assessment_comment.split("\n")
end
end
# rubocop:enable Metrics/AbcSize

def expiry_response
I18n.t('nsm.steps.view_claim.expiry_explanations',
requested: claim.further_informations.maximum(:requested_at).to_fs(:stamp),
requested: further_information.requested_at.to_fs(:stamp),
deadline: tag.strong(resubmission_deadline_text)).map(&:html_safe)
end

Expand Down Expand Up @@ -167,7 +165,8 @@ def any_changes?(type)
end

def further_information
claim.pending_further_information
# If a claim is expired, the most recent further information that we want to reference won't be pending
claim.pending_further_information || claim.further_informations.order(:requested_at).last
end

def update_claim_button
Expand Down

0 comments on commit 5b2449d

Please sign in to comment.