Skip to content

Commit

Permalink
Merge branch 'master' into add-webpacker-switch
Browse files Browse the repository at this point in the history
  • Loading branch information
sgara authored Sep 26, 2019
2 parents 37d4b11 + 5a7db30 commit 90b7f19
Show file tree
Hide file tree
Showing 20 changed files with 328 additions and 66 deletions.
33 changes: 24 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

## Unreleased

### Enhancements

* Make optimization to not use expensive COUNT queries also work for decorated actions. [#5811] by [@irmela]
* Render a text filter instead of a select for large associations (opt-in) [#5548] by [@DanielHeath]

## 2.3.1 [](https://github.com/activeadmin/activeadmin/compare/v2.3.0..v2.3.1)

### Bug Fixes

* 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]

## 2.3.0 [](https://github.com/activeadmin/activeadmin/compare/v2.2.0..v2.3.0)

### Enhancements
Expand Down Expand Up @@ -493,11 +504,14 @@ Please check [0-6-stable] for previous changes.
[#5800]: https://github.com/activeadmin/activeadmin/pull/5800
[#5801]: https://github.com/activeadmin/activeadmin/pull/5801
[#5802]: https://github.com/activeadmin/activeadmin/pull/5802
[#5811]: https://github.com/activeadmin/activeadmin/pull/5811
[#5816]: https://github.com/activeadmin/activeadmin/pull/5816
[#5822]: https://github.com/activeadmin/activeadmin/pull/5822
[#5826]: https://github.com/activeadmin/activeadmin/pull/5826
[#5831]: https://github.com/activeadmin/activeadmin/pull/5831
[#5548]: https://github.com/activeadmin/activeadmin/pull/5548
[#5842]: https://github.com/activeadmin/activeadmin/pull/5842
[#5854]: https://github.com/activeadmin/activeadmin/pull/5854

[@5t111111]: https://github.com/5t111111
[@aarek]: https://github.com/aarek
Expand All @@ -506,10 +520,12 @@ Please check [0-6-stable] for previous changes.
[@amiel]: https://github.com/amiel
[@amiuhle]: https://github.com/amiuhle
[@andreslemik]: https://github.com/andreslemik
[@bartoszkopinski]: https://github.com/bartoszkopinski
[@blocknotes]: https://github.com/blocknotes
[@bolshakov]: https://github.com/bolshakov
[@buren]: https://github.com/buren
[@chancancode]: https://github.com/chancancode
[@chrp]: https://github.com/chrp
[@chumakoff]: https://github.com/chumakoff
[@craigmcnamara]: https://github.com/craigmcnamara
[@DanielHeath]: https://github.com/DanielHeath
Expand All @@ -528,26 +544,32 @@ Please check [0-6-stable] for previous changes.
[@HappyKadaver]: https://github.com/HappyKadaver
[@innparusu95]: https://github.com/innparusu95
[@ionut998]: https://github.com/ionut998
[@irmela]: https://github.com/irmela
[@jasl]: https://github.com/jasl
[@javierjulio]: https://github.com/javierjulio
[@jawa]: https://github.com/jawa
[@JiiHu]: https://github.com/JiiHu
[@johnnyshields]: https://github.com/johnnyshields
[@jscheid]: https://github.com/jscheid
[@kjeldahl]: https://github.com/kjeldahl
[@kobeumut]: https://github.com/kobeumut
[@Kris-LIBIS]: https://github.com/Kris-LIBIS
[@kwent]: https://github.com/kwent
[@leio10]: https://github.com/leio10
[@markstory]: https://github.com/markstory
[@mauriciopasquier]: https://github.com/mauriciopasquier
[@mconiglio]: https://github.com/mconiglio
[@ndbroadbent]: https://github.com/ndbroadbent
[@Nguyenanh]: https://github.com/Nguyenanh
[@panasyuk]: https://github.com/panasyuk
[@PChambino]: https://github.com/PChambino
[@potatosalad]: https://github.com/potatosalad
[@pranas]: https://github.com/pranas
[@renotocn]: https://github.com/renotocn
[@RobinvanderVliet]: https://github.com/RobinvanderVliet
[@rogerkk]: https://github.com/rogerkk
[@seanlinsley]: https://github.com/seanlinsley
[@sgara]: https://github.com/sgara
[@ShallmentMo]: https://github.com/ShallmentMo
[@shekibobo]: https://github.com/shekibobo
[@shouya]: https://github.com/shouya
Expand All @@ -557,16 +579,9 @@ Please check [0-6-stable] for previous changes.
[@timoschilling]: https://github.com/timoschilling
[@TimPetricola]: https://github.com/TimPetricola
[@varyonic]: https://github.com/varyonic
[@wasifhossain]: https://github.com/wasifhossain
[@violeta-p]: https://github.com/violeta-p
[@WaKeMaTTa]: https://github.com/WaKeMaTTa
[@wasifhossain]: https://github.com/wasifhossain
[@Wowu]: https://github.com/Wowu
[@wspurgin]: https://github.com/wspurgin
[@zorab47]: https://github.com/zorab47
[@chrp]: https://github.com/chrp
[@bartoszkopinski]: https://github.com/bartoszkopinski
[@panasyuk]: https://github.com/panasyuk
[@jscheid]: https://github.com/jscheid
[@violeta-p]: https://github.com/violeta-p
[@ndbroadbent]: https://github.com/ndbroadbent
[@Kris-LIBIS]: https://github.com/Kris-LIBIS
[@sgara]: https://github.com/sgara
1 change: 1 addition & 0 deletions Gemfile.common
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ gem "devise", "~> 4.7"
group :test do
gem 'apparition'
gem 'capybara', '~> 3.14'
gem 'db-query-matchers', '0.9.0'

gem 'simplecov', require: false # Test coverage generator. Go to /coverage/ after running tests
gem 'cucumber-rails', '~> 1.5', require: false
Expand Down
12 changes: 10 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
PATH
remote: .
specs:
activeadmin (2.3.0)
activeadmin (2.3.1)
arbre (~> 1.2, >= 1.2.1)
formtastic (~> 3.1)
formtastic_i18n (~> 0.4)
inherited_resources (~> 1.7)
jquery-rails (~> 4.2)
kaminari (~> 1.0, >= 1.0.1)
railties (>= 5.0, < 6.1)
ransack (~> 2.3)
ransack (~> 2.1, >= 2.1.1)
sassc-rails (~> 2.1)
sprockets (>= 3.0, < 4.1)
sprockets-es6 (~> 0.9, >= 0.9.2)
Expand Down Expand Up @@ -136,6 +136,9 @@ GEM
cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1)
database_cleaner (1.7.0)
db-query-matchers (0.9.0)
activesupport (>= 4.0, <= 6.0)
rspec (~> 3.0)
devise (4.7.1)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
Expand Down Expand Up @@ -323,6 +326,10 @@ GEM
responders (3.0.0)
actionpack (>= 5.0)
railties (>= 5.0)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.2)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.4)
Expand Down Expand Up @@ -417,6 +424,7 @@ DEPENDENCIES
cucumber
cucumber-rails (~> 1.5)
database_cleaner
db-query-matchers (= 0.9.0)
devise (~> 4.7)
draper (~> 3.1)
i18n-spec
Expand Down
2 changes: 1 addition & 1 deletion activeadmin.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Gem::Specification.new do |s|
s.add_dependency 'jquery-rails', '~> 4.2'
s.add_dependency 'kaminari', '~> 1.0', '>= 1.0.1'
s.add_dependency 'railties', '>= 5.0', '< 6.1'
s.add_dependency 'ransack', '~> 2.3'
s.add_dependency 'ransack', '~> 2.1', '>= 2.1.1'
s.add_dependency 'sassc-rails', '~> 2.1'
s.add_dependency 'sprockets', '>= 3.0', '< 4.1'
s.add_dependency 'sprockets-es6', '~> 0.9', '>= 0.9.2'
Expand Down
59 changes: 59 additions & 0 deletions config/locales/sk.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
sk:
activerecord:
models:
comment:
one: "Komentár"
few: "Komentáre"
many: "Komentárov"
other: "Komentáre"
active_admin/comment:
one: "Komentár"
few: "Komentáre"
many: "Komentárov"
other: "Komentáre"
attributes:
active_admin/comment:
author_type: "Typ autora"
body: "Telo"
created_at: "Vytvorený"
namespace: "Namespace"
resource_type: "Typ komentovanej položky"
updated_at: "Upravený"
active_admin:
dashboard: Úvod
dashboard_welcome:
Expand All @@ -8,6 +28,7 @@ sk:
edit: "Upraviť"
delete: "Zmazať"
delete_confirmation: "Ste si istí, že chcete túto položku zmazať?"
create_another: "Vytvoriť ďalší %{model}"
new_model: "Vytvoriť"
edit_model: "Upraviť"
delete_model: "Zmazať"
Expand All @@ -20,6 +41,7 @@ sk:
has_many_new: "Pridať nový"
has_many_delete: "Zmazať"
has_many_remove: "Odstrániť"
move: "Presunúť"
filters:
buttons:
filter: "Filtrovať"
Expand All @@ -31,6 +53,17 @@ sk:
ends_with: "Končí na"
greater_than: "Väčší ako"
less_than: "Menší ako"
gteq_datetime: "Od"
lteq_datetime: "Do"
from: "Od"
to: "Do"
scopes:
all: "Všetko"
search_status:
headline: "Stav vyhľadávania:"
current_scope: "Scope:"
current_filters: "Filtre:"
no_current_filters: "Žiadne"
status_tag:
"yes": "Áno"
"no": "Nie"
Expand All @@ -40,6 +73,7 @@ sk:
powered_by: "%{active_admin} %{version}"
sidebars:
filters: "Filtre"
search_status: "Stav vyhľadávania"
pagination:
empty: "Nenájdený."
one: "Zobrazená <b>1</b> položka"
Expand Down Expand Up @@ -70,18 +104,34 @@ sk:
labels:
destroy: "Vymazať"
comments:
created_at: "Vytvorený"
resource_type: "Typ zdroja"
author_type: "Typ autora"
body: "Telo"
author: "Autor"
add: "Pridať komentár"
delete: "Zmazať komentár"
delete_confirmation: "Naozaj chcete zmazať tento komentár?"
resource: "Zdroj"
no_comments_yet: "Žiadny komentár"
author_missing: "Anonymný"
title_content: "Komentáre administrátorov (%{count})"
errors:
empty_text: "Komentár nebol uložený, je prázdny."
devise:
username:
title: "Užívateľské meno"
email:
title: "Email"
subdomain:
title: "Subdoména"
password:
title: "Heslo"
password_confirmation:
title: "Potvrdenie hesla"
sign_up:
title: "Registrácia"
submit: "Registrovať"
login:
title: "Prihlásenie"
remember_me: "Zapamätať si ma"
Expand All @@ -95,11 +145,20 @@ sk:
unlock:
title: "Zaslanie inštrukcií k odomknutiu účtu"
submit: "Zaslať inštrukcií k odomknutiu účtu"
resend_confirmation_instructions:
title: "Preposlanie potvrdzovacie inštrukcie"
submit: "Preposlať potvrdzovacie inštrukcie"
links:
sign_in: "Prihlásiť sa"
sign_up: "Registrovať sa"
forgot_your_password: "Zabudli ste heslo?"
sign_in_with_omniauth_provider: "Prihlásiť sa cez %{provider}"
resend_unlock_instructions: "Poslať znovu inštrukcie na odomknutie účtu"
resend_confirmation_instructions: "Preposlať potvrdzovacie inštrukcie"
unsupported_browser:
headline: "ActiveAdmin nepodporuje Internet Explorer vo verzii <= 8."
recommendation: "Odporúčame <a href=\"http://browsehappy.com/\">aktualizovať Váš prehliadač</a>."
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>"
access_denied:
message: "Nemáte oprávnenie k vykonaniu tejto akcie."
index_list:
Expand Down
76 changes: 76 additions & 0 deletions features/index/filters.feature
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,79 @@ Feature: Index Filtering
When I select "The arrogant president" from "Posts"
And I press "Filter"
And I should see 1 user in the table

Scenario: Too many categories to show
Given a category named "Astrology" exists
And a category named "Astronomy" exists
And a category named "Navigation" exists
And a post with the title "Star Signs" in category "Astrology" exists
And a post with the title "Constellations" in category "Astronomy" exists
And a post with the title "Compass and Sextant" in category "Navigation" exists
And an index configuration of:
"""
ActiveAdmin.register Category
ActiveAdmin.register Post do
config.namespace.maximum_association_filter_arity = 3
end
"""
And I am on the index page for posts
Then I should see "Category" within "#filters_sidebar_section label[for="q_custom_category_id"]"
And I should not see "Category name starts with" within "#filters_sidebar_section"

Given an index configuration of:
"""
ActiveAdmin.register Category
ActiveAdmin.register Post do
config.namespace.maximum_association_filter_arity = 2
end
"""
And I am on the index page for posts
Then I should see "Category name starts with" within "#filters_sidebar_section"
When I fill in "Category name starts with" with "Astro"
And I press "Filter"
Then I should see "Star Signs"
And I should see "Constellations"
And I should not see "Compass and Sextant"

Given an index configuration of:
"""
ActiveAdmin.register Category
ActiveAdmin.register Post do
config.namespace.maximum_association_filter_arity = 2
config.namespace.filter_method_for_large_association = '_contains'
end
"""
And I am on the index page for posts
Then I should see "Category name contains" within "#filters_sidebar_section"
When I fill in "Category name contains" with "Astro"
And I press "Filter"
Then I should see "Star Signs"
And I should see "Constellations"
And I should not see "Compass and Sextant"

Given an index configuration of:
"""
ActiveAdmin.register Category
ActiveAdmin.register Post do
config.namespace.maximum_association_filter_arity = :unlimited
config.namespace.filter_method_for_large_association = '_contains'
end
"""
And I am on the index page for posts
Then I should see "Category" within "#filters_sidebar_section"
When I select "Astronomy" from "Category"
And I press "Filter"
Then I should not see "Star Signs"
And I should see "Constellations"
And I should not see "Compass and Sextant"

Given an index configuration of:
"""
ActiveAdmin.register Category
ActiveAdmin.register Post do
config.namespace.maximum_association_filter_arity = :unlimited
end
"""
And I am on the index page for posts
Then I should see "Category" within "#filters_sidebar_section label[for="q_custom_category_id"]"
And I should not see "Category name starts with" within "#filters_sidebar_section"
Loading

0 comments on commit 90b7f19

Please sign in to comment.