Skip to content

3 0 stable#1

Open
maharshi-me wants to merge 47 commits intoDocBuddy:3-0-stablefrom
activeadmin:3-0-stable
Open

3 0 stable#1
maharshi-me wants to merge 47 commits intoDocBuddy:3-0-stablefrom
activeadmin:3-0-stable

Conversation

@maharshi-me
Copy link

No description provided.

mgrunberg and others added 30 commits April 30, 2024 18:03
Backport to 3-0 stable branch suppress ruby 3.3 warning (#8303)

```
/myapp/vendor/bundle/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34: warning: csv was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add csv to your Gemfile or gemspec. Also contact author of activeadmin-3.2.0 to add csv into its gemspec.
```

Co-authored-by: wonda-tea-coffee <lagrange.resolvent@gmail.com>
…ncorrect) (#8311)

Backport to 3.0 stable branch Recommend using target="_blank" instead of target="blank" (incorrect) (#8278)

Use target="_blank" instead of target="blank" (incorrect)

Co-authored-by: Nathan Broadbent <git@ndbroadbent.com>
To avoid deprecations related to Node 16 actions.

Also test against Ruby 3.3 and update all dependencies
Update actions

Prevent a deprecation message related to Node 16 actions
Update vendored jquery-ui

JavaScript files have been manually updated because:
- `jquery-ui-rails` is unmaintained and it is bundling 1.13.0
- An active fork of `jquery-ui-rails` is bundling 1.13.2, but there is
  a more recent version (1.13.3)
 
`escape-selector` has been removed because jQuery UI is using
jQuery's built-in escape selector. This selector is available from
version 3.0, which is required by Active Admin, so it should not be
a problem

Ref #8327

Ref:
- https://bugs.jqueryui.com/ticket/14991/
- jquery/jquery-ui#1957
* Fix strange context names

* Escape legend to prevent XSS
Update dependencies

Also:
- Backport #8344
- Use latest rubygems (partial backport of #8370)
- Backport #8372
Fix url redirects 

Issues identified with the help of `awesome_bot` gem
Fix strftime month directive

`%M` is minute of the hour, and Rails 7.2 is guarding against invalid
timestamps before executing migrations by default

This commit uses the correct zero-padded month directive `%m`

Fix #8368

Ref: https://ruby-doc.org/stdlib-3.1.0/libdoc/date/rdoc/DateTime.html#method-i-strftime
* improve counter_cache_col? check

Reimplementation of #7347
Fixes #7346.

Thanks @plashchynski for the work!

```
I have a model with some column ends with a "_count" substring.
This column doesn't appear on a show page.
It should appear as It is a regular column just like any other.
```

* fix specs
…8405)

move basic-button, dark-button, light-button and clearfix inclusions to the bottom (last rule before nesting)

The use of declarations after nested rules is currently deprecated in
Sass.

We have a bunch of mixins that have nested rules in their definition:
basic-button, dark-button, light-button, clearfix.

To be compatible with dartsass, the solution is to move the inclusion of
those mixins to the bottom.

In some scenarios, like dropdown_menu_button (dropdown_menu.scss) the
intention is to override default button styles. To keep that behaviour
I'm using `& {}` which is the recommended way in dartsass to put rules
below a nesting.

Read more about the deprecation here https://sass-lang.com/documentation/breaking-changes/mixed-decls/

Sadly libsass does not implement the deprecation. The only way to test
this commit is manually (I don't see the point on building a feature
test just to check building against a different sass engine. Specially
since v4 doesn't use sass).

Steps to test:
````
bin/rake local bundle add dartsass-rails
bin/rake local rails dartsass:install
cp tmp/development_apps/rails_71/app/assets/stylesheets/active_admin.scss tmp/development_apps/rails_71/app/assets/stylesheets/application.scss
bin/rake local rails dartsass:build
````

I tested this won't break anything by compiling CSS using sassc-rails
and checking rules order. I also did a manual review of development app

NOTE: I tested against Rails 7.1
* Improve form f.inputs attributes rendering (#8439)

* Improve rendering attributes for f.inputs

* Support rails 6.1

but use tag.attributes if available

* Use tag.legend instead of "<legend ..."

* use helpers to prevent calling resource methods (tag admin)

* be able to customize Tag resource form

#8439 improved form
attributes rendering but introduced an issue if host app has an admin
for Tag resource.

The problem is that `tag` (`tag.attributes`) refences the resource and
not the `TagHelper`.

Let's prefix the call with `helpers`.

---------

Co-authored-by: Amiel Martin <amiel.martin@gmail.com>
* Get ready for 3.2.4 release

* Update changelog
* Update dependencies

Relax sqlite3 version constraint because rails/rails#51636 is included
in the latest 7.1.4 release

* Fix bug report template and update to Rails 7.2

Current bug report template does not work because sqlite3 2.x is not
compatible with Rails 7.0.x.

This commit also:
- Test bug report template against Ruby 3.3
- Set config.eager_load to avoid a warning on stdout:
  ```
  config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:
  ```
- Default to `3-0-stable` branch when `ACTIVE_ADMIN_PATH` is not
  specified
- Add `force_ruby_platform` to `sqlite3` for uniformity with `master`
  branch
…8468)

add favicon for template app

We have some specs failing in Rails 7.2. The only hint we have in the
log is

```
No route matches [GET] "/favicon.ico" (ActionController::RoutingError)
```

Rails 7.2 new app generator does not use favicon.ico anymore. It uses a
png + meta "icon" tag.

Let's configure the icon in the template app to prevent this kind of
error.
#8469)

Use attribute_types instead of columns_hash to determine type

Previously, virtual attributes of type boolean with value `nil` would
not be rendered as status tag. This also improves boolean detection in
rare cases when an `attribute` declaration overrides the type detected
in the database.

Co-authored-by: Tilmann Singer <tils@tils.net>
* Optimize count query for `pagination_total: false` option (#6911)

* Remove duplicated delegation

`total_pages` is listed twice.

* Remove ORDER BY from count subquery

Queries like `SELECT COUNT(*) FROM (SELECT DISTINCT resources.* FROM resources ORDER BY resources.created_at DESC LIMIT 1 OFFSET 30) subquery_for_count`
are too inefficient

* add specs about ensure count query does not include ORDER BY clause

* exclude also select because based on https://github.com/activeadmin/activeadmin/pull/7489\#issuecomment-1554197081

---------

Co-authored-by: Rafael Sales <rafaelcds@gmail.com>
Co-authored-by: David Rodríguez <deivid-rodriguez>
Co-authored-by: Matias Grunberg <matias@yellowspot.dev>

* fix perform_database_query_matcher: make sure to keep match truthy after the first matched query

---------

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
Co-authored-by: Rafael Sales <rafaelcds@gmail.com>
Get ready for 3.2.5 release
Active Admin v3 can be used with the vite_rails gem, but the
instructions for doing so are buried in a discussion comment.

Also, using a modern build system like Vite will often lead to
deprecation warnings due to the older color functions used in Active
Admin's SCSS assets.

To address these issues, I've made some small improvements to Active
Admin's docs. Namely:

- Add a vite_rails section to the installation document.
- Mention the SCSS deprecation warnings in the "gotchas" document, with
  a workaround that specifically works with Vite.

As discussed in
<#8492>, it would
be great to solve the deprecation warnings rather than just hiding them,
but that will require some significant refactoring, which can be a
separate PR. In the meantime I wanted to improve the documentation to at
least point users in the right direction.
…w record form items (#8551)

Fix has_many custom attrs not being set on new record form items
* backport 8500: test against rails 8.0

* Update dependencies

- Downgrade zeitwerk to allow 3.1
- Use Ruby 3.0 to update Rails 7.0 and 7.1 dependencies

```
BUNDLE_GEMFILE=gemfiles/rails_70/Gemfile rvm use 3.0.7 do bash -c "bundle update && bundle update --bundler"
BUNDLE_GEMFILE=gemfiles/rails_71/Gemfile rvm use 3.0.7 do bash -c "bundle update && bundle update --bundler"
```

* Use Struct instead of OpenStruct

---------

Co-authored-by: Geremia Taglialatela <tagliala.dev@gmail.com>
Fix deprecation warning in Ruby 3.4 (#8593)

After upgrade to Ruby 3.4, our test suite outputs the following warning:

```
lib/active_admin/inputs/filters/select_input.rb:19: warning: string returned by <Symbol>.to_s will be frozen in the future
```

Co-authored-by: Yvan BARTHÉLEMY <223016+ybart@users.noreply.github.com>
Fix circular require warning in belongs_to.rb

When running specs with `RUBYOPTS='-w'`, numerous warnings are generated
due to a circular require between:
- `lib/active_admin/resource/belongs_to.rb`
- `lib/active_admin/resource.rb`

The warning message is:

```
warning: loading in progress, circular require considered harmful - ./lib/active_admin/resource.rb

```

Based on the code history, there is no specific reason for the inverse
require from `belongs_to` to `resource`.

This change removes the unnecessary require to eliminate the warnings.

Backports #8598 to `3-0-stable` branch
Update dependencies and test against Ruby 3.4

Additionally, in order to allow CI to run against all supported
Ruby versions:
  - Lock net-imap to ~> 0.4.18 on Rails 6.1
  - Lock nokogiri to ~> 1.17.2 on Rails 6.1 and Rails 7.0
  - Lock securerandom to ~> 0.3.2 on Rails 6.1 and Rails 7.0
  - Do not test Rails 7.1 against Ruby 3.0, change it to the oldest
    supported Rails version, 6.1
mgrunberg and others added 17 commits March 7, 2025 23:41
Support sortable argument in id_column

This is mostly useful to prevent sorting on tables with uuid PKs.

Sorting by uuid isn't very useful, and it can have problematic performance if the table is very large, even if there is an index.

Backport #8639
Update dependencies

- Use Ruby 3.0 for Rails 6.1
Update dependencies

Use Ruby 3.0 for Rails 6.1
Set rubygems version in CI to 3.5.7 to make the CI pass against all the
supported Ruby and Rails versions.

"Gemfile sanity is up to date" was failing with `rubygems` set to
`latest`
* Update Node, Ruby, and Actions in CI

* Fix RuboCop config

- Use plugins instead of require
- Fix a Style/StringLiterals offense
- Rename `Naming/PredicateName` to `Naming/PredicatePrefix`
Add Rails 8.1 compatibility

Additionally:
- Drop ruby < 3.0
- Bump minor version number
- Use Ruby 3.0 for Rails 6.1
- Use Ruby 3.1 for Rails 7.x
Ruby versions used for gem update:
- Rails 6.1: Ruby 3.0
- Rails 7.0/7.1/7.2: Ruby 3.1
- Rails 8.0/8.1: Ruby 3.4

Updates to `.gitignore` allow to preserve a clean working tree when
switching between `master` and `3-0-stable` branch
The changes introduced in #8839 dropped support for all Ruby versions
below 3.0, but the gemspec had not yet reflected this.

Update the gemspec to set the minimum required Ruby version to 3.0,
aligning documentation and configuration with the currently supported
runtime.
Additionally:
- Update GitHub Actions
- Use strings for Ruby version for consistency
- Update to Node 24
- Conditionally install rubygems according to Rails version
Ruby versions used for gem update:
- Rails 6.1: Ruby 3.0
- Rails 7.0/7.1/7.2: Ruby 3.1
- Rails 8.0/8.1: Ruby 3.2
Ruby versions used for gem update:
- Rails 6.1: Ruby 3.0
- Rails 7.0/7.1/7.2: Ruby 3.1
- Rails 8.0/8.1: Ruby 3.2

Additionally:
- Lock Devise to 4.9 because of formtastic/formtastic#1401
- Backport #8920 to v3
JavaScript files have been manually updated because:
- `jquery-ui-rails` is unmaintained and it is bundling 1.13.0
- An active fork of `jquery-ui-rails` is bundling 1.13.2, but there is
  a more recent version (1.13.3)

Files removed because they have been dropped from jQuery UI:
- form.js
- ie.js
- safe-active-element.js
- safe-blur.js

Additionally:
- Allow jQuery 4
- Bump minimum required jQuery to 3.7.1
- Fix an issue with Datepicker not being initialized correctly in
  jQuery 4 (See jquery/jquery-ui#2385 for more information)

Refs:
- #8656
- https://jqueryui.com/upgrade-guide/1.14/#removed-apis
- jquery/jquery-ui#2385
Allow resource_class to be passed as a String

the current pattern of using the class directly loads all models bound to activeadmin before using them, needlessly. besides that, the only purpose of it is to store the class name

this patch allows one to pass the class name directly instead, kind of like how activerecord avoids eager-loading association classes.

Co-authored-by: Tiago Cardoso <tiago.cardoso@withpersona.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants