Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into restore-deferred-…
Browse files Browse the repository at this point in the history
…config-loading-2
  • Loading branch information
q3aiml committed Mar 25, 2022
2 parents e2ec3b9 + 9c72851 commit e6e4dfd
Show file tree
Hide file tree
Showing 13 changed files with 1,020 additions and 410 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ A clear and concise description of what you expected to happen.

- `rails` version:
- `rails_admin` version:
- `rails_admin` npm package version:
- full stack trace (if there's an exception)

Add any other context about the problem here.
30 changes: 29 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,35 @@

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

[Full Changelog](https://github.com/railsadminteam/rails_admin/compare/v3.0.0.rc3...HEAD)
[Full Changelog](https://github.com/railsadminteam/rails_admin/compare/v3.0.0...HEAD)

## [3.0.0](https://github.com/railsadminteam/rails_admin/tree/v3.0.0) - 2022-03-21

[Full Changelog](https://github.com/railsadminteam/rails_admin/compare/v3.0.0.rc4...v3.0.0)

### Fixed

- Fix table sorting not working ([83a0c88](https://github.com/railsadminteam/rails_admin/commit/83a0c889f1de38a0b24c412b0f0f7484add86b29), [#3497](https://github.com/railsadminteam/rails_admin/issues/3497))
- Fix reset button by the query box not working ([4a583e9](https://github.com/railsadminteam/rails_admin/commit/4a583e924c5bef6bfc46d6a49ab751c2323ba23e))

## [3.0.0.rc4](https://github.com/railsadminteam/rails_admin/tree/v3.0.0.rc4) - 2022-03-13

[Full Changelog](https://github.com/railsadminteam/rails_admin/compare/v3.0.0.rc3...v3.0.0.rc4)

### Added

- 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))

### Changed

- Upgrade vendorized Flatpickr to 4.6.11 ([7f8c831](https://github.com/railsadminteam/rails_admin/commit/7f8c831b9aa407987ba89191c21040e2e72e366e))

### Fixed

- Fix not utilizing full browser width after Bootstrap 5 upgrade ([#3493](https://github.com/railsadminteam/rails_admin/pull/3493))
- Fix the style for show views broken on Bootstrap 5 upgrade ([#3491](https://github.com/railsadminteam/rails_admin/pull/3491))
- Fix Pundit 2.2 deprecation for not using Pundit::Authorization ([e38eb46](https://github.com/railsadminteam/rails_admin/commit/e38eb46ffe79cd866c34b837dd4cfbb65361558f))
- 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))

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

Expand Down
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@

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

## Announcements

### [Action required] Security issue

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

## Getting started

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

## Installation

1. On your gemfile: `gem 'rails_admin', ['>= 3.0.0.rc3', '< 4']`
1. On your gemfile: `gem 'rails_admin', '~> 3.0'`
2. Run `bundle install`
3. Run `rails g rails_admin:install`
4. Provide a namespace for the routes when asked
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/rails_admin/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<%= render "layouts/rails_admin/sidebar_navigation" %>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2">
<div class="container">
<div class="container-fluid">
<%= render template: 'layouts/rails_admin/content' %>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/rails_admin/main/history.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<% selected = (sort == property_name) %>
<% sort_direction = (sort_reverse ? "headerSortUp" : "headerSortDown" if selected) %>
<% 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"} : {})) %>
<th class="header <%= column[:css_class] %> <%= sort_direction if selected %>">
<th class="header <%= column[:css_class] %> <%= sort_direction if selected %>" data-href="<%= sort_location %>">
<%= column[:link_text] %>
</th>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion lib/rails_admin/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Version
MAJOR = 3
MINOR = 0
PATCH = 0
PRE = 'rc3'
PRE = nil

class << self
# @return [String]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rails_admin",
"version": "3.0.0-rc3",
"version": "3.0.0",
"description": "RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data.",
"homepage": "https://github.com/railsadminteam/rails_admin",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/rails_admin/main_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def get(action, params)
end

controller(RailsAdmin::MainController) do
include ::Pundit
include defined?(::Pundit::Authorization) ? ::Pundit::Authorization : ::Pundit
after_action :verify_authorized
end

Expand Down
6 changes: 6 additions & 0 deletions spec/integration/actions/history_index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
is_expected.to have_css(%([href="/admin/paper_trail_test/#{paper_trail_test.id}"]), count: 11)
end

it 'supports sorting', js: true do
visit history_index_path(model_name: 'paper_trail_test')
find('th.header', text: 'Item').click
is_expected.to have_css('th.item.headerSortDown')
end

context "when Kaminari's custom param_name is set" do
before { Kaminari.config.param_name = :pagina }
after { Kaminari.config.param_name = :page }
Expand Down
14 changes: 14 additions & 0 deletions spec/integration/actions/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@
end
end

it 'allows to clear the search query box', js: true do
visit index_path(model_name: 'player', query: @players[0].name)
is_expected.not_to have_content(@players[1].name)
find_button('Reset filters').click
is_expected.to have_content(@players[1].name)
end

it 'allows to filter on one attribute' do
RailsAdmin.config Player do
list do
Expand Down Expand Up @@ -824,6 +831,13 @@ def visit_page(page)
expect(find("tbody tr:nth-child(#{i + 1})")).to have_content(name)
end
end

it 'can be activated by clicking the table header', js: true do
visit index_path(model_name: 'player')
find('th.header', text: 'Name').trigger('click')
is_expected.to have_css('th.name_field.headerSortDown')
expect(all('tbody td.name_field').map(&:text)).to eq @players.map(&:name).sort
end
end

context 'on listing as compact json' do
Expand Down
1 change: 0 additions & 1 deletion spec/integration/widgets/datetimepicker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
visit new_path(model_name: 'field_test', field_test: {datetime_field: '2021-01-02T03:45:00'})
expect(find('[name="field_test[datetime_field]"]', visible: false).value).to eq '2021-01-02T03:45:00'
expect(find('#field_test_datetime_field + input').value).to eq 'samedi 02 janvier 2021 03:45'
pending 'flatpickr date parsing does not work well with a localized string'
find('#field_test_datetime_field + input').set 'mercredi 03 février 2021 04:55'
expect(find('[name="field_test[datetime_field]"]', visible: false).value).to eq '2021-02-03T04:55:00'
end
Expand Down
7 changes: 6 additions & 1 deletion src/rails_admin/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,15 @@ import I18n from "./i18n";
event.preventDefault();
$("#filters_box").html("");
$("hr.filters_box").hide();
$(this).parent().siblings("input[type='search']").val("");
$(this).siblings("input[type='search']").val("");
$(this).parents("form").submit();
});

$(document).on("click", "th.header", function (event) {
event.preventDefault();
window.Turbo.visit($(this).data("href"));
});

$(document).on(
"click",
"#fields_to_export label input#check_all",
Expand Down
Loading

0 comments on commit e6e4dfd

Please sign in to comment.