activeadmin 2.3.1 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activeadmin might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 563d1b0d5a864fbade2689270fb82575242d8c557f4c4807e45d5fb6d3679ccb
4
- data.tar.gz: 0076ad12634d0c8762697204639d0ce9447f051fd4b6827da3a09e4fdf7dcb1b
3
+ metadata.gz: ddd5ccf937ae176b3ba0e13d2af256758dbde0c4aafe9b966c752bb1bb411ea8
4
+ data.tar.gz: fa4bbd86cf444fb150d6cd624ed8a3125144481878001de32461f5256e30b835
5
5
  SHA512:
6
- metadata.gz: 7cdc8ddd8ba6452996a80f098cde70512a83215c4731d03b7a0b0a9d601f5886c12f5db824be5aaf0ecb92a8151f0685ad65f95d1c7f623767613f4a46e29617
7
- data.tar.gz: 7b14dc13a08928a73f48bfcd4972d20b4a2d33db3c29afb1769ab63c3654cbe6e711e6ff8f39b4b131af6c94c060ac6b5056abb6494cafc4b6c3a13f99bbb7db
6
+ metadata.gz: 84c708ca4b0aa8580a3181de153dd698f39c427e9c28adca8c7b3d1f75ff09ba41fa9955d84c6eeb3beccd174db2147a54980123302093cb0d51dd22a021ff40
7
+ data.tar.gz: 95fc6f7f92134b18270a2ccfdb05c1c55e9151bde9390bbd752f3735633f494c4145674534c1f2bc964687dc513aeb925a5427c8678ea3380340b89859431ebe
@@ -2,6 +2,14 @@
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
+
5
13
  ## 2.3.1 [☰](https://github.com/activeadmin/activeadmin/compare/v2.3.0..v2.3.1)
6
14
 
7
15
  ### Bug Fixes
@@ -499,12 +507,15 @@ Please check [0-6-stable] for previous changes.
499
507
  [#5800]: https://github.com/activeadmin/activeadmin/pull/5800
500
508
  [#5801]: https://github.com/activeadmin/activeadmin/pull/5801
501
509
  [#5802]: https://github.com/activeadmin/activeadmin/pull/5802
510
+ [#5811]: https://github.com/activeadmin/activeadmin/pull/5811
502
511
  [#5816]: https://github.com/activeadmin/activeadmin/pull/5816
503
512
  [#5822]: https://github.com/activeadmin/activeadmin/pull/5822
504
513
  [#5826]: https://github.com/activeadmin/activeadmin/pull/5826
505
514
  [#5831]: https://github.com/activeadmin/activeadmin/pull/5831
515
+ [#5548]: https://github.com/activeadmin/activeadmin/pull/5548
506
516
  [#5842]: https://github.com/activeadmin/activeadmin/pull/5842
507
517
  [#5854]: https://github.com/activeadmin/activeadmin/pull/5854
518
+ [#5874]: https://github.com/activeadmin/activeadmin/pull/5874
508
519
 
509
520
  [@5t111111]: https://github.com/5t111111
510
521
  [@aarek]: https://github.com/aarek
@@ -513,10 +524,12 @@ Please check [0-6-stable] for previous changes.
513
524
  [@amiel]: https://github.com/amiel
514
525
  [@amiuhle]: https://github.com/amiuhle
515
526
  [@andreslemik]: https://github.com/andreslemik
527
+ [@bartoszkopinski]: https://github.com/bartoszkopinski
516
528
  [@blocknotes]: https://github.com/blocknotes
517
529
  [@bolshakov]: https://github.com/bolshakov
518
530
  [@buren]: https://github.com/buren
519
531
  [@chancancode]: https://github.com/chancancode
532
+ [@chrp]: https://github.com/chrp
520
533
  [@chumakoff]: https://github.com/chumakoff
521
534
  [@craigmcnamara]: https://github.com/craigmcnamara
522
535
  [@DanielHeath]: https://github.com/DanielHeath
@@ -535,19 +548,25 @@ Please check [0-6-stable] for previous changes.
535
548
  [@HappyKadaver]: https://github.com/HappyKadaver
536
549
  [@innparusu95]: https://github.com/innparusu95
537
550
  [@ionut998]: https://github.com/ionut998
551
+ [@irmela]: https://github.com/irmela
538
552
  [@jasl]: https://github.com/jasl
539
553
  [@javierjulio]: https://github.com/javierjulio
540
554
  [@jawa]: https://github.com/jawa
541
555
  [@JiiHu]: https://github.com/JiiHu
542
556
  [@johnnyshields]: https://github.com/johnnyshields
557
+ [@jscheid]: https://github.com/jscheid
558
+ [@juril33t]: https://github.com/juril33t
543
559
  [@kjeldahl]: https://github.com/kjeldahl
544
560
  [@kobeumut]: https://github.com/kobeumut
561
+ [@Kris-LIBIS]: https://github.com/Kris-LIBIS
545
562
  [@kwent]: https://github.com/kwent
546
563
  [@leio10]: https://github.com/leio10
547
564
  [@markstory]: https://github.com/markstory
548
565
  [@mauriciopasquier]: https://github.com/mauriciopasquier
549
566
  [@mconiglio]: https://github.com/mconiglio
567
+ [@ndbroadbent]: https://github.com/ndbroadbent
550
568
  [@Nguyenanh]: https://github.com/Nguyenanh
569
+ [@panasyuk]: https://github.com/panasyuk
551
570
  [@PChambino]: https://github.com/PChambino
552
571
  [@potatosalad]: https://github.com/potatosalad
553
572
  [@pranas]: https://github.com/pranas
@@ -555,6 +574,7 @@ Please check [0-6-stable] for previous changes.
555
574
  [@RobinvanderVliet]: https://github.com/RobinvanderVliet
556
575
  [@rogerkk]: https://github.com/rogerkk
557
576
  [@seanlinsley]: https://github.com/seanlinsley
577
+ [@sgara]: https://github.com/sgara
558
578
  [@ShallmentMo]: https://github.com/ShallmentMo
559
579
  [@shekibobo]: https://github.com/shekibobo
560
580
  [@shouya]: https://github.com/shouya
@@ -564,16 +584,9 @@ Please check [0-6-stable] for previous changes.
564
584
  [@timoschilling]: https://github.com/timoschilling
565
585
  [@TimPetricola]: https://github.com/TimPetricola
566
586
  [@varyonic]: https://github.com/varyonic
567
- [@wasifhossain]: https://github.com/wasifhossain
587
+ [@violeta-p]: https://github.com/violeta-p
568
588
  [@WaKeMaTTa]: https://github.com/WaKeMaTTa
589
+ [@wasifhossain]: https://github.com/wasifhossain
569
590
  [@Wowu]: https://github.com/Wowu
570
591
  [@wspurgin]: https://github.com/wspurgin
571
592
  [@zorab47]: https://github.com/zorab47
572
- [@chrp]: https://github.com/chrp
573
- [@bartoszkopinski]: https://github.com/bartoszkopinski
574
- [@panasyuk]: https://github.com/panasyuk
575
- [@jscheid]: https://github.com/jscheid
576
- [@violeta-p]: https://github.com/violeta-p
577
- [@ndbroadbent]: https://github.com/ndbroadbent
578
- [@Kris-LIBIS]: https://github.com/Kris-LIBIS
579
- [@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:
@@ -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.1'
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.1
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-13 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
@@ -615,7 +615,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
615
615
  - !ruby/object:Gem::Version
616
616
  version: '0'
617
617
  requirements: []
618
- rubygems_version: 3.0.6
618
+ rubygems_version: 3.0.3
619
619
  signing_key:
620
620
  specification_version: 4
621
621
  summary: Active Admin is a Ruby on Rails plugin for generating administration style