filterrific 5.2.1 → 5.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a1fa8a5a4ff398442a2c78dea54460d53e142dca
4
- data.tar.gz: 591c17e9e1832475dbfa4bf10c74cd57b6a1a6f4
3
+ metadata.gz: 5226106f7944a5b6c08d8f568185d4e6fcf0c561
4
+ data.tar.gz: 2e4b24d697de15d10a5dddf6a7b444b5564950ed
5
5
  SHA512:
6
- metadata.gz: 71625782430ff42eb28fed1f5a8ec9ec6a5d12bf303bb0a1616e2e5313dc5be8c59dbd207b616f9a80ab94674c23a126052b211cbaa3398a657d8151d3077c09
7
- data.tar.gz: b6870c78b8d46659b75bc1b8cdcad8ac1190005fe513653e0d40c2697b6808bb44e965ac18f31678e5617b03db75ae96f24b2d25479e465d39f7468522c98fe1
6
+ metadata.gz: 7829c794eb5e1a2e19a95cbb2e9651550f8c6cb5c123709a78c5fd5658c569a2c78963144f68b07cb30de9d28372ad3bfaf0087499a91f48f2e5c0597ed09d02
7
+ data.tar.gz: 4c7894ba6c9c1e9e5cde222bd69a088761dda82ccc01c0a1c12a1db4ed9e489b1f03b008bdc09dad8563355d95f138491cc17bd5c78174f1b9f6b46c3a4f0ec9
data/CHANGELOG.md CHANGED
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7
7
 
8
8
  Filterrific major versions match the Ruby on Rails major versions they work with.
9
9
 
10
+ ## [5.2.2] - Jul. 11, 2021
11
+
12
+ * Fixed Ruby 2.7 deprecated warning when trying to regex match an Integer.
13
+ * Added ability to pass custom url parameter instead of default :filterrific.
14
+ * Added basic Aria attrs to spinner for accessibility.
15
+ * Improved concurrent ajax requests: Abort prior request when new ones are triggered.
16
+
10
17
  ## [5.2.1] - Aug. 5, 2019
11
18
 
12
19
  * Fixed issue where uncommitted code was pushed to rubygems and broke array filters.
@@ -25,8 +25,14 @@ Filterrific.submitFilterForm = function(){
25
25
  $(form).trigger('loadingFilterrificResults');
26
26
  // turn on spinner
27
27
  $('.filterrific_spinner').show();
28
+
29
+ // Abort previous ajax request
30
+ if (Filterrific.lastRequest && Filterrific.lastRequest.readyState != 4) {
31
+ Filterrific.lastRequest.abort();
32
+ }
33
+
28
34
  // Submit ajax request
29
- $.ajax({
35
+ Filterrific.lastRequest = $.ajax({
30
36
  url: url,
31
37
  data: form.serialize(),
32
38
  type: 'GET',
@@ -0,0 +1,12 @@
1
+ # Filterrific JS handling
2
+
3
+ Filterrific JS and assets can be used in a number of scenarios:
4
+
5
+ ## Rails Sprockets (asset pipeline)
6
+
7
+ ## Rails with webpacker
8
+
9
+ * https://www.reddit.com/r/rails/comments/d4o691/can_webpacker_pull_in_assets_from_a_rails_engine/
10
+
11
+ ## No JS assets, just API mode
12
+
@@ -1,3 +1,7 @@
1
+ Flexport's style guide has interesting guidelines for filter widgets:
2
+
3
+ https://www.flexport.com/design/guidelines/filtering
4
+
1
5
  All view related aspects of filterrific are handled via the view API:
2
6
 
3
7
  <%= filterrific_form_for @filterrific do |f| %>
data/doc/meta.md CHANGED
@@ -38,8 +38,8 @@ a branch for each minor version of Rails that is tested and supported.
38
38
  Sequence of a release:
39
39
 
40
40
  * finish updates in filterrific
41
- * run specs in each filterrific_demo branch (via `rake`)
42
- * when all specs pass, release filterrific (see above for steps)
41
+ * update filterrific_demo Gemfile to refer to local filterrific via path: "../filterrific"
42
+ * start the app and exercise it (currently there are no automated tests)
43
+ * when everything works as expected, release filterrific (see above for steps)
43
44
  * after new filterrific is released, add new release version to each branch in
44
- filterrific_demo and push each branch to trigger a Travis CI build for the
45
- new filterrific release.
45
+ filterrific_demo.
data/doc/scratchpad.md CHANGED
@@ -1,8 +1,38 @@
1
1
  # Filterrific scratchpad
2
2
 
3
+ ## 2021 Initiative
4
+
5
+ * Update for Rails 6
6
+ * Implement API only version (no frontend)
7
+ * Update scope docs to use AREL
8
+ * Implement/document various front end scenarios:
9
+ * React
10
+ * Stimulus
11
+ * jQuery
12
+ * sprockets/webpacker
13
+ * Thoughts: Support the rails defaults (webpacker or sprockets?) out of the box, batteries included. Document how to do everything else.
14
+ * Work through issues and pull requests
15
+
16
+ improve the filterrific frontend handling:
17
+
18
+ * Remove invocation of init, document for devs to do it manually
19
+ https://github.com/jhund/filterrific/issues/199
20
+ * Replace jquery with vanilla JS
21
+ * Provide filterrific API version
22
+ * Make compatible with Rails 6
23
+ * Remove jquery dependency, make it easier to use with webpacker, document how to do init
24
+ https://github.com/jhund/filterrific/issues/198
25
+
26
+ * Support the following js scenarios:
27
+ * Sprockets
28
+ * Webpacker
29
+ * API only (e.g., for React)
30
+
31
+
3
32
  ## TODO
4
33
 
5
34
  * add check that no filter_name conflicts with existing methods on included ActiveRecord class (See https://github.com/jhund/filterrific/issues/17)
35
+ * Update SW architecture and documentation according to Osterhuis Philosophy of software architecture/design book (mark advanced controller options as such to keep interface to learn simple)
6
36
 
7
37
  ## Travis
8
38
 
@@ -27,7 +27,7 @@ module Filterrific
27
27
  def render_filterrific_spinner
28
28
  %(
29
29
  <span class="filterrific_spinner" style="display:none;">
30
- #{ image_tag('filterrific/filterrific-spinner.gif') }
30
+ #{ image_tag('filterrific/filterrific-spinner.gif', alt: '', role: 'presentation') }
31
31
  </span>
32
32
  ).html_safe
33
33
  end
@@ -74,6 +74,7 @@ module Filterrific
74
74
  :label => sort_key.to_s.humanize,
75
75
  :sorting_scope_name => :sorted_by,
76
76
  :url_for_attrs => {},
77
+ :as => :filterrific
77
78
  }.merge(opts)
78
79
  opts.merge!(
79
80
  :html_attrs => opts[:html_attrs].with_indifferent_access,
@@ -110,7 +111,7 @@ module Filterrific
110
111
  new_filterrific_params = filterrific.to_hash
111
112
  .with_indifferent_access
112
113
  .merge(opts[:sorting_scope_name] => new_sorting)
113
- url_for_attrs = opts[:url_for_attrs].merge(:filterrific => new_filterrific_params)
114
+ url_for_attrs = opts[:url_for_attrs].merge(opts[:as] => new_filterrific_params)
114
115
  link_to(
115
116
  safe_join([opts[:label], opts[:current_sort_direction_indicator]], ' '),
116
117
  url_for(url_for_attrs),
@@ -133,7 +134,7 @@ module Filterrific
133
134
  new_filterrific_params = filterrific.to_hash
134
135
  .with_indifferent_access
135
136
  .merge(opts[:sorting_scope_name] => new_sorting)
136
- url_for_attrs = opts[:url_for_attrs].merge(:filterrific => new_filterrific_params)
137
+ url_for_attrs = opts[:url_for_attrs].merge(opts[:as] => new_filterrific_params)
137
138
  link_to(
138
139
  opts[:label],
139
140
  url_for(url_for_attrs),
@@ -101,7 +101,7 @@ module Filterrific
101
101
  # type cast Hash to OpenStruct so that nested params render correctly
102
102
  # in the form
103
103
  fp[key] = OpenStruct.new(fp[key])
104
- when val =~ integer_detector_regex
104
+ when val.is_a?(String) && val =~ integer_detector_regex
105
105
  # type cast integer
106
106
  fp[key] = fp[key].to_i
107
107
  end
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  module Filterrific
4
- VERSION = "5.2.1"
4
+ VERSION = "5.2.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: filterrific
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.1
4
+ version: 5.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jo Hund
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-06 00:00:00.000000000 Z
11
+ date: 2021-07-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Filterrific is a Rails Engine plugin that makes it easy to filter, search,
14
14
  and sort your ActiveRecord lists.
@@ -28,6 +28,7 @@ files:
28
28
  - doc/Overview diagram.graffle/image1.tiff
29
29
  - doc/development_notes/api_design.txt
30
30
  - doc/development_notes/controller_api.txt
31
+ - doc/development_notes/javascript_handling.md
31
32
  - doc/development_notes/model_api.rb
32
33
  - doc/development_notes/view_api.txt
33
34
  - doc/meta.md
@@ -66,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
67
  version: '0'
67
68
  requirements: []
68
69
  rubyforge_project:
69
- rubygems_version: 2.6.14
70
+ rubygems_version: 2.6.14.3
70
71
  signing_key:
71
72
  specification_version: 4
72
73
  summary: A Rails engine plugin for filtering ActiveRecord lists.