web47core 3.2.14 → 3.2.16
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 +4 -4
- data/app/helpers/core_card_nav_items_helper.rb +25 -0
- data/lib/app/models/command_job.rb +6 -7
- data/lib/web47core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b7ec1335fd6b59f65fc8e7ea82aba0bfb4893416d3e9c4ff27a9cac006aaaa7
|
4
|
+
data.tar.gz: 70e6f61629155390bf3b8fdfacf88b5cbc3f73cd330b51a563e059ee10b6cabe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45e10f6cf040b5d4fad26b8ca69b9373be8921f4a382d6c615c2b9cbb63bf40b0a97d55f70d992d268eba8508591120b8914ea954fc6be3490f4f7b3e0ee2da9
|
7
|
+
data.tar.gz: 1ec288fb6611a53f2389192965137f7c973092aecc78f72a4e90d100b1868d8a16f2b0133d6d155200860588bd58e181d0237bbddae44e669edc67b81163a916
|
@@ -11,6 +11,31 @@ module CoreCardNavItemsHelper
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
+
# @abstract Link to the jobs icon
|
15
|
+
# @return HTML - The HTML for the given tag
|
16
|
+
def jobs_nav_link(obj, path, title: 'Jobs')
|
17
|
+
return unless can?(:view, obj)
|
18
|
+
|
19
|
+
card_nav_item_link(path, title, 'stack-overflow')
|
20
|
+
end
|
21
|
+
|
22
|
+
# @abstract Link to the jobs icon
|
23
|
+
# @return HTML - The HTML for the given tag
|
24
|
+
def current_job_nav_link(obj, path, title: 'Current Job')
|
25
|
+
return unless can?(:view, obj)
|
26
|
+
|
27
|
+
card_nav_item_link(path, title, 'run')
|
28
|
+
end
|
29
|
+
|
30
|
+
# @abstract Link to the jobs icon
|
31
|
+
# @return HTML - The HTML for the given tag
|
32
|
+
def start_job_nav_link(obj, path, title: 'Start', confirm: nil)
|
33
|
+
return unless can?(:view, obj)
|
34
|
+
|
35
|
+
confirm ||= "Are you sure you want to restart this #{obj.class_title} job?"
|
36
|
+
card_nav_item_link(path, title, 'play', btn_class: 'btn-success', confirm: confirm, method: :post)
|
37
|
+
end
|
38
|
+
|
14
39
|
# @abstract Link to restart, replay a given object
|
15
40
|
# @param [Object] obj - The object to operate on, for permission checks
|
16
41
|
# @param [String] path - The path/URL for the action
|
@@ -192,9 +192,8 @@ class CommandJob
|
|
192
192
|
end
|
193
193
|
end
|
194
194
|
|
195
|
-
#
|
196
|
-
#
|
197
|
-
#
|
195
|
+
# @abstract Steps to execute after a run
|
196
|
+
# @return [String] - state of the job
|
198
197
|
def after_run
|
199
198
|
case state
|
200
199
|
when STATE_RETRYING, STATE_WIP
|
@@ -204,12 +203,11 @@ class CommandJob
|
|
204
203
|
else
|
205
204
|
set finished_at: Time.now.utc
|
206
205
|
end
|
206
|
+
state
|
207
207
|
end
|
208
208
|
|
209
|
-
#
|
210
|
-
#
|
211
|
-
# Perform the command job
|
212
|
-
#
|
209
|
+
# @abstract Perform the command job
|
210
|
+
# @return [String] - state of the job
|
213
211
|
def perform
|
214
212
|
before_run
|
215
213
|
run
|
@@ -217,6 +215,7 @@ class CommandJob
|
|
217
215
|
rescue StandardError => error
|
218
216
|
log_error 'Unable to start job', error
|
219
217
|
set state: STATE_FAIL, error_message: error.message
|
218
|
+
STATE_FAIL
|
220
219
|
end
|
221
220
|
|
222
221
|
alias perform_now perform
|
data/lib/web47core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web47core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Schroeder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|