activeadmin-ajax_filter 0.5.0 → 0.6.0

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
  SHA256:
3
- metadata.gz: e1c3b1529c52840fb04649b4f78d20102fa2f1c7540540af12b826ef649f7724
4
- data.tar.gz: b7a810bdaf0c5d19aecc341ec2006b3f0327160117ab574685da0edf8d578807
3
+ metadata.gz: e77fef457bafe5fe3912b1dbff79a8ab07b6852f7905feeee44837a59e53b975
4
+ data.tar.gz: 4059e4a79da7e7c23f37786ce41e7b084c17f9ec667c6d2774d405cc4a14c971
5
5
  SHA512:
6
- metadata.gz: a5c3cea3ccdcbf370e84904d52c487776b91eac047c785fb38c88d020f63a9dd5a770ee6faa3994864ac9bf54dfd915a3572177c573111d4f28c9dee974e3350
7
- data.tar.gz: debfbb96573653c059a8c8c64fb0ac88110cdb8f3e6103c3529309a5fe1a763ebb425172182408e85a4fa02bb4e6a94db779c01e456becd2e4c1a2eed8af5e23
6
+ metadata.gz: 568aa9e5661d5c451c3427087c6982cb2fd102e7e74f0d2723c44f15d167ca4ce87101b613422f9c9dc7068ece7bad256312cbc3a4158dfc61fd858343a3b227
7
+ data.tar.gz: 204ca9d213b72bd784ef714e81983a04341d8c627e87477da57eb342e4a762aa5230c67cbf3b80be91fd63af797aecac63d2d966ed3cccc015948a58eb3bbd1b
@@ -0,0 +1,29 @@
1
+ name: Tests
2
+ on:
3
+ push:
4
+ branches:
5
+ - master
6
+ pull_request:
7
+ branches:
8
+ - master
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ ruby-version: ['2.7', '3.0', '3.1']
18
+
19
+ steps:
20
+ - uses: actions/checkout@v3
21
+ - name: Set up Ruby ${{ matrix.ruby-version }}
22
+ uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
23
+ with:
24
+ ruby-version: ${{ matrix.ruby-version }}
25
+ bundler-cache: true
26
+
27
+ - run: bundle install --retry=3
28
+ - run: 'bundle exec rake dummy:prepare'
29
+ - run: bundle exec rspec
data/.gitignore CHANGED
@@ -10,5 +10,6 @@
10
10
  /spec/dummy/.sass-cache
11
11
  /spec/dummy/log/*.log
12
12
  /tmp/
13
+ .DS_Store
13
14
  *.sqlite3
14
15
  *.gem
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.5
1
+ 2.7.2
data/Gemfile.lock CHANGED
@@ -5,72 +5,88 @@ PATH
5
5
  activeadmin (>= 1.0)
6
6
  coffee-rails (>= 4.1.0)
7
7
  has_scope (>= 0.6.0)
8
- rails (>= 5.0)
8
+ rails (~> 6.0)
9
9
  selectize-rails (>= 0.12.6)
10
10
 
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- actioncable (5.2.4.2)
15
- actionpack (= 5.2.4.2)
14
+ actioncable (6.1.7.3)
15
+ actionpack (= 6.1.7.3)
16
+ activesupport (= 6.1.7.3)
16
17
  nio4r (~> 2.0)
17
18
  websocket-driver (>= 0.6.1)
18
- actionmailer (5.2.4.2)
19
- actionpack (= 5.2.4.2)
20
- actionview (= 5.2.4.2)
21
- activejob (= 5.2.4.2)
19
+ actionmailbox (6.1.7.3)
20
+ actionpack (= 6.1.7.3)
21
+ activejob (= 6.1.7.3)
22
+ activerecord (= 6.1.7.3)
23
+ activestorage (= 6.1.7.3)
24
+ activesupport (= 6.1.7.3)
25
+ mail (>= 2.7.1)
26
+ actionmailer (6.1.7.3)
27
+ actionpack (= 6.1.7.3)
28
+ actionview (= 6.1.7.3)
29
+ activejob (= 6.1.7.3)
30
+ activesupport (= 6.1.7.3)
22
31
  mail (~> 2.5, >= 2.5.4)
23
32
  rails-dom-testing (~> 2.0)
24
- actionpack (5.2.4.2)
25
- actionview (= 5.2.4.2)
26
- activesupport (= 5.2.4.2)
27
- rack (~> 2.0, >= 2.0.8)
33
+ actionpack (6.1.7.3)
34
+ actionview (= 6.1.7.3)
35
+ activesupport (= 6.1.7.3)
36
+ rack (~> 2.0, >= 2.0.9)
28
37
  rack-test (>= 0.6.3)
29
38
  rails-dom-testing (~> 2.0)
30
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
31
- actionview (5.2.4.2)
32
- activesupport (= 5.2.4.2)
39
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
40
+ actiontext (6.1.7.3)
41
+ actionpack (= 6.1.7.3)
42
+ activerecord (= 6.1.7.3)
43
+ activestorage (= 6.1.7.3)
44
+ activesupport (= 6.1.7.3)
45
+ nokogiri (>= 1.8.5)
46
+ actionview (6.1.7.3)
47
+ activesupport (= 6.1.7.3)
33
48
  builder (~> 3.1)
34
49
  erubi (~> 1.4)
35
50
  rails-dom-testing (~> 2.0)
36
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
37
- activeadmin (2.7.0)
51
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
52
+ activeadmin (2.13.1)
38
53
  arbre (~> 1.2, >= 1.2.1)
39
- formtastic (~> 3.1)
54
+ formtastic (>= 3.1, < 5.0)
40
55
  formtastic_i18n (~> 0.4)
41
56
  inherited_resources (~> 1.7)
42
57
  jquery-rails (~> 4.2)
43
- kaminari (~> 1.0, >= 1.0.1)
44
- railties (>= 5.2, < 6.1)
45
- ransack (~> 2.1, >= 2.1.1)
46
- sassc-rails (~> 2.1)
47
- sprockets (>= 3.0, < 4.1)
48
- activejob (5.2.4.2)
49
- activesupport (= 5.2.4.2)
58
+ kaminari (~> 1.0, >= 1.2.1)
59
+ railties (>= 6.1, < 7.1)
60
+ ransack (>= 2.1.1, < 4)
61
+ activejob (6.1.7.3)
62
+ activesupport (= 6.1.7.3)
50
63
  globalid (>= 0.3.6)
51
- activemodel (5.2.4.2)
52
- activesupport (= 5.2.4.2)
64
+ activemodel (6.1.7.3)
65
+ activesupport (= 6.1.7.3)
53
66
  activemodel-serializers-xml (1.0.2)
54
67
  activemodel (> 5.x)
55
68
  activesupport (> 5.x)
56
69
  builder (~> 3.1)
57
- activerecord (5.2.4.2)
58
- activemodel (= 5.2.4.2)
59
- activesupport (= 5.2.4.2)
60
- arel (>= 9.0)
61
- activestorage (5.2.4.2)
62
- actionpack (= 5.2.4.2)
63
- activerecord (= 5.2.4.2)
64
- marcel (~> 0.3.1)
65
- activesupport (5.2.4.2)
70
+ activerecord (6.1.7.3)
71
+ activemodel (= 6.1.7.3)
72
+ activesupport (= 6.1.7.3)
73
+ activestorage (6.1.7.3)
74
+ actionpack (= 6.1.7.3)
75
+ activejob (= 6.1.7.3)
76
+ activerecord (= 6.1.7.3)
77
+ activesupport (= 6.1.7.3)
78
+ marcel (~> 1.0)
79
+ mini_mime (>= 1.1.0)
80
+ activesupport (6.1.7.3)
66
81
  concurrent-ruby (~> 1.0, >= 1.0.2)
67
- i18n (>= 0.7, < 2)
68
- minitest (~> 5.1)
69
- tzinfo (~> 1.1)
82
+ i18n (>= 1.6, < 2)
83
+ minitest (>= 5.1)
84
+ tzinfo (~> 2.0)
85
+ zeitwerk (~> 2.3)
70
86
  addressable (2.4.0)
71
- arbre (1.2.1)
72
- activesupport (>= 3.0.0)
73
- arel (9.0.0)
87
+ arbre (1.5.0)
88
+ activesupport (>= 3.0.0, < 7.1)
89
+ ruby2_keywords (>= 0.0.2, < 1.0)
74
90
  builder (3.2.4)
75
91
  capybara (2.7.1)
76
92
  addressable
@@ -90,125 +106,136 @@ GEM
90
106
  coffee-script-source
91
107
  execjs
92
108
  coffee-script-source (1.12.2)
93
- concurrent-ruby (1.1.6)
109
+ concurrent-ruby (1.2.2)
94
110
  crass (1.0.6)
95
111
  database_cleaner (1.8.3)
112
+ date (3.3.3)
96
113
  diff-lcs (1.3)
97
- docile (1.1.5)
114
+ docile (1.4.0)
98
115
  draper (4.0.0)
99
116
  actionpack (>= 5.0)
100
117
  activemodel (>= 5.0)
101
118
  activemodel-serializers-xml (>= 1.0)
102
119
  activesupport (>= 5.0)
103
120
  request_store (>= 1.0)
104
- erubi (1.9.0)
105
- execjs (2.7.0)
121
+ erubi (1.12.0)
122
+ execjs (2.8.1)
106
123
  factory_girl (4.5.0)
107
124
  activesupport (>= 3.0.0)
108
125
  factory_girl_rails (4.5.0)
109
126
  factory_girl (~> 4.5.0)
110
127
  railties (>= 3.0.0)
111
- ffi (1.11.1)
112
- formtastic (3.1.5)
113
- actionpack (>= 3.2.13)
114
- formtastic_i18n (0.6.0)
115
- globalid (0.4.2)
116
- activesupport (>= 4.2.0)
117
- has_scope (0.7.2)
118
- actionpack (>= 4.1)
119
- activesupport (>= 4.1)
120
- i18n (1.8.2)
128
+ ffi (1.15.5)
129
+ formtastic (4.0.0)
130
+ actionpack (>= 5.2.0)
131
+ formtastic_i18n (0.7.0)
132
+ globalid (1.1.0)
133
+ activesupport (>= 5.0)
134
+ has_scope (0.8.1)
135
+ actionpack (>= 5.2)
136
+ activesupport (>= 5.2)
137
+ i18n (1.12.0)
121
138
  concurrent-ruby (~> 1.0)
122
- inherited_resources (1.11.0)
123
- actionpack (>= 5.0, < 6.1)
139
+ inherited_resources (1.13.1)
140
+ actionpack (>= 5.2, < 7.1)
124
141
  has_scope (~> 0.6)
125
- railties (>= 5.0, < 6.1)
142
+ railties (>= 5.2, < 7.1)
126
143
  responders (>= 2, < 4)
127
- jquery-rails (4.4.0)
144
+ jquery-rails (4.5.1)
128
145
  rails-dom-testing (>= 1, < 3)
129
146
  railties (>= 4.2.0)
130
147
  thor (>= 0.14, < 2.0)
131
- json (1.8.6)
132
- kaminari (1.2.0)
148
+ kaminari (1.2.2)
133
149
  activesupport (>= 4.1.0)
134
- kaminari-actionview (= 1.2.0)
135
- kaminari-activerecord (= 1.2.0)
136
- kaminari-core (= 1.2.0)
137
- kaminari-actionview (1.2.0)
150
+ kaminari-actionview (= 1.2.2)
151
+ kaminari-activerecord (= 1.2.2)
152
+ kaminari-core (= 1.2.2)
153
+ kaminari-actionview (1.2.2)
138
154
  actionview
139
- kaminari-core (= 1.2.0)
140
- kaminari-activerecord (1.2.0)
155
+ kaminari-core (= 1.2.2)
156
+ kaminari-activerecord (1.2.2)
141
157
  activerecord
142
- kaminari-core (= 1.2.0)
143
- kaminari-core (1.2.0)
158
+ kaminari-core (= 1.2.2)
159
+ kaminari-core (1.2.2)
144
160
  launchy (2.4.3)
145
161
  addressable (~> 2.3)
146
- loofah (2.4.0)
162
+ loofah (2.20.0)
147
163
  crass (~> 1.0.2)
148
164
  nokogiri (>= 1.5.9)
149
- mail (2.7.1)
165
+ mail (2.8.1)
150
166
  mini_mime (>= 0.1.1)
151
- marcel (0.3.3)
152
- mimemagic (~> 0.3.2)
167
+ net-imap
168
+ net-pop
169
+ net-smtp
170
+ marcel (1.0.2)
153
171
  method_source (1.0.0)
154
- mime-types (3.2.2)
172
+ mime-types (3.4.1)
155
173
  mime-types-data (~> 3.2015)
156
- mime-types-data (3.2018.0812)
157
- mimemagic (0.3.5)
158
- mini_mime (1.0.2)
159
- mini_portile2 (2.4.0)
160
- minitest (5.14.0)
161
- nio4r (2.5.2)
162
- nokogiri (1.10.9)
163
- mini_portile2 (~> 2.4.0)
174
+ mime-types-data (3.2023.0218.1)
175
+ mini_mime (1.1.2)
176
+ mini_portile2 (2.8.1)
177
+ minitest (5.18.0)
178
+ net-imap (0.3.4)
179
+ date
180
+ net-protocol
181
+ net-pop (0.1.2)
182
+ net-protocol
183
+ net-protocol (0.2.1)
184
+ timeout
185
+ net-smtp (0.3.3)
186
+ net-protocol
187
+ nio4r (2.5.9)
188
+ nokogiri (1.14.3)
189
+ mini_portile2 (~> 2.8.0)
190
+ racc (~> 1.4)
164
191
  phantomjs (2.1.1.0)
165
192
  poltergeist (1.10.0)
166
193
  capybara (~> 2.1)
167
194
  cliver (~> 0.3.1)
168
195
  websocket-driver (>= 0.2.0)
169
- polyamorous (2.3.2)
170
- activerecord (>= 5.2.1)
171
196
  pry (0.13.1)
172
197
  coderay (~> 1.1)
173
198
  method_source (~> 1.0)
174
- rack (2.2.2)
175
- rack-test (1.1.0)
176
- rack (>= 1.0, < 3)
177
- rails (5.2.4.2)
178
- actioncable (= 5.2.4.2)
179
- actionmailer (= 5.2.4.2)
180
- actionpack (= 5.2.4.2)
181
- actionview (= 5.2.4.2)
182
- activejob (= 5.2.4.2)
183
- activemodel (= 5.2.4.2)
184
- activerecord (= 5.2.4.2)
185
- activestorage (= 5.2.4.2)
186
- activesupport (= 5.2.4.2)
187
- bundler (>= 1.3.0)
188
- railties (= 5.2.4.2)
199
+ racc (1.6.2)
200
+ rack (2.2.6.4)
201
+ rack-test (2.1.0)
202
+ rack (>= 1.3)
203
+ rails (6.1.7.3)
204
+ actioncable (= 6.1.7.3)
205
+ actionmailbox (= 6.1.7.3)
206
+ actionmailer (= 6.1.7.3)
207
+ actionpack (= 6.1.7.3)
208
+ actiontext (= 6.1.7.3)
209
+ actionview (= 6.1.7.3)
210
+ activejob (= 6.1.7.3)
211
+ activemodel (= 6.1.7.3)
212
+ activerecord (= 6.1.7.3)
213
+ activestorage (= 6.1.7.3)
214
+ activesupport (= 6.1.7.3)
215
+ bundler (>= 1.15.0)
216
+ railties (= 6.1.7.3)
189
217
  sprockets-rails (>= 2.0.0)
190
218
  rails-dom-testing (2.0.3)
191
219
  activesupport (>= 4.2.0)
192
220
  nokogiri (>= 1.6)
193
- rails-html-sanitizer (1.3.0)
194
- loofah (~> 2.3)
195
- railties (5.2.4.2)
196
- actionpack (= 5.2.4.2)
197
- activesupport (= 5.2.4.2)
221
+ rails-html-sanitizer (1.5.0)
222
+ loofah (~> 2.19, >= 2.19.1)
223
+ railties (6.1.7.3)
224
+ actionpack (= 6.1.7.3)
225
+ activesupport (= 6.1.7.3)
198
226
  method_source
199
- rake (>= 0.8.7)
200
- thor (>= 0.19.0, < 2.0)
227
+ rake (>= 12.2)
228
+ thor (~> 1.0)
201
229
  rake (12.3.3)
202
- ransack (2.3.2)
203
- activerecord (>= 5.2.1)
204
- activesupport (>= 5.2.1)
230
+ ransack (3.2.1)
231
+ activerecord (>= 6.1.5)
232
+ activesupport (>= 6.1.5)
205
233
  i18n
206
- polyamorous (= 2.3.2)
207
234
  request_store (1.5.0)
208
235
  rack (>= 1.4)
209
- responders (3.0.0)
210
- actionpack (>= 5.0)
211
- railties (>= 5.0)
236
+ responders (3.1.0)
237
+ actionpack (>= 5.2)
238
+ railties (>= 5.2)
212
239
  rspec (3.9.0)
213
240
  rspec-core (~> 3.9.0)
214
241
  rspec-expectations (~> 3.9.0)
@@ -230,7 +257,8 @@ GEM
230
257
  rspec-mocks (~> 3.9.0)
231
258
  rspec-support (~> 3.9.0)
232
259
  rspec-support (3.9.2)
233
- sassc (2.2.1)
260
+ ruby2_keywords (0.0.5)
261
+ sassc (2.4.0)
234
262
  ffi (~> 1.9)
235
263
  sassc-rails (2.1.2)
236
264
  railties (>= 4.0.0)
@@ -239,32 +267,36 @@ GEM
239
267
  sprockets-rails
240
268
  tilt
241
269
  selectize-rails (0.12.6)
242
- simplecov (0.11.1)
243
- docile (~> 1.1.0)
244
- json (~> 1.8)
245
- simplecov-html (~> 0.10.0)
246
- simplecov-html (0.10.0)
247
- sprockets (4.0.0)
270
+ simplecov (0.22.0)
271
+ docile (~> 1.1)
272
+ simplecov-html (~> 0.11)
273
+ simplecov_json_formatter (~> 0.1)
274
+ simplecov-html (0.12.3)
275
+ simplecov_json_formatter (0.1.4)
276
+ sprockets (4.2.0)
248
277
  concurrent-ruby (~> 1.0)
249
- rack (> 1, < 3)
250
- sprockets-rails (3.2.1)
251
- actionpack (>= 4.0)
252
- activesupport (>= 4.0)
278
+ rack (>= 2.2.4, < 4)
279
+ sprockets-rails (3.4.2)
280
+ actionpack (>= 5.2)
281
+ activesupport (>= 5.2)
253
282
  sprockets (>= 3.0.0)
254
- sqlite3 (1.3.11)
283
+ sqlite3 (1.6.2)
284
+ mini_portile2 (~> 2.8.0)
255
285
  temping (3.3.0)
256
286
  activerecord (>= 3.1)
257
287
  activesupport (>= 3.1)
258
- thor (1.0.1)
259
- thread_safe (0.3.6)
260
- tilt (2.0.10)
261
- tzinfo (1.2.6)
262
- thread_safe (~> 0.1)
263
- websocket-driver (0.7.1)
288
+ thor (1.2.1)
289
+ tilt (2.1.0)
290
+ timeout (0.3.2)
291
+ tzinfo (2.0.6)
292
+ concurrent-ruby (~> 1.0)
293
+ webrick (1.8.1)
294
+ websocket-driver (0.7.5)
264
295
  websocket-extensions (>= 0.1.0)
265
- websocket-extensions (0.1.4)
296
+ websocket-extensions (0.1.5)
266
297
  xpath (2.0.0)
267
298
  nokogiri (~> 1.3)
299
+ zeitwerk (2.6.7)
268
300
 
269
301
  PLATFORMS
270
302
  ruby
@@ -286,8 +318,9 @@ DEPENDENCIES
286
318
  rspec-rails (~> 3.3)
287
319
  sassc-rails
288
320
  selectize-rails (>= 0.11.2)
289
- sqlite3 (~> 1.3, >= 1.3.11)
321
+ sqlite3 (~> 1.4)
290
322
  temping (~> 3.3, >= 3.3.0)
323
+ webrick
291
324
 
292
325
  BUNDLED WITH
293
326
  1.17.2
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/activeadmin-ajax_filter.svg)](https://badge.fury.io/rb/activeadmin-ajax_filter)
2
- [![Build Status](https://travis-ci.org/holyketzer/activeadmin-ajax_filter.svg?branch=master)](https://travis-ci.org/holyketzer/activeadmin-ajax_filter)
2
+ [![Build Status](https://github.com/holyketzer/activeadmin-ajax_filter/actions/workflows/main.yaml/badge.svg)](https://github.com/holyketzer/activeadmin-ajax_filter/actions)
3
3
  [![Code Climate](https://codeclimate.com/github/holyketzer/activeadmin-ajax_filter/badges/gpa.svg)](https://codeclimate.com/github/holyketzer/activeadmin-ajax_filter)
4
4
  [![Test Coverage](https://codeclimate.com/github/holyketzer/activeadmin-ajax_filter/badges/coverage.svg)](https://codeclimate.com/github/holyketzer/activeadmin-ajax_filter/coverage)
5
5
 
@@ -12,7 +12,9 @@ This gem extends ActiveAdmin so that your can use filters with AJAX-powered inpu
12
12
 
13
13
  ## Prerequisites
14
14
 
15
- Minimum Ruby version `2.5`
15
+ Minimum Ruby version `2.7`
16
+
17
+ ### Notes for `v0.5.0` (Ruby `2.5`)
16
18
 
17
19
  This extension assumes that you're using [Active Admin](https://github.com/activeadmin/activeadmin) with [Ransack](https://github.com/activerecord-hackery/ransack). And for AJAX input it uses [selectize-rails](https://github.com/manuelvanrijn/selectize-rails)
18
20
 
@@ -100,6 +102,8 @@ You can use next parameters in `data` hash:
100
102
  * `ajax_search_fields` - array of field names. `ajax_select` input depends on `ajax_search_fields` values: e.g. you can scope user by languages.
101
103
  * `static_ransack` - hash of ransack predicates which will be applied statically and independently from current input field value
102
104
  * `min_chars_count_to_request` - minimal count of chars in the input field to make an AJAX request
105
+ * `placeholder` - input field placeholder.
106
+ * `close_after_select` - close search results drop-down after selected a value. Default is `false`.
103
107
 
104
108
  ### Filter by belongs_to relation fields
105
109
 
@@ -119,7 +123,7 @@ f.input :patient, as: :ajax_select, collection: [], data: {
119
123
  Ordering by related fields doesn't work, e.g. this will not work: `ordering: 'user.name ASC'`
120
124
 
121
125
 
122
- ## Caveats
126
+ ## Caveats
123
127
 
124
128
  ### Ransack _cont on Integer column
125
129
 
@@ -7,7 +7,7 @@ Gem::Specification.new do |gem|
7
7
  gem.name = 'activeadmin-ajax_filter'
8
8
  gem.version = ActiveAdmin::AjaxFilter::VERSION
9
9
  gem.authors = ['Alex Emelyanov']
10
- gem.email = ['aemelyanov@spbtv.com']
10
+ gem.email = ['holyketzer@gmail.com']
11
11
 
12
12
  gem.summary = 'AJAX filters for ActiveAdmin'
13
13
  gem.description = 'Allows to define form inputs and filters by relation for ActiveAdmin resource pages using Ransacker to dynamicaly load items while user is typing symbols in filter'
@@ -20,7 +20,7 @@ Gem::Specification.new do |gem|
20
20
  gem.require_paths = ['lib']
21
21
 
22
22
  gem.add_dependency 'activeadmin', '>= 1.0'
23
- gem.add_dependency 'rails', '>= 5.0'
23
+ gem.add_dependency 'rails', '~> 6.0'
24
24
  gem.add_dependency 'coffee-rails', '>= 4.1.0'
25
25
  gem.add_dependency 'selectize-rails', '>= 0.12.6'
26
26
  gem.add_dependency 'has_scope', '>= 0.6.0' # Force Ruby 2.1.5 support
@@ -30,7 +30,7 @@ Gem::Specification.new do |gem|
30
30
  gem.add_development_dependency 'rspec', '~> 3.3', '>= 3.3.0'
31
31
  gem.add_development_dependency 'rspec-rails', '~> 3.3'
32
32
  gem.add_development_dependency 'factory_girl_rails'
33
- gem.add_development_dependency 'sqlite3', '~> 1.3', '>= 1.3.11'
33
+ gem.add_development_dependency 'sqlite3', '~> 1.4'
34
34
  gem.add_development_dependency 'temping', '~> 3.3', '>= 3.3.0'
35
35
  gem.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
36
36
  gem.add_development_dependency 'capybara', '~> 2.1'
@@ -40,4 +40,5 @@ Gem::Specification.new do |gem|
40
40
  gem.add_development_dependency 'database_cleaner', '~> 1.5'
41
41
  gem.add_development_dependency 'launchy', '~> 2.4.3'
42
42
  gem.add_development_dependency 'pry'
43
+ gem.add_development_dependency 'webrick'
43
44
  end
@@ -7,10 +7,12 @@ $ ->
7
7
  $('.filter_ajax_select select, .ajax_select select').each (_, select) ->
8
8
  select = $(select)
9
9
  valueField = select.data('value-field')
10
+ closeAfterSelect = select.data('close-after-select') || false
10
11
  display_fields = select.data('display-fields').split(' ')
11
12
  searchFields = select.data('search-fields').split(' ')
12
13
  staticRansack = select.data('static-ransack')
13
14
  minCharsCountToRequest = select.data('min-chars-count-to-request') || 1
15
+ placeholder = select.data('placeholder') || ''
14
16
 
15
17
  ajaxFields = select.data('ajax-search-fields')
16
18
  if ajaxFields
@@ -48,6 +50,8 @@ $ ->
48
50
  select.selectize
49
51
  valueField: valueField
50
52
  labelField: display_fields[0]
53
+ closeAfterSelect: closeAfterSelect
54
+ placeholder: placeholder
51
55
  searchField: searchFields
52
56
  sortField: ordering.split(',').map (clause)->
53
57
  c = clause.trim().split(' ')
@@ -1,5 +1,5 @@
1
1
  module ActiveAdmin
2
2
  module AjaxFilter
3
- VERSION = '0.5.0'
3
+ VERSION = '0.6.0'
4
4
  end
5
5
  end
@@ -20,6 +20,8 @@ module ActiveAdmin
20
20
  'data-selected-value' => selected_value,
21
21
  'data-url' => url,
22
22
  'data-min-chars-count-to-request' => min_chars_count_to_request,
23
+ 'data-placeholder' => placeholder,
24
+ 'data-close-after-select' => close_after_select
23
25
  )
24
26
  end
25
27
 
@@ -67,6 +69,14 @@ module ActiveAdmin
67
69
  ajax_data[:min_chars_count_to_request] || 1
68
70
  end
69
71
 
72
+ def placeholder
73
+ ajax_data[:placeholder]
74
+ end
75
+
76
+ def close_after_select
77
+ ajax_data[:close_after_select] || false
78
+ end
79
+
70
80
  def ransackify(field_names)
71
81
  # Map fields refer to related tables user.name -> user_name
72
82
  field_names.map { |f| f.to_s.sub('.', '_') }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin-ajax_filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Emelyanov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-09 00:00:00.000000000 Z
11
+ date: 2023-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeadmin
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: rails
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '5.0'
33
+ version: '6.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '5.0'
40
+ version: '6.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: coffee-rails
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -176,20 +176,14 @@ dependencies:
176
176
  requirements:
177
177
  - - "~>"
178
178
  - !ruby/object:Gem::Version
179
- version: '1.3'
180
- - - ">="
181
- - !ruby/object:Gem::Version
182
- version: 1.3.11
179
+ version: '1.4'
183
180
  type: :development
184
181
  prerelease: false
185
182
  version_requirements: !ruby/object:Gem::Requirement
186
183
  requirements:
187
184
  - - "~>"
188
185
  - !ruby/object:Gem::Version
189
- version: '1.3'
190
- - - ">="
191
- - !ruby/object:Gem::Version
192
- version: 1.3.11
186
+ version: '1.4'
193
187
  - !ruby/object:Gem::Dependency
194
188
  name: temping
195
189
  requirement: !ruby/object:Gem::Requirement
@@ -322,15 +316,30 @@ dependencies:
322
316
  - - ">="
323
317
  - !ruby/object:Gem::Version
324
318
  version: '0'
319
+ - !ruby/object:Gem::Dependency
320
+ name: webrick
321
+ requirement: !ruby/object:Gem::Requirement
322
+ requirements:
323
+ - - ">="
324
+ - !ruby/object:Gem::Version
325
+ version: '0'
326
+ type: :development
327
+ prerelease: false
328
+ version_requirements: !ruby/object:Gem::Requirement
329
+ requirements:
330
+ - - ">="
331
+ - !ruby/object:Gem::Version
332
+ version: '0'
325
333
  description: Allows to define form inputs and filters by relation for ActiveAdmin
326
334
  resource pages using Ransacker to dynamicaly load items while user is typing symbols
327
335
  in filter
328
336
  email:
329
- - aemelyanov@spbtv.com
337
+ - holyketzer@gmail.com
330
338
  executables: []
331
339
  extensions: []
332
340
  extra_rdoc_files: []
333
341
  files:
342
+ - ".github/workflows/main.yaml"
334
343
  - ".gitignore"
335
344
  - ".rspec"
336
345
  - ".ruby-version"
@@ -357,7 +366,7 @@ homepage: https://github.com/holyketzer/activeadmin-ajax_filter
357
366
  licenses:
358
367
  - MIT
359
368
  metadata: {}
360
- post_install_message:
369
+ post_install_message:
361
370
  rdoc_options: []
362
371
  require_paths:
363
372
  - lib
@@ -372,8 +381,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
372
381
  - !ruby/object:Gem::Version
373
382
  version: '0'
374
383
  requirements: []
375
- rubygems_version: 3.1.3
376
- signing_key:
384
+ rubygems_version: 3.1.4
385
+ signing_key:
377
386
  specification_version: 4
378
387
  summary: AJAX filters for ActiveAdmin
379
388
  test_files: []