Skip to content

Commit

Permalink
status tag helper
Browse files Browse the repository at this point in the history
  • Loading branch information
starswan committed Jan 23, 2025
1 parent 69919fc commit 2745c59
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/helpers/status_tag_helper.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
module StatusTagHelper
def review_section_tag(resource, form_classes)
steps = form_classes.map(&:target_name)
if steps.all? { |step| resource.in_progress_steps.include?(step.to_s) }
if steps.all? { |step| resource.in_progress_steps.include?(step.to_s) } || steps.none? { |step| step_completed?(resource, step) }
incomplete
elsif steps.all? { |step| resource.imported_steps.include?(step.to_s) }
imported
elsif form_classes.all?(&:optional?)
optional
elsif steps.none? { |step| step_completed?(resource, step) }
incomplete
elsif step_forms_contain_errors?(resource, form_classes)
action_required
else
Expand Down

0 comments on commit 2745c59

Please sign in to comment.