activeadmin_jobs 0.1.2 → 0.2.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
  SHA1:
3
- metadata.gz: 07e83a90ef11938bba5c98aa29cc5ee65e82b695
4
- data.tar.gz: 1bbff96ed1503dabfe23ac695acded7e6ebc2ec5
3
+ metadata.gz: fc87fc50de20e3acb80bde2e43341217ae474d54
4
+ data.tar.gz: da28e26899d58186597c342a00354dc856a7e78f
5
5
  SHA512:
6
- metadata.gz: b1a14b6a65555f0a2675dba872ec4b7627d64f1626c8e340ee5adb0d1b10b2dd417292ec8995549352640ac947620b39fde5258bcf89d37191f52011ee97c07e
7
- data.tar.gz: dc4c0b9a912f6d61c48da615013ae30467330b2ab7676aeac0c03f37dda1984c55a26a03bc5c40475182445483ac9624404c79b4ce151a67416f288fcc9ee953
6
+ metadata.gz: 8014c32fd0bdece6b0e8e938706e977015948878ad6fc765d8374cc2f18be3f80aa3ef6c55dfbe8362411c8fed2eadbfe10a3946b8501b0b2c695b249d019140
7
+ data.tar.gz: 610cfb7a83d4588ee5aaa6ef850d5e8369a989d3fb09b5912b8d68e8f1f149c3dd1f82e3941aee42a69258cef7ef45249210f039d535f09ae70d2e20789f593c
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.2
1
+ 2.3
data/.travis.yml ADDED
@@ -0,0 +1,21 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.3.1
4
+ before_install: gem install bundler -v 1.12.5
5
+ before_script:
6
+ - "export DISPLAY=:99.0"
7
+ - "sh -e /etc/init.d/xvfb start"
8
+ - sleep 3 # give xvfb some time to start
9
+ addons:
10
+ firefox: "31.0esr"
11
+ script:
12
+ - cd spec/dummy && RAILS_ENV=test bundle exec rake db:create db:migrate
13
+ - cd ../.. && bundle exec rspec spec
14
+ deploy:
15
+ provider: rubygems
16
+ api_key:
17
+ secure: bCeyRAepiV3YsCQfwrvYgZyxm6ys1gHpRyZ1p7z8c0pYxnOzkvEJF1RDuuMwU6fo2AIQH2LqfhywfPM7NCq96P3lGqQhZmgTiiZN7603akUXdU12nx40KputjJv2DhiGtLGOv3Ju5FVgBGQtxopWhvdRB/uaAzEL71YI/TRxfaGedPD46cWYF0Vj+b2bxe5b7f06NKJ+niE0YFpAho/GVY3eTbyCzqKGVwdZcOAWXdLoIdfhUL/wLxWUXhYIuBpDun/WQM0Oe0AcWAXSl8whys7jl+R/WbWDyqTjyNID/bKg3vdRilULU8tg04s7jq+AqnjqQ4BOGjJNzvTdhLs+H3tPfljK/sJr7bmeDZLe4vxlgGUa6dlKtuKOXZE0nUuY0nG5aHTRy8Yd4QRAQX5i/qGj+WIhpRlQMP8LqlTnZfGvm+rKu+a6aaQIbYeTuqRtKzRDwq6ZDWWjkeTEUSjVuIcfY2ZuWHj2CWWpbQlwz4yBauqc7/7GTUKVrDZRxE1ljU7r3TS5vQ0k8k7Ot4fb5uUpZReEvBxhLedLdS3IDI9UCREg07t5BQ1WQ9IkDmkirXkwNkXhBbJRA2borUsUewy1xh9qvrrh2ZNHr4HhLy7gALdj0y2omo/gehWiZ5WHwTASF4KsXki13bgt8ABIcIqbCleBdh/JGeUsthlHygc=
18
+ gem: activeadmin_jobs
19
+ on:
20
+ tags: true
21
+ repo: platanus/activeadmin_jobs
data/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ### v0.2.0
6
+
7
+ #### Added
8
+
9
+ - Add .travis.yml with config to deploy on tag creation.
10
+
11
+ #### Removed
12
+
13
+ - Remove useless notified column from index/show job's views.
14
+
15
+ #### Security
16
+
17
+ - Avoid CSRF issue executing protect_from_forgery in Application Controller.
18
+
5
19
  ### v0.1.2
6
20
 
7
21
  #### Fixed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activeadmin_jobs (0.1.2)
4
+ activeadmin_jobs (0.2.0)
5
5
  activeadmin (~> 1.0.0.pre2)
6
6
  activeadmin_addons (~> 0.9, >= 0.9.2)
7
7
  devise (~> 3.5, >= 3.5.0)
@@ -45,7 +45,7 @@ GEM
45
45
  ransack (~> 1.3)
46
46
  sass-rails
47
47
  sprockets (< 4)
48
- activeadmin_addons (0.9.3)
48
+ activeadmin_addons (0.10.1)
49
49
  railties
50
50
  select2-rails (~> 3.5.9)
51
51
  xdan-datetimepicker-rails (~> 2.5.1)
@@ -70,7 +70,7 @@ GEM
70
70
  activesupport (>= 3.0.0)
71
71
  arel (6.0.3)
72
72
  bcrypt (3.1.11)
73
- bourbon (4.2.7)
73
+ bourbon (4.3.3)
74
74
  sass (~> 3.4)
75
75
  thor (~> 0.19)
76
76
  builder (3.2.2)
@@ -90,9 +90,9 @@ GEM
90
90
  coffee-script (2.4.1)
91
91
  coffee-script-source
92
92
  execjs
93
- coffee-script-source (1.10.0)
93
+ coffee-script-source (1.12.2)
94
94
  colorize (0.8.1)
95
- concurrent-ruby (1.0.2)
95
+ concurrent-ruby (1.0.5)
96
96
  daemons (1.2.3)
97
97
  database_cleaner (1.5.3)
98
98
  delayed_job (4.1.2)
@@ -113,26 +113,26 @@ GEM
113
113
  erubis (2.7.0)
114
114
  execjs (2.7.0)
115
115
  ffi (1.9.10)
116
- formtastic (3.1.4)
116
+ formtastic (3.1.5)
117
117
  actionpack (>= 3.2.13)
118
118
  formtastic_i18n (0.6.0)
119
- globalid (0.3.6)
119
+ globalid (0.3.7)
120
120
  activesupport (>= 4.1.0)
121
- has_scope (0.6.0)
122
- actionpack (>= 3.2, < 5)
123
- activesupport (>= 3.2, < 5)
121
+ has_scope (0.7.0)
122
+ actionpack (>= 4.1, < 5.1)
123
+ activesupport (>= 4.1, < 5.1)
124
124
  i18n (0.7.0)
125
- inherited_resources (1.6.0)
126
- actionpack (>= 3.2, < 5)
127
- has_scope (~> 0.6.0.rc)
128
- railties (>= 3.2, < 5)
125
+ inherited_resources (1.7.0)
126
+ actionpack (>= 3.2, < 5.1)
127
+ has_scope (~> 0.6)
128
+ railties (>= 3.2, < 5.1)
129
129
  responders
130
130
  job_notifier (1.1.1)
131
131
  colorize (~> 0.7, >= 0.7.7)
132
132
  enumerize (~> 1.0.0, ~> 1.0)
133
133
  rails (~> 4.2, >= 4.2.0)
134
134
  silencer (= 1.0.0.rc3)
135
- jquery-rails (4.1.1)
135
+ jquery-rails (4.2.2)
136
136
  rails-dom-testing (>= 1, < 3)
137
137
  railties (>= 4.2.0)
138
138
  thor (>= 0.14, < 2.0)
@@ -196,13 +196,13 @@ GEM
196
196
  rake (>= 0.8.7)
197
197
  thor (>= 0.18.1, < 2.0)
198
198
  rake (11.1.2)
199
- ransack (1.8.0)
199
+ ransack (1.8.2)
200
200
  actionpack (>= 3.0)
201
201
  activerecord (>= 3.0)
202
202
  activesupport (>= 3.0)
203
203
  i18n
204
204
  polyamorous (~> 1.3)
205
- responders (2.2.0)
205
+ responders (2.3.0)
206
206
  railties (>= 4.2.0, < 5.1)
207
207
  rspec-core (3.4.4)
208
208
  rspec-support (~> 3.4.0)
@@ -222,8 +222,8 @@ GEM
222
222
  rspec-support (~> 3.4.0)
223
223
  rspec-support (3.4.1)
224
224
  rubyzip (1.2.0)
225
- sass (3.4.22)
226
- sass-rails (5.0.5)
225
+ sass (3.4.23)
226
+ sass-rails (5.0.6)
227
227
  railties (>= 4.0.0, < 6)
228
228
  sass (~> 3.1)
229
229
  sprockets (>= 2.8, < 4.0)
@@ -237,20 +237,20 @@ GEM
237
237
  websocket (~> 1.0)
238
238
  silencer (1.0.0.rc3)
239
239
  slop (3.6.0)
240
- sprockets (3.6.3)
240
+ sprockets (3.7.1)
241
241
  concurrent-ruby (~> 1.0)
242
242
  rack (> 1, < 3)
243
- sprockets-rails (3.1.1)
243
+ sprockets-rails (3.2.0)
244
244
  actionpack (>= 4.0)
245
245
  activesupport (>= 4.0)
246
246
  sprockets (>= 3.0.0)
247
247
  sqlite3 (1.3.11)
248
248
  thor (0.19.1)
249
249
  thread_safe (0.3.5)
250
- tilt (2.0.5)
250
+ tilt (2.0.6)
251
251
  tzinfo (1.2.2)
252
252
  thread_safe (~> 0.1)
253
- warden (1.2.6)
253
+ warden (1.2.7)
254
254
  rack (>= 1.0)
255
255
  websocket (1.2.3)
256
256
  xdan-datetimepicker-rails (2.5.4)
@@ -268,6 +268,7 @@ DEPENDENCIES
268
268
  daemons
269
269
  database_cleaner
270
270
  delayed_job_active_record
271
+ jquery-ui-rails (~> 5.0.5)
271
272
  pry-rails
272
273
  quiet_assets
273
274
  rails-assets-growl (~> 1.3.1)!
@@ -276,4 +277,4 @@ DEPENDENCIES
276
277
  sqlite3
277
278
 
278
279
  BUNDLED WITH
279
- 1.12.4
280
+ 1.14.4
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Active Admin Jobs
1
+ # Active Admin Jobs [![Build Status](https://secure.travis-ci.org/platanus/activeadmin_jobs.svg?branch=master)](http://travis-ci.org/platanus/activeadmin_jobs)
2
2
 
3
3
  It's a Rails engine that allows you to play nice with [Active Job](https://github.com/rails/activejob) in [Active Admin](https://github.com/activeadmin/activeadmin) providing user feedback.
4
4
 
@@ -31,4 +31,5 @@ Gem::Specification.new do |s|
31
31
  s.add_development_dependency "daemons"
32
32
  s.add_development_dependency "delayed_job_active_record"
33
33
  s.add_development_dependency "quiet_assets"
34
+ s.add_development_dependency "jquery-ui-rails", "~> 5.0.5"
34
35
  end
data/app/admin/jobs.rb CHANGED
@@ -2,14 +2,12 @@ ActiveAdmin.register JobNotifier::Job, as: "Job" do
2
2
  actions :index, :show
3
3
 
4
4
  filter :status
5
- filter :notified
6
5
  filter :created_at
7
6
 
8
7
  index do
9
8
  id_column
10
9
  tag_column :status
11
10
  column :description
12
- bool_column :notified
13
11
  column :created_at
14
12
  actions
15
13
  end
@@ -19,12 +17,13 @@ ActiveAdmin.register JobNotifier::Job, as: "Job" do
19
17
  row :id
20
18
  tag_row :status
21
19
  row :description
22
- bool_row :notified
23
20
  row :created_at
24
21
  end
25
22
 
26
- panel JobNotifier::Job.human_attribute_name(:result) do
27
- ActiveadminJobs::JobResultRenderer.new(self).render
28
- end unless resource.result.blank?
23
+ if !resource.result.blank?
24
+ panel JobNotifier::Job.human_attribute_name(:result) do
25
+ ActiveadminJobs::JobResultRenderer.new(self).render
26
+ end
27
+ end
29
28
  end
30
29
  end
@@ -1,7 +1,3 @@
1
- JobNotifier.translations = <%= I18nDictionary.translations.to_json %>;
2
- JobNotifier.jobsUrl = "<%= AdminHelpers.jobs_url %>";
3
- console.info('translations', JobNotifier.translations);
4
-
5
1
  JobNotifier.onNotify = function(result) {
6
2
  DEFAULT_MESSAGES = {
7
3
  finished: {
@@ -18,7 +14,8 @@ JobNotifier.onNotify = function(result) {
18
14
 
19
15
  function findTranslation(jobClass, status, key) {
20
16
  try {
21
- return JobNotifier.translations[jobClass][status][key];
17
+ var translations = getTranslations();
18
+ return translations[jobClass][status][key];
22
19
  } catch(err) {
23
20
  console.info('Translation not found. Using default...', jobClass, status, key);
24
21
  }
@@ -30,9 +27,19 @@ JobNotifier.onNotify = function(result) {
30
27
  return str.replace(/\W+/g, '_').replace(/([a-z\d])([A-Z])/g, '$1_$2').toLowerCase();
31
28
  }
32
29
 
30
+ function getTranslations() {
31
+ var body = document.querySelector('body');
32
+ return JSON.parse(body.dataset.translations);
33
+ }
34
+
35
+ function getJobsUrl() {
36
+ var body = document.querySelector('body');
37
+ return body.dataset.jobsUrl;
38
+ }
39
+
33
40
  function prepareMessage(job, count) {
34
41
  var jobClass = camelToDash(job.job_class);
35
- var jobsUrl = JobNotifier.jobsUrl;
42
+ var jobsUrl = getJobsUrl();
36
43
  var msg = '';
37
44
 
38
45
  if(count == 1) {
@@ -1,4 +1,5 @@
1
1
  module ActiveadminJobs
2
2
  class ApplicationController < ActionController::Base
3
+ protect_from_forgery with: :exception
3
4
  end
4
5
  end
@@ -26,6 +26,8 @@ class ActiveAdmin::Views::Pages::Base
26
26
  admins_job_identifier = send(current_user_method).job_identifier
27
27
  @body.set_attribute "data-identifier", admins_job_identifier
28
28
  @body.set_attribute "data-root-url", "/"
29
+ @body.set_attribute "data-jobs-url", AdminHelpers.jobs_url
30
+ @body.set_attribute "data-translations", I18nDictionary.translations.to_json
29
31
  end
30
32
  end
31
33
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveadminJobs
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin_jobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Platanus
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-07-19 00:00:00.000000000 Z
13
+ date: 2017-03-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -232,6 +232,20 @@ dependencies:
232
232
  - - ">="
233
233
  - !ruby/object:Gem::Version
234
234
  version: '0'
235
+ - !ruby/object:Gem::Dependency
236
+ name: jquery-ui-rails
237
+ requirement: !ruby/object:Gem::Requirement
238
+ requirements:
239
+ - - "~>"
240
+ - !ruby/object:Gem::Version
241
+ version: 5.0.5
242
+ type: :development
243
+ prerelease: false
244
+ version_requirements: !ruby/object:Gem::Requirement
245
+ requirements:
246
+ - - "~>"
247
+ - !ruby/object:Gem::Version
248
+ version: 5.0.5
235
249
  description: It's a Rails engine that allows you to play nice with Active Job in Active
236
250
  Admin providing user feedback
237
251
  email:
@@ -245,6 +259,7 @@ files:
245
259
  - ".gitignore"
246
260
  - ".rspec"
247
261
  - ".ruby-version"
262
+ - ".travis.yml"
248
263
  - CHANGELOG.md
249
264
  - Gemfile
250
265
  - Gemfile.lock
@@ -256,7 +271,7 @@ files:
256
271
  - app/assets/images/activeadmin_jobs/.keep
257
272
  - app/assets/javascripts/activeadmin_jobs/application.js
258
273
  - app/assets/javascripts/activeadmin_jobs/base.js
259
- - app/assets/javascripts/activeadmin_jobs/growl_setup.js.erb
274
+ - app/assets/javascripts/activeadmin_jobs/growl_setup.js
260
275
  - app/assets/stylesheets/activeadmin_jobs/application.css
261
276
  - app/assets/stylesheets/activeadmin_jobs/base.scss
262
277
  - app/controllers/activeadmin_jobs/application_controller.rb
@@ -303,7 +318,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
303
318
  version: '0'
304
319
  requirements: []
305
320
  rubyforge_project:
306
- rubygems_version: 2.4.5.1
321
+ rubygems_version: 2.4.5
307
322
  signing_key:
308
323
  specification_version: 4
309
324
  summary: Gem that allows you to play nice with Active Job in Active Admin providing