wice_grid 4.1.0 → 6.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +63 -36
  3. data/.github/dependabot.yml +36 -0
  4. data/CHANGELOG.md +14 -7
  5. data/Gemfile.lock +68 -47
  6. data/README.md +10 -13
  7. data/config/locales/cz.yml +2 -5
  8. data/config/locales/de.yml +0 -5
  9. data/config/locales/en.yml +0 -5
  10. data/config/locales/es.yml +0 -5
  11. data/config/locales/fr.yml +2 -5
  12. data/config/locales/is.yml +4 -8
  13. data/config/locales/it.yml +0 -5
  14. data/config/locales/ja.yml +0 -5
  15. data/config/locales/nl.yml +2 -5
  16. data/config/locales/pt-BR.yml +2 -5
  17. data/config/locales/pt.yml +2 -5
  18. data/config/locales/ru.yml +2 -5
  19. data/config/locales/sk.yml +2 -5
  20. data/config/locales/uk.yml +2 -5
  21. data/config/locales/zh.yml +2 -5
  22. data/gemfiles/rails_5.0.gemfile.lock +34 -26
  23. data/gemfiles/rails_5.1.gemfile.lock +35 -27
  24. data/gemfiles/rails_5.2.gemfile.lock +37 -29
  25. data/lib/wice/active_record_column_wrapper.rb +10 -0
  26. data/lib/wice/columns/column_custom_dropdown.rb +14 -4
  27. data/lib/wice/grid_renderer.rb +3 -3
  28. data/lib/wice/table_column_matrix.rb +2 -1
  29. data/lib/wice/wice_grid_controller.rb +1 -51
  30. data/lib/wice_grid.rb +1 -1
  31. data/package.json +18 -0
  32. data/spec/acceptance_helper.rb +1 -0
  33. data/spec/features/auto_reloads2_request_spec.rb +18 -1
  34. data/spec/features/auto_reloads_request_spec.rb +19 -3
  35. data/spec/features/custom_filters1_request_spec.rb +5 -24
  36. data/spec/features/custom_filters2_request_spec.rb +4 -26
  37. data/spec/features/custom_filters3_request_spec.rb +3 -19
  38. data/spec/features/detached_filters_spec.rb +1 -1
  39. data/spec/features/detached_filters_two_grids_spec.rb +10 -2
  40. data/spec/features/shared_detached_filters.rb +18 -1
  41. data/vendor/assets/javascripts/wice_grid_processor.js.coffee +3 -3
  42. data/wice_grid.gemspec +14 -12
  43. metadata +56 -36
  44. data/.travis.yml +0 -22
  45. data/TODO.md +0 -16
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'acceptance_helper'
3
3
 
4
- describe 'auto reloads 2 WiceGrid', type: :request, js: true do
4
+ describe 'auto reloads 2 WiceGrid', type: :feature, js: true do
5
5
  before :each do
6
6
  visit '/auto_reloads2'
7
7
  end
@@ -153,10 +153,18 @@ describe 'auto reloads 2 WiceGrid', type: :request, js: true do
153
153
  click_on 'Title'
154
154
  end
155
155
 
156
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child td.sorted' do
157
+ expect(page).to have_content('ab')
158
+ end
159
+
156
160
  within '.pagination_status' do
157
161
  expect(page).to have_content('1-3 / 3')
158
162
  end
159
163
 
164
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child td.sorted' do
165
+ expect(page).to have_content('ab')
166
+ end
167
+
160
168
  expect(page).to have_content('507')
161
169
  expect(page).to have_content('508')
162
170
  expect(page).to have_content('509')
@@ -293,13 +301,18 @@ describe 'auto reloads 2 WiceGrid', type: :request, js: true do
293
301
  end
294
302
 
295
303
  it 'should negate the semantics of the text filter' do
304
+ expect(page).to have_content('sequi')
305
+ expect(page).to have_content('sed impedit iste')
306
+
296
307
  fill_in('grid_f_title_v', with: 'sed')
297
308
  select 'no', from: 'grid_f_archived'
298
309
 
310
+ expect(page).to have_no_content('sequi')
299
311
  expect(page).to have_content('sed impedit iste')
300
312
 
301
313
  find(:css, '#grid_f_title_n').click
302
314
 
315
+ expect(page).to have_content('sequi')
303
316
  expect(page).to have_no_content('sed impedit iste')
304
317
  end
305
318
 
@@ -341,6 +354,10 @@ describe 'auto reloads 2 WiceGrid', type: :request, js: true do
341
354
  expect(page).to have_content('corporis expedita vel')
342
355
  expect(page).to have_content('sed impedit iste')
343
356
 
357
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child td.active-filter' do
358
+ expect(page).to have_content('sed impedit iste')
359
+ end
360
+
344
361
  find(:css, '.wg-external-reset-button').click
345
362
  within '.pagination_status' do
346
363
  expect(page).to have_content('1-20 / 50')
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'acceptance_helper'
3
3
 
4
- describe 'auto reloads WiceGrid', type: :request, js: true do
4
+ describe 'auto reloads WiceGrid', type: :feature, js: true do
5
5
  before :each do
6
6
  visit '/auto_reloads'
7
7
  end
@@ -154,6 +154,10 @@ describe 'auto reloads WiceGrid', type: :request, js: true do
154
154
  click_on 'Title'
155
155
  end
156
156
 
157
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child td.sorted' do
158
+ expect(page).to have_content('ab')
159
+ end
160
+
157
161
  within '.pagination_status' do
158
162
  expect(page).to have_content('1-3 / 3')
159
163
  end
@@ -291,15 +295,24 @@ describe 'auto reloads WiceGrid', type: :request, js: true do
291
295
  end
292
296
  end
293
297
 
294
- it 'should negate the semantics of the text filter' do
298
+ it 'should negate the semantics of the text filter' do
295
299
  fill_in('grid_f_title_v', with: 'sed')
300
+
301
+ expect(page).to have_content('sed impedit iste')
302
+ expect(page).to have_no_content('sequi')
303
+
296
304
  select 'no', from: 'grid_f_archived'
297
305
 
306
+ # Does not change the visible rows, just highlights the archived column
307
+ expect(page).to have_selector('.wice-grid tbody tr td:nth-child(3).active-filter')
308
+
298
309
  expect(page).to have_content('sed impedit iste')
310
+ expect(page).to have_no_content('sequi')
299
311
 
300
312
  find(:css, '#grid_f_title_n').click
301
313
 
302
314
  expect(page).to have_no_content('sed impedit iste')
315
+ expect(page).to have_content('sequi')
303
316
  end
304
317
 
305
318
  it 'should reload the title filter' do
@@ -337,8 +350,11 @@ describe 'auto reloads WiceGrid', type: :request, js: true do
337
350
  expect(page).to have_content('1-2 / 2')
338
351
  end
339
352
 
353
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child td.active-filter' do
354
+ expect(page).to have_content('sed impedit iste')
355
+ end
356
+
340
357
  expect(page).to have_content('corporis expedita vel')
341
- expect(page).to have_content('sed impedit iste')
342
358
 
343
359
  find(:css, '#grid_reset_grid_icon').click
344
360
  within '.pagination_status' do
@@ -1,35 +1,16 @@
1
1
  # encoding: utf-8
2
2
  require 'acceptance_helper'
3
3
 
4
- describe 'custom_ordering WiceGrid', type: :request, js: true do
4
+ describe 'custom_ordering WiceGrid', type: :feature, js: true do
5
5
  before :each do
6
6
  visit '/custom_filters1'
7
7
  end
8
8
 
9
9
  it 'should have all options' do
10
- within '#g1_f_status' do
11
- expect(page).to have_content('Development')
12
- expect(page).to have_content('Testing')
13
- expect(page).to have_content('Production')
14
- end
15
-
16
- within '#g2_f_status' do
17
- expect(page).to have_content('Development')
18
- expect(page).to have_content('Testing')
19
- expect(page).to have_content('Production')
20
- end
21
-
22
- within '#g3_f_status' do
23
- expect(page).to have_content('development')
24
- expect(page).to have_content('testing')
25
- expect(page).to have_content('production')
26
- end
27
-
28
- within '#g4_f_status' do
29
- expect(page).to have_content('development')
30
- expect(page).to have_content('testing')
31
- expect(page).to have_content('production')
32
- end
10
+ expect(page).to have_select('g1_f_status', options: %w(-- Development Testing Production))
11
+ expect(page).to have_select('g2_f_status', options: %w(-- Development Testing Production))
12
+ expect(page).to have_select('g3_f_status', options: %w(-- development testing production))
13
+ expect(page).to have_select('g4_f_status', options: %w(-- development testing production))
33
14
  end
34
15
 
35
16
  it 'should have expand/collapse' do
@@ -1,37 +1,15 @@
1
1
  # encoding: utf-8
2
2
  require 'acceptance_helper'
3
3
 
4
- describe 'custom_ordering WiceGrid', type: :request, js: true do
4
+ describe 'custom_ordering WiceGrid', type: :feature, js: true do
5
5
  before :each do
6
6
  visit '/custom_filters2'
7
7
  end
8
8
 
9
9
  it 'should have all options' do
10
- within '#grid_f_priorities_name' do
11
- expect(page).to have_content('Anecdotic')
12
- expect(page).to have_content('High')
13
- expect(page).to have_content('Low')
14
- expect(page).to have_content('Normal')
15
- expect(page).to have_content('Urgent')
16
- end
17
-
18
- within '#grid_f_status_id' do
19
- expect(page).to have_content('Assigned')
20
- expect(page).to have_content('Cancelled')
21
- expect(page).to have_content('Closed')
22
- expect(page).to have_content('Duplicate')
23
- expect(page).to have_content('New')
24
- expect(page).to have_content('Postponed')
25
- expect(page).to have_content('Resolved')
26
- expect(page).to have_content('Started')
27
- expect(page).to have_content('Verified')
28
- end
29
-
30
- within '#grid_f_project_id' do
31
- expect(page).to have_content('Divine Firmware')
32
- expect(page).to have_content('Super Game')
33
- expect(page).to have_content('Ultimate Website')
34
- end
10
+ expect(page).to have_select('grid_f_priorities_name', options: %w(-- Anecdotic High Low Normal Urgent))
11
+ expect(page).to have_select('grid_f_status_id', options: %w(-- Assigned Cancelled Closed Duplicate New Postponed Resolved Started Verified))
12
+ expect(page).to have_select('grid_f_project_id', options: ['--', 'Divine Firmware', 'Super Game', 'Ultimate Website'])
35
13
  end
36
14
 
37
15
  it 'should filter by custom filters' do
@@ -1,30 +1,14 @@
1
1
  # encoding: utf-8
2
2
  require 'acceptance_helper'
3
3
 
4
- describe 'custom_ordering WiceGrid', type: :request, js: true do
4
+ describe 'custom_ordering WiceGrid', type: :feature, js: true do
5
5
  before :each do
6
6
  visit '/custom_filters3'
7
7
  end
8
8
 
9
9
  it 'should have all options' do
10
- within '#grid_f_expected_version_id' do
11
- expect(page).to have_content('1.0')
12
- expect(page).to have_content('2.0')
13
- expect(page).to have_content('1.2')
14
- end
15
-
16
- within '#grid_f_versions_name' do
17
- expect(page).to have_content('1.0')
18
- expect(page).to have_content('1.1')
19
- expect(page).to have_content('1.2')
20
- expect(page).to have_content('2.0')
21
- expect(page).to have_content('3.0')
22
- expect(page).to have_content('6.0')
23
- expect(page).to have_content('7.1')
24
- expect(page).to have_content('8.0')
25
- expect(page).to have_content('88.1')
26
- expect(page).to have_content('99.0')
27
- end
10
+ expect(page).to have_select('grid_f_expected_version_id', options: %w(-- 1.0 2.0 1.2))
11
+ expect(page).to have_select('grid_f_versions_name', options: %w(-- 1.0 1.1 1.2 2.0 3.0 6.0 7.1 8.0 88.1 99.0))
28
12
  end
29
13
 
30
14
  it 'should filter by custom fields' do
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'acceptance_helper'
3
3
 
4
- describe 'buttons WiceGrid', type: :request, js: true do
4
+ describe 'buttons WiceGrid', type: :feature, js: true do
5
5
  before :each do
6
6
  visit '/detached_filters'
7
7
  end
@@ -1,12 +1,12 @@
1
1
  # encoding: utf-8
2
2
  require 'acceptance_helper'
3
3
 
4
- describe 'buttons WiceGrid', type: :request, js: true do
4
+ describe 'buttons WiceGrid', type: :feature, js: true do
5
5
  before :each do
6
6
  visit '/detached_filters_two_grids'
7
7
  end
8
8
 
9
- it 'should be independant of each other' do
9
+ it 'should be independent of each other' do
10
10
  select 'yes', from: 'grid_f_archived'
11
11
 
12
12
  find(:css, '.external-buttons-grid1 .wg-external-submit-button').click
@@ -50,6 +50,10 @@ describe 'buttons WiceGrid', type: :request, js: true do
50
50
 
51
51
  find(:css, '.external-buttons-grid1 .wg-external-reset-button').click
52
52
 
53
+ expect(page).to have_select('grid_f_archived', selected: '--')
54
+ expect(page).to have_selector('#grid_f_due_date_fr_date_placeholder:not([value])')
55
+ expect(page).to have_selector('#grid_f_due_date_to_date_placeholder:not([value])')
56
+
53
57
  within 'div#grid.wice-grid-container .pagination_status' do
54
58
  expect(page).to have_content('1-20 / 50')
55
59
  end
@@ -60,6 +64,10 @@ describe 'buttons WiceGrid', type: :request, js: true do
60
64
 
61
65
  find(:css, '.external-buttons-grid2 .wg-external-reset-button').click
62
66
 
67
+ expect(page).to have_select('grid2_f_archived', selected: '--')
68
+ expect(page).to have_selector('#grid2_f_due_date_fr_date_placeholder:not([value])')
69
+ expect(page).to have_selector('#grid2_f_due_date_to_date_placeholder:not([value])')
70
+
63
71
  within 'div#grid.wice-grid-container .pagination_status' do
64
72
  expect(page).to have_content('1-20 / 50')
65
73
  end
@@ -74,12 +74,19 @@ shared_examples "detached_filters" do
74
74
  click_on 'ID'
75
75
  end
76
76
 
77
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child td.active-filter' do
78
+ expect(page).to have_content('sed impedit iste')
79
+ end
80
+
77
81
  within '.pagination_status' do
78
82
  expect(page).to have_content('1-2 / 2')
79
83
  end
80
84
 
85
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child td.active-filter' do
86
+ expect(page).to have_content('sed impedit iste')
87
+ end
88
+
81
89
  expect(page).to have_content('corporis expedita vel')
82
- expect(page).to have_content('sed impedit iste')
83
90
 
84
91
  click_button('Reset')
85
92
  within '.pagination_status' do
@@ -118,6 +125,10 @@ shared_examples "detached_filters" do
118
125
 
119
126
  expect(page).to have_selector('.pagination_status', text: '1-12 / 12')
120
127
 
128
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child td.active-filter' do
129
+ expect(page).to have_content('Velit atque sapiente aspernatur sint fuga.')
130
+ end
131
+
121
132
  expect(page).to have_content('Adipisci voluptate sed esse velit.')
122
133
  expect(page).to have_content('Ad sunt vel maxime labore temporibus incidunt quidem.')
123
134
 
@@ -138,17 +149,23 @@ shared_examples "detached_filters" do
138
149
 
139
150
  expect(page).to have_content('Inventore iure eos labore ipsum.')
140
151
  expect(page).to have_content('Velit atque sapiente aspernatur sint fuga.')
152
+ expect(page).to have_no_content('Eos qui est quis.')
141
153
 
142
154
  within 'div.wice-grid-container table.wice-grid thead' do
143
155
  click_on 'Description'
144
156
  end
145
157
 
158
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child' do
159
+ expect(page).to have_content('Accusamus voluptas sunt deleniti iusto dolorem repudiandae.')
160
+ end
161
+
146
162
  within '.pagination_status' do
147
163
  expect(page).to have_content('1-11 / 11')
148
164
  end
149
165
 
150
166
  expect(page).to have_content('Inventore iure eos labore ipsum.')
151
167
  expect(page).to have_content('Velit atque sapiente aspernatur sint fuga.')
168
+ expect(page).to have_no_content('Eos qui est quis.')
152
169
 
153
170
  click_button('Reset')
154
171
  within '.pagination_status' do
@@ -14,8 +14,8 @@ class WiceGridProcessor
14
14
  process : (domIdToFocus)->
15
15
  @visit @buildUrlWithParams(domIdToFocus)
16
16
 
17
- visit : (path) ->
18
- if Turbolinks?
17
+ visit : (path, use_turbolink = true) ->
18
+ if Turbolinks? and use_turbolink
19
19
  Turbolinks.visit path
20
20
  else
21
21
  window.location = path
@@ -84,7 +84,7 @@ class WiceGridProcessor
84
84
 
85
85
 
86
86
  exportToCsv : ->
87
- @visit @linkForExport
87
+ @visit @linkForExport, false
88
88
 
89
89
 
90
90
  register : (func)->
data/wice_grid.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'wice_grid'
3
- s.version = '4.1.0'
3
+ s.version = '6.1.3'
4
4
  s.authors = ['Yuri Leikind and contributors']
5
- s.email = ['patrick@yamasolutions.com']
6
- s.homepage = 'https://github.com/patricklindsay/wice_grid'
5
+ s.email = ['koulikoff@gmail.com']
6
+ s.homepage = 'https://github.com/leikind/wice_grid'
7
7
  s.summary = 'A Rails grid plugin to quickly create grids with sorting, pagination, and filters.'
8
8
  s.description = 'A Rails grid plugin to create grids with sorting, pagination, and filters generated automatically based on column types. ' \
9
9
  'The contents of the cell are up for the developer, just like one does when rendering a collection via a simple table. ' \
@@ -13,11 +13,12 @@ Gem::Specification.new do |s|
13
13
  s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
14
14
  s.license = 'MIT'
15
15
  s.require_paths = ['lib']
16
- s.date = '2018-11-28'
16
+ s.date = '2024-06-10'
17
17
 
18
- s.add_dependency 'rails', '~> 5.0', '< 5.3'
19
- s.add_dependency 'kaminari', ['~> 1.1.0']
18
+ s.add_dependency 'rails', '>= 5.0'
19
+ s.add_dependency 'kaminari', ['~> 1.1']
20
20
  s.add_dependency 'coffee-rails', ['> 3.2']
21
+ s.add_dependency 'font-awesome-sass'
21
22
 
22
23
  s.add_development_dependency('rake', '~> 10.1')
23
24
  s.add_development_dependency('byebug')
@@ -26,25 +27,26 @@ Gem::Specification.new do |s|
26
27
  s.add_development_dependency('rspec', '~> 3.6.0')
27
28
  s.add_development_dependency('rspec-rails', '~> 3.6.0')
28
29
  s.add_development_dependency('shoulda-matchers', '2.8.0')
29
- s.add_development_dependency('capybara', '~> 2.2.0')
30
+ s.add_development_dependency('capybara', '~> 3.13.2')
30
31
  s.add_development_dependency('faker', '~> 1.8.7')
31
- s.add_development_dependency('poltergeist', '~> 1.9.0')
32
+ s.add_development_dependency('poltergeist', '~> 1.18.0')
32
33
  s.add_development_dependency('capybara-screenshot', '~> 1.0.11')
33
34
  s.add_development_dependency('selenium-webdriver', '~> 2.51.0')
35
+ s.add_development_dependency('phantomjs', '>= 2.1.1')
34
36
 
35
37
  # Required by the test app.
36
38
  s.add_development_dependency('haml', '~> 5.0.4')
37
39
  s.add_development_dependency('coderay', '~> 1.1.0')
38
- s.add_development_dependency('jquery-rails', '~> 4.3.3')
39
- s.add_development_dependency('jquery-ui-rails', '~> 5.0.5')
40
+ s.add_development_dependency('jquery-rails', '~> 4.4.0')
41
+ s.add_development_dependency('jquery-ui-rails', '~> 7.0.0')
40
42
  s.add_development_dependency('jquery-ui-themes', '~> 0.0.11')
41
43
  s.add_development_dependency('sass-rails', '>= 3.2')
42
- s.add_development_dependency('bootstrap-sass', '3.1.1.1')
44
+ s.add_development_dependency('bootstrap-sass', '3.4.1')
43
45
  s.add_development_dependency('font-awesome-sass', '4.4.0')
44
46
  s.add_development_dependency('turbolinks', '~> 5.1.1')
45
47
  s.add_development_dependency('therubyracer')
46
48
 
47
- s.add_development_dependency('bundler', '~> 1.3')
49
+ s.add_development_dependency('bundler')
48
50
  s.add_development_dependency('simplecov', '~> 0.7')
49
51
  s.add_development_dependency('sqlite3', '~> 1.3')
50
52