sidekiq-tasks 0.1.5 → 0.1.6

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: d04a49b7d050c6c355d565b6fce32e27cf0682154596da6d3e3f0f041762b957
4
- data.tar.gz: bb6b5b81369db48617a240463734bca35c9a396dc170578f457e7c6ddadaf842
3
+ metadata.gz: '012139adfe0354b0f2521146f617c043aa6f940d3841827a5a8b1d68a729a4d5'
4
+ data.tar.gz: f4d1b0aa4b214a99a92fbad2b26ba39f610b1ded9d7e81524f272e93da281a05
5
5
  SHA512:
6
- metadata.gz: 7ef504991cfaacc4ed522e923e5305075507d44ce0f5afd46b74e16f95cdc3915d854ca3bed6ab0fbf440d7fa5ef2672f8fcb64e2eca38a7c68c355b84b46a06
7
- data.tar.gz: 8fda83fc3182b73e19a9a2c718366afde97667763705270ae7bdd02b9fc9a2a9cc1ad17dec341a78c204d301c583b235fe302e2c0932475aca3a5d9a0e113655
6
+ metadata.gz: 0ca5fcf42d4c2ec26ea1f67791d428418e610b24746a2599e1805b4440d3af747a21d523ebe19f01d81062f718454791ce5bfeab64073414b680a444557859c0
7
+ data.tar.gz: bb66768aa135be0b6e82dff713a5425be34a3a3a4945e017006766f6072572d26c7b1197da1fbdbd983b2daf36bb7c194634db2e6eae166e653e0a8c44bbe6a0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## Changelog
2
2
 
3
+ ### [0.1.6] - 2025-05-11
4
+
5
+ - Enable CI workflows on all branches. (#4)
6
+ - Add description to task list. (#2)
7
+ - Detect magic comment before multiline desc. (#3)
8
+ - Fix style tag rendering and plugin registration for Sidekiq Web UI 7.3+ and 8.0+. (#1)
9
+ - Enable horizontal scroll on tasks table for mobile. (#5)
10
+
3
11
  ### [0.1.5] - 2025-05-04
4
12
 
5
13
  - Add duration, status and error reports to history.
@@ -12,6 +12,7 @@ module Sidekiq
12
12
  return false if lines.nil?
13
13
 
14
14
  return true if task_has_magic_comment?(lines, line_number)
15
+ return true if desc_has_magic_comment?(task.full_comment, lines, line_number)
15
16
 
16
17
  namespace_line_index = find_namespace_line_index(lines, task)
17
18
  return false unless namespace_line_index
@@ -33,6 +34,17 @@ module Sidekiq
33
34
  raise ArgumentError, "File '#{file}' not found"
34
35
  end
35
36
 
37
+ def desc_has_magic_comment?(desc, lines, task_line)
38
+ return false unless desc&.include?("\n")
39
+
40
+ desc_line_index = lines[0...task_line].rindex { |line| line.strip.start_with?("desc") }
41
+
42
+ return false unless desc_line_index
43
+
44
+ comment_line = lines[desc_line_index - 1]&.strip
45
+ !!(comment_line =~ magic_comment_regex)
46
+ end
47
+
36
48
  def task_has_magic_comment?(lines, task_line)
37
49
  context_range = (task_line - 3..task_line).to_a.select { |i| i >= 0 }
38
50
  context_range.reverse.any? do |i|
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sidekiq
4
4
  module Tasks
5
- VERSION = "0.1.5"
5
+ VERSION = "0.1.6"
6
6
  end
7
7
  end
@@ -12,17 +12,26 @@ module Sidekiq
12
12
  end
13
13
  end
14
14
 
15
- if Sidekiq::Tasks::Web::SIDEKIQ_GTE_7_3_0
15
+ if Sidekiq::Tasks::Web::SIDEKIQ_GTE_8_0_0
16
16
  Sidekiq::Web.configure do |config|
17
17
  config.register(
18
18
  Sidekiq::Tasks::Web::Extension,
19
19
  name: "tasks",
20
- tab: ["Tasks"],
21
- index: ["tasks"],
20
+ tab: "Tasks",
21
+ index: "tasks",
22
22
  root_dir: Sidekiq::Tasks::Web::ROOT,
23
23
  asset_paths: ["js", "css"]
24
24
  )
25
25
  end
26
+ elsif Sidekiq::Tasks::Web::SIDEKIQ_GTE_7_3_0
27
+ Sidekiq::Web.register(
28
+ Sidekiq::Tasks::Web::Extension,
29
+ name: "tasks",
30
+ tab: "Tasks",
31
+ index: "tasks",
32
+ root_dir: Sidekiq::Tasks::Web::ROOT,
33
+ asset_paths: ["js", "css"]
34
+ )
26
35
  else
27
36
  Sidekiq::Web.tabs["Tasks"] = "tasks"
28
37
  Sidekiq::Web.register(Sidekiq::Tasks::Web::Extension)
data/web/locales/en.yml CHANGED
@@ -6,6 +6,7 @@ en:
6
6
  filter: "Filter"
7
7
  no_tasks: "No tasks found"
8
8
  name: "Name"
9
+ description: "Description"
9
10
  last_enqueued: "Last enqueued"
10
11
  history: "History"
11
12
  no_history: "No history"
data/web/locales/fr.yml CHANGED
@@ -6,6 +6,7 @@ fr:
6
6
  filter: "Filtrer"
7
7
  no_tasks: "Aucune tâche trouvée"
8
8
  name: "Nom"
9
+ description: "Description"
9
10
  last_enqueued: "Dernière mise en file d'attente"
10
11
  history: "Historique"
11
12
  no_history: "Aucun historique"
data/web/views/task.erb CHANGED
@@ -1,7 +1,13 @@
1
- <% if Sidekiq::Tasks::Web::SIDEKIQ_GTE_7_3_0 %>
1
+ <% if Sidekiq::Tasks::Web::SIDEKIQ_GTE_8_0_0 %>
2
2
  <% style_tag "tasks/css/ext.css" %>
3
+ <% elsif Sidekiq::Tasks::Web::SIDEKIQ_GTE_7_3_0 %>
4
+ <% add_to_head do %>
5
+ <%= style_tag "tasks/css/ext.css" %>
6
+ <% end %>
3
7
  <% else %>
4
- <link href="<%= root_path %>tasks/css/ext.css" media="screen" rel="stylesheet" type="text/css"/>
8
+ <% add_to_head do %>
9
+ <link href="<%= root_path %>tasks/css/ext.css" media="screen" rel="stylesheet" type="text/css"/>
10
+ <% end %>
5
11
  <% end %>
6
12
 
7
13
  <header class="st-header">
data/web/views/tasks.erb CHANGED
@@ -1,7 +1,13 @@
1
- <% if Sidekiq::Tasks::Web::SIDEKIQ_GTE_7_3_0 %>
1
+ <% if Sidekiq::Tasks::Web::SIDEKIQ_GTE_8_0_0 %>
2
2
  <% style_tag "tasks/css/ext.css" %>
3
+ <% elsif Sidekiq::Tasks::Web::SIDEKIQ_GTE_7_3_0 %>
4
+ <% add_to_head do %>
5
+ <%= style_tag "tasks/css/ext.css" %>
6
+ <% end %>
3
7
  <% else %>
4
- <link href="<%= root_path %>tasks/css/ext.css" media="screen" rel="stylesheet" type="text/css"/>
8
+ <% add_to_head do %>
9
+ <link href="<%= root_path %>tasks/css/ext.css" media="screen" rel="stylesheet" type="text/css"/>
10
+ <% end %>
5
11
  <% end %>
6
12
 
7
13
  <header class="st-header">
@@ -22,30 +28,34 @@
22
28
  </form>
23
29
  </header>
24
30
 
25
- <% if @search.tasks.empty? %>
26
- <%= t("no_tasks") %>
27
- <% else %>
28
- <table class="st-table">
29
- <thead>
30
- <tr>
31
- <th><%= t("name") %></th>
32
- <th><%= t("last_enqueued") %></th>
33
- </tr>
34
- </thead>
35
- <tbody>
36
- <% @search.tasks.each do |task| %>
31
+ <div class="st-table-container">
32
+ <% if @search.tasks.empty? %>
33
+ <%= t("no_tasks") %>
34
+ <% else %>
35
+ <table class="st-table">
36
+ <thead>
37
37
  <tr>
38
- <td>
39
- <a href="<%= task_url(root_path, task) %>" class="st-text-primary">
40
- <b><%= task.name %></b>
41
- </a>
42
- </td>
43
-
44
- <td><%= task.last_enqueue_at ? relative_time(task.last_enqueue_at) : "-" %></td>
38
+ <th><%= t("name") %></th>
39
+ <th><%= t("description") %></th>
40
+ <th><%= t("last_enqueued") %></th>
45
41
  </tr>
46
- <% end %>
47
- </tbody>
48
- </table>
42
+ </thead>
43
+ <tbody>
44
+ <% @search.tasks.each do |task| %>
45
+ <tr>
46
+ <td>
47
+ <a href="<%= task_url(root_path, task) %>" class="st-text-primary">
48
+ <b><%= task.name %></b>
49
+ </a>
50
+ </td>
49
51
 
50
- <%= erb(read_view(:_pagination), locals: {search: @search}) %>
51
- <% end %>
52
+ <td><%= task.desc %></td>
53
+ <td><%= task.last_enqueue_at ? relative_time(task.last_enqueue_at) : "-" %></td>
54
+ </tr>
55
+ <% end %>
56
+ </tbody>
57
+ </table>
58
+
59
+ <%= erb(read_view(:_pagination), locals: {search: @search}) %>
60
+ <% end %>
61
+ </div>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-05-04 00:00:00.000000000 Z
10
+ date: 2025-05-11 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rake