Skip to content

Commit

Permalink
refactor and render status method
Browse files Browse the repository at this point in the history
  • Loading branch information
akuppa9 committed Nov 7, 2023
1 parent 6e588ae commit ee98e3d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
16 changes: 1 addition & 15 deletions apps/dashboard/app/helpers/batch_connect/sessions_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,21 +140,7 @@ def display_choices(session)
end

def status(session)
if session.starting?
"Starting"
elsif session.running?
"Running"
elsif session.queued?
"Queued"
elsif session.held?
"Held"
elsif session.suspended?
"Suspended"
elsif session.completed?
"Completed"
else
"Undetermined"
end
render(partial: 'batch_connect/sessions/card/status', locals: { session: session })
end

def status_context(session)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<% if session.starting? %>
Starting
<% elsif session.running? %>
Running
<% elsif session.queued? %>
Queued
<% elsif session.held? %>
Held
<% elsif session.suspended? %>
Suspended
<% elsif session.completed? %>
Completed
<% else %>
Undetermined
<% end %>

0 comments on commit ee98e3d

Please sign in to comment.