rocketjob_mission_control 6.0.4 → 6.0.5
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/rocket_job_mission_control/application_helper.rb +1 -1
- data/app/models/rocket_job_mission_control/job_sanitizer.rb +5 -0
- data/lib/rocket_job_mission_control/version.rb +1 -1
- data/test/controllers/rocket_job_mission_control/dirmon_entries_controller_test.rb +13 -13
- data/test/models/rocket_job_mission_control/job_sanitizer_test.rb +9 -0
- 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: 672b98f43803c00da5285184197598c13e6d68c66e9757f4fe34bde84e0f0949
|
4
|
+
data.tar.gz: e1dff7e6033aafdb33c1b326bc7756698cc17bd773c74410c9dca1e1f00f7b1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d13db013b7dbb66845a98eaa4d009c1e30029f0783bb58836d8da48e9a430b24ceb1d27f2fef91e93ac5f1b6312b42e10aeb5ef1520305c01cb9dc01d1454ec
|
7
|
+
data.tar.gz: d1ed38f093b515a0e3aba81f45386ee8b4f56290f1da9da882fd9412d6063bc83437e8f147a8c40ee39c00e0418890a208efc592f622546e578cfd2b17284e4d
|
@@ -93,7 +93,7 @@ module RocketJobMissionControl
|
|
93
93
|
f.text_field(field_name, value: value ? value.to_json : "", class: "form-control", placeholder: '{"key1":"value1", "key2":"value2", "key3":"value3"}')
|
94
94
|
when "Array"
|
95
95
|
options = value.present? ? Array(value) : []
|
96
|
-
f.select(field_name, options_for_select(options, options), {}, {class: "selectize form-control", multiple: true})
|
96
|
+
f.select(field_name, options_for_select(options, options), {include_hidden: true}, {class: "selectize form-control", multiple: true})
|
97
97
|
else
|
98
98
|
"[#{field.type.name}]".html_safe +
|
99
99
|
f.text_field(field_name, value: value, class: "form-control", placeholder: placeholder)
|
@@ -36,6 +36,11 @@ module RocketJobMissionControl
|
|
36
36
|
target.errors.add(:properties, e.message)
|
37
37
|
value = nil
|
38
38
|
end
|
39
|
+
when "Array"
|
40
|
+
# remove blank entries from rails converted arrays when using multi-select input
|
41
|
+
if !value.blank?
|
42
|
+
value.reject! { |v| v.empty? }
|
43
|
+
end
|
39
44
|
end
|
40
45
|
|
41
46
|
if value.blank? && !value.is_a?(Hash)
|
@@ -15,9 +15,9 @@ module RocketJobMissionControl
|
|
15
15
|
|
16
16
|
let :existing_dirmon_entry do
|
17
17
|
RocketJob::DirmonEntry.create!(
|
18
|
-
name: "
|
18
|
+
name: "Existing path test",
|
19
19
|
job_class_name: job_class_name,
|
20
|
-
pattern: "
|
20
|
+
pattern: "existing_path"
|
21
21
|
)
|
22
22
|
end
|
23
23
|
|
@@ -26,9 +26,9 @@ module RocketJobMissionControl
|
|
26
26
|
let :one_dirmon_entry_for_every_state do
|
27
27
|
dirmon_entry_states.collect do |state|
|
28
28
|
RocketJob::DirmonEntry.create!(
|
29
|
-
name: "
|
29
|
+
name: "Test_for_state_#{state}",
|
30
30
|
job_class_name: job_class_name,
|
31
|
-
pattern: "
|
31
|
+
pattern: "path_for_state_#{state}",
|
32
32
|
state: state
|
33
33
|
)
|
34
34
|
end
|
@@ -375,27 +375,27 @@ module RocketJobMissionControl
|
|
375
375
|
json = JSON.parse(response.body)
|
376
376
|
expected_data = {
|
377
377
|
pending: {
|
378
|
-
"0" => " <a href=\"/dirmon_entries/#{RocketJob::DirmonEntry.pending.first.id}\">\n <i class=\"fas fa-inbox pending\" style=\"font-size: 75%\" title=\"pending\"></i>\n
|
378
|
+
"0" => " <a href=\"/dirmon_entries/#{RocketJob::DirmonEntry.pending.first.id}\">\n <i class=\"fas fa-inbox pending\" style=\"font-size: 75%\" title=\"pending\"></i>\n Test_for_state_pending\n </a>\n",
|
379
379
|
"1" => "RocketJob::Jobs::SimpleJob",
|
380
|
-
"2" => "
|
380
|
+
"2" => "path_for_state_pending",
|
381
381
|
"DT_RowClass" => "card callout callout-pending"
|
382
382
|
},
|
383
383
|
enabled: {
|
384
|
-
"0" => " <a href=\"/dirmon_entries/#{RocketJob::DirmonEntry.enabled.first.id}\">\n <i class=\"fas fa-check enabled\" style=\"font-size: 75%\" title=\"enabled\"></i>\n
|
384
|
+
"0" => " <a href=\"/dirmon_entries/#{RocketJob::DirmonEntry.enabled.first.id}\">\n <i class=\"fas fa-check enabled\" style=\"font-size: 75%\" title=\"enabled\"></i>\n Test_for_state_enabled\n </a>\n",
|
385
385
|
"1" => "RocketJob::Jobs::SimpleJob",
|
386
|
-
"2" => "
|
386
|
+
"2" => "path_for_state_enabled",
|
387
387
|
"DT_RowClass" => "card callout callout-enabled"
|
388
388
|
},
|
389
389
|
failed: {
|
390
|
-
"0" => " <a href=\"/dirmon_entries/#{RocketJob::DirmonEntry.failed.first.id}\">\n <i class=\"fas fa-exclamation-triangle failed\" style=\"font-size: 75%\" title=\"failed\"></i>\n
|
390
|
+
"0" => " <a href=\"/dirmon_entries/#{RocketJob::DirmonEntry.failed.first.id}\">\n <i class=\"fas fa-exclamation-triangle failed\" style=\"font-size: 75%\" title=\"failed\"></i>\n Test_for_state_failed\n </a>\n",
|
391
391
|
"1" => "RocketJob::Jobs::SimpleJob",
|
392
|
-
"2" => "
|
392
|
+
"2" => "path_for_state_failed",
|
393
393
|
"DT_RowClass" => "card callout callout-failed"
|
394
394
|
},
|
395
395
|
disabled: {
|
396
|
-
"0" => " <a href=\"/dirmon_entries/#{RocketJob::DirmonEntry.disabled.first.id}\">\n <i class=\"fas fa-stop disabled\" style=\"font-size: 75%\" title=\"disabled\"></i>\n
|
396
|
+
"0" => " <a href=\"/dirmon_entries/#{RocketJob::DirmonEntry.disabled.first.id}\">\n <i class=\"fas fa-stop disabled\" style=\"font-size: 75%\" title=\"disabled\"></i>\n Test_for_state_disabled\n </a>\n",
|
397
397
|
"1" => "RocketJob::Jobs::SimpleJob",
|
398
|
-
"2" => "
|
398
|
+
"2" => "path_for_state_disabled",
|
399
399
|
"DT_RowClass" => "card callout callout-disabled"
|
400
400
|
}
|
401
401
|
}
|
@@ -404,7 +404,7 @@ module RocketJobMissionControl
|
|
404
404
|
assert_equal 0, json["draw"]
|
405
405
|
assert_equal 4, json["recordsTotal"]
|
406
406
|
assert_equal 4, json["recordsFiltered"]
|
407
|
-
assert_equal [expected_data[:
|
407
|
+
assert_equal [expected_data[:disabled], expected_data[:enabled], expected_data[:failed], expected_data[:pending]], json["data"]
|
408
408
|
else
|
409
409
|
assert_equal 0, json["draw"]
|
410
410
|
assert_equal 1, json["recordsTotal"]
|
@@ -92,6 +92,15 @@ class JobSanitizerTest < Minitest::Test
|
|
92
92
|
assert_equal 0, @job.errors.count
|
93
93
|
assert_equal({hash_field: {}}, cleansed)
|
94
94
|
end
|
95
|
+
|
96
|
+
it "removes blank entries from rails converted arrays when using multi-select input" do
|
97
|
+
properties = {
|
98
|
+
array: ["", "rf@exp.com", "rm@exp.com", "lb@exp.com"]
|
99
|
+
}
|
100
|
+
cleansed = RocketJobMissionControl::JobSanitizer.sanitize(properties, @job.class, @job, false)
|
101
|
+
assert_equal 0, @job.errors.count
|
102
|
+
assert_equal({array: ["rf@exp.com", "rm@exp.com", "lb@exp.com"]}, cleansed)
|
103
|
+
end
|
95
104
|
end
|
96
105
|
end
|
97
106
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rocketjob_mission_control
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.
|
4
|
+
version: 6.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Cloutier
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2021-11-
|
14
|
+
date: 2021-11-10 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: access-granted
|