activeadmin 2.3.0 → 2.4.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
  SHA256:
3
- metadata.gz: 7c8782460aa60e1293d44be5e3b998002e34794150cebf3c4effc6ba409149d8
4
- data.tar.gz: b5834e4dc64f9043142376093ace0ddf0af7119f1a4dbba257ed344a4ac7079a
3
+ metadata.gz: ddd5ccf937ae176b3ba0e13d2af256758dbde0c4aafe9b966c752bb1bb411ea8
4
+ data.tar.gz: fa4bbd86cf444fb150d6cd624ed8a3125144481878001de32461f5256e30b835
5
5
  SHA512:
6
- metadata.gz: c55ad8c616ffee8776434ac4626351a4e789a9cb4d0771da2c548517d9854c5c3fa66f3e9b856831c625bc8f0f8c6afe85d3cf9f28101ec54467fce8d97b43cc
7
- data.tar.gz: 336e001de67c48174e8611f20007dc2a762eac47f09a4d6b3ad4ee6deb090410d072c58d1e3f61e8fc4a4cf1615e4a633f8210abd93979dd07a2d55f2510d4ef
6
+ metadata.gz: 84c708ca4b0aa8580a3181de153dd698f39c427e9c28adca8c7b3d1f75ff09ba41fa9955d84c6eeb3beccd174db2147a54980123302093cb0d51dd22a021ff40
7
+ data.tar.gz: 95fc6f7f92134b18270a2ccfdb05c1c55e9151bde9390bbd752f3735633f494c4145674534c1f2bc964687dc513aeb925a5427c8678ea3380340b89859431ebe
data/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.4.0 [☰](https://github.com/activeadmin/activeadmin/compare/v2.3.1..v2.4.0)
6
+
7
+ ### Enhancements
8
+
9
+ * Make optimization to not use expensive COUNT queries also work for decorated actions. [#5811] by [@irmela]
10
+ * Render a text filter instead of a select for large associations (opt-in) [#5548] by [@DanielHeath]
11
+ * Improve German translations [#5874] by [@juril33t]
12
+
13
+ ## 2.3.1 [☰](https://github.com/activeadmin/activeadmin/compare/v2.3.0..v2.3.1)
14
+
15
+ ### Bug Fixes
16
+
17
+ * Revert ransack version pinning because 2.3 has an outstanding bug that affects quite a lot of users. See [this ransack issue](https://github.com/activerecord-hackery/ransack/issues/1039) for more information. [#5854] by [@deivid-rodriguez]
18
+
5
19
  ## 2.3.0 [☰](https://github.com/activeadmin/activeadmin/compare/v2.2.0..v2.3.0)
6
20
 
7
21
  ### Enhancements
@@ -493,11 +507,15 @@ Please check [0-6-stable] for previous changes.
493
507
  [#5800]: https://github.com/activeadmin/activeadmin/pull/5800
494
508
  [#5801]: https://github.com/activeadmin/activeadmin/pull/5801
495
509
  [#5802]: https://github.com/activeadmin/activeadmin/pull/5802
510
+ [#5811]: https://github.com/activeadmin/activeadmin/pull/5811
496
511
  [#5816]: https://github.com/activeadmin/activeadmin/pull/5816
497
512
  [#5822]: https://github.com/activeadmin/activeadmin/pull/5822
498
513
  [#5826]: https://github.com/activeadmin/activeadmin/pull/5826
499
514
  [#5831]: https://github.com/activeadmin/activeadmin/pull/5831
515
+ [#5548]: https://github.com/activeadmin/activeadmin/pull/5548
500
516
  [#5842]: https://github.com/activeadmin/activeadmin/pull/5842
517
+ [#5854]: https://github.com/activeadmin/activeadmin/pull/5854
518
+ [#5874]: https://github.com/activeadmin/activeadmin/pull/5874
501
519
 
502
520
  [@5t111111]: https://github.com/5t111111
503
521
  [@aarek]: https://github.com/aarek
@@ -506,10 +524,12 @@ Please check [0-6-stable] for previous changes.
506
524
  [@amiel]: https://github.com/amiel
507
525
  [@amiuhle]: https://github.com/amiuhle
508
526
  [@andreslemik]: https://github.com/andreslemik
527
+ [@bartoszkopinski]: https://github.com/bartoszkopinski
509
528
  [@blocknotes]: https://github.com/blocknotes
510
529
  [@bolshakov]: https://github.com/bolshakov
511
530
  [@buren]: https://github.com/buren
512
531
  [@chancancode]: https://github.com/chancancode
532
+ [@chrp]: https://github.com/chrp
513
533
  [@chumakoff]: https://github.com/chumakoff
514
534
  [@craigmcnamara]: https://github.com/craigmcnamara
515
535
  [@DanielHeath]: https://github.com/DanielHeath
@@ -528,19 +548,25 @@ Please check [0-6-stable] for previous changes.
528
548
  [@HappyKadaver]: https://github.com/HappyKadaver
529
549
  [@innparusu95]: https://github.com/innparusu95
530
550
  [@ionut998]: https://github.com/ionut998
551
+ [@irmela]: https://github.com/irmela
531
552
  [@jasl]: https://github.com/jasl
532
553
  [@javierjulio]: https://github.com/javierjulio
533
554
  [@jawa]: https://github.com/jawa
534
555
  [@JiiHu]: https://github.com/JiiHu
535
556
  [@johnnyshields]: https://github.com/johnnyshields
557
+ [@jscheid]: https://github.com/jscheid
558
+ [@juril33t]: https://github.com/juril33t
536
559
  [@kjeldahl]: https://github.com/kjeldahl
537
560
  [@kobeumut]: https://github.com/kobeumut
561
+ [@Kris-LIBIS]: https://github.com/Kris-LIBIS
538
562
  [@kwent]: https://github.com/kwent
539
563
  [@leio10]: https://github.com/leio10
540
564
  [@markstory]: https://github.com/markstory
541
565
  [@mauriciopasquier]: https://github.com/mauriciopasquier
542
566
  [@mconiglio]: https://github.com/mconiglio
567
+ [@ndbroadbent]: https://github.com/ndbroadbent
543
568
  [@Nguyenanh]: https://github.com/Nguyenanh
569
+ [@panasyuk]: https://github.com/panasyuk
544
570
  [@PChambino]: https://github.com/PChambino
545
571
  [@potatosalad]: https://github.com/potatosalad
546
572
  [@pranas]: https://github.com/pranas
@@ -548,6 +574,7 @@ Please check [0-6-stable] for previous changes.
548
574
  [@RobinvanderVliet]: https://github.com/RobinvanderVliet
549
575
  [@rogerkk]: https://github.com/rogerkk
550
576
  [@seanlinsley]: https://github.com/seanlinsley
577
+ [@sgara]: https://github.com/sgara
551
578
  [@ShallmentMo]: https://github.com/ShallmentMo
552
579
  [@shekibobo]: https://github.com/shekibobo
553
580
  [@shouya]: https://github.com/shouya
@@ -557,16 +584,9 @@ Please check [0-6-stable] for previous changes.
557
584
  [@timoschilling]: https://github.com/timoschilling
558
585
  [@TimPetricola]: https://github.com/TimPetricola
559
586
  [@varyonic]: https://github.com/varyonic
560
- [@wasifhossain]: https://github.com/wasifhossain
587
+ [@violeta-p]: https://github.com/violeta-p
561
588
  [@WaKeMaTTa]: https://github.com/WaKeMaTTa
589
+ [@wasifhossain]: https://github.com/wasifhossain
562
590
  [@Wowu]: https://github.com/Wowu
563
591
  [@wspurgin]: https://github.com/wspurgin
564
592
  [@zorab47]: https://github.com/zorab47
565
- [@chrp]: https://github.com/chrp
566
- [@bartoszkopinski]: https://github.com/bartoszkopinski
567
- [@panasyuk]: https://github.com/panasyuk
568
- [@jscheid]: https://github.com/jscheid
569
- [@violeta-p]: https://github.com/violeta-p
570
- [@ndbroadbent]: https://github.com/ndbroadbent
571
- [@Kris-LIBIS]: https://github.com/Kris-LIBIS
572
- [@sgara]: https://github.com/sgara
@@ -1,4 +1,20 @@
1
1
  de:
2
+ activerecord:
3
+ models:
4
+ comment:
5
+ one: "Kommentar"
6
+ other: "Kommentare"
7
+ active_admin/comment:
8
+ one: "Kommentar"
9
+ other: "Kommentare"
10
+ attributes:
11
+ active_admin/comment:
12
+ author_type: "Autortyp"
13
+ body: "Inhalt"
14
+ created_at: "Erstellt"
15
+ namespace: "Namensraum"
16
+ resource_type: "Ressourcentyp"
17
+ updated_at: "Aktualisiert"
2
18
  active_admin:
3
19
  dashboard: Übersicht
4
20
  dashboard_welcome:
@@ -37,6 +53,8 @@ de:
37
53
  lteq_datetime: "Kleiner gleich"
38
54
  from: "Von"
39
55
  to: "Bis"
56
+ scopes:
57
+ all: "Alle"
40
58
  search_status:
41
59
  headline: "Filter"
42
60
  current_scope: "Anwendungsbereich:"
@@ -1,4 +1,24 @@
1
1
  sk:
2
+ activerecord:
3
+ models:
4
+ comment:
5
+ one: "Komentár"
6
+ few: "Komentáre"
7
+ many: "Komentárov"
8
+ other: "Komentáre"
9
+ active_admin/comment:
10
+ one: "Komentár"
11
+ few: "Komentáre"
12
+ many: "Komentárov"
13
+ other: "Komentáre"
14
+ attributes:
15
+ active_admin/comment:
16
+ author_type: "Typ autora"
17
+ body: "Telo"
18
+ created_at: "Vytvorený"
19
+ namespace: "Namespace"
20
+ resource_type: "Typ komentovanej položky"
21
+ updated_at: "Upravený"
2
22
  active_admin:
3
23
  dashboard: Úvod
4
24
  dashboard_welcome:
@@ -8,6 +28,7 @@ sk:
8
28
  edit: "Upraviť"
9
29
  delete: "Zmazať"
10
30
  delete_confirmation: "Ste si istí, že chcete túto položku zmazať?"
31
+ create_another: "Vytvoriť ďalší %{model}"
11
32
  new_model: "Vytvoriť"
12
33
  edit_model: "Upraviť"
13
34
  delete_model: "Zmazať"
@@ -20,6 +41,7 @@ sk:
20
41
  has_many_new: "Pridať nový"
21
42
  has_many_delete: "Zmazať"
22
43
  has_many_remove: "Odstrániť"
44
+ move: "Presunúť"
23
45
  filters:
24
46
  buttons:
25
47
  filter: "Filtrovať"
@@ -31,6 +53,17 @@ sk:
31
53
  ends_with: "Končí na"
32
54
  greater_than: "Väčší ako"
33
55
  less_than: "Menší ako"
56
+ gteq_datetime: "Od"
57
+ lteq_datetime: "Do"
58
+ from: "Od"
59
+ to: "Do"
60
+ scopes:
61
+ all: "Všetko"
62
+ search_status:
63
+ headline: "Stav vyhľadávania:"
64
+ current_scope: "Scope:"
65
+ current_filters: "Filtre:"
66
+ no_current_filters: "Žiadne"
34
67
  status_tag:
35
68
  "yes": "Áno"
36
69
  "no": "Nie"
@@ -40,6 +73,7 @@ sk:
40
73
  powered_by: "%{active_admin} %{version}"
41
74
  sidebars:
42
75
  filters: "Filtre"
76
+ search_status: "Stav vyhľadávania"
43
77
  pagination:
44
78
  empty: "Nenájdený."
45
79
  one: "Zobrazená <b>1</b> položka"
@@ -70,11 +104,14 @@ sk:
70
104
  labels:
71
105
  destroy: "Vymazať"
72
106
  comments:
107
+ created_at: "Vytvorený"
73
108
  resource_type: "Typ zdroja"
74
109
  author_type: "Typ autora"
75
110
  body: "Telo"
76
111
  author: "Autor"
77
112
  add: "Pridať komentár"
113
+ delete: "Zmazať komentár"
114
+ delete_confirmation: "Naozaj chcete zmazať tento komentár?"
78
115
  resource: "Zdroj"
79
116
  no_comments_yet: "Žiadny komentár"
80
117
  author_missing: "Anonymný"
@@ -82,6 +119,19 @@ sk:
82
119
  errors:
83
120
  empty_text: "Komentár nebol uložený, je prázdny."
84
121
  devise:
122
+ username:
123
+ title: "Užívateľské meno"
124
+ email:
125
+ title: "Email"
126
+ subdomain:
127
+ title: "Subdoména"
128
+ password:
129
+ title: "Heslo"
130
+ password_confirmation:
131
+ title: "Potvrdenie hesla"
132
+ sign_up:
133
+ title: "Registrácia"
134
+ submit: "Registrovať"
85
135
  login:
86
136
  title: "Prihlásenie"
87
137
  remember_me: "Zapamätať si ma"
@@ -95,11 +145,20 @@ sk:
95
145
  unlock:
96
146
  title: "Zaslanie inštrukcií k odomknutiu účtu"
97
147
  submit: "Zaslať inštrukcií k odomknutiu účtu"
148
+ resend_confirmation_instructions:
149
+ title: "Preposlanie potvrdzovacie inštrukcie"
150
+ submit: "Preposlať potvrdzovacie inštrukcie"
98
151
  links:
99
152
  sign_in: "Prihlásiť sa"
100
153
  sign_up: "Registrovať sa"
101
154
  forgot_your_password: "Zabudli ste heslo?"
102
155
  sign_in_with_omniauth_provider: "Prihlásiť sa cez %{provider}"
156
+ resend_unlock_instructions: "Poslať znovu inštrukcie na odomknutie účtu"
157
+ resend_confirmation_instructions: "Preposlať potvrdzovacie inštrukcie"
158
+ unsupported_browser:
159
+ headline: "ActiveAdmin nepodporuje Internet Explorer vo verzii <= 8."
160
+ recommendation: "Odporúčame <a href=\"http://browsehappy.com/\">aktualizovať Váš prehliadač</a>."
161
+ turn_off_compatibility_view: "Ak používate Internet Explorer vo verzii >= 9, uistite sa, že <a href=\"https://support.microsoft.com/en-us/help/17471\">\"režim kompatibility\" je vypnutý</a>"
103
162
  access_denied:
104
163
  message: "Nemáte oprávnenie k vykonaniu tejto akcie."
105
164
  index_list:
data/docs/Gemfile.lock CHANGED
@@ -219,7 +219,7 @@ GEM
219
219
  ruby-enum (0.7.2)
220
220
  i18n
221
221
  ruby_dep (1.5.0)
222
- rubyzip (1.2.2)
222
+ rubyzip (2.0.0)
223
223
  safe_yaml (1.0.4)
224
224
  sass (3.6.0)
225
225
  sass-listen (~> 4.0.0)
@@ -129,12 +129,36 @@ module ActiveAdmin
129
129
  not_poly.reject! { |r| r.chain.length > 2 }
130
130
 
131
131
  filters = poly.map(&:foreign_type) + not_poly.map(&:name)
132
+
133
+ # Check high-arity associations for filterable columns
134
+ max = namespace.maximum_association_filter_arity
135
+ if max != :unlimited
136
+ high_arity, low_arity = not_poly.partition do |r|
137
+ r.klass.reorder(nil).limit(max + 1).count > max
138
+ end
139
+
140
+ # Remove high-arity associations with no searchable column
141
+ high_arity = high_arity.select(&method(:searchable_column_for))
142
+
143
+ high_arity = high_arity.map { |r| r.name.to_s + "_" + searchable_column_for(r) + namespace.filter_method_for_large_association }
144
+
145
+ filters = poly.map(&:foreign_type) + low_arity.map(&:name) + high_arity
146
+ end
147
+
132
148
  filters.map &:to_sym
133
149
  else
134
150
  []
135
151
  end
136
152
  end
137
153
 
154
+ def search_columns
155
+ @search_columns ||= namespace.filter_columns_for_large_association.map(&:to_s)
156
+ end
157
+
158
+ def searchable_column_for(relation)
159
+ relation.klass.column_names.find { |name| search_columns.include?(name) }
160
+ end
161
+
138
162
  def add_filters_sidebar_section
139
163
  self.sidebar_sections << filters_sidebar_section
140
164
  end
@@ -106,5 +106,18 @@ module ActiveAdmin
106
106
 
107
107
  # Include association filters by default
108
108
  register :include_default_association_filters, true
109
+
110
+ register :maximum_association_filter_arity, :unlimited
111
+
112
+ register :filter_columns_for_large_association, [
113
+ :display_name,
114
+ :full_name,
115
+ :name,
116
+ :username,
117
+ :login,
118
+ :title,
119
+ :email,
120
+ ]
121
+ register :filter_method_for_large_association, '_starts_with'
109
122
  end
110
123
  end
@@ -3,7 +3,7 @@ module ActiveAdmin
3
3
  attr_reader :field, :order, :active_admin_config
4
4
 
5
5
  def initialize(active_admin_config, clause)
6
- clause =~ /^([\w\_\.]+)(->'\w+')?_(desc|asc)$/
6
+ clause =~ /^([\w\.]+)(->'\w+')?_(desc|asc)$/
7
7
  @column = $1
8
8
  @op = $2
9
9
  @order = $3
@@ -67,8 +67,8 @@ module ActiveAdmin
67
67
  def self.wrap!(parent, name)
68
68
  ::Class.new parent do
69
69
  delegate :reorder, :page, :current_page, :total_pages, :limit_value,
70
- :total_count, :total_pages, :to_key, :group_values, :except,
71
- :find_each, :ransack
70
+ :total_count, :total_pages, :offset, :to_key, :group_values,
71
+ :except, :find_each, :ransack
72
72
 
73
73
  define_singleton_method(:name) { name }
74
74
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveAdmin
2
- VERSION = '2.3.0'
2
+ VERSION = '2.4.0'
3
3
  end
@@ -96,7 +96,7 @@ module ActiveAdmin
96
96
  options[:params] = @params if @params
97
97
  options[:param_name] = @param_name if @param_name
98
98
 
99
- if !@display_total && collection.respond_to?(:offset)
99
+ if !@display_total
100
100
  # The #paginate method in kaminari will query the resource with a
101
101
  # count(*) to determine how many pages there should be unless
102
102
  # you pass in the :total_pages option. We issue a query to determine
@@ -286,12 +286,25 @@ ActiveAdmin.setup do |config|
286
286
  # config.filters = true
287
287
  #
288
288
  # By default the filters include associations in a select, which means
289
- # that every record will be loaded for each association.
289
+ # that every record will be loaded for each association (up
290
+ # to the value of config.maximum_association_filter_arity).
290
291
  # You can enabled or disable the inclusion
291
292
  # of those filters by default here.
292
293
  #
293
294
  # config.include_default_association_filters = true
294
295
 
296
+ # config.maximum_association_filter_arity = 256 # default value of :unlimited will change to 256 in a future version
297
+ # config.filter_columns_for_large_association, [
298
+ # :display_name,
299
+ # :full_name,
300
+ # :name,
301
+ # :username,
302
+ # :login,
303
+ # :title,
304
+ # :email,
305
+ # ]
306
+ # config.filter_method_for_large_association, '_starts_with'
307
+
295
308
  # == Head
296
309
  #
297
310
  # You can add your own content to the site head like analytics. Make sure
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Maresh
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2019-09-12 00:00:00.000000000 Z
18
+ date: 2019-10-03 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: arbre
@@ -139,14 +139,20 @@ dependencies:
139
139
  requirements:
140
140
  - - "~>"
141
141
  - !ruby/object:Gem::Version
142
- version: '2.3'
142
+ version: '2.1'
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: 2.1.1
143
146
  type: :runtime
144
147
  prerelease: false
145
148
  version_requirements: !ruby/object:Gem::Requirement
146
149
  requirements:
147
150
  - - "~>"
148
151
  - !ruby/object:Gem::Version
149
- version: '2.3'
152
+ version: '2.1'
153
+ - - ">="
154
+ - !ruby/object:Gem::Version
155
+ version: 2.1.1
150
156
  - !ruby/object:Gem::Dependency
151
157
  name: sassc-rails
152
158
  requirement: !ruby/object:Gem::Requirement
@@ -609,7 +615,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
609
615
  - !ruby/object:Gem::Version
610
616
  version: '0'
611
617
  requirements: []
612
- rubygems_version: 3.0.6
618
+ rubygems_version: 3.0.3
613
619
  signing_key:
614
620
  specification_version: 4
615
621
  summary: Active Admin is a Ruby on Rails plugin for generating administration style