good_job 1.9.5 → 1.9.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba4287705b5c3537dca930a07b02597d5c58b807346f811221c7adf6bfdd12a1
4
- data.tar.gz: 6032005f621e9c796850c18db098be248764b76ce822f2e5135e105d381d2770
3
+ metadata.gz: db147d840e981330790b1b3254d9aa40d0c9e6e9284612336e3815928c0efa38
4
+ data.tar.gz: 22d1b91b0edc67538ded7b8efd9dbdf36e4d1a06717c8e96ed09adb50188310a
5
5
  SHA512:
6
- metadata.gz: 53ac0b6e5a4729cf96338cb67dc7e599656aff108e24d8e01f8545fb8439f2a708db61764fb1bb5a83853a2e63b0879729c0b89ec4b302d20916a91befd506ee
7
- data.tar.gz: 8e1c6d319bf63b68715bfe6fbcc7bd30ca66531dbafcfd27ca3ef920d573d9b2d2454745a582501a0b845f7474c427e0493371f8ff2eb83031d16f8c4a9b67f1
6
+ metadata.gz: 352ddf2bbe0dbe7c79a650a32f37c070855d3330ecb444a79b33afbb253108bac567794959cd2a2111f10c7c2623f08a341f17211ee70c13841c783f0611ed04
7
+ data.tar.gz: 5ecbac7d33b5a6db0d8ad2f5964dadd9bc6f394eab3d6935584c5b4ab3633dadc1ed2249e99de8e532f8cd1c4cd4268a76cf7104c21f3b00bc924e8fd12ee64b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [v1.9.6](https://github.com/bensheldon/good_job/tree/v1.9.6) (2021-06-04)
4
+
5
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v1.9.5...v1.9.6)
6
+
7
+ **Closed issues:**
8
+
9
+ - Pause jobs during migration / maintenance? [\#257](https://github.com/bensheldon/good_job/issues/257)
10
+ - How to properly report errors to error tracker service [\#159](https://github.com/bensheldon/good_job/issues/159)
11
+
12
+ **Merged pull requests:**
13
+
14
+ - Add deleting jobs from UI. [\#265](https://github.com/bensheldon/good_job/pull/265) ([morgoth](https://github.com/morgoth))
15
+ - Collapse Dashboard params by default [\#263](https://github.com/bensheldon/good_job/pull/263) ([morgoth](https://github.com/morgoth))
16
+
3
17
  ## [v1.9.5](https://github.com/bensheldon/good_job/tree/v1.9.5) (2021-05-24)
4
18
 
5
19
  [Full Changelog](https://github.com/bensheldon/good_job/compare/v1.9.4...v1.9.5)
@@ -14,7 +14,7 @@ module GoodJob
14
14
  def jobs
15
15
  after_scheduled_at = params[:after_scheduled_at].present? ? Time.zone.parse(params[:after_scheduled_at]) : nil
16
16
  sql = GoodJob::Job.display_all(after_scheduled_at: after_scheduled_at, after_id: params[:after_id])
17
- .limit(params.fetch(:limit, 10))
17
+ .limit(params.fetch(:limit, 25))
18
18
  sql = sql.with_job_class(params[:job_class]) if params[:job_class]
19
19
  if params[:state]
20
20
  case params[:state]
@@ -0,0 +1,9 @@
1
+ module GoodJob
2
+ class JobsController < GoodJob::BaseController
3
+ def destroy
4
+ deleted_count = GoodJob::Job.where(id: params[:id]).delete_all
5
+ message = deleted_count.positive? ? { notice: "Job deleted" } : { alert: "Job not deleted" }
6
+ redirect_to root_path, **message
7
+ end
8
+ end
9
+ end
@@ -51,6 +51,19 @@
51
51
  </div>
52
52
  </div>
53
53
 
54
+ <% if notice %>
55
+ <div class="alert alert-success alert-dismissible fade show d-flex align-items-center offset-md-3 col-6" role="alert">
56
+ <%= render "shared/icons/check", class: "flex-shrink-0 me-2" %>
57
+ <div><%= notice %></div>
58
+ <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
59
+ </div>
60
+ <% elsif alert %>
61
+ <div class="alert alert-warning alert-dismissible fade show d-flex align-items-center offset-md-3 col-6" role="alert">
62
+ <%= render "shared/icons/check", class: "flex-shrink-0 me-2" %>
63
+ <div><%= alert %></div>
64
+ <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
65
+ </div>
66
+ <% end %>
54
67
  <%= yield %>
55
68
  </div>
56
69
  </body>
@@ -9,6 +9,7 @@
9
9
  <th>Scheduled At</th>
10
10
  <th>Error</th>
11
11
  <th>ActiveJob Params</th>
12
+ <th>Actions</th>
12
13
  </thead>
13
14
  <tbody>
14
15
  <% jobs.each do |job| %>
@@ -19,7 +20,18 @@
19
20
  <td><%= job.queue_name %></td>
20
21
  <td><%= job.scheduled_at || job.created_at %></td>
21
22
  <td><%= job.error %></td>
22
- <td><pre><%= JSON.pretty_generate(job.serialized_params) %></pre></td>
23
+ <td>
24
+ <%= tag.button "Preview", type: "button", class: "btn btn-sm btn-outline-primary", role: "button",
25
+ data: {bs_toggle: "collapse", bs_target: "##{dom_id(job, 'params')}"},
26
+ aria: {expanded: false, controls: dom_id(job, "params")}
27
+ %>
28
+ <%= tag.pre JSON.pretty_generate(job.serialized_params), id: dom_id(job, "params"), class: "collapse" %>
29
+ </td>
30
+ <td>
31
+ <%= button_to job_path(job.id), method: :delete, class: "btn btn-sm btn-outline-danger", title: "Delete job" do %>
32
+ <%= render "shared/icons/trash" %>
33
+ <% end %>
34
+ </td>
23
35
  </tr>
24
36
  <% end %>
25
37
  </tbody>
@@ -0,0 +1,4 @@
1
+ <!-- https://icons.getbootstrap.com/icons/check-circle-fill/ -->
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-circle-fill <%= local_assigns[:class] %>" viewBox="0 0 16 16">
3
+ <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z" />
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <!-- https://icons.getbootstrap.com/icons/exclamation-triangle-fill/ -->
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-exclamation-triangle-fill <%= local_assigns[:class] %>" viewBox="0 0 16 16">
3
+ <path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z" />
4
+ </svg>
@@ -0,0 +1,5 @@
1
+ <!-- https://icons.getbootstrap.com/icons/trash/ -->
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash" viewBox="0 0 16 16">
3
+ <path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z" />
4
+ <path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z" />
5
+ </svg>
@@ -1,6 +1,7 @@
1
1
  GoodJob::Engine.routes.draw do
2
2
  root to: 'dashboards#index'
3
- resources :active_jobs, only: :show
3
+ resources :active_jobs, only: %i[show]
4
+ resources :jobs, only: %i[destroy]
4
5
 
5
6
  scope controller: :assets do
6
7
  get :bootstrap_css
@@ -1,4 +1,4 @@
1
1
  module GoodJob
2
2
  # GoodJob gem version.
3
- VERSION = '1.9.5'.freeze
3
+ VERSION = '1.9.6'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: good_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.5
4
+ version: 1.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Sheldon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-24 00:00:00.000000000 Z
11
+ date: 2021-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob
@@ -327,12 +327,16 @@ files:
327
327
  - engine/app/controllers/good_job/assets_controller.rb
328
328
  - engine/app/controllers/good_job/base_controller.rb
329
329
  - engine/app/controllers/good_job/dashboards_controller.rb
330
+ - engine/app/controllers/good_job/jobs_controller.rb
330
331
  - engine/app/helpers/good_job/application_helper.rb
331
332
  - engine/app/views/good_job/active_jobs/show.html.erb
332
333
  - engine/app/views/good_job/dashboards/index.html.erb
333
334
  - engine/app/views/layouts/good_job/base.html.erb
334
335
  - engine/app/views/shared/_chart.erb
335
336
  - engine/app/views/shared/_jobs_table.erb
337
+ - engine/app/views/shared/icons/_check.html.erb
338
+ - engine/app/views/shared/icons/_exclamation.html.erb
339
+ - engine/app/views/shared/icons/_trash.html.erb
336
340
  - engine/config/routes.rb
337
341
  - engine/lib/good_job/engine.rb
338
342
  - exe/good_job