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 +4 -4
- data/.github/workflows/main.yaml +29 -0
- data/.gitignore +1 -0
- data/.ruby-version +1 -1
- data/Gemfile.lock +166 -133
- data/README.md +7 -3
- data/activeadmin-ajax_filter.gemspec +4 -3
- data/app/assets/javascripts/activeadmin-ajax_filter.js.coffee +4 -0
- data/lib/active_admin/ajax_filter/version.rb +1 -1
- data/lib/active_admin/inputs/ajax_core.rb +10 -0
- metadata +28 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e77fef457bafe5fe3912b1dbff79a8ab07b6852f7905feeee44837a59e53b975
|
4
|
+
data.tar.gz: 4059e4a79da7e7c23f37786ce41e7b084c17f9ec667c6d2774d405cc4a14c971
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
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 (
|
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 (
|
15
|
-
actionpack (=
|
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
|
-
|
19
|
-
actionpack (=
|
20
|
-
|
21
|
-
|
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 (
|
25
|
-
actionview (=
|
26
|
-
activesupport (=
|
27
|
-
rack (~> 2.0, >= 2.0.
|
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
|
31
|
-
|
32
|
-
|
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.
|
37
|
-
activeadmin (2.
|
51
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
52
|
+
activeadmin (2.13.1)
|
38
53
|
arbre (~> 1.2, >= 1.2.1)
|
39
|
-
formtastic (
|
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.
|
44
|
-
railties (>=
|
45
|
-
ransack (
|
46
|
-
|
47
|
-
|
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 (
|
52
|
-
activesupport (=
|
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 (
|
58
|
-
activemodel (=
|
59
|
-
activesupport (=
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
activerecord (=
|
64
|
-
|
65
|
-
|
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 (>=
|
68
|
-
minitest (
|
69
|
-
tzinfo (~>
|
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.
|
72
|
-
activesupport (>= 3.0.0)
|
73
|
-
|
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.
|
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.
|
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.
|
105
|
-
execjs (2.
|
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.
|
112
|
-
formtastic (
|
113
|
-
actionpack (>=
|
114
|
-
formtastic_i18n (0.
|
115
|
-
globalid (
|
116
|
-
activesupport (>=
|
117
|
-
has_scope (0.
|
118
|
-
actionpack (>=
|
119
|
-
activesupport (>=
|
120
|
-
i18n (1.
|
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.
|
123
|
-
actionpack (>= 5.
|
139
|
+
inherited_resources (1.13.1)
|
140
|
+
actionpack (>= 5.2, < 7.1)
|
124
141
|
has_scope (~> 0.6)
|
125
|
-
railties (>= 5.
|
142
|
+
railties (>= 5.2, < 7.1)
|
126
143
|
responders (>= 2, < 4)
|
127
|
-
jquery-rails (4.
|
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
|
-
|
132
|
-
kaminari (1.2.0)
|
148
|
+
kaminari (1.2.2)
|
133
149
|
activesupport (>= 4.1.0)
|
134
|
-
kaminari-actionview (= 1.2.
|
135
|
-
kaminari-activerecord (= 1.2.
|
136
|
-
kaminari-core (= 1.2.
|
137
|
-
kaminari-actionview (1.2.
|
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.
|
140
|
-
kaminari-activerecord (1.2.
|
155
|
+
kaminari-core (= 1.2.2)
|
156
|
+
kaminari-activerecord (1.2.2)
|
141
157
|
activerecord
|
142
|
-
kaminari-core (= 1.2.
|
143
|
-
kaminari-core (1.2.
|
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.
|
162
|
+
loofah (2.20.0)
|
147
163
|
crass (~> 1.0.2)
|
148
164
|
nokogiri (>= 1.5.9)
|
149
|
-
mail (2.
|
165
|
+
mail (2.8.1)
|
150
166
|
mini_mime (>= 0.1.1)
|
151
|
-
|
152
|
-
|
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.
|
172
|
+
mime-types (3.4.1)
|
155
173
|
mime-types-data (~> 3.2015)
|
156
|
-
mime-types-data (3.
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
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
|
-
|
175
|
-
rack
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
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.
|
194
|
-
loofah (~> 2.
|
195
|
-
railties (
|
196
|
-
actionpack (=
|
197
|
-
activesupport (=
|
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 (>=
|
200
|
-
thor (
|
227
|
+
rake (>= 12.2)
|
228
|
+
thor (~> 1.0)
|
201
229
|
rake (12.3.3)
|
202
|
-
ransack (
|
203
|
-
activerecord (>=
|
204
|
-
activesupport (>=
|
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.
|
210
|
-
actionpack (>= 5.
|
211
|
-
railties (>= 5.
|
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
|
-
|
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.
|
243
|
-
docile (~> 1.1
|
244
|
-
|
245
|
-
|
246
|
-
simplecov-html (0.
|
247
|
-
|
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 (
|
250
|
-
sprockets-rails (3.2
|
251
|
-
actionpack (>=
|
252
|
-
activesupport (>=
|
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.
|
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.
|
259
|
-
|
260
|
-
|
261
|
-
tzinfo (
|
262
|
-
|
263
|
-
|
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.
|
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.
|
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://
|
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.
|
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 = ['
|
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', '
|
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.
|
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(' ')
|
@@ -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.
|
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:
|
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: '
|
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: '
|
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.
|
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.
|
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
|
-
-
|
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.
|
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: []
|