Added support of Active Admin v4#219
Merged
Fivell merged 3 commits intoJun 1, 2026
Merged
Conversation
Fivell
reviewed
Jun 1, 2026
Fivell
reviewed
Jun 1, 2026
Fivell
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for ActiveAdmin 4 (tested against
4.0.0.beta22) alongside the existing AA 3 support. The gem stays a pure-Ruby dependency —active_admin_importgains no Node/npm dependency, and neither does its test suite: Tailwind asset compilation is owned entirely by ActiveAdmin in host apps.The dependency range widens to
>= 3.0, < 4.1and the test matrix gains AA 4 cells (SQLite + PostgreSQL).Why
ActiveAdmin 4 moves from Sprockets/Sass to Tailwind + importmap and ships Formtastic 6. Two things needed to change for the import flow to work under AA 4 while staying compatible with AA 3:
error/alert/notice— aflash[:warning]is silently dropped (see_flash_messages.html.erb). The empty-file message picks the key by AA version::alerton AA 4,:warningon AA 3 — so AA 3 behavior is unchanged and AA 4 renders correctly.action_itemlinks carry a Tailwind class. The import link now accepts HTML options so it can match.Changes
Library
lib/active_admin_import/dsl.rb— empty-file message usesflash[:alert]on AA 4 andflash[:warning]on AA 3 (no behavior change for AA 3). The index "Import …"action_itemlink now forwards:action_item_html_optionstolink_to.lib/active_admin_import/options.rb— new:action_item_html_optionsoption, defaulting to{ class: 'action-item-button' }(the class AA 4 hardcodes for its action items; a no-op on AA 3).README.md— documents the new:action_item_html_optionsoption in the options table.Dependency
active_admin_import.gemspec— widensactiveadminfrom>= 3.0, < 4.0to>= 3.0, < 4.1.4.0.0.beta22). Bumping it to admit AA 4.1+ should come with a matching CI cell for that release.CI / test harness
.github/workflows/test.yml— adds AA4.0.0.beta22matrix rows (Rails 7.2 / 8.0), plus a dedicated PostgreSQL 16 + AA 4 job. No Node setup needed.Gemfile— on AA 4, loadscssbundling-rails+importmap-railsinstead ofsprockets-rails+sass-rails(Tailwind v4 conflicts with sass-rails); pins AA prerelease versions exactly so each CI cell tests the build it claims to.spec/support/rails_template.rb— on AA 4, runsactive_admin:assets(swaps the Sprockets SCSS/JS for AA 4's Tailwind CSS stub). No Tailwind compile: the specs assert on DOM structure and flash text, not visual styling, so an unstyled stub suffices and the suite stays Node-free.tasks/test.rake/spec/spec_helper.rb/spec/support/test_app_paths.rb(new) — skip the asset pipeline when generating the AA 4 test app, and key the cached app on the AA version via a shared helper (rails-<rails>-<db>-aa<aa>) so AA 3 and AA 4 apps — which generate structurally different apps — no longer collide in one cache slot.spec/support/import_form_selectors.rb(new) — centralizes the import-form DOM selectors so specs are not littered with literal IDs; AA 3 and AA 4 share the same selectors today.spec/import_spec.rb— specs reference the shared selectors instead of inline strings.Gemfile/spec/spec_helper.rb— removes the unusedcuprite+webricktest dependencies and pins Capybara to itsrack_testdriver explicitly. No spec uses a JavaScript / real-browser driver (none are taggedjs: true), so the suite needs neither Chrome nor a running app server.Test plan
4.0.0.beta22matrix cells green (Rails 7.2 / 8.0, SQLite).4.0.0.beta22+ PostgreSQL 16 job green.Follow-up
< 4.1cap (with a matching CI cell).AA-matrixed PostgreSQL job to cut duplication.version.rbchange in this MR).