rocketjob_mission_control 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +11 -1
- data/app/assets/javascripts/rocket_job_mission_control/base.js +9 -5
- data/app/assets/javascripts/rocket_job_mission_control/datatable.js +72 -33
- data/app/assets/javascripts/rocket_job_mission_control/dirmon_entries.js +13 -9
- data/app/assets/javascripts/rocket_job_mission_control/selectize.js +6 -4
- data/lib/rocket_job_mission_control/version.rb +1 -1
- data/test/controllers/rocket_job_mission_control/application_controller_test.rb +19 -26
- data/test/controllers/rocket_job_mission_control/dirmon_entries_controller_test.rb +67 -13
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95c31dad97c24947bcd03965186d8e2e3a18d9e6
|
4
|
+
data.tar.gz: '064995269a737889937e84659e86160d8b0a7c26'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a5a5b0ce3cae2cd1964deef79a70f2d35fabe7348e4e8f01e86fe22059d0c2dad02ffd82a32bd4442cbce9d2b149b62d088b4851393d818225030ec72bdfe4d
|
7
|
+
data.tar.gz: 4fda4abf731c3c5487d7bcf2601d4b528d2ff6f887a91cb9ce059860f0802ae617ffcde72f0ec07f605ede8e6326c1cd3015f8a78e50c3e58ed3675d54f3fbb2
|
data/Rakefile
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
# Setup bundler to avoid having to run bundle exec all the time.
|
2
|
+
require 'rubygems'
|
3
|
+
require 'bundler/setup'
|
4
|
+
|
1
5
|
APP_RAKEFILE = File.expand_path('../rjmc/Rakefile', __FILE__)
|
2
6
|
load 'rails/tasks/engine.rake'
|
3
7
|
|
@@ -21,4 +25,10 @@ Rake::TestTask.new(:test) do |t|
|
|
21
25
|
t.warning = false
|
22
26
|
end
|
23
27
|
|
24
|
-
|
28
|
+
# By default run tests against all appraisals
|
29
|
+
if !ENV["APPRAISAL_INITIALIZED"] && !ENV["TRAVIS"]
|
30
|
+
require 'appraisal'
|
31
|
+
task default: 'app:appraisal'
|
32
|
+
else
|
33
|
+
task default: :test
|
34
|
+
end
|
@@ -1,12 +1,16 @@
|
|
1
|
-
|
1
|
+
'use strict';
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
$(document).ready(function () {
|
4
|
+
return toggleCanvas();
|
5
|
+
});
|
6
|
+
|
7
|
+
var toggleCanvas = function toggleCanvas() {
|
8
|
+
return $('[data-toggle=offcanvas]').click(function () {
|
5
9
|
$(this).toggleClass('visible-xs text-center');
|
6
10
|
$(this).find('i').toggleClass('fa-chevron-right fa-chevron-left');
|
7
11
|
$('.row-offcanvas').toggleClass('active');
|
8
12
|
$('#lg-menu').toggleClass('hidden-xs').toggleClass('visible-xs');
|
9
13
|
$('#xs-menu').toggleClass('visible-xs').toggleClass('hidden-xs');
|
10
14
|
return $('#btnShow').toggle();
|
11
|
-
})
|
12
|
-
;
|
15
|
+
});
|
16
|
+
};
|
@@ -1,40 +1,79 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var _createClass = function () {
|
4
|
+
function defineProperties(target, props) {
|
5
|
+
for (var i = 0; i < props.length; i++) {
|
6
|
+
var descriptor = props[i];
|
7
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
8
|
+
descriptor.configurable = true;
|
9
|
+
if ("value" in descriptor) descriptor.writable = true;
|
10
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
14
|
+
return function (Constructor, protoProps, staticProps) {
|
15
|
+
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
16
|
+
if (staticProps) defineProperties(Constructor, staticProps);
|
17
|
+
return Constructor;
|
18
|
+
};
|
19
|
+
}();
|
20
|
+
|
21
|
+
function _classCallCheck(instance, Constructor) {
|
22
|
+
if (!(instance instanceof Constructor)) {
|
23
|
+
throw new TypeError("Cannot call a class as a function");
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
var RjmcDatatable = function () {
|
28
|
+
function RjmcDatatable(table, columns, opts) {
|
29
|
+
_classCallCheck(this, RjmcDatatable);
|
30
|
+
|
3
31
|
this.reloadTable = this.reloadTable.bind(this);
|
4
|
-
if (opts == null) {
|
5
|
-
|
6
|
-
|
7
|
-
this.
|
8
|
-
this.
|
32
|
+
if (opts == null) {
|
33
|
+
opts = {};
|
34
|
+
}
|
35
|
+
this.table = $(table);
|
36
|
+
this.columns = columns;
|
37
|
+
this.ordering = opts.ordering != null ? opts.ordering : true;
|
38
|
+
this.searching = opts.searching != null ? opts.searching : true;
|
9
39
|
this.pageLength = opts.pageLength != null ? opts.pageLength : 100;
|
10
|
-
this.order
|
11
|
-
this.reload
|
40
|
+
this.order = opts.order != null ? opts.order : [];
|
41
|
+
this.reload = $("[data-behavior='reload']");
|
12
42
|
this.initializeTable();
|
13
43
|
this.setEvents();
|
14
44
|
}
|
15
45
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
46
|
+
_createClass(RjmcDatatable, [{
|
47
|
+
key: 'initializeTable',
|
48
|
+
value: function initializeTable() {
|
49
|
+
return this.data = this.table.DataTable({
|
50
|
+
pagingType: 'full_numbers',
|
51
|
+
pageLength: this.pageLength,
|
52
|
+
responsive: true,
|
53
|
+
ajax: this.table.data('source'),
|
54
|
+
processing: true,
|
55
|
+
serverSide: true,
|
56
|
+
columns: this.columns,
|
57
|
+
ordering: this.ordering,
|
58
|
+
searching: this.searching,
|
59
|
+
order: this.order
|
60
|
+
});
|
61
|
+
}
|
62
|
+
}, {
|
63
|
+
key: 'setEvents',
|
64
|
+
value: function setEvents() {
|
65
|
+
return this.reload.on('click', this.reloadTable);
|
66
|
+
}
|
67
|
+
}, {
|
68
|
+
key: 'reloadTable',
|
69
|
+
value: function reloadTable() {
|
70
|
+
var icon = this.reload.find('i');
|
71
|
+
icon.addClass('fa-spin');
|
72
|
+
return this.data.ajax.reload(function () {
|
73
|
+
return icon.removeClass('fa-spin');
|
74
|
+
});
|
75
|
+
}
|
76
|
+
}]);
|
30
77
|
|
31
|
-
|
32
|
-
|
33
|
-
}
|
34
|
-
|
35
|
-
reloadTable() {
|
36
|
-
let icon = this.reload.find('i');
|
37
|
-
icon.addClass('fa-spin');
|
38
|
-
return this.data.ajax.reload(() => icon.removeClass('fa-spin'));
|
39
|
-
}
|
40
|
-
};
|
78
|
+
return RjmcDatatable;
|
79
|
+
}();
|
@@ -1,15 +1,19 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
active_states
|
6
|
-
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
$(document).on('ready', function () {
|
4
|
+
$('.filter .state-toggle').on('change', function () {
|
5
|
+
var active_states = $('.filter :checked');
|
6
|
+
var param_string = "?";
|
7
|
+
active_states.each(function (_, state) {
|
8
|
+
return param_string += 'states[]=' + $(state).attr('id') + '&';
|
9
|
+
});
|
10
|
+
return window.location.href = window.location.href.replace(/[\?#].*|$/, param_string);
|
7
11
|
});
|
8
12
|
|
9
13
|
if ($('#properties').length) {
|
10
|
-
return $('#properties').on('click', function() {
|
11
|
-
|
12
|
-
|
14
|
+
return $('#properties').on('click', function () {
|
15
|
+
var params = $('#new_rocket_job_dirmon_entry').serialize();
|
16
|
+
var new_dirmon_path = $('#properties').data('url') + ('?' + params);
|
13
17
|
return window.location = new_dirmon_path;
|
14
18
|
});
|
15
19
|
}
|
@@ -5,43 +5,36 @@ module RocketJobMissionControl
|
|
5
5
|
def index
|
6
6
|
@time_zone = Time.zone
|
7
7
|
|
8
|
-
render
|
8
|
+
render plain: 'Time Zoned'
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
class ApplicationControllerTest < ActionController::TestCase
|
13
13
|
describe TestController do
|
14
14
|
describe '#with_time_zone' do
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
describe 'with a session present' do
|
23
|
-
describe 'that contains a time zone' do
|
24
|
-
let(:expected_time_zone) { 'America/Los_Angeles' }
|
25
|
-
let(:session_params) { {'time_zone' => expected_time_zone} }
|
26
|
-
|
27
|
-
it 'sets the time zone correctly' do
|
28
|
-
assert_equal expected_time_zone, assigns(:time_zone).name
|
29
|
-
end
|
15
|
+
it 'uses correct timezone with session and time_zone set' do
|
16
|
+
if Rails.version.to_i >= 5
|
17
|
+
session['time_zone'] = 'America/Los_Angeles'
|
18
|
+
get :index
|
19
|
+
else
|
20
|
+
get :index, {}, {'time_zone' => 'America/Los_Angeles'}
|
30
21
|
end
|
22
|
+
assert_equal 'America/Los_Angeles', assigns(:time_zone).name
|
23
|
+
end
|
31
24
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
25
|
+
it 'uses correct timezone with session, but no time_zone set' do
|
26
|
+
if Rails.version.to_i >= 5
|
27
|
+
session['user_id'] = '42'
|
28
|
+
get :index
|
29
|
+
else
|
30
|
+
get :index, {}, {'user_id' => '42'}
|
38
31
|
end
|
32
|
+
assert_equal 'UTC', assigns(:time_zone).name
|
39
33
|
end
|
40
34
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
end
|
35
|
+
it 'uses correct timezone without a session' do
|
36
|
+
get :index
|
37
|
+
assert_equal 'UTC', assigns(:time_zone).name
|
45
38
|
end
|
46
39
|
end
|
47
40
|
end
|
@@ -37,7 +37,11 @@ module RocketJobMissionControl
|
|
37
37
|
describe 'PATCH #enable' do
|
38
38
|
describe 'when transition is allowed' do
|
39
39
|
before do
|
40
|
-
|
40
|
+
if Rails.version.to_i >= 5
|
41
|
+
patch :enable, params: {id: existing_dirmon_entry.id}
|
42
|
+
else
|
43
|
+
patch :enable, id: existing_dirmon_entry.id
|
44
|
+
end
|
41
45
|
end
|
42
46
|
|
43
47
|
it do
|
@@ -52,7 +56,11 @@ module RocketJobMissionControl
|
|
52
56
|
describe 'when transition is not allowed' do
|
53
57
|
before do
|
54
58
|
existing_dirmon_entry.enable!
|
55
|
-
|
59
|
+
if Rails.version.to_i >= 5
|
60
|
+
patch :enable, params: {id: existing_dirmon_entry.id}
|
61
|
+
else
|
62
|
+
patch :enable, id: existing_dirmon_entry.id
|
63
|
+
end
|
56
64
|
end
|
57
65
|
|
58
66
|
it 'succeeds' do
|
@@ -69,7 +77,11 @@ module RocketJobMissionControl
|
|
69
77
|
describe 'when transition is allowed' do
|
70
78
|
before do
|
71
79
|
existing_dirmon_entry.enable!
|
72
|
-
|
80
|
+
if Rails.version.to_i >= 5
|
81
|
+
patch :disable, params: {id: existing_dirmon_entry.id}
|
82
|
+
else
|
83
|
+
patch :disable, id: existing_dirmon_entry.id
|
84
|
+
end
|
73
85
|
end
|
74
86
|
|
75
87
|
it do
|
@@ -83,7 +95,11 @@ module RocketJobMissionControl
|
|
83
95
|
|
84
96
|
describe 'when transition is not allowed' do
|
85
97
|
before do
|
86
|
-
|
98
|
+
if Rails.version.to_i >= 5
|
99
|
+
patch :disable, params: {id: existing_dirmon_entry.id}
|
100
|
+
else
|
101
|
+
patch :disable, id: existing_dirmon_entry.id
|
102
|
+
end
|
87
103
|
end
|
88
104
|
|
89
105
|
it 'succeeds' do
|
@@ -100,7 +116,11 @@ module RocketJobMissionControl
|
|
100
116
|
let(:entry_params) { {} }
|
101
117
|
|
102
118
|
before do
|
103
|
-
|
119
|
+
if Rails.version.to_i >= 5
|
120
|
+
get :new, params: entry_params
|
121
|
+
else
|
122
|
+
get :new, entry_params
|
123
|
+
end
|
104
124
|
end
|
105
125
|
|
106
126
|
it 'succeeds' do
|
@@ -153,7 +173,11 @@ module RocketJobMissionControl
|
|
153
173
|
describe 'PATCH #update' do
|
154
174
|
describe 'with valid parameters' do
|
155
175
|
before do
|
156
|
-
|
176
|
+
if Rails.version.to_i >= 5
|
177
|
+
patch :update, params: {id: existing_dirmon_entry.id, rocket_job_dirmon_entry: {pattern: 'the_path2', job_class_name: job_class_name}}
|
178
|
+
else
|
179
|
+
patch :update, id: existing_dirmon_entry.id, rocket_job_dirmon_entry: {pattern: 'the_path2', job_class_name: job_class_name}
|
180
|
+
end
|
157
181
|
end
|
158
182
|
|
159
183
|
it 'redirects to the updated entry' do
|
@@ -168,7 +192,11 @@ module RocketJobMissionControl
|
|
168
192
|
|
169
193
|
describe 'with invalid parameters' do
|
170
194
|
before do
|
171
|
-
|
195
|
+
if Rails.version.to_i >= 5
|
196
|
+
patch :update, params: {id: existing_dirmon_entry.id, rocket_job_dirmon_entry: {job_class_name: 'FakeAndBadJob'}}
|
197
|
+
else
|
198
|
+
patch :update, id: existing_dirmon_entry.id, rocket_job_dirmon_entry: {job_class_name: 'FakeAndBadJob'}
|
199
|
+
end
|
172
200
|
end
|
173
201
|
|
174
202
|
it 'renders the edit template' do
|
@@ -194,7 +222,11 @@ module RocketJobMissionControl
|
|
194
222
|
end
|
195
223
|
|
196
224
|
before do
|
197
|
-
|
225
|
+
if Rails.version.to_i >= 5
|
226
|
+
post :create, params: {rocket_job_dirmon_entry: dirmon_params}
|
227
|
+
else
|
228
|
+
post :create, rocket_job_dirmon_entry: dirmon_params
|
229
|
+
end
|
198
230
|
end
|
199
231
|
|
200
232
|
it 'creates the entry' do
|
@@ -233,7 +265,11 @@ module RocketJobMissionControl
|
|
233
265
|
end
|
234
266
|
|
235
267
|
before do
|
236
|
-
|
268
|
+
if Rails.version.to_i >= 5
|
269
|
+
post :create, params: {rocket_job_dirmon_entry: dirmon_params}
|
270
|
+
else
|
271
|
+
post :create, rocket_job_dirmon_entry: dirmon_params
|
272
|
+
end
|
237
273
|
end
|
238
274
|
|
239
275
|
describe 'on model attributes' do
|
@@ -251,7 +287,11 @@ module RocketJobMissionControl
|
|
251
287
|
|
252
288
|
describe 'GET #edit' do
|
253
289
|
before do
|
254
|
-
|
290
|
+
if Rails.version.to_i >= 5
|
291
|
+
get :edit, params: {id: existing_dirmon_entry.id}
|
292
|
+
else
|
293
|
+
get :edit, id: existing_dirmon_entry.id
|
294
|
+
end
|
255
295
|
end
|
256
296
|
|
257
297
|
it 'succeeds' do
|
@@ -266,7 +306,11 @@ module RocketJobMissionControl
|
|
266
306
|
describe 'GET #show' do
|
267
307
|
describe 'with an invalid id' do
|
268
308
|
before do
|
269
|
-
|
309
|
+
if Rails.version.to_i >= 5
|
310
|
+
get :show, params: {id: 42}
|
311
|
+
else
|
312
|
+
get :show, id: 42
|
313
|
+
end
|
270
314
|
end
|
271
315
|
|
272
316
|
it 'redirects' do
|
@@ -280,7 +324,11 @@ module RocketJobMissionControl
|
|
280
324
|
|
281
325
|
describe 'with a valid id' do
|
282
326
|
before do
|
283
|
-
|
327
|
+
if Rails.version.to_i >= 5
|
328
|
+
get :show, params: {id: existing_dirmon_entry.id}
|
329
|
+
else
|
330
|
+
get :show, id: existing_dirmon_entry.id
|
331
|
+
end
|
284
332
|
end
|
285
333
|
|
286
334
|
it 'succeeds' do
|
@@ -295,7 +343,13 @@ module RocketJobMissionControl
|
|
295
343
|
|
296
344
|
describe 'DELETE #destroy' do
|
297
345
|
describe 'with a valid id' do
|
298
|
-
before
|
346
|
+
before do
|
347
|
+
if Rails.version.to_i >= 5
|
348
|
+
delete :destroy, params: {id: existing_dirmon_entry.id}
|
349
|
+
else
|
350
|
+
delete :destroy, id: existing_dirmon_entry.id
|
351
|
+
end
|
352
|
+
end
|
299
353
|
|
300
354
|
it 'redirects to index' do
|
301
355
|
assert_redirected_to dirmon_entries_path
|
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: 3.0.
|
4
|
+
version: 3.0.1
|
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: 2017-03-
|
14
|
+
date: 2017-03-07 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|