Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Discard action to scheduled jobs #73

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion app/helpers/mission_control/jobs/jobs_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def attribute_names_for_job_status(status)
when "failed" then [ "Error", "" ]
when "blocked" then [ "Queue", "Blocked by", "Block expiry" ]
when "finished" then [ "Queue", "Finished" ]
when "scheduled" then [ "Queue", "Scheduled" ]
when "scheduled" then [ "Queue", "Scheduled", ""]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a space missing here:

Suggested change
when "scheduled" then [ "Queue", "Scheduled", ""]
when "scheduled" then [ "Queue", "Scheduled", "" ]

I think Rubocop is complaining about that as well.

when "in_progress" then [ "Queue", "Run by", "Running for" ]
else []
end
Expand Down
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), 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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline at the end of this file.

3 changes: 3 additions & 0 deletions app/views/mission_control/jobs/jobs/scheduled/_job.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
<div class="is-danger tag ml-4">delayed</div>
<% end %>
</td>
<td class="pr-0">
<%= render "mission_control/jobs/jobs/scheduled/actions", job: job %>
</td>
1 change: 1 addition & 0 deletions test/controllers/jobs_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,6 @@ class MissionControl::Jobs::JobsControllerTest < ActionDispatch::IntegrationTest
assert_select "tr.job", 2
assert_select "tr.job", /DummyJob\s+Enqueued 2 minutes ago\s+queue_1\s+in 1 minute/
assert_select "tr.job", /DummyJob\s+Enqueued 2 minutes ago\s+queue_1\s+(1 minute ago|less than a minute ago)/
assert_select "tr.job", /Discard/
end
end
Loading