Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions app/controllers/mission_control/jobs/discards_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ def jobs_relation
end

def redirect_location
status = @job.status.presence_in(supported_job_statuses) || :failed
application_jobs_url(@application, status, **jobs_filter_param)
if @job.pending?
application_queue_path(@application, @job.queue_name)
else
status = @job.status.presence_in(supported_job_statuses) || :failed
application_jobs_url(@application, status, **jobs_filter_param)
end
end
end
3 changes: 3 additions & 0 deletions app/views/mission_control/jobs/jobs/_title.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<div class="<%= modifier_for_status(job.status) %> tag ml-4"><%= job.status %></div>
</div>
<div class="level-right">
<% if job.pending? %>
<%= render "mission_control/jobs/jobs/pending/actions", job: job %>
<% end %>
<% if job.failed? %>
<%= render "mission_control/jobs/jobs/failed/actions", job: job %>
<% end %>
Expand Down
4 changes: 4 additions & 0 deletions app/views/mission_control/jobs/jobs/pending/_actions.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="buttons is-right">
<%= button_to "Discard", application_job_discard_path(@application, job.job_id, params: jobs_filter_param), class: "button is-danger is-light mr-0",
form: { data: { turbo_confirm: "This will delete the job and can't be undone. Are you sure?" } } %>
</div>