Skip to content

Commit 8dfc51b

Browse files
committed
Merge branch '3.0-stable'
2 parents 37158c6 + f5cc427 commit 8dfc51b

File tree

9 files changed

+60
-13
lines changed

9 files changed

+60
-13
lines changed

CHANGELOG.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,35 @@
22

33
## [Unreleased](https://github.com/railsadminteam/rails_admin/tree/HEAD)
44

5-
[Full Changelog](https://github.com/railsadminteam/rails_admin/compare/v3.0.0.rc3...HEAD)
5+
[Full Changelog](https://github.com/railsadminteam/rails_admin/compare/v3.0.0...HEAD)
6+
7+
## [3.0.0](https://github.com/railsadminteam/rails_admin/tree/v3.0.0) - 2022-03-21
8+
9+
[Full Changelog](https://github.com/railsadminteam/rails_admin/compare/v3.0.0.rc4...v3.0.0)
10+
11+
### Fixed
12+
13+
- Fix table sorting not working ([83a0c88](https://github.com/railsadminteam/rails_admin/commit/83a0c889f1de38a0b24c412b0f0f7484add86b29), [#3497](https://github.com/railsadminteam/rails_admin/issues/3497))
14+
- Fix reset button by the query box not working ([4a583e9](https://github.com/railsadminteam/rails_admin/commit/4a583e924c5bef6bfc46d6a49ab751c2323ba23e))
15+
16+
## [3.0.0.rc4](https://github.com/railsadminteam/rails_admin/tree/v3.0.0.rc4) - 2022-03-13
17+
18+
[Full Changelog](https://github.com/railsadminteam/rails_admin/compare/v3.0.0.rc3...v3.0.0.rc4)
19+
20+
### Added
21+
22+
- Instruct users on potential issues with npm package installation ([2b0594c](https://github.com/railsadminteam/rails_admin/commit/2b0594c6824eb4eed217cbab9477639b61eb99db), [c7a74f1](https://github.com/railsadminteam/rails_admin/commit/c7a74f1ce7a040b8c87b24fe1907ddd9088bf1e5))
23+
24+
### Changed
25+
26+
- Upgrade vendorized Flatpickr to 4.6.11 ([7f8c831](https://github.com/railsadminteam/rails_admin/commit/7f8c831b9aa407987ba89191c21040e2e72e366e))
27+
28+
### Fixed
29+
30+
- Fix not utilizing full browser width after Bootstrap 5 upgrade ([#3493](https://github.com/railsadminteam/rails_admin/pull/3493))
31+
- Fix the style for show views broken on Bootstrap 5 upgrade ([#3491](https://github.com/railsadminteam/rails_admin/pull/3491))
32+
- Fix Pundit 2.2 deprecation for not using Pundit::Authorization ([e38eb46](https://github.com/railsadminteam/rails_admin/commit/e38eb46ffe79cd866c34b837dd4cfbb65361558f))
33+
- Fix JS issues when navigating across the main app and RailsAdmin ([eb4a185](https://github.com/railsadminteam/rails_admin/commit/eb4a18558e9d8c69aeea3fd733f5dc251f3f79f9), [#3484](https://github.com/railsadminteam/rails_admin/pull/3484))
634

735
## [3.0.0.rc3](https://github.com/railsadminteam/rails_admin/tree/v3.0.0.rc3) - 2022-02-27
836

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414

1515
RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data.
1616

17-
## Announcements
18-
19-
### [Action required] Security issue
20-
21-
**RailsAdmin 2.0.1, 2.0.0 and up to 1.4.2 have been reported to have XSS vulnerability.** We strongly recommend that you upgrade RailsAdmin to 2.0.2 (and higher) or 1.4.3 as soon as possible, if you are on those versions. See [d72090ec](https://github.com/railsadminteam/rails_admin/commit/d72090ec6a07c3b9b7b48ab50f3d405f91ff4375) for the detail.
22-
2317
## Getting started
2418

2519
- Check out [the docs][docs].
@@ -45,7 +39,7 @@ RailsAdmin is a Rails engine that provides an easy-to-use interface for managing
4539

4640
## Installation
4741

48-
1. On your gemfile: `gem 'rails_admin', ['>= 3.0.0.rc3', '< 4']`
42+
1. On your gemfile: `gem 'rails_admin', '~> 3.0'`
4943
2. Run `bundle install`
5044
3. Run `rails g rails_admin:install`
5145
4. Provide a namespace for the routes when asked

app/views/rails_admin/main/history.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<% selected = (sort == property_name) %>
3333
<% sort_direction = (sort_reverse ? "headerSortUp" : "headerSortDown" if selected) %>
3434
<% sort_location = send(path_method, params.except("sort_reverse").merge(model_name: @abstract_model.to_param, sort: property_name).merge(selected && sort_reverse != "true" ? {sort_reverse: "true"} : {})) %>
35-
<th class="header <%= column[:css_class] %> <%= sort_direction if selected %>">
35+
<th class="header <%= column[:css_class] %> <%= sort_direction if selected %>" data-href="<%= sort_location %>">
3636
<%= column[:link_text] %>
3737
</th>
3838
<% end %>

lib/rails_admin/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Version
55
MAJOR = 3
66
MINOR = 0
77
PATCH = 0
8-
PRE = 'rc3'
8+
PRE = nil
99

1010
class << self
1111
# @return [String]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rails_admin",
3-
"version": "3.0.0-rc3",
3+
"version": "3.0.0",
44
"description": "RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data.",
55
"homepage": "https://github.com/railsadminteam/rails_admin",
66
"license": "MIT",

spec/controllers/rails_admin/main_controller_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def get(action, params)
272272
end
273273

274274
controller(RailsAdmin::MainController) do
275-
include ::Pundit
275+
include defined?(::Pundit::Authorization) ? ::Pundit::Authorization : ::Pundit
276276
after_action :verify_authorized
277277
end
278278

spec/integration/actions/history_index_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
is_expected.to have_css(%([href="/admin/paper_trail_test/#{paper_trail_test.id}"]), count: 11)
3333
end
3434

35+
it 'supports sorting', js: true do
36+
visit history_index_path(model_name: 'paper_trail_test')
37+
find('th.header', text: 'Item').click
38+
is_expected.to have_css('th.item.headerSortDown')
39+
end
40+
3541
context "when Kaminari's custom param_name is set" do
3642
before { Kaminari.config.param_name = :pagina }
3743
after { Kaminari.config.param_name = :page }

spec/integration/actions/index_spec.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@
7777
end
7878
end
7979

80+
it 'allows to clear the search query box', js: true do
81+
visit index_path(model_name: 'player', query: @players[0].name)
82+
is_expected.not_to have_content(@players[1].name)
83+
find_button('Reset filters').click
84+
is_expected.to have_content(@players[1].name)
85+
end
86+
8087
it 'allows to filter on one attribute' do
8188
RailsAdmin.config Player do
8289
list do
@@ -824,6 +831,13 @@ def visit_page(page)
824831
expect(find("tbody tr:nth-child(#{i + 1})")).to have_content(name)
825832
end
826833
end
834+
835+
it 'can be activated by clicking the table header', js: true do
836+
visit index_path(model_name: 'player')
837+
find('th.header', text: 'Name').trigger('click')
838+
is_expected.to have_css('th.name_field.headerSortDown')
839+
expect(all('tbody td.name_field').map(&:text)).to eq @players.map(&:name).sort
840+
end
827841
end
828842

829843
context 'on listing as compact json' do

src/rails_admin/ui.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,15 @@ import I18n from "./i18n";
114114
event.preventDefault();
115115
$("#filters_box").html("");
116116
$("hr.filters_box").hide();
117-
$(this).parent().siblings("input[type='search']").val("");
117+
$(this).siblings("input[type='search']").val("");
118118
$(this).parents("form").submit();
119119
});
120120

121+
$(document).on("click", "th.header", function (event) {
122+
event.preventDefault();
123+
window.Turbo.visit($(this).data("href"));
124+
});
125+
121126
$(document).on(
122127
"click",
123128
"#fields_to_export label input#check_all",

0 commit comments

Comments
 (0)