good_job 2.3.1 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d37e613a1bbc15da2a5245b19443a220a49d69e49abd616ceb34f25bfea0ecc
4
- data.tar.gz: ab189fd086ad548dfaf0c71c39f30d9fd07a1c7fc72c3764794365ce69b027b5
3
+ metadata.gz: 9a8150ef0c4bf16e9091908964e629175bf1b3543c0955e796be67c46a842a55
4
+ data.tar.gz: 707260ea8989fa5d108b533c0b61a39741be036de397980d37a725e1e188d6f2
5
5
  SHA512:
6
- metadata.gz: add7f07d52a89171eecad11d31e3bf1f504ec72522a6f093204ee6bad8ec32a3cfa802f5d86394b5d98980ce74d3e333ef6d0a513871f4af38b782a0cffee625
7
- data.tar.gz: ddc8d64f20a5060512814676c07e647adf2711a3b1bcd0b1bfc8c8527841c9e2b1bea87a25b8e93e6b80176159d3c5fd65f54d1fa77b44e4baf1bf48fae6dc1f
6
+ metadata.gz: 9b6b1292908f04a1e1bc72a541c1e8751856b8deb836046660290d766494f94d54f37b6070b614690c59ee34849c1051a88aa5f0c66f1c5931b765d2d9e0c685
7
+ data.tar.gz: a3b6ed6bb8032e0ee772186b6846af655fee07e097bc2dc0be82185d8369141f6f14c611223c2e5c5239a2287dea4b2969d90ededb1e817b64f253a0b2b48699
data/CHANGELOG.md CHANGED
@@ -1,13 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ ## [v2.4.0](https://github.com/bensheldon/good_job/tree/v2.4.0) (2021-10-02)
4
+
5
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v2.3.1...v2.4.0)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Display schedule time relative to now. [\#394](https://github.com/bensheldon/good_job/pull/394) ([morgoth](https://github.com/morgoth))
10
+ - Display cron schedules properties in dashboard [\#391](https://github.com/bensheldon/good_job/pull/391) ([aried3r](https://github.com/aried3r))
11
+
12
+ **Fixed bugs:**
13
+
14
+ - Correct icon for alert flash [\#395](https://github.com/bensheldon/good_job/pull/395) ([morgoth](https://github.com/morgoth))
15
+
3
16
  ## [v2.3.1](https://github.com/bensheldon/good_job/tree/v2.3.1) (2021-09-30)
4
17
 
5
18
  [Full Changelog](https://github.com/bensheldon/good_job/compare/v2.3.0...v2.3.1)
6
19
 
20
+ **Fixed bugs:**
21
+
22
+ - Wrap Scheduler task execution with Rails `reloader` instead of `executor` to avoid database connection changing during code reload [\#389](https://github.com/bensheldon/good_job/pull/389) ([bensheldon](https://github.com/bensheldon))
23
+
7
24
  **Merged pull requests:**
8
25
 
9
26
  - Log Cleanup thread tests, introduce "Slow" ExampleJob type, refactor ExampleJob types, run cron and log Postgres warnings in GoodJob Development harness [\#390](https://github.com/bensheldon/good_job/pull/390) ([bensheldon](https://github.com/bensheldon))
10
- - Wrap Scheduler task execution with Rails `reloader` instead of `executor` to avoid database connection changing during code reload [\#389](https://github.com/bensheldon/good_job/pull/389) ([bensheldon](https://github.com/bensheldon))
11
27
 
12
28
  ## [v2.3.0](https://github.com/bensheldon/good_job/tree/v2.3.0) (2021-09-25)
13
29
 
@@ -1,5 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
  module GoodJob
3
3
  module ApplicationHelper
4
+ def relative_time(timestamp)
5
+ text = timestamp.future? ? "in #{time_ago_in_words(timestamp)}" : "#{time_ago_in_words(timestamp)} ago"
6
+ tag.time(text, datetime: timestamp, title: timestamp)
7
+ end
4
8
  end
5
9
  end
@@ -5,6 +5,13 @@
5
5
  <thead>
6
6
  <th>Cron Job Name</th>
7
7
  <th>Configuration</th>
8
+ <th>
9
+ Set&nbsp;
10
+ <%= tag.button "Toggle", type: "button", class: "btn btn-sm btn-outline-primary", role: "button",
11
+ data: { bs_toggle: "collapse", bs_target: ".job-properties" },
12
+ aria: { expanded: false, controls: @cron_schedules.map { |job_key, _| "##{job_key.to_param}" }.join(" ") }
13
+ %>
14
+ </th>
8
15
  <th>Class</th>
9
16
  <th>Description</th>
10
17
  <th>Next scheduled</th>
@@ -14,6 +21,21 @@
14
21
  <tr>
15
22
  <td class="font-monospace"><%= job_key %></td>
16
23
  <td class="font-monospace"><%= job[:cron] %></td>
24
+ <td>
25
+ <%=
26
+ case job[:set]
27
+ when NilClass
28
+ "None"
29
+ when Proc
30
+ "Lambda/Callable"
31
+ when Hash
32
+ tag.button("Preview", type: "button", class: "btn btn-sm btn-outline-primary", role: "button",
33
+ data: { bs_toggle: "collapse", bs_target: "##{job_key.to_param}" },
34
+ aria: { expanded: false, controls: job_key.to_param }) +
35
+ tag.pre(JSON.pretty_generate(job[:set]), id: job_key.to_param, class: "collapse job-properties")
36
+ end
37
+ %>
38
+ </td>
17
39
  <td class="font-monospace"><%= job[:class] %></td>
18
40
  <td><%= job[:description] %></td>
19
41
  <td><%= Fugit.parse_cron(job[:cron]).next_time.to_local_time %></td>
@@ -34,7 +34,7 @@
34
34
  </td>
35
35
  <td><%= execution.serialized_params['job_class'] %></td>
36
36
  <td><%= execution.queue_name %></td>
37
- <td><%= execution.scheduled_at || execution.created_at %></td>
37
+ <td><%= relative_time(execution.scheduled_at || execution.created_at) %></td>
38
38
  <td class="text-break"><%= truncate(execution.error, length: 1_000) %></td>
39
39
  <td>
40
40
  <%= tag.button "Preview", type: "button", class: "btn btn-sm btn-outline-primary", role: "button",
@@ -33,7 +33,7 @@
33
33
  </td>
34
34
  <td><%= job.job_class %></td>
35
35
  <td><%= job.queue_name %></td>
36
- <td><%= job.scheduled_at || job.created_at %></td>
36
+ <td><%= relative_time(job.scheduled_at || job.created_at) %></td>
37
37
  <td><%= job.executions_count %></td>
38
38
  <td class="text-break"><%= truncate(job.recent_error, length: 1_000) %></td>
39
39
  <td>
@@ -68,7 +68,7 @@
68
68
  </div>
69
69
  <% elsif alert %>
70
70
  <div class="alert alert-warning alert-dismissible fade show d-flex align-items-center offset-md-3 col-6" role="alert">
71
- <%= render "good_job/shared/icons/check", class: "flex-shrink-0 me-2" %>
71
+ <%= render "good_job/shared/icons/exclamation", class: "flex-shrink-0 me-2" %>
72
72
  <div><%= alert %></div>
73
73
  <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
74
74
  </div>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module GoodJob
3
3
  # GoodJob gem version.
4
- VERSION = '2.3.1'
4
+ VERSION = '2.4.0'
5
5
  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: 2.3.1
4
+ version: 2.4.0
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-09-30 00:00:00.000000000 Z
11
+ date: 2021-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob