diff --git a/.github/workflows/bug-report-template.yml b/.github/workflows/bug-report-template.yml index 85e179faf68..ef6bda1dd2e 100644 --- a/.github/workflows/bug-report-template.yml +++ b/.github/workflows/bug-report-template.yml @@ -15,7 +15,7 @@ concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' }} env: - RUBY_VERSION: ruby-3.2 + RUBY_VERSION: '4.0' jobs: bug_report_template_test: @@ -24,7 +24,7 @@ jobs: if: ${{ github.event_name == 'pull_request' || github.repository_owner == 'activeadmin' }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ env.RUBY_VERSION }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8418b777dc2..8b7312b880d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,29 +19,64 @@ jobs: fail-fast: false matrix: ruby: - - 3.2 - - 3.1 - - '3.0' + - '4.0' + - '3.4' + - '3.3' + - '3.2' + - '3.1' os: - ubuntu-latest deps: - - rails_61 - - rails_70 + - rails_81 + - rails_80 + - rails_72 - rails_71 + - rails_70 + - rails_61 + include: + - ruby: '3.0' + os: ubuntu-latest + deps: rails_61 + exclude: + - ruby: '3.1' + os: ubuntu-latest + deps: rails_80 + - ruby: '3.1' + os: ubuntu-latest + deps: rails_81 + - ruby: '3.4' + os: ubuntu-latest + deps: rails_61 + - ruby: '3.4' + os: ubuntu-latest + deps: rails_70 + - ruby: '4.0' + os: ubuntu-latest + deps: rails_61 + - ruby: '4.0' + os: ubuntu-latest + deps: rails_70 + - ruby: '4.0' + os: ubuntu-latest + deps: rails_71 + - ruby: '4.0' + os: ubuntu-latest + deps: rails_72 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - name: Configure bundler (default) run: | echo "BUNDLE_GEMFILE=Gemfile" >> "$GITHUB_ENV" - if: matrix.deps == 'rails_71' + if: matrix.deps == 'rails_81' - name: Configure bundler (alternative) run: | echo "BUNDLE_GEMFILE=gemfiles/${{ matrix.deps }}/Gemfile" >> "$GITHUB_ENV" - if: matrix.deps != 'rails_71' + if: matrix.deps != 'rails_81' - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true + rubygems: ${{ startsWith(matrix.deps, 'rails_8') && 'latest' || '3.5.7' }} - name: Setup git for test app setup run: | git config --global user.email activeadmin@ci.dummy @@ -49,7 +84,7 @@ jobs: - name: Create test app run: bin/rake setup - name: Restore cached RSpec runtimes - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: tmp/parallel_runtime_rspec.log key: runtimes-rspec-${{ matrix.ruby }}-${{ matrix.deps }}-${{ hashFiles('tmp/parallel_runtime_rspec.log') }} @@ -60,7 +95,7 @@ jobs: bin/parallel_rspec RSPEC_FILESYSTEM_CHANGES=true bin/rspec - name: Restore cached cucumber runtimes - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: tmp/parallel_runtime_cucumber.log key: runtimes-cucumber-${{ matrix.ruby }}-${{ matrix.deps }}-${{ hashFiles('tmp/parallel_runtime_cucumber.log') }} @@ -71,9 +106,11 @@ jobs: bin/parallel_cucumber --fail-fast bin/cucumber --profile filesystem-changes bin/cucumber --profile class-reloading - - uses: actions/upload-artifact@v3 + - name: Rename coverage file by matrix run + run: mv coverage/coverage.xml coverage/coverage-ruby-${{ matrix.ruby }}-${{ matrix.deps }}.xml + - uses: actions/upload-artifact@v5 with: - name: coverage + name: coverage-ruby-${{ matrix.ruby }}-${{ matrix.deps }} path: coverage if-no-files-found: error @@ -82,12 +119,14 @@ jobs: runs-on: ubuntu-latest needs: [test] steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v6 + - uses: actions/download-artifact@v5 with: - name: coverage path: coverage - - uses: codecov/codecov-action@v3 + pattern: coverage-ruby-* + merge-multiple: true + - uses: codecov/codecov-action@v4 with: + token: ${{ secrets.CODECOV_TOKEN }} directory: coverage fail_ci_if_error: true diff --git a/.github/workflows/gherkin-lint.yml b/.github/workflows/gherkin-lint.yml index cef7bb6b4e3..25f1651f5c1 100644 --- a/.github/workflows/gherkin-lint.yml +++ b/.github/workflows/gherkin-lint.yml @@ -11,15 +11,15 @@ on: - '**.feature' env: - NODE_VERSION: 18.x + NODE_VERSION: '24.x' jobs: gherkin_lint: name: Run gherkin-lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 with: node-version: ${{ env.NODE_VERSION }} cache: 'yarn' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 35ab097867a..74bdb503c42 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,14 +4,14 @@ on: pull_request: env: - RUBY_VERSION: 3.2 + RUBY_VERSION: '4.0' jobs: lint: name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ env.RUBY_VERSION }} diff --git a/.gitignore b/.gitignore index 0b5ebdc3e44..e26ea760672 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ /src /vendor/bundle /rails_70 +/dist +docs/.vitepress/cache +docs/.vitepress/dist diff --git a/.rubocop.yml b/.rubocop.yml index cd71fc0da30..29b4a38c848 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,7 +4,7 @@ inherit_mode: merge: - Include -require: +plugins: - rubocop-packaging - rubocop-rails - rubocop-rspec @@ -141,7 +141,7 @@ Layout/IndentationConsistency: Layout/IndentationWidth: Enabled: true -Naming/PredicateName: +Naming/PredicatePrefix: Enabled: true ForbiddenPrefixes: diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dced96e956..872c8ba090a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,78 @@ ## Unreleased +* Update vendored jQuery UI to 1.14.2 [#8670] by [@tagliala] (thanks to [@tobischo]) + +## 3.4.0 [☰](https://github.com/activeadmin/activeadmin/compare/v3.3.0..v3.4.0) + +* Add Rails 8.1 compatibility and drop Ruby < 3.0 support [#8837] by [@tagliala] + +## 3.3.0 [☰](https://github.com/activeadmin/activeadmin/compare/v3.2.5..v3.3.0) + +### Enhancements + +* Improve v3 docs regarding compatibility with vite_rails [#8548] by [@mattbrictson] +* Backport test against Rails 8.0 [#8556] by [@mgrunberg] and [@tagliala] +* Test against Ruby 3.4 [#8614] by [@tagliala] +* Backport Support sortable argument in id_column [#8650] by [@jaynetics] +* Backport Support title for id_column [#8652] by [@mgrunberg] + +### Bug Fixes + +* Backport Fix attributes passed to form has_many not being set on new record form items [#8551] by [@Fs00] +* Backport Fix deprecation warning in Ruby 3.4 [#8596] by [@tagliala] +* Backport Fix circular require warning in belongs_to.rb [#8601] by [@tagliala] + +## 3.2.5 [☰](https://github.com/activeadmin/activeadmin/compare/v3.2.4..v3.2.5) + +### Enhancements + +* Backport Add favicon to template app to fix Rails 7.2 test suite run [#8468] by [@mgrunberg] +* Backport Use attribute_types instead of columns_hash to determine type [#8469] by [@mgrunberg] +* Backport Optimize count query for pagination_total: false option [#8470] by [@mgrunberg] + +### Bug Fixes + +* Restore inner span tag to form inputs legend [#8467] by [@denisahearn] + +## 3.2.4 [☰](https://github.com/activeadmin/activeadmin/compare/v3.2.3..v3.2.4) + +### Enhancements + +* Test against Rails 7.2 [#8434] by [@mgrunberg] + +### Bug Fixes + +* Backport Improve form f.inputs attributes rendering [#8446] by [@amiel] + +## 3.2.3 [☰](https://github.com/activeadmin/activeadmin/compare/v3.2.2..v3.2.3) + +### Enhancements + +* Backport better implementation of counter-cache-column check [#8412] by [@plashchynski] + +### Bug Fixes + +* Remove deprecation warnings when building with dart sass >= 1.77.7 [#8405] by [@mgrunberg] + +## 3.2.2 [☰](https://github.com/activeadmin/activeadmin/compare/v3.2.1..v3.2.2) + +### Security Fixes + +* Backport Fix potential XSS issue when rendering form legends [#8349] by + [@deivid-rodriguez] + +### Enhancements + +* Update vendored jQuery UI to 1.13.3 [#8329] by [@tagliala] + +## 3.2.1 [☰](https://github.com/activeadmin/activeadmin/compare/v3.2.0..v3.2.1) + +### Enhancements + +* Backport Suppress ruby 3.3 warning [#8310] by [@mgrunberg] +* Backport Recommend using target="_blank" instead of target="blank" [#8311] by [@mgrunberg] + ## 3.2.0 [☰](https://github.com/activeadmin/activeadmin/compare/v3.1.0..v3.2.0) ### Security Fixes @@ -898,6 +970,28 @@ Please check [0-6-stable] for previous changes. [#8165]: https://github.com/activeadmin/activeadmin/pull/8165 [#8166]: https://github.com/activeadmin/activeadmin/pull/8166 [#8167]: https://github.com/activeadmin/activeadmin/pull/8167 +[#8310]: https://github.com/activeadmin/activeadmin/pull/8310 +[#8311]: https://github.com/activeadmin/activeadmin/pull/8311 +[#8329]: https://github.com/activeadmin/activeadmin/pull/8329 +[#8349]: https://github.com/activeadmin/activeadmin/pull/8349 +[#8405]: https://github.com/activeadmin/activeadmin/pull/8405 +[#8412]: https://github.com/activeadmin/activeadmin/pull/8412 +[#8434]: https://github.com/activeadmin/activeadmin/pull/8434 +[#8446]: https://github.com/activeadmin/activeadmin/pull/8446 +[#8467]: https://github.com/activeadmin/activeadmin/pull/8467 +[#8468]: https://github.com/activeadmin/activeadmin/pull/8468 +[#8469]: https://github.com/activeadmin/activeadmin/pull/8469 +[#8470]: https://github.com/activeadmin/activeadmin/pull/8470 +[#8548]: https://github.com/activeadmin/activeadmin/pull/8548 +[#8551]: https://github.com/activeadmin/activeadmin/pull/8551 +[#8556]: https://github.com/activeadmin/activeadmin/pull/8556 +[#8596]: https://github.com/activeadmin/activeadmin/pull/8596 +[#8601]: https://github.com/activeadmin/activeadmin/pull/8601 +[#8614]: https://github.com/activeadmin/activeadmin/pull/8614 +[#8650]: https://github.com/activeadmin/activeadmin/pull/8650 +[#8652]: https://github.com/activeadmin/activeadmin/pull/8652 +[#8670]: https://github.com/activeadmin/activeadmin/pull/8670 +[#8837]: https://github.com/activeadmin/activeadmin/pull/8837 [@1000ship]: https://github.com/1000ship [@5t111111]: https://github.com/5t111111 @@ -926,6 +1020,7 @@ Please check [0-6-stable] for previous changes. [@craigmcnamara]: https://github.com/craigmcnamara [@DanielHeath]: https://github.com/DanielHeath [@deivid-rodriguez]: https://github.com/deivid-rodriguez +[@denisahearn]: https://github.com/denisahearn [@dennisvdvliet]: https://github.com/dennisvdvliet [@dhyegofernando]: https://github.com/dhyegofernando [@dkniffin]: https://github.com/dkniffin @@ -977,6 +1072,7 @@ Please check [0-6-stable] for previous changes. [@Looooong]: https://github.com/Looooong [@lubosch]: https://github.com/lubosch [@markstory]: https://github.com/markstory +[@mattbrictson]: https://github.com/mattbrictson [@mauriciopasquier]: https://github.com/mauriciopasquier [@mconiglio]: https://github.com/mconiglio [@mgrunberg]: https://github.com/mgrunberg @@ -992,6 +1088,7 @@ Please check [0-6-stable] for previous changes. [@orkhan]: https://github.com/orkhan [@panasyuk]: https://github.com/panasyuk [@PChambino]: https://github.com/PChambino +[@plashchynski]: https://github.com/plashchynski [@potatosalad]: https://github.com/potatosalad [@pranas]: https://github.com/pranas [@ray-curran]: https://github.com/ray-curran @@ -1019,6 +1116,7 @@ Please check [0-6-stable] for previous changes. [@timoschilling]: https://github.com/timoschilling [@TimPetricola]: https://github.com/TimPetricola [@timwis]: https://github.com/timwis +[@tobischo]: https://github.com/tobischo [@tomgilligan]: https://github.com/tomgilligan [@TonyArra]: https://github.com/TonyArra [@tordans]: https://github.com/tordans diff --git a/Gemfile b/Gemfile index af671244c3e..db5483cca4e 100644 --- a/Gemfile +++ b/Gemfile @@ -8,13 +8,13 @@ group :development, :test do gem "pundit" gem "draper" - gem "devise" + gem "devise", "~> 4.9" # TODO: relax this dependency when formtastic/formtastic#1401 will be fixed - gem "rails", "~> 7.1.0" + gem "rails", "~> 8.1.0" gem "sprockets-rails" gem "sassc-rails" - gem "ransack", ">= 4.1.0" + gem "ransack", ">= 4.2.0" gem "formtastic", ">= 5.0.0" end @@ -25,9 +25,9 @@ group :test do gem "simplecov", require: false # Test coverage generator. Go to /coverage/ after running tests gem "simplecov-cobertura", require: false - gem "cucumber-rails", require: false, github: "cucumber/cucumber-rails", branch: "main" + gem "cucumber-rails", require: false gem "cucumber" - gem "database_cleaner" + gem "database_cleaner-active_record" gem "launchy" gem "parallel_tests" gem "rspec-rails" diff --git a/Gemfile.lock b/Gemfile.lock index 29e0d86d4aa..78ad1cc87be 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,18 +1,9 @@ -GIT - remote: https://github.com/cucumber/cucumber-rails.git - revision: 9879b81609b0871a0dc3bf675ace7bd0cd88c3cc - branch: main - specs: - cucumber-rails (3.0.0.rc.1) - capybara (>= 3.11, < 4) - cucumber (>= 5, < 10) - railties (>= 5.2, < 8) - PATH remote: . specs: - activeadmin (3.2.0) + activeadmin (3.4.0) arbre (~> 1.2, >= 1.2.1) + csv formtastic (>= 3.1) formtastic_i18n (>= 0.4) inherited_resources (~> 1.7) @@ -24,106 +15,100 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (7.1.0) - actionpack (= 7.1.0) - activesupport (= 7.1.0) + action_text-trix (2.1.16) + railties + actioncable (8.1.2) + actionpack (= 8.1.2) + activesupport (= 8.1.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.0) - actionpack (= 7.1.0) - activejob (= 7.1.0) - activerecord (= 7.1.0) - activestorage (= 7.1.0) - activesupport (= 7.1.0) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.1.0) - actionpack (= 7.1.0) - actionview (= 7.1.0) - activejob (= 7.1.0) - activesupport (= 7.1.0) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp + actionmailbox (8.1.2) + actionpack (= 8.1.2) + activejob (= 8.1.2) + activerecord (= 8.1.2) + activestorage (= 8.1.2) + activesupport (= 8.1.2) + mail (>= 2.8.0) + actionmailer (8.1.2) + actionpack (= 8.1.2) + actionview (= 8.1.2) + activejob (= 8.1.2) + activesupport (= 8.1.2) + mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (7.1.0) - actionview (= 7.1.0) - activesupport (= 7.1.0) + actionpack (8.1.2) + actionview (= 8.1.2) + activesupport (= 8.1.2) nokogiri (>= 1.8.5) rack (>= 2.2.4) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.0) - actionpack (= 7.1.0) - activerecord (= 7.1.0) - activestorage (= 7.1.0) - activesupport (= 7.1.0) + useragent (~> 0.16) + actiontext (8.1.2) + action_text-trix (~> 2.1.15) + actionpack (= 8.1.2) + activerecord (= 8.1.2) + activestorage (= 8.1.2) + activesupport (= 8.1.2) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.0) - activesupport (= 7.1.0) + actionview (8.1.2) + activesupport (= 8.1.2) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.1.0) - activesupport (= 7.1.0) + activejob (8.1.2) + activesupport (= 8.1.2) globalid (>= 0.3.6) - activemodel (7.1.0) - activesupport (= 7.1.0) - activemodel-serializers-xml (1.0.2) - activemodel (> 5.x) - activesupport (> 5.x) + activemodel (8.1.2) + activesupport (= 8.1.2) + activemodel-serializers-xml (1.0.3) + activemodel (>= 5.0.0.a) + activesupport (>= 5.0.0.a) builder (~> 3.1) - activerecord (7.1.0) - activemodel (= 7.1.0) - activesupport (= 7.1.0) + activerecord (8.1.2) + activemodel (= 8.1.2) + activesupport (= 8.1.2) timeout (>= 0.4.0) - activestorage (7.1.0) - actionpack (= 7.1.0) - activejob (= 7.1.0) - activerecord (= 7.1.0) - activesupport (= 7.1.0) + activestorage (8.1.2) + actionpack (= 8.1.2) + activejob (= 8.1.2) + activerecord (= 8.1.2) + activesupport (= 8.1.2) marcel (~> 1.0) - activesupport (7.1.0) + activesupport (8.1.2) base64 bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) + concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + json + logger (>= 1.4.2) minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) - addressable (2.8.5) - public_suffix (>= 2.0.2, < 6.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + addressable (2.8.8) + public_suffix (>= 2.0.2, < 8.0) arbre (1.7.0) activesupport (>= 3.0.0) ruby2_keywords (>= 0.0.2) - ast (2.4.2) - base64 (0.1.1) - bcrypt (3.1.19) - better_html (2.0.2) - actionview (>= 6.0) - activesupport (>= 6.0) - ast (~> 2.0) - erubi (~> 1.4) - parser (>= 2.4) - smart_properties - bigdecimal (3.1.4) - builder (3.2.4) - cancancan (3.5.0) - capybara (3.39.2) + ast (2.4.3) + base64 (0.3.0) + bcrypt (3.1.21) + bigdecimal (4.0.1) + builder (3.3.0) + cancancan (3.6.1) + capybara (3.40.0) addressable matrix mini_mime (>= 0.1.3) - nokogiri (~> 1.8) + nokogiri (~> 1.11) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) @@ -131,112 +116,125 @@ GEM chandler (0.9.0) netrc octokit (>= 2.2.0) - concurrent-ruby (1.2.2) - connection_pool (2.4.1) + childprocess (5.1.0) + logger (~> 1.5) + concurrent-ruby (1.3.6) + connection_pool (3.0.2) crass (1.0.6) - cucumber (8.0.0) - builder (~> 3.2, >= 3.2.4) - cucumber-ci-environment (~> 9.0, >= 9.0.4) - cucumber-core (~> 11.0, >= 11.0.0) - cucumber-cucumber-expressions (~> 15.1, >= 15.1.1) - cucumber-gherkin (~> 23.0, >= 23.0.1) - cucumber-html-formatter (~> 19.1, >= 19.1.0) - cucumber-messages (~> 18.0, >= 18.0.0) - diff-lcs (~> 1.5, >= 1.5.0) - mime-types (~> 3.4, >= 3.4.1) - multi_test (~> 1.1, >= 1.1.0) - sys-uname (~> 1.2, >= 1.2.2) - cucumber-ci-environment (9.2.0) - cucumber-core (11.0.0) - cucumber-gherkin (~> 23.0, >= 23.0.1) - cucumber-messages (~> 18.0, >= 18.0.0) - cucumber-tag-expressions (~> 4.1, >= 4.1.0) - cucumber-cucumber-expressions (15.2.0) - cucumber-gherkin (23.0.1) - cucumber-messages (~> 18.0, >= 18.0.0) - cucumber-html-formatter (19.2.0) - cucumber-messages (~> 18.0, >= 18.0.0) - cucumber-messages (18.0.0) - cucumber-tag-expressions (4.1.0) - cuprite (0.14.3) + csv (3.3.5) + cucumber (10.2.0) + base64 (~> 0.2) + builder (~> 3.2) + cucumber-ci-environment (> 9, < 12) + cucumber-core (> 15, < 17) + cucumber-cucumber-expressions (> 17, < 20) + cucumber-html-formatter (> 21, < 23) + diff-lcs (~> 1.5) + logger (~> 1.6) + mini_mime (~> 1.1) + multi_test (~> 1.1) + sys-uname (~> 1.3) + cucumber-ci-environment (11.0.0) + cucumber-core (16.1.1) + cucumber-gherkin (> 36, < 40) + cucumber-messages (> 31, < 33) + cucumber-tag-expressions (> 6, < 9) + cucumber-cucumber-expressions (19.0.0) + bigdecimal + cucumber-gherkin (38.0.0) + cucumber-messages (>= 31, < 33) + cucumber-html-formatter (22.3.0) + cucumber-messages (> 23, < 33) + cucumber-messages (32.0.1) + cucumber-rails (4.0.0) + capybara (>= 3.25, < 4) + cucumber (>= 7, < 11) + railties (>= 6.1, < 9) + cucumber-tag-expressions (8.1.0) + cuprite (0.17) capybara (~> 3.0) - ferrum (~> 0.13.0) - database_cleaner (2.0.2) - database_cleaner-active_record (>= 2, < 3) - database_cleaner-active_record (2.1.0) + ferrum (~> 0.17.0) + database_cleaner-active_record (2.2.2) activerecord (>= 5.a) - database_cleaner-core (~> 2.0.0) + database_cleaner-core (~> 2.0) database_cleaner-core (2.0.1) - date (3.3.3) - devise (4.9.3) + date (3.5.1) + devise (4.9.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) - diff-lcs (1.5.0) - docile (1.4.0) - draper (4.0.2) + diff-lcs (1.6.2) + docile (1.4.1) + draper (4.0.6) actionpack (>= 5.0) activemodel (>= 5.0) activemodel-serializers-xml (>= 1.0) activesupport (>= 5.0) request_store (>= 1.0) ruby2_keywords - drb (2.1.1) - ruby2_keywords - erubi (1.12.0) - faraday (2.7.11) - base64 - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) - faraday-net_http (3.0.2) - ferrum (0.13) + drb (2.2.3) + erb (6.0.1) + erubi (1.13.1) + faraday (2.14.0) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-net_http (3.4.2) + net-http (~> 0.5) + ferrum (0.17.1) addressable (~> 2.5) + base64 (~> 0.2) concurrent-ruby (~> 1.1) webrick (~> 1.7) - websocket-driver (>= 0.6, < 0.8) - ffi (1.16.3) + websocket-driver (~> 0.7) + ffi (1.17.3) + ffi (1.17.3-arm64-darwin) + ffi (1.17.3-x86_64-linux-gnu) formtastic (5.0.0) actionpack (>= 6.0.0) formtastic_i18n (0.7.0) - globalid (1.2.1) + globalid (1.3.0) activesupport (>= 6.1) - has_scope (0.8.1) - actionpack (>= 5.2) - activesupport (>= 5.2) - highline (2.1.0) - i18n (1.14.1) + has_scope (0.9.0) + actionpack (>= 7.0) + activesupport (>= 7.0) + highline (3.1.2) + reline + i18n (1.14.8) concurrent-ruby (~> 1.0) i18n-spec (0.6.0) iso - i18n-tasks (1.0.12) + i18n-tasks (1.1.2) activesupport (>= 4.0.2) ast (>= 2.1.0) - better_html (>= 1.0, < 3.0) erubi - highline (>= 2.0.0) + highline (>= 3.0.0) i18n - parser (>= 2.2.3.0) + parser (>= 3.2.2.1) + prism rails-i18n rainbow (>= 2.2.2, < 4.0) + ruby-progressbar (~> 1.8, >= 1.8.1) terminal-table (>= 1.5.1) inherited_resources (1.14.0) actionpack (>= 6.0) has_scope (>= 0.6) railties (>= 6.0) responders (>= 2) - io-console (0.6.0) - irb (1.8.1) - rdoc - reline (>= 0.3.8) + io-console (0.8.2) + irb (1.16.0) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) iso (0.4.0) i18n - jquery-rails (4.6.0) + jquery-rails (4.6.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - json (2.6.3) + json (2.18.0) kaminari (1.2.2) activesupport (>= 4.1.0) kaminari-actionview (= 1.2.2) @@ -249,165 +247,176 @@ GEM activerecord kaminari-core (= 1.2.2) kaminari-core (1.2.2) - kramdown (2.4.0) - rexml - language_server-protocol (3.17.0.3) - launchy (2.5.2) + kramdown (2.5.2) + rexml (>= 3.4.4) + language_server-protocol (3.17.0.5) + launchy (3.1.1) addressable (~> 2.8) - loofah (2.21.4) + childprocess (~> 5.0) + logger (~> 1.6) + lint_roller (1.1.0) + logger (1.7.0) + loofah (2.25.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) - mail (2.8.1) + mail (2.9.0) + logger mini_mime (>= 0.1.1) net-imap net-pop net-smtp - marcel (1.0.2) - matrix (0.4.2) - mime-types (3.5.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2023.1003) + marcel (1.1.0) + matrix (0.4.3) + memoist3 (1.0.0) mini_mime (1.1.5) - mini_portile2 (2.8.5) - minitest (5.20.0) + mini_portile2 (2.8.9) + minitest (6.0.1) + prism (~> 1.5) multi_test (1.1.0) - mutex_m (0.1.2) - net-imap (0.4.1) + net-http (0.9.1) + uri (>= 0.11.1) + net-imap (0.6.2) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.4.0) + net-smtp (0.5.1) net-protocol netrc (0.11.0) - nio4r (2.5.9) - nokogiri (1.15.4) + nio4r (2.7.5) + nokogiri (1.19.0) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.15.4-arm64-darwin) + nokogiri (1.19.0-arm64-darwin) racc (~> 1.4) - nokogiri (1.15.4-x86_64-linux) + nokogiri (1.19.0-x86_64-linux-gnu) racc (~> 1.4) - octokit (7.2.0) + octokit (10.0.0) faraday (>= 1, < 3) sawyer (~> 0.9) orm_adapter (0.5.0) - parallel (1.23.0) - parallel_tests (4.3.0) + parallel (1.27.0) + parallel_tests (5.5.0) parallel - parser (3.2.2.4) + parser (3.3.10.1) ast (~> 2.4.1) racc - psych (5.1.1) + pp (0.6.3) + prettyprint + prettyprint (0.2.0) + prism (1.9.0) + psych (5.3.1) + date stringio - public_suffix (5.0.3) - pundit (2.3.1) + public_suffix (7.0.2) + pundit (2.5.2) activesupport (>= 3.0.0) - racc (1.7.1) - rack (3.0.8) - rack-session (2.0.0) + racc (1.8.1) + rack (3.2.4) + rack-session (2.1.1) + base64 (>= 0.1.0) rack (>= 3.0.0) - rack-test (2.1.0) + rack-test (2.2.0) rack (>= 1.3) - rackup (2.1.0) + rackup (2.3.1) rack (>= 3) - webrick (~> 1.8) - rails (7.1.0) - actioncable (= 7.1.0) - actionmailbox (= 7.1.0) - actionmailer (= 7.1.0) - actionpack (= 7.1.0) - actiontext (= 7.1.0) - actionview (= 7.1.0) - activejob (= 7.1.0) - activemodel (= 7.1.0) - activerecord (= 7.1.0) - activestorage (= 7.1.0) - activesupport (= 7.1.0) + rails (8.1.2) + actioncable (= 8.1.2) + actionmailbox (= 8.1.2) + actionmailer (= 8.1.2) + actionpack (= 8.1.2) + actiontext (= 8.1.2) + actionview (= 8.1.2) + activejob (= 8.1.2) + activemodel (= 8.1.2) + activerecord (= 8.1.2) + activestorage (= 8.1.2) + activesupport (= 8.1.2) bundler (>= 1.15.0) - railties (= 7.1.0) - rails-dom-testing (2.2.0) + railties (= 8.1.2) + rails-dom-testing (2.3.0) activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) + rails-html-sanitizer (1.6.2) loofah (~> 2.21) - nokogiri (~> 1.14) - rails-i18n (7.0.8) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + rails-i18n (8.1.0) i18n (>= 0.7, < 2) - railties (>= 6.0.0, < 8) - railties (7.1.0) - actionpack (= 7.1.0) - activesupport (= 7.1.0) - irb + railties (>= 8.0.0, < 9) + railties (8.1.2) + actionpack (= 8.1.2) + activesupport (= 8.1.2) + irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) + tsort (>= 0.2) zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.0.6) - ransack (4.1.0) - activerecord (>= 6.1.5) - activesupport (>= 6.1.5) + rake (13.3.1) + ransack (4.4.1) + activerecord (>= 7.2) + activesupport (>= 7.2) i18n - rdoc (6.5.0) + rdoc (7.1.0) + erb psych (>= 4.0.0) - regexp_parser (2.8.1) - reline (0.3.9) + tsort + regexp_parser (2.11.3) + reline (0.6.3) io-console (~> 0.5) - request_store (1.5.1) + request_store (1.7.0) rack (>= 1.4) - responders (3.1.1) - actionpack (>= 5.2) - railties (>= 5.2) - rexml (3.2.6) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + responders (3.2.0) + actionpack (>= 7.0) + railties (>= 7.0) + rexml (3.4.4) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.7) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-rails (6.0.3) - actionpack (>= 6.1) - activesupport (>= 6.1) - railties (>= 6.1) - rspec-core (~> 3.12) - rspec-expectations (~> 3.12) - rspec-mocks (~> 3.12) - rspec-support (~> 3.12) - rspec-support (3.12.1) - rubocop (1.56.4) - base64 (~> 0.1.1) + rspec-support (~> 3.13.0) + rspec-rails (8.0.2) + actionpack (>= 7.2) + activesupport (>= 7.2) + railties (>= 7.2) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.7) + rubocop (1.84.0) json (~> 2.3) - language_server-protocol (>= 3.17.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) - parser (>= 3.2.2.3) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.1, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.49.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.29.0) - parser (>= 3.2.1.0) - rubocop-capybara (2.19.0) - rubocop (~> 1.41) - rubocop-factory_bot (2.24.0) - rubocop (~> 1.33) - rubocop-packaging (0.5.2) - rubocop (>= 1.33, < 2.0) - rubocop-rails (2.21.2) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.49.0) + parser (>= 3.3.7.2) + prism (~> 1.7) + rubocop-packaging (0.6.0) + lint_roller (~> 1.1.0) + rubocop (>= 1.72.1, < 2.0) + rubocop-rails (2.34.3) activesupport (>= 4.2.0) + lint_roller (~> 1.1) rack (>= 1.1) - rubocop (>= 1.33.0, < 2.0) - rubocop-rspec (2.24.1) - rubocop (~> 1.33) - rubocop-capybara (~> 2.17) - rubocop-factory_bot (~> 2.22) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.44.0, < 2.0) + rubocop-rspec (3.9.0) + lint_roller (~> 1.1) + rubocop (~> 1.81) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) sassc (2.4.0) @@ -418,54 +427,62 @@ GEM sprockets (> 3.0) sprockets-rails tilt - sawyer (0.9.2) + sawyer (0.9.3) addressable (>= 2.3.5) faraday (>= 0.17.3, < 3) + securerandom (0.4.1) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) - simplecov-cobertura (2.1.0) + simplecov-cobertura (3.1.0) rexml simplecov (~> 0.19) - simplecov-html (0.12.3) + simplecov-html (0.13.2) simplecov_json_formatter (0.1.4) - smart_properties (1.17.0) - sprockets (4.2.1) + sprockets (4.2.2) concurrent-ruby (~> 1.0) + logger rack (>= 2.2.4, < 4) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) + sprockets-rails (3.5.2) + actionpack (>= 6.1) + activesupport (>= 6.1) sprockets (>= 3.0.0) - sqlite3 (1.6.6) + sqlite3 (2.9.0) mini_portile2 (~> 2.8.0) - sqlite3 (1.6.6-arm64-darwin) - sqlite3 (1.6.6-x86_64-linux) - stringio (3.0.8) - sys-uname (1.2.3) + sqlite3 (2.9.0-arm64-darwin) + sqlite3 (2.9.0-x86_64-linux-gnu) + stringio (3.2.0) + sys-uname (1.4.1) ffi (~> 1.1) - terminal-table (3.0.2) - unicode-display_width (>= 1.1.1, < 3) - thor (1.2.2) - tilt (2.3.0) - timeout (0.4.0) + memoist3 (~> 1.0.0) + terminal-table (4.0.0) + unicode-display_width (>= 1.1.1, < 4) + thor (1.5.0) + tilt (2.7.0) + timeout (0.6.0) + tsort (0.2.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.5.0) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) + uri (1.1.1) + useragent (0.16.11) warden (1.2.9) rack (>= 2.0.9) - webrick (1.8.1) - websocket-driver (0.7.6) + webrick (1.9.2) + websocket-driver (0.8.0) + base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - yard (0.9.34) - zeitwerk (2.6.12) + yard (0.9.38) + zeitwerk (2.7.4) PLATFORMS - arm64-darwin-21 + arm64-darwin ruby x86_64-linux @@ -475,10 +492,10 @@ DEPENDENCIES capybara chandler cucumber - cucumber-rails! + cucumber-rails cuprite - database_cleaner - devise + database_cleaner-active_record + devise (~> 4.9) draper formtastic (>= 5.0.0) i18n-spec @@ -488,10 +505,10 @@ DEPENDENCIES octokit parallel_tests pundit - rails (~> 7.1.0) + rails (~> 8.1.0) rails-i18n rake - ransack (>= 4.1.0) + ransack (>= 4.2.0) rspec-rails rubocop rubocop-packaging @@ -506,4 +523,4 @@ DEPENDENCIES yard BUNDLED WITH - 2.4.8 + 4.0.5 diff --git a/README.md b/README.md index e3f31484d54..221c067cb6c 100644 --- a/README.md +++ b/README.md @@ -85,8 +85,8 @@ Thanks to [Tidelift][tidelift] and all our Tidelift subscribers. Thanks to [Open Collective][opencollective contributors] and all our Open Collective contributors. [Arbre]: https://github.com/activeadmin/arbre -[Devise]: https://github.com/plataformatec/devise -[Formtastic]: https://github.com/justinfrench/formtastic +[Devise]: https://github.com/heartcombo/devise +[Formtastic]: https://github.com/formtastic/formtastic [Inherited Resources]: https://github.com/activeadmin/inherited_resources [Kaminari]: https://github.com/kaminari/kaminari [Ransack]: https://github.com/activerecord-hackery/ransack diff --git a/activeadmin.gemspec b/activeadmin.gemspec index b3a9eea42b0..e76c8ca9c86 100644 --- a/activeadmin.gemspec +++ b/activeadmin.gemspec @@ -29,9 +29,10 @@ Gem::Specification.new do |s| "wiki_uri" => "https://github.com/activeadmin/activeadmin/wiki" } - s.required_ruby_version = ">= 2.6" + s.required_ruby_version = ">= 3.0" s.add_dependency "arbre", "~> 1.2", ">= 1.2.1" + s.add_dependency "csv" s.add_dependency "formtastic", ">= 3.1" s.add_dependency "formtastic_i18n", ">= 0.4" s.add_dependency "inherited_resources", "~> 1.7" diff --git a/app/assets/javascripts/active_admin/base.js b/app/assets/javascripts/active_admin/base.js index b8606232192..26ab04960d4 100644 --- a/app/assets/javascripts/active_admin/base.js +++ b/app/assets/javascripts/active_admin/base.js @@ -187,6 +187,7 @@ }; var options = input.data("datepicker-options"); input.datepicker($.extend(defaults, options)); + input.datepicker("show"); }); })(jQuery); var DropdownMenu = function() { @@ -468,23 +469,19 @@ $.fn["perPage"] = PerPage._jQueryInterface; $.fn["perPage"].Constructor = PerPage; })(jQuery); - function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - _setPrototypeOf(subClass, superClass); + function _inheritsLoose(t, o) { + t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); + function _setPrototypeOf(t, e) { + return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) { + return t.__proto__ = e, t; + }, _setPrototypeOf(t, e); } var TableCheckboxToggler = function(_CheckboxToggler) { - _inheritsLoose(TableCheckboxToggler, _CheckboxToggler); function TableCheckboxToggler() { return _CheckboxToggler.apply(this, arguments) || this; } + _inheritsLoose(TableCheckboxToggler, _CheckboxToggler); var _proto = TableCheckboxToggler.prototype; _proto._bind = function _bind() { var _this = this; diff --git a/app/assets/stylesheets/active_admin/_forms.scss b/app/assets/stylesheets/active_admin/_forms.scss index 93eb2d8a8ca..fc1ae8a374a 100644 --- a/app/assets/stylesheets/active_admin/_forms.scss +++ b/app/assets/stylesheets/active_admin/_forms.scss @@ -220,9 +220,8 @@ form { /* Buttons */ input[type=submit], input[type=button], button { - @include dark-button; cursor: pointer; - + @include dark-button; } .buttons, .actions { diff --git a/app/assets/stylesheets/active_admin/components/_comments.scss b/app/assets/stylesheets/active_admin/components/_comments.scss index c1c83aeb0de..80a10d93d53 100644 --- a/app/assets/stylesheets/active_admin/components/_comments.scss +++ b/app/assets/stylesheets/active_admin/components/_comments.scss @@ -2,10 +2,10 @@ .comments { .active_admin_comment { - @include clearfix; margin-top: 10px; margin-bottom: 20px; max-width: 700px; + @include clearfix; .active_admin_comment_meta { width: 130px; diff --git a/app/assets/stylesheets/active_admin/components/_dropdown_menu.scss b/app/assets/stylesheets/active_admin/components/_dropdown_menu.scss index b02f2046981..3815ec6ab30 100644 --- a/app/assets/stylesheets/active_admin/components/_dropdown_menu.scss +++ b/app/assets/stylesheets/active_admin/components/_dropdown_menu.scss @@ -3,9 +3,12 @@ .dropdown_menu_button { @include light-button; - position: relative; - padding-right: 22px !important; - cursor: pointer; + + & { + position: relative; + padding-right: 22px !important; + cursor: pointer; + } &:before { content: ' '; @@ -139,11 +142,11 @@ } &:last-child { + border: none; a { border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; } - border: none; } } } diff --git a/app/assets/stylesheets/active_admin/components/_pagination.scss b/app/assets/stylesheets/active_admin/components/_pagination.scss index bbed72488c5..d270deae763 100644 --- a/app/assets/stylesheets/active_admin/components/_pagination.scss +++ b/app/assets/stylesheets/active_admin/components/_pagination.scss @@ -38,8 +38,11 @@ margin-left: 4px; select { @include light-button; - @include rounded(0px); - padding: 1px 5px; + + & { + @include rounded(0px); + padding: 1px 5px; + } } } diff --git a/app/assets/stylesheets/active_admin/components/_table_tools.scss b/app/assets/stylesheets/active_admin/components/_table_tools.scss index 1b5e430c9a4..1935a55ac42 100644 --- a/app/assets/stylesheets/active_admin/components/_table_tools.scss +++ b/app/assets/stylesheets/active_admin/components/_table_tools.scss @@ -1,6 +1,6 @@ .table_tools { - @include clearfix; margin-bottom: 16px; + @include clearfix; } .table_tools .dropdown_menu { @@ -9,11 +9,14 @@ a.table_tools_button, .table_tools .dropdown_menu_button { @include light-button; - @include gradient(#FFFFFF, #F0F0F0); - @include border-colors(#d9d9d9, #d0d0d0, #c5c5c5); - font-size: 0.9em; - padding: 4px 14px 4px; - margin: 0; + + & { + @include gradient(#FFFFFF, #F0F0F0); + @include border-colors(#d9d9d9, #d0d0d0, #c5c5c5); + font-size: 0.9em; + padding: 4px 14px 4px; + margin: 0; + } &:not(.disabled) { &:hover { diff --git a/app/assets/stylesheets/active_admin/components/_tabs.scss b/app/assets/stylesheets/active_admin/components/_tabs.scss index e212ece7184..b64c4d10190 100644 --- a/app/assets/stylesheets/active_admin/components/_tabs.scss +++ b/app/assets/stylesheets/active_admin/components/_tabs.scss @@ -28,13 +28,16 @@ a { @include light-button; - @include gradient(#FFFFFF, #F0F0F0); - @include border-colors(#d9d9d9, #d0d0d0, #c5c5c5); - text-decoration: none; - border-radius: 0; - border-width: 1px .5px 1px .5px; - margin-right: 0; - padding: 4px 14px 4px; + + & { + @include gradient(#FFFFFF, #F0F0F0); + @include border-colors(#d9d9d9, #d0d0d0, #c5c5c5); + text-decoration: none; + border-radius: 0; + border-width: 1px .5px 1px .5px; + margin-right: 0; + padding: 4px 14px 4px; + } &:not(.disabled) { &:hover { diff --git a/app/assets/stylesheets/active_admin/mixins/_buttons.scss b/app/assets/stylesheets/active_admin/mixins/_buttons.scss index efb9462d66d..bd5bed138e5 100644 --- a/app/assets/stylesheets/active_admin/mixins/_buttons.scss +++ b/app/assets/stylesheets/active_admin/mixins/_buttons.scss @@ -17,13 +17,13 @@ } @mixin default-button { - @include basic-button; @include gradient(lighten($primary-color, 15%), darken($primary-color, 12%)); @include text-shadow(#000); box-shadow: 0 1px 1px rgba(0,0,0,0.10), 0 1px 0 0px rgba(255,255,255, 0.2) inset; border: solid 1px #484e53; @include border-colors(#616a71, #484e53, #363b3f); color: #efefef; + @include basic-button; &:not(.disabled) { &:hover{ @@ -38,13 +38,13 @@ } @mixin light-button { - @include basic-button; @include gradient(#FFFFFF, #E7E7E7); box-shadow: 0 1px 1px rgba(0,0,0,0.10), 0 1px 0 0 rgba(255,255,255, 0.8) inset; border: solid 1px #c7c7c7; @include border-colors(#d3d3d3, #c7c7c7, #c2c2c2); @include text-shadow; color: $primary-color; + @include basic-button; &:not(.disabled) { &:hover { diff --git a/app/assets/stylesheets/active_admin/pages/_logged_out.scss b/app/assets/stylesheets/active_admin/pages/_logged_out.scss index cb8c3b58673..cc7519e135b 100644 --- a/app/assets/stylesheets/active_admin/pages/_logged_out.scss +++ b/app/assets/stylesheets/active_admin/pages/_logged_out.scss @@ -28,13 +28,13 @@ body.logged_out { @include no-shadow; background: none; padding: 0; + margin-bottom: 0; li { padding: 10px 0; } input[type=text], input[type=email], input[type=password] { width: 70%; } &.buttons { margin-left: 20%; } - margin-bottom: 0; } } diff --git a/app/assets/stylesheets/active_admin/structure/_footer.scss b/app/assets/stylesheets/active_admin/structure/_footer.scss index ae1aca60f0a..3a5aba0c122 100644 --- a/app/assets/stylesheets/active_admin/structure/_footer.scss +++ b/app/assets/stylesheets/active_admin/structure/_footer.scss @@ -10,10 +10,10 @@ // -------------------------------------- Index Footer (Under Table) #index_footer { - @include clearfix; padding-top: 5px; text-align: right; font-size: 0.85em; + @include clearfix; } .index_content { clear: both; } diff --git a/app/assets/stylesheets/active_admin/structure/_title_bar.scss b/app/assets/stylesheets/active_admin/structure/_title_bar.scss index f44d77d7ad4..7379f397780 100644 --- a/app/assets/stylesheets/active_admin/structure/_title_bar.scss +++ b/app/assets/stylesheets/active_admin/structure/_title_bar.scss @@ -1,6 +1,5 @@ #title_bar { @include section-header; - @include clearfix; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.37); display: table; border-bottom-color: #EEE; @@ -9,6 +8,7 @@ margin: 0; padding: 10px $horizontal-page-margin; z-index: 800; + @include clearfix; #titlebar_left, #titlebar_right { height: 50px; @@ -32,8 +32,11 @@ span.action_item { & > a, & > .dropdown_menu > a { @include light-button; - padding: 12px 17px 10px; - margin: 0px; + + & { + padding: 12px 17px 10px; + margin: 0px; + } } } } diff --git a/app/javascript/active_admin/initializers/datepicker.js b/app/javascript/active_admin/initializers/datepicker.js index 2c8aabd6166..abf31fd506a 100644 --- a/app/javascript/active_admin/initializers/datepicker.js +++ b/app/javascript/active_admin/initializers/datepicker.js @@ -11,6 +11,9 @@ const options = input.data('datepicker-options'); input.datepicker($.extend(defaults, options)); + + // See https://github.com/jquery/jquery-ui/issues/2385 + input.datepicker('show'); }); })(jQuery); diff --git a/docs/0-installation.md b/docs/0-installation.md index 3140a72fadb..5df046f8f6a 100644 --- a/docs/0-installation.md +++ b/docs/0-installation.md @@ -136,6 +136,17 @@ You can **opt-in to using Webpacker for ActiveAdmin assets** as well by updating rails g active_admin:webpacker ``` +## vite_rails + +To use Active Admin with Vite, make sure the `@activeadmin/activeadmin` dependency is added to your `package.json` using e.g. Yarn: + +```sh +yarn add @activeadmin/activeadmin@^3 +``` + +Then follow the steps outlined in this discussion comment: https://github.com/activeadmin/activeadmin/discussions/7947#discussioncomment-5867902 + + [CHANGELOG]: https://github.com/activeadmin/activeadmin/blob/master/CHANGELOG.md [dashboard.rb]: https://github.com/activeadmin/activeadmin/blob/master/lib/generators/active_admin/install/templates/dashboard.rb [active_admin.rb]: https://github.com/activeadmin/activeadmin/blob/master/lib/generators/active_admin/install/templates/active_admin.rb.erb diff --git a/docs/1-general-configuration.md b/docs/1-general-configuration.md index a6a04c7bc11..51ab580085e 100644 --- a/docs/1-general-configuration.md +++ b/docs/1-general-configuration.md @@ -206,7 +206,7 @@ ActiveAdmin.setup do |config| config.namespace :admin do |admin| admin.build_menu :utility_navigation do |menu| menu.add label: "ActiveAdmin.info", url: "http://www.activeadmin.info", - html_options: { target: :blank } + html_options: { target: "_blank" } admin.add_current_user_to_menu menu admin.add_logout_button_to_menu menu end diff --git a/docs/14-gotchas.md b/docs/14-gotchas.md index 071880f87c3..dc989714edd 100644 --- a/docs/14-gotchas.md +++ b/docs/14-gotchas.md @@ -76,6 +76,14 @@ one, you can do one of these things: * You can remove all `require_tree` commands from your root level css files, where the `active_admin.scss` is in the tree. +## Deprecation warnings with modern sass build tools + +Active Admin v3's SCSS is written for [sassc](https://rubygems.org/gems/sassc), which follows an older version of the SCSS specification. If you use a Node-based build system like esbuild, webpacker, or vite, you may encounter deprecation warnings for color functions like this when compiling assets: + +> DEPRECATION WARNING: lighten() is deprecated + +As a quick workaround, you may be able to silence these warnings by passing the `quietDeps` scss compilation option in your build system. With vite, follow these instructions: (note this requires installing the `sass-embedded` dependency). + ## Conflicts ### With gems that provides a `search` class method on a model diff --git a/docs/2-resource-customization.md b/docs/2-resource-customization.md index a6f84204027..1f656bb21b7 100644 --- a/docs/2-resource-customization.md +++ b/docs/2-resource-customization.md @@ -289,7 +289,7 @@ config.namespace :admin do |admin| menu.add label: "Sites" do |sites| sites.add label: "Google", url: "http://google.com", - html_options: { target: :blank } + html_options: { target: "_blank" } sites.add label: "Facebook", url: "http://facebook.com" diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 511371fc8c6..de9316064cc 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -1,57 +1,64 @@ GEM remote: https://rubygems.org/ specs: - activesupport (7.1.0) + activesupport (8.1.1) base64 bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) + concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + json + logger (>= 1.4.2) minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) - addressable (2.8.5) - public_suffix (>= 2.0.2, < 6.0) - base64 (0.1.1) - bigdecimal (3.1.4) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + addressable (2.8.8) + public_suffix (>= 2.0.2, < 8.0) + base64 (0.3.0) + bigdecimal (4.0.1) coffee-script (2.4.1) coffee-script-source execjs - coffee-script-source (1.11.1) + coffee-script-source (1.12.2) colorator (1.1.0) - commonmarker (0.23.10) - concurrent-ruby (1.2.2) - connection_pool (2.4.1) - dnsruby (1.70.0) + commonmarker (0.23.12) + concurrent-ruby (1.3.6) + connection_pool (3.0.2) + csv (3.3.5) + dnsruby (1.73.1) + base64 (>= 0.2) + logger (~> 1.6) simpleidn (~> 0.2.1) - drb (2.1.1) - ruby2_keywords + drb (2.2.3) em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) - ethon (0.16.0) + ethon (0.18.0) ffi (>= 1.15.0) + logger eventmachine (1.2.7) - execjs (2.9.1) - faraday (2.7.11) - base64 - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) - faraday-net_http (3.0.2) - ffi (1.16.3) + execjs (2.10.0) + faraday (2.14.0) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-net_http (3.4.2) + net-http (~> 0.5) + ffi (1.17.3) forwardable-extended (2.6.0) - gemoji (3.0.1) - github-pages (228) - github-pages-health-check (= 1.17.9) - jekyll (= 3.9.3) - jekyll-avatar (= 0.7.0) - jekyll-coffeescript (= 1.1.1) - jekyll-commonmark-ghpages (= 0.4.0) - jekyll-default-layout (= 0.1.4) - jekyll-feed (= 0.15.1) + gemoji (4.1.0) + github-pages (232) + github-pages-health-check (= 1.18.2) + jekyll (= 3.10.0) + jekyll-avatar (= 0.8.0) + jekyll-coffeescript (= 1.2.2) + jekyll-commonmark-ghpages (= 0.5.1) + jekyll-default-layout (= 0.1.5) + jekyll-feed (= 0.17.0) jekyll-gist (= 1.5.0) - jekyll-github-metadata (= 2.13.0) + jekyll-github-metadata (= 2.16.1) jekyll-include-cache (= 0.2.1) jekyll-mentions (= 1.6.0) jekyll-optional-front-matter (= 0.3.2) @@ -78,30 +85,32 @@ GEM jekyll-theme-tactile (= 0.2.0) jekyll-theme-time-machine (= 0.2.0) jekyll-titles-from-headings (= 0.5.3) - jemoji (= 0.12.0) - kramdown (= 2.3.2) + jemoji (= 0.13.0) + kramdown (= 2.4.0) kramdown-parser-gfm (= 1.1.0) liquid (= 4.0.4) mercenary (~> 0.3) minima (= 2.5.1) - nokogiri (>= 1.13.6, < 2.0) - rouge (= 3.26.0) + nokogiri (>= 1.16.2, < 2.0) + rouge (= 3.30.0) terminal-table (~> 1.4) - github-pages-health-check (1.17.9) + webrick (~> 1.8) + github-pages-health-check (1.18.2) addressable (~> 2.3) dnsruby (~> 1.60) - octokit (~> 4.0) - public_suffix (>= 3.0, < 5.0) + octokit (>= 4, < 8) + public_suffix (>= 3.0, < 6.0) typhoeus (~> 1.3) html-pipeline (2.14.3) activesupport (>= 2) nokogiri (>= 1.4) - http_parser.rb (0.8.0) - i18n (1.14.1) + http_parser.rb (0.8.1) + i18n (1.14.8) concurrent-ruby (~> 1.0) - jekyll (3.9.3) + jekyll (3.10.0) addressable (~> 2.4) colorator (~> 1.0) + csv (~> 3.0) em-websocket (~> 0.5) i18n (>= 0.7, < 2) jekyll-sass-converter (~> 1.0) @@ -112,27 +121,28 @@ GEM pathutil (~> 0.9) rouge (>= 1.7, < 4) safe_yaml (~> 1.0) - jekyll-avatar (0.7.0) + webrick (>= 1.0) + jekyll-avatar (0.8.0) jekyll (>= 3.0, < 5.0) - jekyll-coffeescript (1.1.1) + jekyll-coffeescript (1.2.2) coffee-script (~> 2.2) - coffee-script-source (~> 1.11.1) + coffee-script-source (~> 1.12) jekyll-commonmark (1.4.0) commonmarker (~> 0.22) - jekyll-commonmark-ghpages (0.4.0) - commonmarker (~> 0.23.7) - jekyll (~> 3.9.0) + jekyll-commonmark-ghpages (0.5.1) + commonmarker (>= 0.23.7, < 1.1.0) + jekyll (>= 3.9, < 4.0) jekyll-commonmark (~> 1.4.0) rouge (>= 2.0, < 5.0) - jekyll-default-layout (0.1.4) - jekyll (~> 3.0) - jekyll-feed (0.15.1) + jekyll-default-layout (0.1.5) + jekyll (>= 3.0, < 5.0) + jekyll-feed (0.17.0) jekyll (>= 3.7, < 5.0) jekyll-gist (1.5.0) octokit (~> 4.2) - jekyll-github-metadata (2.13.0) + jekyll-github-metadata (2.16.1) jekyll (>= 3.4, < 5.0) - octokit (~> 4.0, != 4.4.0) + octokit (>= 4, < 7, != 4.4.0) jekyll-include-cache (0.2.1) jekyll (>= 3.7, < 5.0) jekyll-mentions (1.6.0) @@ -203,27 +213,31 @@ GEM jekyll (>= 3.3, < 5.0) jekyll-watch (2.2.1) listen (~> 3.0) - jemoji (0.12.0) - gemoji (~> 3.0) + jemoji (0.13.0) + gemoji (>= 3, < 5) html-pipeline (~> 2.2) jekyll (>= 3.0, < 5.0) - kramdown (2.3.2) + json (2.18.0) + kramdown (2.4.0) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) liquid (4.0.4) - listen (3.8.0) + listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) + logger (1.7.0) mercenary (0.3.6) - mini_portile2 (2.8.4) + mini_portile2 (2.8.9) minima (2.5.1) jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) - minitest (5.20.0) - mutex_m (0.1.2) - nokogiri (1.15.4) + minitest (6.0.1) + prism (~> 1.5) + net-http (0.9.1) + uri (>= 0.11.1) + nokogiri (1.19.0) mini_portile2 (~> 2.8.2) racc (~> 1.4) octokit (4.25.1) @@ -231,36 +245,35 @@ GEM sawyer (~> 0.9) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (4.0.7) - racc (1.7.1) + prism (1.7.0) + public_suffix (5.1.1) + racc (1.8.1) rb-fsevent (0.11.2) - rb-inotify (0.10.1) + rb-inotify (0.11.1) ffi (~> 1.0) - rexml (3.2.6) - rouge (3.26.0) - ruby2_keywords (0.0.5) - rubyzip (2.3.2) + rexml (3.4.4) + rouge (3.30.0) + rubyzip (2.4.1) safe_yaml (1.0.5) sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - sawyer (0.9.2) + sawyer (0.9.3) addressable (>= 2.3.5) faraday (>= 0.17.3, < 3) - simpleidn (0.2.1) - unf (~> 0.1.4) + securerandom (0.4.1) + simpleidn (0.2.3) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) - typhoeus (1.4.0) + typhoeus (1.4.1) ethon (>= 0.9.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.8.2) unicode-display_width (1.8.0) + uri (1.1.1) + webrick (1.9.2) PLATFORMS ruby @@ -269,4 +282,4 @@ DEPENDENCIES github-pages BUNDLED WITH - 2.4.13 + 4.0.3 diff --git a/features/edit_page.feature b/features/edit_page.feature index 5368e4e6dfa..7ed9be47873 100644 --- a/features/edit_page.feature +++ b/features/edit_page.feature @@ -6,8 +6,11 @@ Feature: Edit Page Given a category named "Music" exists And a user named "John Doe" exists And a post with the title "Hello World" written by "John Doe" exists + And a tag named "Bugs" exists And I am logged in - And a configuration of: + + Scenario: Default form with no config + Given a configuration of: """ ActiveAdmin.register Post do permit_params :custom_category_id, :author_id, :title, @@ -15,9 +18,7 @@ Feature: Edit Page end """ When I am on the index page for posts - - Scenario: Default form with no config - Given I follow "Edit" + And I follow "Edit" Then the "Title" field should contain "Hello World" And the "Body" field should contain "" And the "Category" field should contain "" @@ -47,6 +48,7 @@ Feature: Edit Page end end """ + When I am on the index page for posts And I follow "Edit" Then I should see a fieldset titled "Your Post" And I should see a fieldset titled "Publishing" @@ -76,6 +78,7 @@ Feature: Edit Page end end """ + When I am on the index page for posts And I follow "New" Then I follow "Posts" And I follow "Edit" @@ -107,6 +110,7 @@ Feature: Edit Page form partial: "form" end """ + When I am on the index page for posts And I follow "Edit" Then the "Title" field should contain "Hello World" And the "Body" field should contain "" @@ -115,3 +119,20 @@ Feature: Edit Page Then I should see "Post was successfully updated." And I should see the attribute "Title" with "Hello World from update" And I should see the attribute "Author" with "John Doe" + + Scenario: Generating a custom form for Tag resource + Given a configuration of: + """ + ActiveAdmin.register Tag do + form do |f| + f.inputs "Details" do + f.input :name + end + f.actions + end + end + """ + When I am on the index page for tags + And I follow "Edit" + Then I should see a fieldset titled "Details" + And the "Name" field should contain "Bugs" diff --git a/features/index/filters.feature b/features/index/filters.feature index 131c0fd1869..1afe2898abb 100644 --- a/features/index/filters.feature +++ b/features/index/filters.feature @@ -358,3 +358,21 @@ Feature: Index Filtering And I press "Filter" Then I should see current filter "fancy_filter" equal to "Not Starred" with label "Ransackable Custom Filter" And I should see "Hello World" + + Scenario: "counter cache"-like filters + Given a user named "Jane Doe" exists + And an index configuration of: + """ + ActiveAdmin.register User + """ + When I am on the index page for users + Then I should see "Displaying 1 User" + And I should see the following filters: + | Sign in count | number | + + When I fill in "Sign in count" with "0" + And I press "Filter" + Then I should see 1 users in the table + When I fill in "Sign in count" with "1" + And I press "Filter" + Then I should see "No Users found" diff --git a/features/index/index_as_table.feature b/features/index/index_as_table.feature index 469fed4dcf6..47151a013f7 100644 --- a/features/index/index_as_table.feature +++ b/features/index/index_as_table.feature @@ -25,6 +25,15 @@ Feature: Index as Table And I should see a link to "Edit" And I should see a link to "Delete" + Scenario: Viewing the default table with "counter-cache"-like columns + Given a user named "Jane Doe" exists + And an index configuration of: + """ + ActiveAdmin.register User + """ + When I am on the index page for users + Then I should see a sortable table header with "Sign In Count" + Scenario: Customizing the columns with symbols Given a post with the title "Hello World" and body "From the body" exists And an index configuration of: diff --git a/features/show/default_content.feature b/features/show/default_content.feature index ebc692d677b..54a83a7ea68 100644 --- a/features/show/default_content.feature +++ b/features/show/default_content.feature @@ -3,7 +3,7 @@ Feature: Show - Default Content Viewing the show page for a resource Background: - Given a unstarred post with the title "Hello World" written by "Jane Doe" exists + Given a unstarred post with the title "Hello World" written by "Jane Doe" in category "Stories" exists Scenario: Viewing the default show page Given a show configuration of: @@ -42,3 +42,20 @@ Feature: Show - Default Content And I should see the attribute "Body" with "Empty" And I should see the attribute "Created At" with a nicely formatted datetime And I should not see the attribute "Author" + + Scenario: Columns with "counter cache"-like names + Given a show configuration of: + """ + ActiveAdmin.register User + """ + Then I should see the attribute "First Name" with "Jane" + And I should see the attribute "Last Name" with "Doe" + And I should see the attribute "Sign In Count" with "0" + + Scenario: Counter cache columns + Given a show configuration of: + """ + ActiveAdmin.register Category + """ + Then I should see the attribute "Name" with "Stories" + And I should not see the attribute "Posts Count" diff --git a/features/step_definitions/configuration_steps.rb b/features/step_definitions/configuration_steps.rb index 17c4c774602..c009fdc9a5a 100644 --- a/features/step_definitions/configuration_steps.rb +++ b/features/step_definitions/configuration_steps.rb @@ -22,6 +22,8 @@ def load_aa_config(config_content) step "I am on the index page for posts" when "Category" step "I am on the index page for categories" + when "User" + step "I am on the index page for users" else # :nocov: raise "#{resource} is not supported" @@ -33,6 +35,14 @@ def load_aa_config(config_content) step "I am logged in" step "I am on the index page for posts" step 'I follow "View"' + when "User" + step "I am logged in" + step "I am on the index page for users" + step 'I follow "View"' + when "Category" + step "I am logged in" + step "I am on the index page for categories" + step 'I follow "View"' when "Tag" step "I am logged in" Tag.create! diff --git a/features/step_definitions/factory_steps.rb b/features/step_definitions/factory_steps.rb index 8cb67ec5acc..9bc7f5bcf79 100644 --- a/features/step_definitions/factory_steps.rb +++ b/features/step_definitions/factory_steps.rb @@ -28,6 +28,10 @@ def create_user(name, type = "User") Store.create! name: name end +Given /^a tag named "([^"]*)" exists$/ do |name| + Tag.create! name: name +end + Given /^I create a new post with the title "([^"]*)"$/ do |title| first(:link, "Posts").click click_link "New Post" diff --git a/features/step_definitions/filter_steps.rb b/features/step_definitions/filter_steps.rb index 23f79688d45..1080cc8fa6b 100644 --- a/features/step_definitions/filter_steps.rb +++ b/features/step_definitions/filter_steps.rb @@ -21,6 +21,10 @@ expect(page).to have_css ".filter_date_range label", text: label end +Then /^I should see a number filter for "([^"]*)"$/ do |label| + expect(page).to have_css ".filter_numeric label", text: label +end + Then /^I should see the following filters:$/ do |table| table.rows_hash.each do |label, type| step %{I should see a #{type} filter for "#{label}"} diff --git a/features/support/env.rb b/features/support/env.rb index 0dc324e0f7e..f20838639cf 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -58,7 +58,7 @@ Cucumber::Rails::Database.javascript_strategy = :truncation # Warden helpers to speed up login -# See https://github.com/plataformatec/devise/wiki/How-To:-Test-with-Capybara +# See https://github.com/heartcombo/devise/wiki/How-To:-Test-with-Capybara include Warden::Test::Helpers After do diff --git a/gemfiles/rails_61/Gemfile b/gemfiles/rails_61/Gemfile index bea83ec4258..4e7f5b35248 100644 --- a/gemfiles/rails_61/Gemfile +++ b/gemfiles/rails_61/Gemfile @@ -16,6 +16,16 @@ group :development, :test do gem "sprockets-rails" gem "sassc-rails" + + gem "concurrent-ruby", "1.3.4" # Ref: rails/rails#54260 + + # FIXME: relax these dependencies when Ruby 3.0 support will be dropped + gem "net-imap", "~> 0.4.18" + gem "nokogiri", "~> 1.17.2" + gem "securerandom", "~> 0.3.2" + + # FIXME: relax this dependency when Ruby 3.1 support will be dropped + gem "zeitwerk", "~> 2.6.18" end group :test do @@ -27,11 +37,11 @@ group :test do gem "simplecov-cobertura", require: false gem "cucumber-rails", require: false gem "cucumber" - gem "database_cleaner" + gem "database_cleaner-active_record" gem "launchy" gem "parallel_tests" gem "rspec-rails" - gem "sqlite3", platform: :mri + gem "sqlite3", "~> 1.7", platform: :mri # Translations gem "i18n-tasks" diff --git a/gemfiles/rails_61/Gemfile.lock b/gemfiles/rails_61/Gemfile.lock index a824c2b6c44..1d9048064b0 100644 --- a/gemfiles/rails_61/Gemfile.lock +++ b/gemfiles/rails_61/Gemfile.lock @@ -1,8 +1,9 @@ PATH remote: ../.. specs: - activeadmin (3.2.0) + activeadmin (3.4.0) arbre (~> 1.2, >= 1.2.1) + csv formtastic (>= 3.1) formtastic_i18n (>= 0.4) inherited_resources (~> 1.7) @@ -14,205 +15,205 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (6.1.7.6) - actionpack (= 6.1.7.6) - activesupport (= 6.1.7.6) + actioncable (6.1.7.10) + actionpack (= 6.1.7.10) + activesupport (= 6.1.7.10) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7.6) - actionpack (= 6.1.7.6) - activejob (= 6.1.7.6) - activerecord (= 6.1.7.6) - activestorage (= 6.1.7.6) - activesupport (= 6.1.7.6) + actionmailbox (6.1.7.10) + actionpack (= 6.1.7.10) + activejob (= 6.1.7.10) + activerecord (= 6.1.7.10) + activestorage (= 6.1.7.10) + activesupport (= 6.1.7.10) mail (>= 2.7.1) - actionmailer (6.1.7.6) - actionpack (= 6.1.7.6) - actionview (= 6.1.7.6) - activejob (= 6.1.7.6) - activesupport (= 6.1.7.6) + actionmailer (6.1.7.10) + actionpack (= 6.1.7.10) + actionview (= 6.1.7.10) + activejob (= 6.1.7.10) + activesupport (= 6.1.7.10) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.1.7.6) - actionview (= 6.1.7.6) - activesupport (= 6.1.7.6) + actionpack (6.1.7.10) + actionview (= 6.1.7.10) + activesupport (= 6.1.7.10) rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7.6) - actionpack (= 6.1.7.6) - activerecord (= 6.1.7.6) - activestorage (= 6.1.7.6) - activesupport (= 6.1.7.6) + actiontext (6.1.7.10) + actionpack (= 6.1.7.10) + activerecord (= 6.1.7.10) + activestorage (= 6.1.7.10) + activesupport (= 6.1.7.10) nokogiri (>= 1.8.5) - actionview (6.1.7.6) - activesupport (= 6.1.7.6) + actionview (6.1.7.10) + activesupport (= 6.1.7.10) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.1.7.6) - activesupport (= 6.1.7.6) + activejob (6.1.7.10) + activesupport (= 6.1.7.10) globalid (>= 0.3.6) - activemodel (6.1.7.6) - activesupport (= 6.1.7.6) - activemodel-serializers-xml (1.0.2) - activemodel (> 5.x) - activesupport (> 5.x) + activemodel (6.1.7.10) + activesupport (= 6.1.7.10) + activemodel-serializers-xml (1.0.3) + activemodel (>= 5.0.0.a) + activesupport (>= 5.0.0.a) builder (~> 3.1) - activerecord (6.1.7.6) - activemodel (= 6.1.7.6) - activesupport (= 6.1.7.6) - activerecord-jdbc-adapter (61.2-java) + activerecord (6.1.7.10) + activemodel (= 6.1.7.10) + activesupport (= 6.1.7.10) + activerecord-jdbc-adapter (61.3-java) activerecord (~> 6.1.0) - activerecord-jdbcsqlite3-adapter (61.2-java) - activerecord-jdbc-adapter (= 61.2) - jdbc-sqlite3 (~> 3.8, < 3.30) - activestorage (6.1.7.6) - actionpack (= 6.1.7.6) - activejob (= 6.1.7.6) - activerecord (= 6.1.7.6) - activesupport (= 6.1.7.6) + activerecord-jdbcsqlite3-adapter (61.3-java) + activerecord-jdbc-adapter (= 61.3) + jdbc-sqlite3 (~> 3.8) + activestorage (6.1.7.10) + actionpack (= 6.1.7.10) + activejob (= 6.1.7.10) + activerecord (= 6.1.7.10) + activesupport (= 6.1.7.10) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.7.6) + activesupport (6.1.7.10) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) zeitwerk (~> 2.3) - addressable (2.8.5) - public_suffix (>= 2.0.2, < 6.0) + addressable (2.8.8) + public_suffix (>= 2.0.2, < 8.0) arbre (1.7.0) activesupport (>= 3.0.0) ruby2_keywords (>= 0.0.2) - ast (2.4.2) - bcrypt (3.1.19) - bcrypt (3.1.19-java) - better_html (2.0.2) - actionview (>= 6.0) - activesupport (>= 6.0) - ast (~> 2.0) - erubi (~> 1.4) - parser (>= 2.4) - smart_properties - builder (3.2.4) - cancancan (3.5.0) - capybara (3.39.2) + ast (2.4.3) + base64 (0.3.0) + bcrypt (3.1.21) + bcrypt (3.1.21-java) + bigdecimal (4.0.1) + bigdecimal (4.0.1-java) + builder (3.3.0) + cancancan (3.6.1) + capybara (3.40.0) addressable matrix mini_mime (>= 0.1.3) - nokogiri (~> 1.8) + nokogiri (~> 1.11) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - concurrent-ruby (1.2.2) + childprocess (5.1.0) + logger (~> 1.5) + concurrent-ruby (1.3.4) crass (1.0.6) - cucumber (8.0.0) - builder (~> 3.2, >= 3.2.4) - cucumber-ci-environment (~> 9.0, >= 9.0.4) - cucumber-core (~> 11.0, >= 11.0.0) - cucumber-cucumber-expressions (~> 15.1, >= 15.1.1) - cucumber-gherkin (~> 23.0, >= 23.0.1) - cucumber-html-formatter (~> 19.1, >= 19.1.0) - cucumber-messages (~> 18.0, >= 18.0.0) - diff-lcs (~> 1.5, >= 1.5.0) - mime-types (~> 3.4, >= 3.4.1) - multi_test (~> 1.1, >= 1.1.0) - sys-uname (~> 1.2, >= 1.2.2) - cucumber-ci-environment (9.2.0) - cucumber-core (11.0.0) - cucumber-gherkin (~> 23.0, >= 23.0.1) - cucumber-messages (~> 18.0, >= 18.0.0) - cucumber-tag-expressions (~> 4.1, >= 4.1.0) - cucumber-cucumber-expressions (15.2.0) - cucumber-gherkin (23.0.1) - cucumber-messages (~> 18.0, >= 18.0.0) - cucumber-html-formatter (19.2.0) - cucumber-messages (~> 18.0, >= 18.0.0) - cucumber-messages (18.0.0) - cucumber-rails (2.6.1) - capybara (>= 2.18, < 4) - cucumber (>= 3.2, < 9) - mime-types (~> 3.3) - nokogiri (~> 1.10) - railties (>= 5.0, < 8) - rexml (~> 3.0) - webrick (~> 1.7) - cucumber-tag-expressions (4.1.0) - cuprite (0.14.3) + csv (3.3.5) + cucumber (9.2.1) + builder (~> 3.2) + cucumber-ci-environment (> 9, < 11) + cucumber-core (> 13, < 14) + cucumber-cucumber-expressions (~> 17.0) + cucumber-gherkin (> 24, < 28) + cucumber-html-formatter (> 20.3, < 22) + cucumber-messages (> 19, < 25) + diff-lcs (~> 1.5) + mini_mime (~> 1.1) + multi_test (~> 1.1) + sys-uname (~> 1.2) + cucumber-ci-environment (10.0.1) + cucumber-core (13.0.3) + cucumber-gherkin (>= 27, < 28) + cucumber-messages (>= 20, < 23) + cucumber-tag-expressions (> 5, < 7) + cucumber-cucumber-expressions (17.1.0) + bigdecimal + cucumber-gherkin (27.0.0) + cucumber-messages (>= 19.1.4, < 23) + cucumber-html-formatter (21.15.1) + cucumber-messages (> 19, < 28) + cucumber-messages (22.0.0) + cucumber-rails (3.1.1) + capybara (>= 3.11, < 4) + cucumber (>= 5, < 10) + railties (>= 5.2, < 9) + cucumber-tag-expressions (6.1.2) + cuprite (0.17) capybara (~> 3.0) - ferrum (~> 0.13.0) - database_cleaner (2.0.2) - database_cleaner-active_record (>= 2, < 3) - database_cleaner-active_record (2.1.0) + ferrum (~> 0.17.0) + database_cleaner-active_record (2.2.2) activerecord (>= 5.a) - database_cleaner-core (~> 2.0.0) + database_cleaner-core (~> 2.0) database_cleaner-core (2.0.1) - date (3.3.3) - date (3.3.3-java) - devise (4.9.2) + date (3.5.1) + date (3.5.1-java) + devise (4.9.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) - diff-lcs (1.5.0) - docile (1.4.0) - draper (4.0.2) + diff-lcs (1.6.2) + docile (1.4.1) + draper (4.0.6) actionpack (>= 5.0) activemodel (>= 5.0) activemodel-serializers-xml (>= 1.0) activesupport (>= 5.0) request_store (>= 1.0) ruby2_keywords - erubi (1.12.0) - ferrum (0.13) + erubi (1.13.1) + ferrum (0.17.1) addressable (~> 2.5) + base64 (~> 0.2) concurrent-ruby (~> 1.1) webrick (~> 1.7) - websocket-driver (>= 0.6, < 0.8) - ffi (1.16.3) - ffi (1.16.3-java) - formtastic (4.0.0) - actionpack (>= 5.2.0) + websocket-driver (~> 0.7) + ffi (1.17.3) + ffi (1.17.3-arm64-darwin) + ffi (1.17.3-java) + ffi (1.17.3-x86_64-linux-gnu) + formtastic (5.0.0) + actionpack (>= 6.0.0) formtastic_i18n (0.7.0) - globalid (1.2.1) + globalid (1.3.0) activesupport (>= 6.1) - has_scope (0.8.1) + has_scope (0.8.2) actionpack (>= 5.2) activesupport (>= 5.2) - highline (2.1.0) - i18n (1.14.1) + highline (3.1.2) + reline + i18n (1.14.8) concurrent-ruby (~> 1.0) i18n-spec (0.6.0) iso - i18n-tasks (1.0.12) + i18n-tasks (1.0.15) activesupport (>= 4.0.2) ast (>= 2.1.0) - better_html (>= 1.0, < 3.0) erubi highline (>= 2.0.0) i18n - parser (>= 2.2.3.0) + parser (>= 3.2.2.1) rails-i18n rainbow (>= 2.2.2, < 4.0) + ruby-progressbar (~> 1.8, >= 1.8.1) terminal-table (>= 1.5.1) inherited_resources (1.14.0) actionpack (>= 6.0) has_scope (>= 0.6) railties (>= 6.0) responders (>= 2) + io-console (0.8.2) + io-console (0.8.2-java) iso (0.4.0) i18n - jdbc-sqlite3 (3.28.0) - jquery-rails (4.6.0) + jdbc-sqlite3 (3.46.1.1) + jquery-rails (4.6.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - jruby-openssl (0.14.2-java) + jruby-openssl (0.15.5-java) kaminari (1.2.2) activesupport (>= 4.1.0) kaminari-actionview (= 1.2.2) @@ -225,122 +226,127 @@ GEM activerecord kaminari-core (= 1.2.2) kaminari-core (1.2.2) - launchy (2.5.2) + launchy (3.1.1) addressable (~> 2.8) - loofah (2.21.3) + childprocess (~> 5.0) + logger (~> 1.6) + logger (1.7.0) + loofah (2.25.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) - mail (2.8.1) + mail (2.9.0) + logger mini_mime (>= 0.1.1) net-imap net-pop net-smtp - marcel (1.0.2) - matrix (0.4.2) - method_source (1.0.0) - mime-types (3.5.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2023.1003) + marcel (1.1.0) + matrix (0.4.3) + memoist3 (1.0.0) + method_source (1.1.0) mini_mime (1.1.5) - mini_portile2 (2.8.4) - minitest (5.20.0) + mini_portile2 (2.8.9) + minitest (5.26.1) multi_test (1.1.0) - net-imap (0.4.1) + net-imap (0.4.23) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.4.0) + net-smtp (0.5.1) net-protocol - nio4r (2.5.9) - nio4r (2.5.9-java) - nokogiri (1.15.4) + nio4r (2.7.5) + nio4r (2.7.5-java) + nokogiri (1.17.2) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.15.4-arm64-darwin) + nokogiri (1.17.2-arm64-darwin) racc (~> 1.4) - nokogiri (1.15.4-java) + nokogiri (1.17.2-java) racc (~> 1.4) - nokogiri (1.15.4-x86_64-linux) + nokogiri (1.17.2-x86_64-linux) racc (~> 1.4) orm_adapter (0.5.0) - parallel (1.23.0) - parallel_tests (4.3.0) + parallel (1.27.0) + parallel_tests (4.10.1) parallel - parser (3.2.2.4) + parser (3.3.10.1) ast (~> 2.4.1) racc - public_suffix (5.0.3) - pundit (2.3.1) + public_suffix (6.0.2) + pundit (2.5.2) activesupport (>= 3.0.0) - racc (1.7.1) - racc (1.7.1-java) - rack (2.2.8) - rack-test (2.1.0) + racc (1.8.1) + racc (1.8.1-java) + rack (2.2.21) + rack-test (2.2.0) rack (>= 1.3) - rails (6.1.7.6) - actioncable (= 6.1.7.6) - actionmailbox (= 6.1.7.6) - actionmailer (= 6.1.7.6) - actionpack (= 6.1.7.6) - actiontext (= 6.1.7.6) - actionview (= 6.1.7.6) - activejob (= 6.1.7.6) - activemodel (= 6.1.7.6) - activerecord (= 6.1.7.6) - activestorage (= 6.1.7.6) - activesupport (= 6.1.7.6) + rails (6.1.7.10) + actioncable (= 6.1.7.10) + actionmailbox (= 6.1.7.10) + actionmailer (= 6.1.7.10) + actionpack (= 6.1.7.10) + actiontext (= 6.1.7.10) + actionview (= 6.1.7.10) + activejob (= 6.1.7.10) + activemodel (= 6.1.7.10) + activerecord (= 6.1.7.10) + activestorage (= 6.1.7.10) + activesupport (= 6.1.7.10) bundler (>= 1.15.0) - railties (= 6.1.7.6) + railties (= 6.1.7.10) sprockets-rails (>= 2.0.0) - rails-dom-testing (2.2.0) + rails-dom-testing (2.3.0) activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) + rails-html-sanitizer (1.6.2) loofah (~> 2.21) - nokogiri (~> 1.14) - rails-i18n (7.0.8) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + rails-i18n (7.0.10) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (6.1.7.6) - actionpack (= 6.1.7.6) - activesupport (= 6.1.7.6) + railties (6.1.7.10) + actionpack (= 6.1.7.10) + activesupport (= 6.1.7.10) method_source rake (>= 12.2) thor (~> 1.0) rainbow (3.1.1) - rake (13.0.6) - ransack (4.0.0) + rake (13.3.1) + ransack (4.3.0) activerecord (>= 6.1.5) activesupport (>= 6.1.5) i18n - regexp_parser (2.8.1) - request_store (1.5.1) + regexp_parser (2.11.3) + reline (0.6.3) + io-console (~> 0.5) + request_store (1.7.0) rack (>= 1.4) - responders (3.1.0) + responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.2.6) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + rexml (3.4.4) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.7) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-rails (6.0.3) + rspec-support (~> 3.13.0) + rspec-rails (6.1.5) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) - rspec-core (~> 3.12) - rspec-expectations (~> 3.12) - rspec-mocks (~> 3.12) - rspec-support (~> 3.12) - rspec-support (3.12.1) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.7) + ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) sassc (2.4.0) ffi (~> 1.9) @@ -350,51 +356,57 @@ GEM sprockets (> 3.0) sprockets-rails tilt + securerandom (0.3.2) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) - simplecov-cobertura (2.1.0) + simplecov-cobertura (3.1.0) rexml simplecov (~> 0.19) - simplecov-html (0.12.3) + simplecov-html (0.13.2) simplecov_json_formatter (0.1.4) - smart_properties (1.17.0) - sprockets (4.2.1) + sprockets (4.2.2) concurrent-ruby (~> 1.0) + logger rack (>= 2.2.4, < 4) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) + sprockets-rails (3.5.2) + actionpack (>= 6.1) + activesupport (>= 6.1) sprockets (>= 3.0.0) - sqlite3 (1.6.6) + sqlite3 (1.7.3) mini_portile2 (~> 2.8.0) - sqlite3 (1.6.6-arm64-darwin) - sqlite3 (1.6.6-x86_64-linux) - sys-uname (1.2.3) + sqlite3 (1.7.3-arm64-darwin) + sqlite3 (1.7.3-x86_64-linux) + sys-uname (1.4.1) ffi (~> 1.1) - terminal-table (3.0.2) - unicode-display_width (>= 1.1.1, < 3) - thor (1.2.2) - tilt (2.3.0) - timeout (0.4.0) + memoist3 (~> 1.0.0) + terminal-table (4.0.0) + unicode-display_width (>= 1.1.1, < 4) + thor (1.5.0) + tilt (2.7.0) + timeout (0.6.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.5.0) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) warden (1.2.9) rack (>= 2.0.9) - webrick (1.8.1) - websocket-driver (0.7.6) + webrick (1.9.2) + websocket-driver (0.8.0) + base64 websocket-extensions (>= 0.1.0) - websocket-driver (0.7.6-java) + websocket-driver (0.8.0-java) + base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.12) + zeitwerk (2.6.18) PLATFORMS - arm64-darwin-21 + arm64-darwin java ruby x86_64-linux @@ -404,16 +416,19 @@ DEPENDENCIES activerecord-jdbcsqlite3-adapter cancancan capybara + concurrent-ruby (= 1.3.4) cucumber cucumber-rails cuprite - database_cleaner + database_cleaner-active_record devise draper i18n-spec i18n-tasks jruby-openssl launchy + net-imap (~> 0.4.18) + nokogiri (~> 1.17.2) parallel_tests pundit rails (~> 6.1.0) @@ -421,11 +436,13 @@ DEPENDENCIES rake rspec-rails sassc-rails + securerandom (~> 0.3.2) simplecov simplecov-cobertura sprockets-rails - sqlite3 + sqlite3 (~> 1.7) webrick + zeitwerk (~> 2.6.18) BUNDLED WITH - 2.4.8 + 2.5.23 diff --git a/gemfiles/rails_70/Gemfile b/gemfiles/rails_70/Gemfile index 0b9b464ea1f..e606c296d6a 100644 --- a/gemfiles/rails_70/Gemfile +++ b/gemfiles/rails_70/Gemfile @@ -8,12 +8,19 @@ group :development, :test do gem "pundit" gem "draper" - gem "devise" + gem "devise", "~> 4.9" # TODO: relax this dependency when formtastic/formtastic#1401 will be fixed gem "rails", "~> 7.0.0" gem "sprockets-rails" gem "sassc-rails" + + # FIXME: relax these dependencies when Ruby 3.0 support will be dropped + gem "nokogiri", "~> 1.17.2" + gem "securerandom", "~> 0.3.2" + + # FIXME: relax this dependency when Ruby 3.1 support will be dropped + gem "zeitwerk", "~> 2.6.18" end group :test do @@ -25,11 +32,11 @@ group :test do gem "simplecov-cobertura", require: false gem "cucumber-rails", require: false gem "cucumber" - gem "database_cleaner" + gem "database_cleaner-active_record" gem "launchy" gem "parallel_tests" gem "rspec-rails" - gem "sqlite3", platform: :mri + gem "sqlite3", "~> 1.7", platform: :mri # Translations gem "i18n-tasks" diff --git a/gemfiles/rails_70/Gemfile.lock b/gemfiles/rails_70/Gemfile.lock index 1c9c4a7258d..4792f427fc1 100644 --- a/gemfiles/rails_70/Gemfile.lock +++ b/gemfiles/rails_70/Gemfile.lock @@ -1,8 +1,9 @@ PATH remote: ../.. specs: - activeadmin (3.2.0) + activeadmin (3.4.0) arbre (~> 1.2, >= 1.2.1) + csv formtastic (>= 3.1) formtastic_i18n (>= 0.4) inherited_resources (~> 1.7) @@ -14,198 +15,207 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (7.0.8) - actionpack (= 7.0.8) - activesupport (= 7.0.8) + actioncable (7.0.10) + actionpack (= 7.0.10) + activesupport (= 7.0.10) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.8) - actionpack (= 7.0.8) - activejob (= 7.0.8) - activerecord (= 7.0.8) - activestorage (= 7.0.8) - activesupport (= 7.0.8) + actionmailbox (7.0.10) + actionpack (= 7.0.10) + activejob (= 7.0.10) + activerecord (= 7.0.10) + activestorage (= 7.0.10) + activesupport (= 7.0.10) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.8) - actionpack (= 7.0.8) - actionview (= 7.0.8) - activejob (= 7.0.8) - activesupport (= 7.0.8) + actionmailer (7.0.10) + actionpack (= 7.0.10) + actionview (= 7.0.10) + activejob (= 7.0.10) + activesupport (= 7.0.10) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.8) - actionview (= 7.0.8) - activesupport (= 7.0.8) + actionpack (7.0.10) + actionview (= 7.0.10) + activesupport (= 7.0.10) + racc rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.8) - actionpack (= 7.0.8) - activerecord (= 7.0.8) - activestorage (= 7.0.8) - activesupport (= 7.0.8) + actiontext (7.0.10) + actionpack (= 7.0.10) + activerecord (= 7.0.10) + activestorage (= 7.0.10) + activesupport (= 7.0.10) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.8) - activesupport (= 7.0.8) + actionview (7.0.10) + activesupport (= 7.0.10) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.8) - activesupport (= 7.0.8) + activejob (7.0.10) + activesupport (= 7.0.10) globalid (>= 0.3.6) - activemodel (7.0.8) - activesupport (= 7.0.8) - activemodel-serializers-xml (1.0.2) - activemodel (> 5.x) - activesupport (> 5.x) + activemodel (7.0.10) + activesupport (= 7.0.10) + activemodel-serializers-xml (1.0.3) + activemodel (>= 5.0.0.a) + activesupport (>= 5.0.0.a) builder (~> 3.1) - activerecord (7.0.8) - activemodel (= 7.0.8) - activesupport (= 7.0.8) - activestorage (7.0.8) - actionpack (= 7.0.8) - activejob (= 7.0.8) - activerecord (= 7.0.8) - activesupport (= 7.0.8) + activerecord (7.0.10) + activemodel (= 7.0.10) + activesupport (= 7.0.10) + activestorage (7.0.10) + actionpack (= 7.0.10) + activejob (= 7.0.10) + activerecord (= 7.0.10) + activesupport (= 7.0.10) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.8) + activesupport (7.0.10) + base64 + benchmark (>= 0.3) + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) + mutex_m + securerandom (>= 0.3) tzinfo (~> 2.0) - addressable (2.8.5) - public_suffix (>= 2.0.2, < 6.0) + addressable (2.8.8) + public_suffix (>= 2.0.2, < 8.0) arbre (1.7.0) activesupport (>= 3.0.0) ruby2_keywords (>= 0.0.2) - ast (2.4.2) - bcrypt (3.1.19) - better_html (2.0.2) - actionview (>= 6.0) - activesupport (>= 6.0) - ast (~> 2.0) - erubi (~> 1.4) - parser (>= 2.4) - smart_properties - builder (3.2.4) - cancancan (3.5.0) - capybara (3.39.2) + ast (2.4.3) + base64 (0.3.0) + bcrypt (3.1.21) + benchmark (0.5.0) + bigdecimal (4.0.1) + builder (3.3.0) + cancancan (3.6.1) + capybara (3.40.0) addressable matrix mini_mime (>= 0.1.3) - nokogiri (~> 1.8) + nokogiri (~> 1.11) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - concurrent-ruby (1.2.2) + childprocess (5.1.0) + logger (~> 1.5) + concurrent-ruby (1.3.6) crass (1.0.6) - cucumber (8.0.0) - builder (~> 3.2, >= 3.2.4) - cucumber-ci-environment (~> 9.0, >= 9.0.4) - cucumber-core (~> 11.0, >= 11.0.0) - cucumber-cucumber-expressions (~> 15.1, >= 15.1.1) - cucumber-gherkin (~> 23.0, >= 23.0.1) - cucumber-html-formatter (~> 19.1, >= 19.1.0) - cucumber-messages (~> 18.0, >= 18.0.0) - diff-lcs (~> 1.5, >= 1.5.0) - mime-types (~> 3.4, >= 3.4.1) - multi_test (~> 1.1, >= 1.1.0) - sys-uname (~> 1.2, >= 1.2.2) - cucumber-ci-environment (9.2.0) - cucumber-core (11.0.0) - cucumber-gherkin (~> 23.0, >= 23.0.1) - cucumber-messages (~> 18.0, >= 18.0.0) - cucumber-tag-expressions (~> 4.1, >= 4.1.0) - cucumber-cucumber-expressions (15.2.0) - cucumber-gherkin (23.0.1) - cucumber-messages (~> 18.0, >= 18.0.0) - cucumber-html-formatter (19.2.0) - cucumber-messages (~> 18.0, >= 18.0.0) - cucumber-messages (18.0.0) - cucumber-rails (2.6.1) - capybara (>= 2.18, < 4) - cucumber (>= 3.2, < 9) - mime-types (~> 3.3) - nokogiri (~> 1.10) - railties (>= 5.0, < 8) - rexml (~> 3.0) - webrick (~> 1.7) - cucumber-tag-expressions (4.1.0) - cuprite (0.14.3) + csv (3.3.5) + cucumber (9.2.1) + builder (~> 3.2) + cucumber-ci-environment (> 9, < 11) + cucumber-core (> 13, < 14) + cucumber-cucumber-expressions (~> 17.0) + cucumber-gherkin (> 24, < 28) + cucumber-html-formatter (> 20.3, < 22) + cucumber-messages (> 19, < 25) + diff-lcs (~> 1.5) + mini_mime (~> 1.1) + multi_test (~> 1.1) + sys-uname (~> 1.2) + cucumber-ci-environment (10.0.1) + cucumber-core (13.0.3) + cucumber-gherkin (>= 27, < 28) + cucumber-messages (>= 20, < 23) + cucumber-tag-expressions (> 5, < 7) + cucumber-cucumber-expressions (17.1.0) + bigdecimal + cucumber-gherkin (27.0.0) + cucumber-messages (>= 19.1.4, < 23) + cucumber-html-formatter (21.15.1) + cucumber-messages (> 19, < 28) + cucumber-messages (22.0.0) + cucumber-rails (3.1.1) + capybara (>= 3.11, < 4) + cucumber (>= 5, < 10) + railties (>= 5.2, < 9) + cucumber-tag-expressions (6.1.2) + cuprite (0.17) capybara (~> 3.0) - ferrum (~> 0.13.0) - database_cleaner (2.0.2) - database_cleaner-active_record (>= 2, < 3) - database_cleaner-active_record (2.1.0) + ferrum (~> 0.17.0) + database_cleaner-active_record (2.2.2) activerecord (>= 5.a) - database_cleaner-core (~> 2.0.0) + database_cleaner-core (~> 2.0) database_cleaner-core (2.0.1) - date (3.3.3) - devise (4.9.2) + date (3.5.1) + devise (4.9.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) - diff-lcs (1.5.0) - docile (1.4.0) - draper (4.0.2) + diff-lcs (1.6.2) + docile (1.4.1) + draper (4.0.6) actionpack (>= 5.0) activemodel (>= 5.0) activemodel-serializers-xml (>= 1.0) activesupport (>= 5.0) request_store (>= 1.0) ruby2_keywords - erubi (1.12.0) - ferrum (0.13) + drb (2.2.3) + erubi (1.13.1) + ferrum (0.17.1) addressable (~> 2.5) + base64 (~> 0.2) concurrent-ruby (~> 1.1) webrick (~> 1.7) - websocket-driver (>= 0.6, < 0.8) - ffi (1.16.3) - formtastic (4.0.0) - actionpack (>= 5.2.0) + websocket-driver (~> 0.7) + ffi (1.17.3) + ffi (1.17.3-arm64-darwin) + ffi (1.17.3-x86_64-linux-gnu) + formtastic (5.0.0) + actionpack (>= 6.0.0) formtastic_i18n (0.7.0) - globalid (1.2.1) + globalid (1.3.0) activesupport (>= 6.1) - has_scope (0.8.1) - actionpack (>= 5.2) - activesupport (>= 5.2) - highline (2.1.0) - i18n (1.14.1) + has_scope (0.9.0) + actionpack (>= 7.0) + activesupport (>= 7.0) + highline (3.1.2) + reline + i18n (1.14.8) concurrent-ruby (~> 1.0) i18n-spec (0.6.0) iso - i18n-tasks (1.0.12) + i18n-tasks (1.1.2) activesupport (>= 4.0.2) ast (>= 2.1.0) - better_html (>= 1.0, < 3.0) erubi - highline (>= 2.0.0) + highline (>= 3.0.0) i18n - parser (>= 2.2.3.0) + parser (>= 3.2.2.1) + prism rails-i18n rainbow (>= 2.2.2, < 4.0) + ruby-progressbar (~> 1.8, >= 1.8.1) terminal-table (>= 1.5.1) inherited_resources (1.14.0) actionpack (>= 6.0) has_scope (>= 0.6) railties (>= 6.0) responders (>= 2) + io-console (0.8.2) iso (0.4.0) i18n - jquery-rails (4.6.0) + jquery-rails (4.6.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) @@ -221,118 +231,125 @@ GEM activerecord kaminari-core (= 1.2.2) kaminari-core (1.2.2) - launchy (2.5.2) + launchy (3.1.1) addressable (~> 2.8) - loofah (2.21.3) + childprocess (~> 5.0) + logger (~> 1.6) + logger (1.7.0) + loofah (2.25.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) - mail (2.8.1) + mail (2.9.0) + logger mini_mime (>= 0.1.1) net-imap net-pop net-smtp - marcel (1.0.2) - matrix (0.4.2) - method_source (1.0.0) - mime-types (3.5.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2023.1003) + marcel (1.1.0) + matrix (0.4.3) + memoist3 (1.0.0) + method_source (1.1.0) mini_mime (1.1.5) - mini_portile2 (2.8.4) - minitest (5.20.0) + mini_portile2 (2.8.9) + minitest (5.27.0) multi_test (1.1.0) - net-imap (0.4.1) + mutex_m (0.3.0) + net-imap (0.5.13) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.4.0) + net-smtp (0.5.1) net-protocol - nio4r (2.5.9) - nokogiri (1.15.4) + nio4r (2.7.5) + nokogiri (1.17.2) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.15.4-arm64-darwin) + nokogiri (1.17.2-arm64-darwin) racc (~> 1.4) - nokogiri (1.15.4-x86_64-linux) + nokogiri (1.17.2-x86_64-linux) racc (~> 1.4) orm_adapter (0.5.0) - parallel (1.23.0) - parallel_tests (4.3.0) + parallel (1.27.0) + parallel_tests (5.5.0) parallel - parser (3.2.2.4) + parser (3.3.10.1) ast (~> 2.4.1) racc - public_suffix (5.0.3) - pundit (2.3.1) + prism (1.9.0) + public_suffix (6.0.2) + pundit (2.5.2) activesupport (>= 3.0.0) - racc (1.7.1) - rack (2.2.8) - rack-test (2.1.0) + racc (1.8.1) + rack (2.2.21) + rack-test (2.2.0) rack (>= 1.3) - rails (7.0.8) - actioncable (= 7.0.8) - actionmailbox (= 7.0.8) - actionmailer (= 7.0.8) - actionpack (= 7.0.8) - actiontext (= 7.0.8) - actionview (= 7.0.8) - activejob (= 7.0.8) - activemodel (= 7.0.8) - activerecord (= 7.0.8) - activestorage (= 7.0.8) - activesupport (= 7.0.8) + rails (7.0.10) + actioncable (= 7.0.10) + actionmailbox (= 7.0.10) + actionmailer (= 7.0.10) + actionpack (= 7.0.10) + actiontext (= 7.0.10) + actionview (= 7.0.10) + activejob (= 7.0.10) + activemodel (= 7.0.10) + activerecord (= 7.0.10) + activestorage (= 7.0.10) + activesupport (= 7.0.10) bundler (>= 1.15.0) - railties (= 7.0.8) - rails-dom-testing (2.2.0) + railties (= 7.0.10) + rails-dom-testing (2.3.0) activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) + rails-html-sanitizer (1.6.2) loofah (~> 2.21) - nokogiri (~> 1.14) - rails-i18n (7.0.8) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + rails-i18n (7.0.10) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.0.8) - actionpack (= 7.0.8) - activesupport (= 7.0.8) + railties (7.0.10) + actionpack (= 7.0.10) + activesupport (= 7.0.10) method_source rake (>= 12.2) thor (~> 1.0) zeitwerk (~> 2.5) rainbow (3.1.1) - rake (13.0.6) - ransack (4.0.0) + rake (13.3.1) + ransack (4.3.0) activerecord (>= 6.1.5) activesupport (>= 6.1.5) i18n - regexp_parser (2.8.1) - request_store (1.5.1) + regexp_parser (2.11.3) + reline (0.6.3) + io-console (~> 0.5) + request_store (1.7.0) rack (>= 1.4) - responders (3.1.0) - actionpack (>= 5.2) - railties (>= 5.2) - rexml (3.2.6) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + responders (3.2.0) + actionpack (>= 7.0) + railties (>= 7.0) + rexml (3.4.4) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.7) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-rails (6.0.3) - actionpack (>= 6.1) - activesupport (>= 6.1) - railties (>= 6.1) - rspec-core (~> 3.12) - rspec-expectations (~> 3.12) - rspec-mocks (~> 3.12) - rspec-support (~> 3.12) - rspec-support (3.12.1) + rspec-support (~> 3.13.0) + rspec-rails (7.1.1) + actionpack (>= 7.0) + activesupport (>= 7.0) + railties (>= 7.0) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.7) + ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) sassc (2.4.0) ffi (~> 1.9) @@ -342,49 +359,54 @@ GEM sprockets (> 3.0) sprockets-rails tilt + securerandom (0.3.2) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) - simplecov-cobertura (2.1.0) + simplecov-cobertura (3.1.0) rexml simplecov (~> 0.19) - simplecov-html (0.12.3) + simplecov-html (0.13.2) simplecov_json_formatter (0.1.4) - smart_properties (1.17.0) - sprockets (4.2.1) + sprockets (4.2.2) concurrent-ruby (~> 1.0) + logger rack (>= 2.2.4, < 4) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) + sprockets-rails (3.5.2) + actionpack (>= 6.1) + activesupport (>= 6.1) sprockets (>= 3.0.0) - sqlite3 (1.6.6) + sqlite3 (1.7.3) mini_portile2 (~> 2.8.0) - sqlite3 (1.6.6-arm64-darwin) - sqlite3 (1.6.6-x86_64-linux) - sys-uname (1.2.3) + sqlite3 (1.7.3-arm64-darwin) + sqlite3 (1.7.3-x86_64-linux) + sys-uname (1.4.1) ffi (~> 1.1) - terminal-table (3.0.2) - unicode-display_width (>= 1.1.1, < 3) - thor (1.2.2) - tilt (2.3.0) - timeout (0.4.0) + memoist3 (~> 1.0.0) + terminal-table (4.0.0) + unicode-display_width (>= 1.1.1, < 4) + thor (1.5.0) + tilt (2.7.0) + timeout (0.6.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.5.0) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) warden (1.2.9) rack (>= 2.0.9) - webrick (1.8.1) - websocket-driver (0.7.6) + webrick (1.9.2) + websocket-driver (0.8.0) + base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.12) + zeitwerk (2.6.18) PLATFORMS - arm64-darwin-21 + arm64-darwin ruby x86_64-linux @@ -395,12 +417,13 @@ DEPENDENCIES cucumber cucumber-rails cuprite - database_cleaner - devise + database_cleaner-active_record + devise (~> 4.9) draper i18n-spec i18n-tasks launchy + nokogiri (~> 1.17.2) parallel_tests pundit rails (~> 7.0.0) @@ -408,11 +431,13 @@ DEPENDENCIES rake rspec-rails sassc-rails + securerandom (~> 0.3.2) simplecov simplecov-cobertura sprockets-rails - sqlite3 + sqlite3 (~> 1.7) webrick + zeitwerk (~> 2.6.18) BUNDLED WITH - 2.4.8 + 2.6.9 diff --git a/gemfiles/rails_71/Gemfile b/gemfiles/rails_71/Gemfile new file mode 100644 index 00000000000..76f14125af6 --- /dev/null +++ b/gemfiles/rails_71/Gemfile @@ -0,0 +1,62 @@ +# frozen_string_literal: true +source "https://rubygems.org" + +group :development, :test do + gem "rake" + + gem "cancancan" + gem "pundit" + + gem "draper" + gem "devise", "~> 4.9" # TODO: relax this dependency when formtastic/formtastic#1401 will be fixed + + gem "rails", "~> 7.1.0" + + gem "sprockets-rails" + gem "sassc-rails" + gem "ransack", ">= 4.1.0" + gem "formtastic", ">= 5.0.0" + + # FIXME: relax this dependency when Ruby 3.1 support will be dropped + gem "zeitwerk", "~> 2.6.18" +end + +group :test do + gem "cuprite" + gem "capybara" + gem "webrick" + + gem "simplecov", require: false # Test coverage generator. Go to /coverage/ after running tests + gem "simplecov-cobertura", require: false + gem "cucumber-rails", require: false + gem "cucumber" + gem "database_cleaner-active_record" + gem "launchy" + gem "parallel_tests" + gem "rspec-rails" + gem "sqlite3", platform: :mri + + # Translations + gem "i18n-tasks" + gem "i18n-spec" + gem "rails-i18n" # Provides default i18n for many languages +end + +group :release do + gem "chandler" # Github releases from changelog + gem "octokit" +end + +group :rubocop do + gem "rubocop" + gem "rubocop-packaging" + gem "rubocop-rspec" + gem "rubocop-rails" +end + +group :docs do + gem "yard" # Documentation generator + gem "kramdown" # Markdown implementation (for yard) +end + +gemspec path: "../.." diff --git a/gemfiles/rails_71/Gemfile.lock b/gemfiles/rails_71/Gemfile.lock new file mode 100644 index 00000000000..8d074673886 --- /dev/null +++ b/gemfiles/rails_71/Gemfile.lock @@ -0,0 +1,535 @@ +PATH + remote: ../.. + specs: + activeadmin (3.4.0) + arbre (~> 1.2, >= 1.2.1) + csv + formtastic (>= 3.1) + formtastic_i18n (>= 0.4) + inherited_resources (~> 1.7) + jquery-rails (>= 4.2) + kaminari (>= 1.2.1) + railties (>= 6.1) + ransack (>= 4.0) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.1.6) + actionpack (= 7.1.6) + activesupport (= 7.1.6) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (7.1.6) + actionpack (= 7.1.6) + activejob (= 7.1.6) + activerecord (= 7.1.6) + activestorage (= 7.1.6) + activesupport (= 7.1.6) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.1.6) + actionpack (= 7.1.6) + actionview (= 7.1.6) + activejob (= 7.1.6) + activesupport (= 7.1.6) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.2) + actionpack (7.1.6) + actionview (= 7.1.6) + activesupport (= 7.1.6) + cgi + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.6) + actionpack (= 7.1.6) + activerecord (= 7.1.6) + activestorage (= 7.1.6) + activesupport (= 7.1.6) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.1.6) + activesupport (= 7.1.6) + builder (~> 3.1) + cgi + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.6) + activesupport (= 7.1.6) + globalid (>= 0.3.6) + activemodel (7.1.6) + activesupport (= 7.1.6) + activemodel-serializers-xml (1.0.3) + activemodel (>= 5.0.0.a) + activesupport (>= 5.0.0.a) + builder (~> 3.1) + activerecord (7.1.6) + activemodel (= 7.1.6) + activesupport (= 7.1.6) + timeout (>= 0.4.0) + activestorage (7.1.6) + actionpack (= 7.1.6) + activejob (= 7.1.6) + activerecord (= 7.1.6) + activesupport (= 7.1.6) + marcel (~> 1.0) + activesupport (7.1.6) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + mutex_m + securerandom (>= 0.3) + tzinfo (~> 2.0) + addressable (2.8.8) + public_suffix (>= 2.0.2, < 8.0) + arbre (1.7.0) + activesupport (>= 3.0.0) + ruby2_keywords (>= 0.0.2) + ast (2.4.3) + base64 (0.3.0) + bcrypt (3.1.21) + benchmark (0.5.0) + bigdecimal (4.0.1) + builder (3.3.0) + cancancan (3.6.1) + capybara (3.40.0) + addressable + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.11) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + cgi (0.5.1) + chandler (0.9.0) + netrc + octokit (>= 2.2.0) + childprocess (5.1.0) + logger (~> 1.5) + concurrent-ruby (1.3.6) + connection_pool (2.5.5) + crass (1.0.6) + csv (3.3.5) + cucumber (9.2.1) + builder (~> 3.2) + cucumber-ci-environment (> 9, < 11) + cucumber-core (> 13, < 14) + cucumber-cucumber-expressions (~> 17.0) + cucumber-gherkin (> 24, < 28) + cucumber-html-formatter (> 20.3, < 22) + cucumber-messages (> 19, < 25) + diff-lcs (~> 1.5) + mini_mime (~> 1.1) + multi_test (~> 1.1) + sys-uname (~> 1.2) + cucumber-ci-environment (10.0.1) + cucumber-core (13.0.3) + cucumber-gherkin (>= 27, < 28) + cucumber-messages (>= 20, < 23) + cucumber-tag-expressions (> 5, < 7) + cucumber-cucumber-expressions (17.1.0) + bigdecimal + cucumber-gherkin (27.0.0) + cucumber-messages (>= 19.1.4, < 23) + cucumber-html-formatter (21.15.1) + cucumber-messages (> 19, < 28) + cucumber-messages (22.0.0) + cucumber-rails (3.1.1) + capybara (>= 3.11, < 4) + cucumber (>= 5, < 10) + railties (>= 5.2, < 9) + cucumber-tag-expressions (6.1.2) + cuprite (0.17) + capybara (~> 3.0) + ferrum (~> 0.17.0) + database_cleaner-active_record (2.2.2) + activerecord (>= 5.a) + database_cleaner-core (~> 2.0) + database_cleaner-core (2.0.1) + date (3.5.1) + devise (4.9.4) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0) + responders + warden (~> 1.2.3) + diff-lcs (1.6.2) + docile (1.4.1) + draper (4.0.6) + actionpack (>= 5.0) + activemodel (>= 5.0) + activemodel-serializers-xml (>= 1.0) + activesupport (>= 5.0) + request_store (>= 1.0) + ruby2_keywords + drb (2.2.3) + erb (4.0.4) + cgi (>= 0.3.3) + erubi (1.13.1) + faraday (2.14.0) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-net_http (3.4.2) + net-http (~> 0.5) + ferrum (0.17.1) + addressable (~> 2.5) + base64 (~> 0.2) + concurrent-ruby (~> 1.1) + webrick (~> 1.7) + websocket-driver (~> 0.7) + ffi (1.17.3) + ffi (1.17.3-arm64-darwin) + ffi (1.17.3-x86_64-linux-gnu) + formtastic (5.0.0) + actionpack (>= 6.0.0) + formtastic_i18n (0.7.0) + globalid (1.3.0) + activesupport (>= 6.1) + has_scope (0.9.0) + actionpack (>= 7.0) + activesupport (>= 7.0) + highline (3.1.2) + reline + i18n (1.14.8) + concurrent-ruby (~> 1.0) + i18n-spec (0.6.0) + iso + i18n-tasks (1.1.2) + activesupport (>= 4.0.2) + ast (>= 2.1.0) + erubi + highline (>= 3.0.0) + i18n + parser (>= 3.2.2.1) + prism + rails-i18n + rainbow (>= 2.2.2, < 4.0) + ruby-progressbar (~> 1.8, >= 1.8.1) + terminal-table (>= 1.5.1) + inherited_resources (1.14.0) + actionpack (>= 6.0) + has_scope (>= 0.6) + railties (>= 6.0) + responders (>= 2) + io-console (0.8.2) + irb (1.16.0) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + iso (0.4.0) + i18n + jquery-rails (4.6.1) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + json (2.18.0) + kaminari (1.2.2) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.2.2) + kaminari-activerecord (= 1.2.2) + kaminari-core (= 1.2.2) + kaminari-actionview (1.2.2) + actionview + kaminari-core (= 1.2.2) + kaminari-activerecord (1.2.2) + activerecord + kaminari-core (= 1.2.2) + kaminari-core (1.2.2) + kramdown (2.5.2) + rexml (>= 3.4.4) + language_server-protocol (3.17.0.5) + launchy (3.1.1) + addressable (~> 2.8) + childprocess (~> 5.0) + logger (~> 1.6) + lint_roller (1.1.0) + logger (1.7.0) + loofah (2.25.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.9.0) + logger + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.1.0) + matrix (0.4.3) + memoist3 (1.0.0) + mini_mime (1.1.5) + mini_portile2 (2.8.9) + minitest (5.27.0) + multi_test (1.1.0) + mutex_m (0.3.0) + net-http (0.9.1) + uri (>= 0.11.1) + net-imap (0.5.13) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.5.1) + net-protocol + netrc (0.11.0) + nio4r (2.7.5) + nokogiri (1.18.10) + mini_portile2 (~> 2.8.2) + racc (~> 1.4) + nokogiri (1.18.10-arm64-darwin) + racc (~> 1.4) + nokogiri (1.18.10-x86_64-linux-gnu) + racc (~> 1.4) + octokit (10.0.0) + faraday (>= 1, < 3) + sawyer (~> 0.9) + orm_adapter (0.5.0) + parallel (1.27.0) + parallel_tests (5.5.0) + parallel + parser (3.3.10.1) + ast (~> 2.4.1) + racc + pp (0.6.3) + prettyprint + prettyprint (0.2.0) + prism (1.9.0) + psych (5.3.1) + date + stringio + public_suffix (6.0.2) + pundit (2.5.2) + activesupport (>= 3.0.0) + racc (1.8.1) + rack (3.2.4) + rack-session (2.1.1) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) + rack (>= 1.3) + rackup (2.3.1) + rack (>= 3) + rails (7.1.6) + actioncable (= 7.1.6) + actionmailbox (= 7.1.6) + actionmailer (= 7.1.6) + actionpack (= 7.1.6) + actiontext (= 7.1.6) + actionview (= 7.1.6) + activejob (= 7.1.6) + activemodel (= 7.1.6) + activerecord (= 7.1.6) + activestorage (= 7.1.6) + activesupport (= 7.1.6) + bundler (>= 1.15.0) + railties (= 7.1.6) + rails-dom-testing (2.3.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + rails-i18n (7.0.10) + i18n (>= 0.7, < 2) + railties (>= 6.0.0, < 8) + railties (7.1.6) + actionpack (= 7.1.6) + activesupport (= 7.1.6) + cgi + irb + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + tsort (>= 0.2) + zeitwerk (~> 2.6) + rainbow (3.1.1) + rake (13.3.1) + ransack (4.4.0) + activerecord (>= 7.1) + activesupport (>= 7.1) + i18n + rdoc (7.1.0) + erb + psych (>= 4.0.0) + tsort + regexp_parser (2.11.3) + reline (0.6.3) + io-console (~> 0.5) + request_store (1.7.0) + rack (>= 1.4) + responders (3.2.0) + actionpack (>= 7.0) + railties (>= 7.0) + rexml (3.4.4) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.7) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-rails (7.1.1) + actionpack (>= 7.0) + activesupport (>= 7.0) + railties (>= 7.0) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.7) + rubocop (1.84.0) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.49.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.49.0) + parser (>= 3.3.7.2) + prism (~> 1.7) + rubocop-packaging (0.6.0) + lint_roller (~> 1.1.0) + rubocop (>= 1.72.1, < 2.0) + rubocop-rails (2.34.3) + activesupport (>= 4.2.0) + lint_roller (~> 1.1) + rack (>= 1.1) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.44.0, < 2.0) + rubocop-rspec (3.9.0) + lint_roller (~> 1.1) + rubocop (~> 1.81) + ruby-progressbar (1.13.0) + ruby2_keywords (0.0.5) + sassc (2.4.0) + ffi (~> 1.9) + sassc-rails (2.1.2) + railties (>= 4.0.0) + sassc (>= 2.0) + sprockets (> 3.0) + sprockets-rails + tilt + sawyer (0.9.3) + addressable (>= 2.3.5) + faraday (>= 0.17.3, < 3) + securerandom (0.4.1) + simplecov (0.22.0) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-cobertura (3.1.0) + rexml + simplecov (~> 0.19) + simplecov-html (0.13.2) + simplecov_json_formatter (0.1.4) + sprockets (4.2.2) + concurrent-ruby (~> 1.0) + logger + rack (>= 2.2.4, < 4) + sprockets-rails (3.5.2) + actionpack (>= 6.1) + activesupport (>= 6.1) + sprockets (>= 3.0.0) + sqlite3 (2.8.1) + mini_portile2 (~> 2.8.0) + sqlite3 (2.8.1-arm64-darwin) + sqlite3 (2.8.1-x86_64-linux-gnu) + stringio (3.2.0) + sys-uname (1.4.1) + ffi (~> 1.1) + memoist3 (~> 1.0.0) + terminal-table (4.0.0) + unicode-display_width (>= 1.1.1, < 4) + thor (1.5.0) + tilt (2.7.0) + timeout (0.6.0) + tsort (0.2.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) + uri (1.1.1) + warden (1.2.9) + rack (>= 2.0.9) + webrick (1.9.2) + websocket-driver (0.8.0) + base64 + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + xpath (3.2.0) + nokogiri (~> 1.8) + yard (0.9.38) + zeitwerk (2.6.18) + +PLATFORMS + arm64-darwin + ruby + x86_64-linux + +DEPENDENCIES + activeadmin! + cancancan + capybara + chandler + cucumber + cucumber-rails + cuprite + database_cleaner-active_record + devise (~> 4.9) + draper + formtastic (>= 5.0.0) + i18n-spec + i18n-tasks + kramdown + launchy + octokit + parallel_tests + pundit + rails (~> 7.1.0) + rails-i18n + rake + ransack (>= 4.1.0) + rspec-rails + rubocop + rubocop-packaging + rubocop-rails + rubocop-rspec + sassc-rails + simplecov + simplecov-cobertura + sprockets-rails + sqlite3 + webrick + yard + zeitwerk (~> 2.6.18) + +BUNDLED WITH + 2.6.9 diff --git a/gemfiles/rails_72/Gemfile b/gemfiles/rails_72/Gemfile new file mode 100644 index 00000000000..b3df7154930 --- /dev/null +++ b/gemfiles/rails_72/Gemfile @@ -0,0 +1,62 @@ +# frozen_string_literal: true +source "https://rubygems.org" + +group :development, :test do + gem "rake" + + gem "cancancan" + gem "pundit" + + gem "draper" + gem "devise", "~> 4.9" # TODO: relax this dependency when formtastic/formtastic#1401 will be fixed + + gem "rails", "~> 7.2.0" + + gem "sprockets-rails" + gem "sassc-rails" + gem "ransack", ">= 4.2.0" + gem "formtastic", ">= 5.0.0" + + # FIXME: relax this dependency when Ruby 3.1 support will be dropped + gem "zeitwerk", "~> 2.6.18" +end + +group :test do + gem "cuprite" + gem "capybara" + gem "webrick" + + gem "simplecov", require: false # Test coverage generator. Go to /coverage/ after running tests + gem "simplecov-cobertura", require: false + gem "cucumber-rails", require: false + gem "cucumber" + gem "database_cleaner-active_record" + gem "launchy" + gem "parallel_tests" + gem "rspec-rails" + gem "sqlite3", platform: :mri + + # Translations + gem "i18n-tasks" + gem "i18n-spec" + gem "rails-i18n" # Provides default i18n for many languages +end + +group :release do + gem "chandler" # Github releases from changelog + gem "octokit" +end + +group :rubocop do + gem "rubocop" + gem "rubocop-packaging" + gem "rubocop-rspec" + gem "rubocop-rails" +end + +group :docs do + gem "yard" # Documentation generator + gem "kramdown" # Markdown implementation (for yard) +end + +gemspec path: "../.." diff --git a/gemfiles/rails_72/Gemfile.lock b/gemfiles/rails_72/Gemfile.lock new file mode 100644 index 00000000000..7bb0da16404 --- /dev/null +++ b/gemfiles/rails_72/Gemfile.lock @@ -0,0 +1,529 @@ +PATH + remote: ../.. + specs: + activeadmin (3.4.0) + arbre (~> 1.2, >= 1.2.1) + csv + formtastic (>= 3.1) + formtastic_i18n (>= 0.4) + inherited_resources (~> 1.7) + jquery-rails (>= 4.2) + kaminari (>= 1.2.1) + railties (>= 6.1) + ransack (>= 4.0) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.2.3) + actionpack (= 7.2.3) + activesupport (= 7.2.3) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (7.2.3) + actionpack (= 7.2.3) + activejob (= 7.2.3) + activerecord (= 7.2.3) + activestorage (= 7.2.3) + activesupport (= 7.2.3) + mail (>= 2.8.0) + actionmailer (7.2.3) + actionpack (= 7.2.3) + actionview (= 7.2.3) + activejob (= 7.2.3) + activesupport (= 7.2.3) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (7.2.3) + actionview (= 7.2.3) + activesupport (= 7.2.3) + cgi + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4, < 3.3) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (7.2.3) + actionpack (= 7.2.3) + activerecord (= 7.2.3) + activestorage (= 7.2.3) + activesupport (= 7.2.3) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.2.3) + activesupport (= 7.2.3) + builder (~> 3.1) + cgi + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.2.3) + activesupport (= 7.2.3) + globalid (>= 0.3.6) + activemodel (7.2.3) + activesupport (= 7.2.3) + activemodel-serializers-xml (1.0.3) + activemodel (>= 5.0.0.a) + activesupport (>= 5.0.0.a) + builder (~> 3.1) + activerecord (7.2.3) + activemodel (= 7.2.3) + activesupport (= 7.2.3) + timeout (>= 0.4.0) + activestorage (7.2.3) + actionpack (= 7.2.3) + activejob (= 7.2.3) + activerecord (= 7.2.3) + activesupport (= 7.2.3) + marcel (~> 1.0) + activesupport (7.2.3) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + addressable (2.8.8) + public_suffix (>= 2.0.2, < 8.0) + arbre (1.7.0) + activesupport (>= 3.0.0) + ruby2_keywords (>= 0.0.2) + ast (2.4.3) + base64 (0.3.0) + bcrypt (3.1.21) + benchmark (0.5.0) + bigdecimal (4.0.1) + builder (3.3.0) + cancancan (3.6.1) + capybara (3.40.0) + addressable + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.11) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + cgi (0.5.1) + chandler (0.9.0) + netrc + octokit (>= 2.2.0) + childprocess (5.1.0) + logger (~> 1.5) + concurrent-ruby (1.3.6) + connection_pool (2.5.5) + crass (1.0.6) + csv (3.3.5) + cucumber (9.2.1) + builder (~> 3.2) + cucumber-ci-environment (> 9, < 11) + cucumber-core (> 13, < 14) + cucumber-cucumber-expressions (~> 17.0) + cucumber-gherkin (> 24, < 28) + cucumber-html-formatter (> 20.3, < 22) + cucumber-messages (> 19, < 25) + diff-lcs (~> 1.5) + mini_mime (~> 1.1) + multi_test (~> 1.1) + sys-uname (~> 1.2) + cucumber-ci-environment (10.0.1) + cucumber-core (13.0.3) + cucumber-gherkin (>= 27, < 28) + cucumber-messages (>= 20, < 23) + cucumber-tag-expressions (> 5, < 7) + cucumber-cucumber-expressions (17.1.0) + bigdecimal + cucumber-gherkin (27.0.0) + cucumber-messages (>= 19.1.4, < 23) + cucumber-html-formatter (21.15.1) + cucumber-messages (> 19, < 28) + cucumber-messages (22.0.0) + cucumber-rails (3.1.1) + capybara (>= 3.11, < 4) + cucumber (>= 5, < 10) + railties (>= 5.2, < 9) + cucumber-tag-expressions (6.1.2) + cuprite (0.17) + capybara (~> 3.0) + ferrum (~> 0.17.0) + database_cleaner-active_record (2.2.2) + activerecord (>= 5.a) + database_cleaner-core (~> 2.0) + database_cleaner-core (2.0.1) + date (3.5.1) + devise (4.9.4) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0) + responders + warden (~> 1.2.3) + diff-lcs (1.6.2) + docile (1.4.1) + draper (4.0.6) + actionpack (>= 5.0) + activemodel (>= 5.0) + activemodel-serializers-xml (>= 1.0) + activesupport (>= 5.0) + request_store (>= 1.0) + ruby2_keywords + drb (2.2.3) + erb (4.0.4) + cgi (>= 0.3.3) + erubi (1.13.1) + faraday (2.14.0) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-net_http (3.4.2) + net-http (~> 0.5) + ferrum (0.17.1) + addressable (~> 2.5) + base64 (~> 0.2) + concurrent-ruby (~> 1.1) + webrick (~> 1.7) + websocket-driver (~> 0.7) + ffi (1.17.3) + ffi (1.17.3-arm64-darwin) + ffi (1.17.3-x86_64-linux-gnu) + formtastic (5.0.0) + actionpack (>= 6.0.0) + formtastic_i18n (0.7.0) + globalid (1.3.0) + activesupport (>= 6.1) + has_scope (0.9.0) + actionpack (>= 7.0) + activesupport (>= 7.0) + highline (3.1.2) + reline + i18n (1.14.8) + concurrent-ruby (~> 1.0) + i18n-spec (0.6.0) + iso + i18n-tasks (1.1.2) + activesupport (>= 4.0.2) + ast (>= 2.1.0) + erubi + highline (>= 3.0.0) + i18n + parser (>= 3.2.2.1) + prism + rails-i18n + rainbow (>= 2.2.2, < 4.0) + ruby-progressbar (~> 1.8, >= 1.8.1) + terminal-table (>= 1.5.1) + inherited_resources (1.14.0) + actionpack (>= 6.0) + has_scope (>= 0.6) + railties (>= 6.0) + responders (>= 2) + io-console (0.8.2) + irb (1.16.0) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + iso (0.4.0) + i18n + jquery-rails (4.6.1) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + json (2.18.0) + kaminari (1.2.2) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.2.2) + kaminari-activerecord (= 1.2.2) + kaminari-core (= 1.2.2) + kaminari-actionview (1.2.2) + actionview + kaminari-core (= 1.2.2) + kaminari-activerecord (1.2.2) + activerecord + kaminari-core (= 1.2.2) + kaminari-core (1.2.2) + kramdown (2.5.2) + rexml (>= 3.4.4) + language_server-protocol (3.17.0.5) + launchy (3.1.1) + addressable (~> 2.8) + childprocess (~> 5.0) + logger (~> 1.6) + lint_roller (1.1.0) + logger (1.7.0) + loofah (2.25.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.9.0) + logger + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.1.0) + matrix (0.4.3) + memoist3 (1.0.0) + mini_mime (1.1.5) + mini_portile2 (2.8.9) + minitest (5.27.0) + multi_test (1.1.0) + net-http (0.9.1) + uri (>= 0.11.1) + net-imap (0.5.13) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.5.1) + net-protocol + netrc (0.11.0) + nio4r (2.7.5) + nokogiri (1.18.10) + mini_portile2 (~> 2.8.2) + racc (~> 1.4) + nokogiri (1.18.10-arm64-darwin) + racc (~> 1.4) + nokogiri (1.18.10-x86_64-linux-gnu) + racc (~> 1.4) + octokit (10.0.0) + faraday (>= 1, < 3) + sawyer (~> 0.9) + orm_adapter (0.5.0) + parallel (1.27.0) + parallel_tests (5.5.0) + parallel + parser (3.3.10.1) + ast (~> 2.4.1) + racc + pp (0.6.3) + prettyprint + prettyprint (0.2.0) + prism (1.9.0) + psych (5.3.1) + date + stringio + public_suffix (6.0.2) + pundit (2.5.2) + activesupport (>= 3.0.0) + racc (1.8.1) + rack (3.2.4) + rack-session (2.1.1) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) + rack (>= 1.3) + rackup (2.3.1) + rack (>= 3) + rails (7.2.3) + actioncable (= 7.2.3) + actionmailbox (= 7.2.3) + actionmailer (= 7.2.3) + actionpack (= 7.2.3) + actiontext (= 7.2.3) + actionview (= 7.2.3) + activejob (= 7.2.3) + activemodel (= 7.2.3) + activerecord (= 7.2.3) + activestorage (= 7.2.3) + activesupport (= 7.2.3) + bundler (>= 1.15.0) + railties (= 7.2.3) + rails-dom-testing (2.3.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + rails-i18n (7.0.10) + i18n (>= 0.7, < 2) + railties (>= 6.0.0, < 8) + railties (7.2.3) + actionpack (= 7.2.3) + activesupport (= 7.2.3) + cgi + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + tsort (>= 0.2) + zeitwerk (~> 2.6) + rainbow (3.1.1) + rake (13.3.1) + ransack (4.4.1) + activerecord (>= 7.2) + activesupport (>= 7.2) + i18n + rdoc (7.1.0) + erb + psych (>= 4.0.0) + tsort + regexp_parser (2.11.3) + reline (0.6.3) + io-console (~> 0.5) + request_store (1.7.0) + rack (>= 1.4) + responders (3.2.0) + actionpack (>= 7.0) + railties (>= 7.0) + rexml (3.4.4) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.7) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-rails (8.0.2) + actionpack (>= 7.2) + activesupport (>= 7.2) + railties (>= 7.2) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.7) + rubocop (1.84.0) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.49.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.49.0) + parser (>= 3.3.7.2) + prism (~> 1.7) + rubocop-packaging (0.6.0) + lint_roller (~> 1.1.0) + rubocop (>= 1.72.1, < 2.0) + rubocop-rails (2.34.3) + activesupport (>= 4.2.0) + lint_roller (~> 1.1) + rack (>= 1.1) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.44.0, < 2.0) + rubocop-rspec (3.9.0) + lint_roller (~> 1.1) + rubocop (~> 1.81) + ruby-progressbar (1.13.0) + ruby2_keywords (0.0.5) + sassc (2.4.0) + ffi (~> 1.9) + sassc-rails (2.1.2) + railties (>= 4.0.0) + sassc (>= 2.0) + sprockets (> 3.0) + sprockets-rails + tilt + sawyer (0.9.3) + addressable (>= 2.3.5) + faraday (>= 0.17.3, < 3) + securerandom (0.4.1) + simplecov (0.22.0) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-cobertura (3.1.0) + rexml + simplecov (~> 0.19) + simplecov-html (0.13.2) + simplecov_json_formatter (0.1.4) + sprockets (4.2.2) + concurrent-ruby (~> 1.0) + logger + rack (>= 2.2.4, < 4) + sprockets-rails (3.5.2) + actionpack (>= 6.1) + activesupport (>= 6.1) + sprockets (>= 3.0.0) + sqlite3 (2.8.1) + mini_portile2 (~> 2.8.0) + sqlite3 (2.8.1-arm64-darwin) + sqlite3 (2.8.1-x86_64-linux-gnu) + stringio (3.2.0) + sys-uname (1.4.1) + ffi (~> 1.1) + memoist3 (~> 1.0.0) + terminal-table (4.0.0) + unicode-display_width (>= 1.1.1, < 4) + thor (1.5.0) + tilt (2.7.0) + timeout (0.6.0) + tsort (0.2.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) + uri (1.1.1) + useragent (0.16.11) + warden (1.2.9) + rack (>= 2.0.9) + webrick (1.9.2) + websocket-driver (0.8.0) + base64 + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + xpath (3.2.0) + nokogiri (~> 1.8) + yard (0.9.38) + zeitwerk (2.6.18) + +PLATFORMS + arm64-darwin + ruby + x86_64-linux + +DEPENDENCIES + activeadmin! + cancancan + capybara + chandler + cucumber + cucumber-rails + cuprite + database_cleaner-active_record + devise (~> 4.9) + draper + formtastic (>= 5.0.0) + i18n-spec + i18n-tasks + kramdown + launchy + octokit + parallel_tests + pundit + rails (~> 7.2.0) + rails-i18n + rake + ransack (>= 4.2.0) + rspec-rails + rubocop + rubocop-packaging + rubocop-rails + rubocop-rspec + sassc-rails + simplecov + simplecov-cobertura + sprockets-rails + sqlite3 + webrick + yard + zeitwerk (~> 2.6.18) + +BUNDLED WITH + 2.6.9 diff --git a/gemfiles/rails_80/Gemfile b/gemfiles/rails_80/Gemfile new file mode 100644 index 00000000000..bebcbb3848c --- /dev/null +++ b/gemfiles/rails_80/Gemfile @@ -0,0 +1,42 @@ +# frozen_string_literal: true +source "https://rubygems.org" + +group :development, :test do + gem "rake" + + gem "cancancan" + gem "pundit" + + gem "draper" + gem "devise", "~> 4.9" # TODO: relax this dependency when formtastic/formtastic#1401 will be fixed + + gem "rails", "~> 8.0.0" + + gem "sprockets-rails" + gem "sassc-rails" + gem "ransack", ">= 4.2.0" + gem "formtastic", ">= 5.0.0" +end + +group :test do + gem "cuprite" + gem "capybara" + gem "webrick" + + gem "simplecov", require: false # Test coverage generator. Go to /coverage/ after running tests + gem "simplecov-cobertura", require: false + gem "cucumber-rails", require: false + gem "cucumber" + gem "database_cleaner-active_record" + gem "launchy" + gem "parallel_tests" + gem "rspec-rails" + gem "sqlite3", platform: :mri + + # Translations + gem "i18n-tasks" + gem "i18n-spec" + gem "rails-i18n" # Provides default i18n for many languages +end + +gemspec path: "../.." diff --git a/gemfiles/rails_80/Gemfile.lock b/gemfiles/rails_80/Gemfile.lock new file mode 100644 index 00000000000..d9bd2f977d3 --- /dev/null +++ b/gemfiles/rails_80/Gemfile.lock @@ -0,0 +1,488 @@ +PATH + remote: ../.. + specs: + activeadmin (3.4.0) + arbre (~> 1.2, >= 1.2.1) + csv + formtastic (>= 3.1) + formtastic_i18n (>= 0.4) + inherited_resources (~> 1.7) + jquery-rails (>= 4.2) + kaminari (>= 1.2.1) + railties (>= 6.1) + ransack (>= 4.0) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (8.0.4) + actionpack (= 8.0.4) + activesupport (= 8.0.4) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (8.0.4) + actionpack (= 8.0.4) + activejob (= 8.0.4) + activerecord (= 8.0.4) + activestorage (= 8.0.4) + activesupport (= 8.0.4) + mail (>= 2.8.0) + actionmailer (8.0.4) + actionpack (= 8.0.4) + actionview (= 8.0.4) + activejob (= 8.0.4) + activesupport (= 8.0.4) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (8.0.4) + actionview (= 8.0.4) + activesupport (= 8.0.4) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (8.0.4) + actionpack (= 8.0.4) + activerecord (= 8.0.4) + activestorage (= 8.0.4) + activesupport (= 8.0.4) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (8.0.4) + activesupport (= 8.0.4) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (8.0.4) + activesupport (= 8.0.4) + globalid (>= 0.3.6) + activemodel (8.0.4) + activesupport (= 8.0.4) + activemodel-serializers-xml (1.0.3) + activemodel (>= 5.0.0.a) + activesupport (>= 5.0.0.a) + builder (~> 3.1) + activerecord (8.0.4) + activemodel (= 8.0.4) + activesupport (= 8.0.4) + timeout (>= 0.4.0) + activestorage (8.0.4) + actionpack (= 8.0.4) + activejob (= 8.0.4) + activerecord (= 8.0.4) + activesupport (= 8.0.4) + marcel (~> 1.0) + activesupport (8.0.4) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + addressable (2.8.8) + public_suffix (>= 2.0.2, < 8.0) + arbre (1.7.0) + activesupport (>= 3.0.0) + ruby2_keywords (>= 0.0.2) + ast (2.4.3) + base64 (0.3.0) + bcrypt (3.1.21) + benchmark (0.5.0) + bigdecimal (4.0.1) + builder (3.3.0) + cancancan (3.6.1) + capybara (3.40.0) + addressable + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.11) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + childprocess (5.1.0) + logger (~> 1.5) + concurrent-ruby (1.3.6) + connection_pool (3.0.2) + crass (1.0.6) + csv (3.3.5) + cucumber (10.2.0) + base64 (~> 0.2) + builder (~> 3.2) + cucumber-ci-environment (> 9, < 12) + cucumber-core (> 15, < 17) + cucumber-cucumber-expressions (> 17, < 20) + cucumber-html-formatter (> 21, < 23) + diff-lcs (~> 1.5) + logger (~> 1.6) + mini_mime (~> 1.1) + multi_test (~> 1.1) + sys-uname (~> 1.3) + cucumber-ci-environment (11.0.0) + cucumber-core (16.1.1) + cucumber-gherkin (> 36, < 40) + cucumber-messages (> 31, < 33) + cucumber-tag-expressions (> 6, < 9) + cucumber-cucumber-expressions (19.0.0) + bigdecimal + cucumber-gherkin (38.0.0) + cucumber-messages (>= 31, < 33) + cucumber-html-formatter (22.3.0) + cucumber-messages (> 23, < 33) + cucumber-messages (32.0.1) + cucumber-rails (4.0.0) + capybara (>= 3.25, < 4) + cucumber (>= 7, < 11) + railties (>= 6.1, < 9) + cucumber-tag-expressions (8.1.0) + cuprite (0.17) + capybara (~> 3.0) + ferrum (~> 0.17.0) + database_cleaner-active_record (2.2.2) + activerecord (>= 5.a) + database_cleaner-core (~> 2.0) + database_cleaner-core (2.0.1) + date (3.5.1) + devise (4.9.4) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0) + responders + warden (~> 1.2.3) + diff-lcs (1.6.2) + docile (1.4.1) + draper (4.0.6) + actionpack (>= 5.0) + activemodel (>= 5.0) + activemodel-serializers-xml (>= 1.0) + activesupport (>= 5.0) + request_store (>= 1.0) + ruby2_keywords + drb (2.2.3) + erb (6.0.1) + erubi (1.13.1) + ferrum (0.17.1) + addressable (~> 2.5) + base64 (~> 0.2) + concurrent-ruby (~> 1.1) + webrick (~> 1.7) + websocket-driver (~> 0.7) + ffi (1.17.3-aarch64-linux-gnu) + ffi (1.17.3-aarch64-linux-musl) + ffi (1.17.3-arm-linux-gnu) + ffi (1.17.3-arm-linux-musl) + ffi (1.17.3-arm64-darwin) + ffi (1.17.3-x86_64-darwin) + ffi (1.17.3-x86_64-linux-gnu) + ffi (1.17.3-x86_64-linux-musl) + formtastic (5.0.0) + actionpack (>= 6.0.0) + formtastic_i18n (0.7.0) + globalid (1.3.0) + activesupport (>= 6.1) + has_scope (0.9.0) + actionpack (>= 7.0) + activesupport (>= 7.0) + highline (3.1.2) + reline + i18n (1.14.8) + concurrent-ruby (~> 1.0) + i18n-spec (0.6.0) + iso + i18n-tasks (1.1.2) + activesupport (>= 4.0.2) + ast (>= 2.1.0) + erubi + highline (>= 3.0.0) + i18n + parser (>= 3.2.2.1) + prism + rails-i18n + rainbow (>= 2.2.2, < 4.0) + ruby-progressbar (~> 1.8, >= 1.8.1) + terminal-table (>= 1.5.1) + inherited_resources (1.14.0) + actionpack (>= 6.0) + has_scope (>= 0.6) + railties (>= 6.0) + responders (>= 2) + io-console (0.8.2) + irb (1.16.0) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + iso (0.4.0) + i18n + jquery-rails (4.6.1) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + kaminari (1.2.2) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.2.2) + kaminari-activerecord (= 1.2.2) + kaminari-core (= 1.2.2) + kaminari-actionview (1.2.2) + actionview + kaminari-core (= 1.2.2) + kaminari-activerecord (1.2.2) + activerecord + kaminari-core (= 1.2.2) + kaminari-core (1.2.2) + launchy (3.1.1) + addressable (~> 2.8) + childprocess (~> 5.0) + logger (~> 1.6) + logger (1.7.0) + loofah (2.25.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.9.0) + logger + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.1.0) + matrix (0.4.3) + memoist3 (1.0.0) + mini_mime (1.1.5) + minitest (6.0.1) + prism (~> 1.5) + multi_test (1.1.0) + net-imap (0.6.2) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.5.1) + net-protocol + nio4r (2.7.5) + nokogiri (1.19.0-aarch64-linux-gnu) + racc (~> 1.4) + nokogiri (1.19.0-aarch64-linux-musl) + racc (~> 1.4) + nokogiri (1.19.0-arm-linux-gnu) + racc (~> 1.4) + nokogiri (1.19.0-arm-linux-musl) + racc (~> 1.4) + nokogiri (1.19.0-arm64-darwin) + racc (~> 1.4) + nokogiri (1.19.0-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.19.0-x86_64-linux-gnu) + racc (~> 1.4) + nokogiri (1.19.0-x86_64-linux-musl) + racc (~> 1.4) + orm_adapter (0.5.0) + parallel (1.27.0) + parallel_tests (5.5.0) + parallel + parser (3.3.10.1) + ast (~> 2.4.1) + racc + pp (0.6.3) + prettyprint + prettyprint (0.2.0) + prism (1.9.0) + psych (5.3.1) + date + stringio + public_suffix (7.0.2) + pundit (2.5.2) + activesupport (>= 3.0.0) + racc (1.8.1) + rack (3.2.4) + rack-session (2.1.1) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) + rack (>= 1.3) + rackup (2.3.1) + rack (>= 3) + rails (8.0.4) + actioncable (= 8.0.4) + actionmailbox (= 8.0.4) + actionmailer (= 8.0.4) + actionpack (= 8.0.4) + actiontext (= 8.0.4) + actionview (= 8.0.4) + activejob (= 8.0.4) + activemodel (= 8.0.4) + activerecord (= 8.0.4) + activestorage (= 8.0.4) + activesupport (= 8.0.4) + bundler (>= 1.15.0) + railties (= 8.0.4) + rails-dom-testing (2.3.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + rails-i18n (8.1.0) + i18n (>= 0.7, < 2) + railties (>= 8.0.0, < 9) + railties (8.0.4) + actionpack (= 8.0.4) + activesupport (= 8.0.4) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + tsort (>= 0.2) + zeitwerk (~> 2.6) + rainbow (3.1.1) + rake (13.3.1) + ransack (4.4.1) + activerecord (>= 7.2) + activesupport (>= 7.2) + i18n + rdoc (7.1.0) + erb + psych (>= 4.0.0) + tsort + regexp_parser (2.11.3) + reline (0.6.3) + io-console (~> 0.5) + request_store (1.7.0) + rack (>= 1.4) + responders (3.2.0) + actionpack (>= 7.0) + railties (>= 7.0) + rexml (3.4.4) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.7) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-rails (8.0.2) + actionpack (>= 7.2) + activesupport (>= 7.2) + railties (>= 7.2) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.7) + ruby-progressbar (1.13.0) + ruby2_keywords (0.0.5) + sassc (2.4.0) + ffi (~> 1.9) + sassc-rails (2.1.2) + railties (>= 4.0.0) + sassc (>= 2.0) + sprockets (> 3.0) + sprockets-rails + tilt + securerandom (0.4.1) + simplecov (0.22.0) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-cobertura (3.1.0) + rexml + simplecov (~> 0.19) + simplecov-html (0.13.2) + simplecov_json_formatter (0.1.4) + sprockets (4.2.2) + concurrent-ruby (~> 1.0) + logger + rack (>= 2.2.4, < 4) + sprockets-rails (3.5.2) + actionpack (>= 6.1) + activesupport (>= 6.1) + sprockets (>= 3.0.0) + sqlite3 (2.9.0-aarch64-linux-gnu) + sqlite3 (2.9.0-aarch64-linux-musl) + sqlite3 (2.9.0-arm-linux-gnu) + sqlite3 (2.9.0-arm-linux-musl) + sqlite3 (2.9.0-arm64-darwin) + sqlite3 (2.9.0-x86_64-darwin) + sqlite3 (2.9.0-x86_64-linux-gnu) + sqlite3 (2.9.0-x86_64-linux-musl) + stringio (3.2.0) + sys-uname (1.4.1) + ffi (~> 1.1) + memoist3 (~> 1.0.0) + terminal-table (4.0.0) + unicode-display_width (>= 1.1.1, < 4) + thor (1.5.0) + tilt (2.7.0) + timeout (0.6.0) + tsort (0.2.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) + uri (1.1.1) + useragent (0.16.11) + warden (1.2.9) + rack (>= 2.0.9) + webrick (1.9.2) + websocket-driver (0.8.0) + base64 + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.7.4) + +PLATFORMS + aarch64-linux-gnu + aarch64-linux-musl + arm-linux-gnu + arm-linux-musl + arm64-darwin + x86_64-darwin + x86_64-linux-gnu + x86_64-linux-musl + +DEPENDENCIES + activeadmin! + cancancan + capybara + cucumber + cucumber-rails + cuprite + database_cleaner-active_record + devise (~> 4.9) + draper + formtastic (>= 5.0.0) + i18n-spec + i18n-tasks + launchy + parallel_tests + pundit + rails (~> 8.0.0) + rails-i18n + rake + ransack (>= 4.2.0) + rspec-rails + sassc-rails + simplecov + simplecov-cobertura + sprockets-rails + sqlite3 + webrick + +BUNDLED WITH + 4.0.5 diff --git a/lib/active_admin/form_builder.rb b/lib/active_admin/form_builder.rb index 009e9d8e110..48c4676073b 100644 --- a/lib/active_admin/form_builder.rb +++ b/lib/active_admin/form_builder.rb @@ -95,7 +95,7 @@ def content_has_many(&block) contents = without_wrapper { inputs(options, &form_block) } contents ||= "".html_safe - js = new_record ? js_for_has_many(options[:class], &form_block) : "" + js = new_record ? js_for_has_many(&form_block) : "" contents << js end @@ -159,14 +159,13 @@ def without_wrapper end # Capture the ADD JS - def js_for_has_many(class_string, &form_block) + def js_for_has_many(&form_block) assoc_name = assoc_klass.model_name - placeholder = "NEW_#{assoc_name.to_s.underscore.upcase.gsub(/\//, '_')}_RECORD" - opts = { + placeholder = "NEW_#{assoc_name.to_s.underscore.upcase.tr('/', '_')}_RECORD" + opts = options.merge( for: [assoc, assoc_klass.new], - class: class_string, for_options: { child_index: placeholder } - } + ) html = template.capture { __getobj__.send(:inputs_for_nested_attributes, opts, &form_block) } text = new_record.is_a?(String) ? new_record : I18n.t("active_admin.has_many_new", model: assoc_name.human) diff --git a/lib/active_admin/inputs/filters/select_input.rb b/lib/active_admin/inputs/filters/select_input.rb index c950f78afa9..23c9a041022 100644 --- a/lib/active_admin/inputs/filters/select_input.rb +++ b/lib/active_admin/inputs/filters/select_input.rb @@ -15,9 +15,7 @@ def searchable_method_name if searchable_has_many_through? "#{reflection.through_reflection.name}_#{reflection.foreign_key}" else - name = method.to_s - name.concat "_#{reflection.association_primary_key}" if reflection_searchable? - name + reflection_searchable? ? "#{method}_#{reflection.association_primary_key}" : method.to_s end end diff --git a/lib/active_admin/pundit_adapter.rb b/lib/active_admin/pundit_adapter.rb index ad81851dfa8..bdf87cb3a94 100644 --- a/lib/active_admin/pundit_adapter.rb +++ b/lib/active_admin/pundit_adapter.rb @@ -42,7 +42,7 @@ def retrieve_policy(subject) end def format_action(action, subject) - # https://github.com/varvet/pundit/blob/master/lib/generators/pundit/install/templates/application_policy.rb + # https://github.com/varvet/pundit/blob/main/lib/generators/pundit/install/templates/application_policy.rb case action when Auth::READ then subject.is_a?(Class) ? :index? : :show? when Auth::DESTROY then subject.is_a?(Class) ? :destroy_all? : :destroy? diff --git a/lib/active_admin/resource.rb b/lib/active_admin/resource.rb index 65cb9f6160b..c6eaabd6e0f 100644 --- a/lib/active_admin/resource.rb +++ b/lib/active_admin/resource.rb @@ -70,7 +70,7 @@ def sort_order module Base def initialize(namespace, resource_class, options = {}) @namespace = namespace - @resource_class_name = "::#{resource_class.name}" + @resource_class_name = resource_class.respond_to?(:name) ? "::#{resource_class.name}" : resource_class.to_s @options = options @sort_order = options[:sort_order] @member_actions = [] diff --git a/lib/active_admin/resource/attributes.rb b/lib/active_admin/resource/attributes.rb index 13e3d325a7f..07e20b7167c 100644 --- a/lib/active_admin/resource/attributes.rb +++ b/lib/active_admin/resource/attributes.rb @@ -37,7 +37,14 @@ def sti_col?(c) end def counter_cache_col?(c) - c.name.end_with?("_count") + # This helper is called inside a loop. Let's memoize the result. + @counter_cache_columns ||= begin + resource_class.reflect_on_all_associations(:has_many) + .select(&:has_cached_counter?) + .map(&:counter_cache_column) + end + + @counter_cache_columns.include?(c.name) end def filtered_col?(c) diff --git a/lib/active_admin/resource/belongs_to.rb b/lib/active_admin/resource/belongs_to.rb index 45d771c763f..b65503f6ba9 100644 --- a/lib/active_admin/resource/belongs_to.rb +++ b/lib/active_admin/resource/belongs_to.rb @@ -1,5 +1,4 @@ # frozen_string_literal: true -require "active_admin/resource" module ActiveAdmin class Resource diff --git a/lib/active_admin/resource_controller/decorators.rb b/lib/active_admin/resource_controller/decorators.rb index 59243364d66..a916cb24b12 100644 --- a/lib/active_admin/resource_controller/decorators.rb +++ b/lib/active_admin/resource_controller/decorators.rb @@ -61,7 +61,7 @@ def self.wrap(decorator) def self.wrap!(parent, name) ::Class.new parent do delegate :reorder, :page, :current_page, :total_pages, :limit_value, - :total_count, :total_pages, :offset, :to_key, :group_values, + :total_count, :offset, :to_key, :group_values, :except, :find_each, :ransack, to: :object define_singleton_method(:name) { name } diff --git a/lib/active_admin/router.rb b/lib/active_admin/router.rb index 9d5208d29b5..f504c4ef2e7 100644 --- a/lib/active_admin/router.rb +++ b/lib/active_admin/router.rb @@ -21,7 +21,7 @@ def define_root_routes if namespace.root? router.root namespace.root_to_options.merge(to: namespace.root_to) else - router.namespace namespace.name, namespace.route_options.dup do + router.namespace namespace.name, **namespace.route_options.dup do router.root namespace.root_to_options.merge(to: namespace.root_to, as: :root) end end @@ -65,7 +65,7 @@ def resource_routes(config) def page_routes(config) page = config.underscored_resource_name - router.get "/#{page}" => "#{page}#index" + router.get "/#{page}", to: "#{page}#index" config.page_actions.each do |action| Array.wrap(action.http_verb).each do |verb| build_route(verb, "/#{page}/#{action.name}" => "#{page}##{action.name}") @@ -91,8 +91,8 @@ def build_action(action) build_route(action.http_verb, action.name) end - def build_route(verbs, *args) - Array.wrap(verbs).each { |verb| router.send(verb, *args) } + def build_route(verbs, ...) + Array.wrap(verbs).each { |verb| router.send(verb, ...) } end def define_belongs_to_routes(config) @@ -107,7 +107,7 @@ def define_belongs_to_routes(config) end def define_namespace(config) - router.namespace config.namespace.name, config.namespace.route_options.dup do + router.namespace config.namespace.name, **config.namespace.route_options.dup do define_routes(config) end end diff --git a/lib/active_admin/version.rb b/lib/active_admin/version.rb index b9565b51db7..60435efffaf 100644 --- a/lib/active_admin/version.rb +++ b/lib/active_admin/version.rb @@ -1,4 +1,4 @@ # frozen_string_literal: true module ActiveAdmin - VERSION = "3.2.0" + VERSION = "3.4.0" end diff --git a/lib/active_admin/view_helpers/display_helper.rb b/lib/active_admin/view_helpers/display_helper.rb index c50bbdaa95c..ab8fac26cf1 100644 --- a/lib/active_admin/view_helpers/display_helper.rb +++ b/lib/active_admin/view_helpers/display_helper.rb @@ -108,8 +108,8 @@ def boolean_attr?(resource, attr, value) when TrueClass, FalseClass true else - if resource.class.respond_to? :columns_hash - column = resource.class.columns_hash[attr.to_s] and column.type == :boolean + if resource.class.respond_to? :attribute_types + resource.class.attribute_types[attr.to_s].is_a?(ActiveModel::Type::Boolean) end end end diff --git a/lib/active_admin/views/components/active_admin_form.rb b/lib/active_admin/views/components/active_admin_form.rb index 51e2d940f06..0c17a8c93ac 100644 --- a/lib/active_admin/views/components/active_admin_form.rb +++ b/lib/active_admin/views/components/active_admin_form.rb @@ -127,12 +127,24 @@ def build(form_builder, *args, &block) html_options[:class] ||= "inputs" legend = args.shift if args.first.is_a?(::String) legend = html_options.delete(:name) if html_options.key?(:name) - legend_tag = legend ? "#{legend}" : "" - fieldset_attrs = html_options.map { |k, v| %Q{#{k}="#{v}"} }.join(" ") + legend_tag = legend ? helpers.tag.legend(helpers.tag.span(legend), class: "fieldset-title") : "" + fieldset_attrs = tag_attributes html_options @opening_tag = "
#{legend_tag}
    " @closing_tag = "
" super(*(args << html_options), &block) end + + private + + def tag_attributes(html_options) + if Rails::VERSION::MAJOR <= 6 + # Reimplement tag.attributes to backport support for Rails 6.1. + # TODO: this can be removed when support for Rails 6.x is dropped + helpers.tag.tag_options(html_options.to_h).to_s.strip.html_safe + else + helpers.tag.attributes html_options + end + end end class SemanticActionsProxy < FormtasticProxy diff --git a/lib/active_admin/views/components/paginated_collection.rb b/lib/active_admin/views/components/paginated_collection.rb index 07128088a18..6b48d05bbde 100644 --- a/lib/active_admin/views/components/paginated_collection.rb +++ b/lib/active_admin/views/components/paginated_collection.rb @@ -103,7 +103,10 @@ def build_pagination # you pass in the :total_pages option. We issue a query to determine # if there is another page or not, but the limit/offset make this # query fast. - offset = collection.offset(collection.current_page * collection.limit_value).limit(1).count + offset_scope = collection.offset(collection.current_page * collection.limit_value) + # Support array collections. Kaminari::PaginatableArray does not respond to except + offset_scope = offset_scope.except(:select, :order) if offset_scope.respond_to?(:except) + offset = offset_scope.limit(1).count options[:total_pages] = collection.current_page + offset options[:right] = 0 end diff --git a/lib/active_admin/views/index_as_table.rb b/lib/active_admin/views/index_as_table.rb index 4394b7fedcd..bcfbf737f10 100644 --- a/lib/active_admin/views/index_as_table.rb +++ b/lib/active_admin/views/index_as_table.rb @@ -291,9 +291,14 @@ def index_column(start_value = 1) end # Display a column for the id - def id_column + def id_column(*args) raise "#{resource_class.name} has no primary_key!" unless resource_class.primary_key - column(resource_class.human_attribute_name(resource_class.primary_key), sortable: resource_class.primary_key) do |resource| + + options = args.extract_options! + title = args[0].presence || resource_class.human_attribute_name(resource_class.primary_key) + sortable = options.fetch(:sortable, resource_class.primary_key) + + column(title, sortable: sortable) do |resource| if controller.action_methods.include?("show") link_to resource.id, resource_path(resource), class: "resource_id_link" elsif controller.action_methods.include?("edit") diff --git a/lib/generators/active_admin/install/templates/active_admin.rb.erb b/lib/generators/active_admin/install/templates/active_admin.rb.erb index 3c3748ac7f0..c45219193a9 100644 --- a/lib/generators/active_admin/install/templates/active_admin.rb.erb +++ b/lib/generators/active_admin/install/templates/active_admin.rb.erb @@ -258,7 +258,7 @@ ActiveAdmin.setup do |config| # # config.namespace :admin do |admin| # admin.build_menu :default do |menu| - # menu.add label: "My Great Website", url: "http://www.mygreatwebsite.com", html_options: { target: :blank } + # menu.add label: "My Great Website", url: "http://www.mygreatwebsite.com", html_options: { target: "_blank" } # end # end diff --git a/package.json b/package.json index 8c2a7482372..fdc5060d27a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@activeadmin/activeadmin", - "version": "3.2.0", + "version": "3.4.0", "description": "The administration framework for Ruby on Rails.", "main": "app/assets/javascripts/active_admin/base.js", "type": "module", @@ -24,13 +24,13 @@ }, "homepage": "htts://activeadmin.info", "devDependencies": { - "@babel/core": "*", - "@babel/preset-env": "*", + "@babel/core": "7.28.6", + "@babel/preset-env": "7.28.6", "common-tags": "", - "eslint": "*", + "eslint": "9.39.2", "eslint-plugin-import": "*", - "gherkin-lint": "", - "rollup": "*", + "gherkin-lint": "*", + "rollup": "4.55.1", "rollup-plugin-babel": "", "rollup-plugin-commonjs": "", "rollup-plugin-node-resolve": "", @@ -43,8 +43,8 @@ "prepublishOnly": "rm -rf src && cp -R app/javascript/active_admin src && cp -R app/assets/stylesheets/active_admin src/scss" }, "dependencies": { - "jquery": "^3.4.1", - "jquery-ui": "^1.12.1", + "jquery": "^3.7.1 || ^4.0.0", + "jquery-ui": "^1.14.2", "jquery-ujs": "^1.2.2" } } diff --git a/spec/support/matchers/perform_database_query_matcher.rb b/spec/support/matchers/perform_database_query_matcher.rb index 7fc0b79d16c..a8b289c160a 100644 --- a/spec/support/matchers/perform_database_query_matcher.rb +++ b/spec/support/matchers/perform_database_query_matcher.rb @@ -2,10 +2,12 @@ RSpec::Matchers.define :perform_database_query do |query| match do |block| + query_regexp = query.is_a?(Regexp) ? query : Regexp.new(Regexp.escape(query)) + @match = nil callback = lambda do |_name, _started, _finished, _unique_id, payload| - @match = Regexp.new(Regexp.escape(query)).match?(payload[:sql]) + @match ||= query_regexp.match?(payload[:sql]) end ActiveSupport::Notifications.subscribed(callback, "sql.active_record", &block) diff --git a/spec/support/rails_template.rb b/spec/support/rails_template.rb index f0ef5f30556..ec398eb8d23 100644 --- a/spec/support/rails_template.rb +++ b/spec/support/rails_template.rb @@ -4,8 +4,9 @@ create_file "app/assets/stylesheets/some-random-css.css" create_file "app/assets/javascripts/some-random-js.js" create_file "app/assets/images/a/favicon.ico" +create_file "app/assets/config/manifest.js" -initial_timestamp = Time.now.strftime("%Y%M%d%H%M%S").to_i +initial_timestamp = Time.now.strftime("%Y%m%d%H%M%S").to_i template File.expand_path("templates/migrations/create_posts.tt", __dir__), "db/migrate/#{initial_timestamp}_create_posts.rb" @@ -97,11 +98,12 @@ def self.ransackable_associations(auth_object=nil) # Add some translations append_file "config/locales/en.yml", File.read(File.expand_path("templates/en.yml", __dir__)) -# Add predefined admin resources +# Add predefined admin resources, override any file that was generated by rails new generator directory File.expand_path("templates/admin", __dir__), "app/admin" # Add predefined policies directory File.expand_path("templates/policies", __dir__), "app/policies" +directory File.expand_path("templates/public", __dir__), "public", force: true if ENV["RAILS_ENV"] != "test" inject_into_file "config/routes.rb", "\n root to: redirect('admin')", after: /.*routes.draw do/ @@ -129,6 +131,3 @@ def self.ransackable_associations(auth_object=nil) end end end - -git add: "." -git commit: "-m 'Bare application'" diff --git a/spec/support/rails_template_with_data.rb b/spec/support/rails_template_with_data.rb index ab8c6e208de..2e3e41e5220 100644 --- a/spec/support/rails_template_with_data.rb +++ b/spec/support/rails_template_with_data.rb @@ -79,6 +79,3 @@ RUBY rails_command "db:seed" - -git add: "." -git commit: "-m 'Bare application with data'" diff --git a/spec/support/templates/migrations/create_categories.tt b/spec/support/templates/migrations/create_categories.tt index 9bf9af07406..a3737e3345b 100644 --- a/spec/support/templates/migrations/create_categories.tt +++ b/spec/support/templates/migrations/create_categories.tt @@ -3,6 +3,7 @@ class CreateCategories < ActiveRecord::Migration[<%= Rails::VERSION::MAJOR %>.<% create_table :categories do |t| t.string :name t.text :description + t.integer :posts_count, default: 0 t.datetime :created_at t.datetime :updated_at end diff --git a/spec/support/templates/migrations/create_users.tt b/spec/support/templates/migrations/create_users.tt index 3f885e7146d..b1472214cc3 100644 --- a/spec/support/templates/migrations/create_users.tt +++ b/spec/support/templates/migrations/create_users.tt @@ -8,6 +8,7 @@ class CreateUsers < ActiveRecord::Migration[<%= Rails::VERSION::MAJOR %>.<%= Rai t.integer :age t.string :encrypted_password t.string :reason_of_sign_in + t.integer :sign_in_count, default: 0 t.datetime :created_at t.datetime :updated_at end diff --git a/spec/support/templates/models/post.rb b/spec/support/templates/models/post.rb index ff35972cbe0..10e5007a850 100644 --- a/spec/support/templates/models/post.rb +++ b/spec/support/templates/models/post.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true class Post < ApplicationRecord - belongs_to :category, foreign_key: :custom_category_id, optional: true + belongs_to :category, foreign_key: :custom_category_id, optional: true, counter_cache: true belongs_to :author, class_name: "User", optional: true has_many :taggings has_many :tags, through: :taggings diff --git a/spec/support/templates/public/favicon.ico b/spec/support/templates/public/favicon.ico new file mode 100644 index 00000000000..db016de0d55 Binary files /dev/null and b/spec/support/templates/public/favicon.ico differ diff --git a/spec/tasks/gemfile_spec.rb b/spec/tasks/gemfile_spec.rb index 1d1d1a39fd1..cf985f25169 100644 --- a/spec/tasks/gemfile_spec.rb +++ b/spec/tasks/gemfile_spec.rb @@ -1,5 +1,26 @@ # frozen_string_literal: true RSpec.describe "Gemfile sanity" do + # Strips the BUNDLED WITH section from a Gemfile.lock content string. + # This section only contains the Bundler version used and can differ between environments + # without affecting the actual dependency resolution. + # + # Handles various edge cases: + # - Different line endings (\n, \r\n) + # - Any amount of whitespace before the version number + # - Missing BUNDLED WITH section + # - Different formatting + def strip_bundled_with(lockfile_content) + # Normalize line endings to Unix style for consistent comparison + normalized = lockfile_content.gsub(/\r\n/, "\n") + + # Remove the BUNDLED WITH section and everything after it + # The regex matches: + # - Optional newline before BUNDLED WITH + # - The BUNDLED WITH line itself + # - Any content after it (version number with any whitespace/line endings) + normalized.gsub(/\n?BUNDLED WITH\n.*\z/m, '').strip + end + it "is up to date" do gemfile = ENV["BUNDLE_GEMFILE"] || "Gemfile" current_lockfile = File.read("#{gemfile}.lock") @@ -10,6 +31,8 @@ msg = "Please update #{gemfile}'s lock file with `BUNDLE_GEMFILE=#{gemfile} bundle install` and commit the result" - expect(current_lockfile).to eq(new_lockfile), msg + # Compare lockfiles without the BUNDLED WITH section to avoid false failures + # when only the Bundler version differs between environments + expect(strip_bundled_with(current_lockfile)).to eq(strip_bundled_with(new_lockfile)), msg end end diff --git a/spec/unit/form_builder_spec.rb b/spec/unit/form_builder_spec.rb index 2e9246c6081..543ef7c6b88 100644 --- a/spec/unit/form_builder_spec.rb +++ b/spec/unit/form_builder_spec.rb @@ -44,7 +44,7 @@ def build_form(options = {}, form_object = Post.new, &block) end context "in general" do - context "it without custom settings" do + context "without custom settings" do let :body do build_form do |f| f.inputs do @@ -59,10 +59,10 @@ def build_form(options = {}, form_object = Post.new, &block) end end - context "it with custom settings" do + context "with custom settings" do let :body do build_form do |f| - f.inputs class: "custom_class", name: "custom_name", custom_attr: "custom_attr" do + f.inputs class: "custom_class", name: "custom_name", custom_attr: "custom_attr", data: { test: "custom" } do f.input :title f.input :body end @@ -80,6 +80,29 @@ def build_form(options = {}, form_object = Post.new, &block) it "should generate a fieldset with a custom attributes" do expect(body).to have_selector("fieldset[custom_attr='custom_attr']") end + + it "should use the rails helper for rendering attributes" do + expect(body).to have_css("fieldset[data-test='custom']") + end + + it "should generate a legend with an inner span containing the name" do + expect(body).to have_selector("fieldset legend span", text: "custom_name") + end + end + + context "with XSS payload as name" do + let :body do + build_form do |f| + f.inputs name: "" do + f.input :title + f.input :body + end + end + end + + it "should generate a fieldset with the proper legend" do + expect(body).to have_css("legend", text: "") + end end end @@ -625,6 +648,48 @@ def user end end + describe "with custom class" do + let :body do + build_form({ url: "/categories" }, Category.new) do |f| + f.object.posts.build + f.has_many :posts, class: "myclass" do |p| + p.input :title + end + end + end + + it "should generate a fieldset with the given class" do + expect(body).to have_css(".has_many_container > fieldset.myclass") + end + + it "should add the custom class on the fieldset generated by the new record link" do + link = body.find(".has_many_container > a.has_many_add") + new_record_html = Capybara.string(link[:'data-html']) + expect(new_record_html).to have_css("fieldset.myclass") + end + end + + describe "with custom attributes" do + let :body do + build_form({ url: "/categories" }, Category.new) do |f| + f.object.posts.build + f.has_many :posts, attr: "value", data: { 'custom-attribute': "custom-value" } do |p| + p.input :title + end + end + end + + it "should generate a fieldset with the given custom attributes" do + expect(body).to have_css(".has_many_container > fieldset[attr='value'][data-custom-attribute='custom-value']") + end + + it "should add custom attributes on the fieldset generated by the new record link" do + link = body.find(".has_many_container > a.has_many_add") + new_record_html = Capybara.string(link[:'data-html']) + expect(new_record_html).to have_css("fieldset[attr='value'][data-custom-attribute='custom-value']") + end + end + describe "with allow destroy" do shared_examples_for "has many with allow_destroy = true" do |child_num| it "should render the nested form" do diff --git a/spec/unit/menu_item_spec.rb b/spec/unit/menu_item_spec.rb index 7ff3117af5a..06c9f62ebf6 100644 --- a/spec/unit/menu_item_spec.rb +++ b/spec/unit/menu_item_spec.rb @@ -26,8 +26,8 @@ module ActiveAdmin end it "should accept an options hash for link_to" do - item = MenuItem.new html_options: { target: :blank } - expect(item.html_options).to include(target: :blank) + item = MenuItem.new html_options: { target: "_blank" } + expect(item.html_options).to include(target: "_blank") end context "with no items" do diff --git a/spec/unit/namespace/register_resource_spec.rb b/spec/unit/namespace/register_resource_spec.rb index 559ed971eea..60fa3ae3cb1 100644 --- a/spec/unit/namespace/register_resource_spec.rb +++ b/spec/unit/namespace/register_resource_spec.rb @@ -31,6 +31,16 @@ end end + context "when resource class is a string" do + before do + namespace.register 'Category' + end + + it "should store the namespaced registered configuration" do + expect(namespace.resources.keys).to include("Category") + end + end + context "with a block configuration" do it "should be evaluated in the dsl" do expect do |block| diff --git a/spec/unit/resource/attributes_spec.rb b/spec/unit/resource/attributes_spec.rb index 327928685bf..e20d15cae27 100644 --- a/spec/unit/resource/attributes_spec.rb +++ b/spec/unit/resource/attributes_spec.rb @@ -32,6 +32,22 @@ module ActiveAdmin expect(subject).to_not include :published_date ActiveAdmin.application.filter_attributes = keep end + + context "when resource has a counter cache" do + subject { ActiveAdmin::Resource.new(namespace, Category).resource_attributes } + + it "should not include counter cache column" do + expect(subject.keys).not_to include(:posts_count) + end + end + + context "when resource has a 'counter cache'-like column" do + subject { ActiveAdmin::Resource.new(namespace, User).resource_attributes } + + it "should include that attribute" do + expect(subject).to include(sign_in_count: :sign_in_count) + end + end end describe "#association_columns" do diff --git a/spec/unit/view_helpers/display_helper_spec.rb b/spec/unit/view_helpers/display_helper_spec.rb index 7eeb656b03a..5764fefaf44 100644 --- a/spec/unit/view_helpers/display_helper_spec.rb +++ b/spec/unit/view_helpers/display_helper_spec.rb @@ -216,6 +216,22 @@ class ThisModel expect(value.to_s).to eq "Yes\n" end + context "with non-database boolean attribute" do + let(:model_class) do + Class.new(Post) do + attribute :a_virtual_attribute, :boolean + end + end + + it "calls status_tag even when attribute is nil" do + post = model_class.new a_virtual_attribute: nil + + value = view.format_attribute post, :a_virtual_attribute + + expect(value.to_s).to eq "No\n" + end + end + it "calls status_tag for boolean non-database values" do post = Post.new post.define_singleton_method(:true_method) do diff --git a/spec/unit/views/components/index_table_for_spec.rb b/spec/unit/views/components/index_table_for_spec.rb index c26f39ce29c..90497ccaf63 100644 --- a/spec/unit/views/components/index_table_for_spec.rb +++ b/spec/unit/views/components/index_table_for_spec.rb @@ -15,7 +15,8 @@ let(:assigns) do { collection: collection, - active_admin_config: active_admin_config + active_admin_config: active_admin_config, + resource_class: User, } end let(:helpers) { mock_action_view } @@ -44,6 +45,55 @@ end end + context "when creating an id column" do + before { allow(helpers).to receive(:url_for).and_return("routing_stub") } + + def build_index_table(&block) + render_arbre_component assigns, helpers do + insert_tag(ActiveAdmin::Views::IndexAsTable::IndexTableFor, collection, { sortable: true }) do + instance_exec(&block) + end + end + end + + it "use primary key as title by default" do + table = build_index_table { id_column } + header = table.find_by_tag("th").first + expect(header.content).to include("Id") + end + + it "supports title customization" do + table = build_index_table { id_column "Res. Id" } + header = table.find_by_tag("th").first + expect(header.content).to include("Res. Id") + end + + it "is sortable by default" do + table = build_index_table { id_column } + header = table.find_by_tag("th").first + expect(header.attributes[:class]).to include("sortable") + end + + it "supports sortable: false" do + table = build_index_table { id_column sortable: false } + header = table.find_by_tag("th").first + expect(header.attributes[:class]).not_to include("sortable") + end + + it "supports sortable column names" do + table = build_index_table { id_column sortable: :created_at } + header = table.find_by_tag("th").first + expect(header.attributes[:class]).to include("sortable") + end + + it "supports title customization and options" do + table = build_index_table { id_column "Res. Id", sortable: :created_at } + header = table.find_by_tag("th").first + expect(header.content).to include("Res. Id") + expect(header.attributes[:class]).to include("sortable") + end + end + context "when creating an index column" do let(:base_collection) do posts = [ diff --git a/spec/unit/views/components/paginated_collection_spec.rb b/spec/unit/views/components/paginated_collection_spec.rb index f43cf9d3ee2..a5aa7aa91fe 100644 --- a/spec/unit/views/components/paginated_collection_spec.rb +++ b/spec/unit/views/components/paginated_collection_spec.rb @@ -228,16 +228,43 @@ def paginated_collection(*args) end end - it "makes no expensive COUNT queries when pagination_total is false" do - undecorated_collection = Post.all.page(1).per(30) + describe "when pagination_total is false" do + it "makes no expensive COUNT queries" do + undecorated_collection = Post.all.page(1).per(30) + + expect { paginated_collection(undecorated_collection, pagination_total: false) } + .not_to perform_database_query("SELECT COUNT(*) FROM \"posts\"") + + decorated_collection = controller_with_decorator("index", PostDecorator).apply_collection_decorator(undecorated_collection.reset) + + expect { paginated_collection(decorated_collection, pagination_total: false) } + .not_to perform_database_query("SELECT COUNT(*) FROM \"posts\"") + end + + it "makes a performant COUNT query to figure out if we are on the last page" do + # "SELECT COUNT(*) FROM (SELECT 1". Let's make sure the subquery has LIMIT and OFFSET. It shouldn't have ORDER BY + count_query = %r{SELECT COUNT\(\*\) FROM \(SELECT 1 .*FROM "posts" (?=.*OFFSET \?)(?=.*LIMIT \?)(?!.*ORDER BY)} - expect { paginated_collection(undecorated_collection, pagination_total: false) } - .not_to perform_database_query("SELECT COUNT(*) FROM \"posts\"") + undecorated_collection = Post.all.page(1).per(30) - decorated_collection = controller_with_decorator("index", PostDecorator).apply_collection_decorator(undecorated_collection) + expect { paginated_collection(undecorated_collection, pagination_total: false) } + .to perform_database_query(count_query) - expect { paginated_collection(decorated_collection, pagination_total: false) } - .not_to perform_database_query("SELECT COUNT(*) FROM \"posts\"") + undecorated_sorted_collection = undecorated_collection.reset.order(id: :desc) + + expect { paginated_collection(undecorated_sorted_collection, pagination_total: false) } + .to perform_database_query(count_query) + + decorated_collection = controller_with_decorator("index", PostDecorator).apply_collection_decorator(undecorated_collection.reset) + + expect { paginated_collection(decorated_collection, pagination_total: false) } + .to perform_database_query(count_query) + + decorated_sorted_collection = controller_with_decorator("index", PostDecorator).apply_collection_decorator(undecorated_sorted_collection.reset) + + expect { paginated_collection(decorated_sorted_collection, pagination_total: false) } + .to perform_database_query(count_query) + end end it "makes no COUNT queries to figure out the last element of each page" do diff --git a/spec/unit/views/pages/form_spec.rb b/spec/unit/views/pages/form_spec.rb index 436480fd06e..e26e1bc5d87 100644 --- a/spec/unit/views/pages/form_spec.rb +++ b/spec/unit/views/pages/form_spec.rb @@ -16,7 +16,7 @@ end let(:arbre_context) do - OpenStruct.new(params: params, helpers: helpers, assigns: {}) + Struct.new(:params, :helpers, :assigns).new(params, helpers, {}) end context "when :title is set" do diff --git a/spec/unit/views/pages/index_spec.rb b/spec/unit/views/pages/index_spec.rb index 0f61e9eeffb..bd8c3058969 100644 --- a/spec/unit/views/pages/index_spec.rb +++ b/spec/unit/views/pages/index_spec.rb @@ -14,7 +14,7 @@ end let(:arbre_context) do - OpenStruct.new(params: params, helpers: helpers, assigns: {}) + Struct.new(:params, :helpers, :assigns).new(params, helpers, {}) end context "when config[:title] is assigned" do diff --git a/tasks/bug_report_template.rb b/tasks/bug_report_template.rb index 27a1395d572..c8e8dea1fb0 100644 --- a/tasks/bug_report_template.rb +++ b/tasks/bug_report_template.rb @@ -4,19 +4,20 @@ gemfile(true) do source "https://rubygems.org" - # Use local changes or ActiveAdmin master. + # Use `ACTIVE_ADMIN_PATH=. ruby tasks/bug_report_template.rb` to run + # locally, otherwise run against the default branch. if ENV["ACTIVE_ADMIN_PATH"] gem "activeadmin", path: ENV["ACTIVE_ADMIN_PATH"], require: false else - gem "activeadmin", github: "activeadmin/activeadmin", require: false + gem "activeadmin", github: "activeadmin/activeadmin", branch: "3-0-stable", require: false end # Change Rails version if necessary. - gem "rails", "~> 7.0.0" + gem "rails", "~> 8.1.0" gem "sprockets", "~> 3.7" gem "sassc-rails" - gem "sqlite3", platform: :mri + gem "sqlite3", force_ruby_platform: true, platform: :mri gem "activerecord-jdbcsqlite3-adapter", platform: :jruby # Fixes an issue on CI with default gems when using inline bundle with default @@ -51,14 +52,13 @@ class TestApp < Rails::Application config.root = __dir__ + config.hosts << ".example.com" config.session_store :cookie_store, key: "cookie_store_key" - secrets.secret_token = "secret_token" - secrets.secret_key_base = "secret_key_base" - + config.secret_key_base = "secret_key_base" config.eager_load = false - config.logger = Logger.new($stdout) - config.hosts = "www.example.com" + config.logger = Logger.new($stdout) + Rails.logger = config.logger end class ApplicationController < ActionController::Base diff --git a/tasks/test_application.rb b/tasks/test_application.rb index d3197f982a9..4236a8f621e 100644 --- a/tasks/test_application.rb +++ b/tasks/test_application.rb @@ -22,14 +22,34 @@ def generate FileUtils.mkdir_p base_dir args = %W( -m spec/support/#{template}.rb + --skip-action-cable + --skip-action-mailbox + --skip-action-text + --skip-active-storage --skip-bootsnap + --skip-brakeman --skip-bundle + --skip-bundler-audit + --skip-ci + --skip-coffee + --skip-decrypted-diffs + --skip-dev-gems + --skip-docker --skip-gemfile + --skip-git + --skip-hotwire + --skip-javascript + --skip-jbuilder + --skip-kamal --skip-listen + --skip-rubocop + --skip-solid --skip-spring - --skip-turbolinks + --skip-system-test + --skip-test --skip-test-unit - --skip-coffee + --skip-thruster + --skip-turbolinks --skip-webpack-install ) @@ -61,7 +81,7 @@ def base_dir end def app_name - return "rails_71" if main_app? + return "rails_81" if main_app? File.basename(File.dirname(gemfile)) end diff --git a/vendor/assets/javascripts/jquery-ui/data.js b/vendor/assets/javascripts/jquery-ui/data.js index 4bb2f97f9ab..4d91e52d66e 100644 --- a/vendor/assets/javascripts/jquery-ui/data.js +++ b/vendor/assets/javascripts/jquery-ui/data.js @@ -1,20 +1,22 @@ //= require jquery-ui/version /*! - * jQuery UI :data 1.12.1 - * http://jqueryui.com + * jQuery UI :data 1.14.2 + * https://jqueryui.com * - * Copyright jQuery Foundation and other contributors + * Copyright OpenJS Foundation and other contributors * Released under the MIT license. - * http://jquery.org/license + * https://jquery.org/license */ //>>label: :data Selector //>>group: Core //>>description: Selects elements which have data stored under the specified key. -//>>docs: http://api.jqueryui.com/data-selector/ +//>>docs: https://api.jqueryui.com/data-selector/ ( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. @@ -24,18 +26,14 @@ // Browser globals factory( jQuery ); } -} ( function( $ ) { -return $.extend( $.expr[ ":" ], { - data: $.expr.createPseudo ? - $.expr.createPseudo( function( dataName ) { - return function( elem ) { - return !!$.data( elem, dataName ); - }; - } ) : +} )( function( $ ) { +"use strict"; - // Support: jQuery <1.8 - function( elem, i, match ) { - return !!$.data( elem, match[ 3 ] ); - } +return $.extend( $.expr.pseudos, { + data: $.expr.createPseudo( function( dataName ) { + return function( elem ) { + return !!$.data( elem, dataName ); + }; + } ) +} ); } ); -} ) ); diff --git a/vendor/assets/javascripts/jquery-ui/disable-selection.js b/vendor/assets/javascripts/jquery-ui/disable-selection.js index ca89e9aab85..c9d934c0345 100644 --- a/vendor/assets/javascripts/jquery-ui/disable-selection.js +++ b/vendor/assets/javascripts/jquery-ui/disable-selection.js @@ -1,21 +1,23 @@ //= require jquery-ui/version /*! - * jQuery UI Disable Selection 1.12.1 - * http://jqueryui.com + * jQuery UI Disable Selection 1.14.2 + * https://jqueryui.com * - * Copyright jQuery Foundation and other contributors + * Copyright OpenJS Foundation and other contributors * Released under the MIT license. - * http://jquery.org/license + * https://jquery.org/license */ //>>label: disableSelection //>>group: Core //>>description: Disable selection of text content within the set of matched elements. -//>>docs: http://api.jqueryui.com/disableSelection/ +//>>docs: https://api.jqueryui.com/disableSelection/ // This file is deprecated ( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. @@ -25,7 +27,8 @@ // Browser globals factory( jQuery ); } -} ( function( $ ) { +} )( function( $ ) { +"use strict"; return $.fn.extend( { disableSelection: ( function() { @@ -45,4 +48,4 @@ return $.fn.extend( { } } ); -} ) ); +} ); diff --git a/vendor/assets/javascripts/jquery-ui/escape-selector.js b/vendor/assets/javascripts/jquery-ui/escape-selector.js deleted file mode 100644 index 48d7e629417..00000000000 --- a/vendor/assets/javascripts/jquery-ui/escape-selector.js +++ /dev/null @@ -1,23 +0,0 @@ -//= require jquery-ui/version - -( function( factory ) { - if ( typeof define === "function" && define.amd ) { - - // AMD. Register as an anonymous module. - define( [ "jquery", "./version" ], factory ); - } else { - - // Browser globals - factory( jQuery ); - } -} ( function( $ ) { - -// Internal use only -return $.ui.escapeSelector = ( function() { - var selectorEscape = /([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g; - return function( selector ) { - return selector.replace( selectorEscape, "\\$1" ); - }; -} )(); - -} ) ); diff --git a/vendor/assets/javascripts/jquery-ui/focusable.js b/vendor/assets/javascripts/jquery-ui/focusable.js index 2300ba9efeb..853e8ea37ee 100644 --- a/vendor/assets/javascripts/jquery-ui/focusable.js +++ b/vendor/assets/javascripts/jquery-ui/focusable.js @@ -1,20 +1,22 @@ //= require jquery-ui/version /*! - * jQuery UI Focusable 1.12.1 - * http://jqueryui.com + * jQuery UI Focusable 1.14.2 + * https://jqueryui.com * - * Copyright jQuery Foundation and other contributors + * Copyright OpenJS Foundation and other contributors * Released under the MIT license. - * http://jquery.org/license + * https://jquery.org/license */ //>>label: :focusable Selector //>>group: Core //>>description: Selects elements which can be focused. -//>>docs: http://api.jqueryui.com/focusable-selector/ +//>>docs: https://api.jqueryui.com/focusable-selector/ ( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. @@ -24,7 +26,8 @@ // Browser globals factory( jQuery ); } -} ( function( $ ) { +} )( function( $ ) { +"use strict"; // Selectors $.ui.focusable = function( element, hasTabindex ) { @@ -61,21 +64,11 @@ $.ui.focusable = function( element, hasTabindex ) { focusableIfVisible = hasTabindex; } - return focusableIfVisible && $( element ).is( ":visible" ) && visible( $( element ) ); + return focusableIfVisible && $( element ).is( ":visible" ) && + $( element ).css( "visibility" ) === "visible"; }; -// Support: IE 8 only -// IE 8 doesn't resolve inherit to visible/hidden for computed values -function visible( element ) { - var visibility = element.css( "visibility" ); - while ( visibility === "inherit" ) { - element = element.parent(); - visibility = element.css( "visibility" ); - } - return visibility !== "hidden"; -} - -$.extend( $.expr[ ":" ], { +$.extend( $.expr.pseudos, { focusable: function( element ) { return $.ui.focusable( element, $.attr( element, "tabindex" ) != null ); } @@ -83,4 +76,4 @@ $.extend( $.expr[ ":" ], { return $.ui.focusable; -} ) ); +} ); diff --git a/vendor/assets/javascripts/jquery-ui/form-reset-mixin.js b/vendor/assets/javascripts/jquery-ui/form-reset-mixin.js index af55719393c..4dfd9a828a3 100644 --- a/vendor/assets/javascripts/jquery-ui/form-reset-mixin.js +++ b/vendor/assets/javascripts/jquery-ui/form-reset-mixin.js @@ -1,80 +1,81 @@ -//= require jquery-ui/form //= require jquery-ui/version /*! - * jQuery UI Form Reset Mixin 1.12.1 - * http://jqueryui.com + * jQuery UI Form Reset Mixin 1.14.2 + * https://jqueryui.com * - * Copyright jQuery Foundation and other contributors + * Copyright OpenJS Foundation and other contributors * Released under the MIT license. - * http://jquery.org/license + * https://jquery.org/license */ //>>label: Form Reset Mixin //>>group: Core //>>description: Refresh input widgets when their form is reset -//>>docs: http://api.jqueryui.com/form-reset-mixin/ +//>>docs: https://api.jqueryui.com/form-reset-mixin/ ( function( factory ) { - if ( typeof define === "function" && define.amd ) { + "use strict"; - // AMD. Register as an anonymous module. - define( [ - "jquery", - "./form", - "./version" - ], factory ); - } else { + if ( typeof define === "function" && define.amd ) { - // Browser globals - factory( jQuery ); - } -}( function( $ ) { + // AMD. Register as an anonymous module. + define( [ + "jquery", + "./version" + ], factory ); + } else { - return $.ui.formResetMixin = { - _formResetHandler: function() { - var form = $( this ); + // Browser globals + factory( jQuery ); + } +} )( function( $ ) { +"use strict"; - // Wait for the form reset to actually happen before refreshing - setTimeout( function() { - var instances = form.data( "ui-form-reset-instances" ); - $.each( instances, function() { - this.refresh(); - } ); - } ); - }, +return $.ui.formResetMixin = { + _formResetHandler: function() { + var form = $( this ); - _bindFormResetHandler: function() { - this.form = this.element.form(); - if ( !this.form.length ) { - return; - } + // Wait for the form reset to actually happen before refreshing + setTimeout( function() { + var instances = form.data( "ui-form-reset-instances" ); + $.each( instances, function() { + this.refresh(); + } ); + } ); + }, - var instances = this.form.data( "ui-form-reset-instances" ) || []; - if ( !instances.length ) { + _bindFormResetHandler: function() { + this.form = $( this.element.prop( "form" ) ); + if ( !this.form.length ) { + return; + } - // We don't use _on() here because we use a single event handler per form - this.form.on( "reset.ui-form-reset", this._formResetHandler ); - } - instances.push( this ); - this.form.data( "ui-form-reset-instances", instances ); - }, + var instances = this.form.data( "ui-form-reset-instances" ) || []; + if ( !instances.length ) { - _unbindFormResetHandler: function() { - if ( !this.form.length ) { - return; - } + // We don't use _on() here because we use a single event handler per form + this.form.on( "reset.ui-form-reset", this._formResetHandler ); + } + instances.push( this ); + this.form.data( "ui-form-reset-instances", instances ); + }, - var instances = this.form.data( "ui-form-reset-instances" ); - instances.splice( $.inArray( this, instances ), 1 ); - if ( instances.length ) { - this.form.data( "ui-form-reset-instances", instances ); - } else { - this.form - .removeData( "ui-form-reset-instances" ) - .off( "reset.ui-form-reset" ); - } - } - }; + _unbindFormResetHandler: function() { + if ( !this.form.length ) { + return; + } -} ) ); + var instances = this.form.data( "ui-form-reset-instances" ); + instances.splice( $.inArray( this, instances ), 1 ); + if ( instances.length ) { + this.form.data( "ui-form-reset-instances", instances ); + } else { + this.form + .removeData( "ui-form-reset-instances" ) + .off( "reset.ui-form-reset" ); + } + } +}; + +} ); diff --git a/vendor/assets/javascripts/jquery-ui/form.js b/vendor/assets/javascripts/jquery-ui/form.js deleted file mode 100644 index 0aa8f065381..00000000000 --- a/vendor/assets/javascripts/jquery-ui/form.js +++ /dev/null @@ -1,22 +0,0 @@ -//= require jquery-ui/version - -( function( factory ) { - if ( typeof define === "function" && define.amd ) { - - // AMD. Register as an anonymous module. - define( [ "jquery", "./version" ], factory ); - } else { - - // Browser globals - factory( jQuery ); - } -} ( function( $ ) { - -// Support: IE8 Only -// IE8 does not support the form attribute and when it is supplied. It overwrites the form prop -// with a string, so we need to find the proper form. - return $.fn.form = function() { - return typeof this[ 0 ].form === "string" ? this.closest( "form" ) : $( this[ 0 ].form ); - }; - -} ) ); diff --git a/vendor/assets/javascripts/jquery-ui/ie.js b/vendor/assets/javascripts/jquery-ui/ie.js deleted file mode 100644 index c339bab19c2..00000000000 --- a/vendor/assets/javascripts/jquery-ui/ie.js +++ /dev/null @@ -1,17 +0,0 @@ -//= require jquery-ui/version - -( function( factory ) { - if ( typeof define === "function" && define.amd ) { - - // AMD. Register as an anonymous module. - define( [ "jquery", "./version" ], factory ); - } else { - - // Browser globals - factory( jQuery ); - } -} ( function( $ ) { - -// This file is deprecated -return $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() ); -} ) ); diff --git a/vendor/assets/javascripts/jquery-ui/keycode.js b/vendor/assets/javascripts/jquery-ui/keycode.js index 7480dfc80c7..9f6fc153dec 100644 --- a/vendor/assets/javascripts/jquery-ui/keycode.js +++ b/vendor/assets/javascripts/jquery-ui/keycode.js @@ -1,20 +1,22 @@ //= require jquery-ui/version /*! - * jQuery UI Keycode 1.12.1 - * http://jqueryui.com + * jQuery UI Keycode 1.14.2 + * https://jqueryui.com * - * Copyright jQuery Foundation and other contributors + * Copyright OpenJS Foundation and other contributors * Released under the MIT license. - * http://jquery.org/license + * https://jquery.org/license */ //>>label: Keycode //>>group: Core //>>description: Provide keycodes as keynames -//>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/ +//>>docs: https://api.jqueryui.com/jQuery.ui.keyCode/ ( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. @@ -24,7 +26,9 @@ // Browser globals factory( jQuery ); } -} ( function( $ ) { +} )( function( $ ) { +"use strict"; + return $.ui.keyCode = { BACKSPACE: 8, COMMA: 188, @@ -44,4 +48,4 @@ return $.ui.keyCode = { UP: 38 }; -} ) ); +} ); diff --git a/vendor/assets/javascripts/jquery-ui/labels.js b/vendor/assets/javascripts/jquery-ui/labels.js index 2b52fb6dae4..9b9d7f1ca95 100644 --- a/vendor/assets/javascripts/jquery-ui/labels.js +++ b/vendor/assets/javascripts/jquery-ui/labels.js @@ -1,65 +1,70 @@ //= require jquery-ui/version -//= require jquery-ui/escape-selector /*! - * jQuery UI Labels 1.12.1 - * http://jqueryui.com + * jQuery UI Labels 1.14.2 + * https://jqueryui.com * - * Copyright jQuery Foundation and other contributors + * Copyright OpenJS Foundation and other contributors * Released under the MIT license. - * http://jquery.org/license + * https://jquery.org/license */ //>>label: labels //>>group: Core //>>description: Find all the labels associated with a given input -//>>docs: http://api.jqueryui.com/labels/ +//>>docs: https://api.jqueryui.com/labels/ ( function( factory ) { - if ( typeof define === "function" && define.amd ) { + "use strict"; - // AMD. Register as an anonymous module. - define( [ "jquery", "./version", "./escape-selector" ], factory ); - } else { + if ( typeof define === "function" && define.amd ) { - // Browser globals - factory( jQuery ); - } -} ( function( $ ) { + // AMD. Register as an anonymous module. + define( [ "jquery", "./version" ], factory ); + } else { - return $.fn.labels = function() { - var ancestor, selector, id, labels, ancestors; + // Browser globals + factory( jQuery ); + } +} )( function( $ ) { +"use strict"; - // Check control.labels first - if ( this[ 0 ].labels && this[ 0 ].labels.length ) { - return this.pushStack( this[ 0 ].labels ); - } +return $.fn.labels = function() { + var ancestor, selector, id, labels, ancestors; - // Support: IE <= 11, FF <= 37, Android <= 2.3 only - // Above browsers do not support control.labels. Everything below is to support them - // as well as document fragments. control.labels does not work on document fragments - labels = this.eq( 0 ).parents( "label" ); + if ( !this.length ) { + return this.pushStack( [] ); + } - // Look for the label based on the id - id = this.attr( "id" ); - if ( id ) { + // Check control.labels first + if ( this[ 0 ].labels && this[ 0 ].labels.length ) { + return this.pushStack( this[ 0 ].labels ); + } - // We don't search against the document in case the element - // is disconnected from the DOM - ancestor = this.eq( 0 ).parents().last(); + // If `control.labels` is empty - e.g. inside of document fragments - find + // the labels manually + labels = this.eq( 0 ).parents( "label" ); - // Get a full set of top level ancestors - ancestors = ancestor.add( ancestor.length ? ancestor.siblings() : this.siblings() ); + // Look for the label based on the id + id = this.attr( "id" ); + if ( id ) { - // Create a selector for the label based on the id - selector = "label[for='" + $.ui.escapeSelector( id ) + "']"; + // We don't search against the document in case the element + // is disconnected from the DOM + ancestor = this.eq( 0 ).parents().last(); - labels = labels.add( ancestors.find( selector ).addBack( selector ) ); + // Get a full set of top level ancestors + ancestors = ancestor.add( ancestor.length ? ancestor.siblings() : this.siblings() ); - } + // Create a selector for the label based on the id + selector = "label[for='" + CSS.escape( id ) + "']"; - // Return whatever we have found for labels - return this.pushStack( labels ); - }; + labels = labels.add( ancestors.find( selector ).addBack( selector ) ); -} ) ); + } + + // Return whatever we have found for labels + return this.pushStack( labels ); +}; + +} ); diff --git a/vendor/assets/javascripts/jquery-ui/plugin.js b/vendor/assets/javascripts/jquery-ui/plugin.js index ce60e7b5eaf..261c547ea29 100644 --- a/vendor/assets/javascripts/jquery-ui/plugin.js +++ b/vendor/assets/javascripts/jquery-ui/plugin.js @@ -1,6 +1,8 @@ //= require jquery-ui/version ( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. @@ -10,7 +12,8 @@ // Browser globals factory( jQuery ); } -} ( function( $ ) { +} )( function( $ ) { +"use strict"; // $.ui.plugin is deprecated. Use $.widget() extensions instead. return $.ui.plugin = { @@ -43,4 +46,4 @@ return $.ui.plugin = { } }; -} ) ); +} ); diff --git a/vendor/assets/javascripts/jquery-ui/position.js b/vendor/assets/javascripts/jquery-ui/position.js index 7f6bc91d789..c3e4b7afe4a 100644 --- a/vendor/assets/javascripts/jquery-ui/position.js +++ b/vendor/assets/javascripts/jquery-ui/position.js @@ -1,23 +1,25 @@ //= require jquery-ui/version /*! - * jQuery UI Position 1.12.1 - * http://jqueryui.com + * jQuery UI Position 1.14.2 + * https://jqueryui.com * - * Copyright jQuery Foundation and other contributors + * Copyright OpenJS Foundation and other contributors * Released under the MIT license. - * http://jquery.org/license + * https://jquery.org/license * - * http://api.jqueryui.com/position/ + * https://api.jqueryui.com/position/ */ //>>label: Position //>>group: Core //>>description: Positions elements relative to other elements. -//>>docs: http://api.jqueryui.com/position/ -//>>demos: http://jqueryui.com/position/ +//>>docs: https://api.jqueryui.com/position/ +//>>demos: https://jqueryui.com/position/ ( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. @@ -27,7 +29,9 @@ // Browser globals factory( jQuery ); } -}( function( $ ) { +} )( function( $ ) { +"use strict"; + ( function() { var cachedScrollbarWidth, max = Math.max, @@ -50,6 +54,10 @@ function parseCss( element, property ) { return parseInt( $.css( element, property ), 10 ) || 0; } +function isWindow( obj ) { + return obj != null && obj === obj.window; +} + function getDimensions( elem ) { var raw = elem[ 0 ]; if ( raw.nodeType === 9 ) { @@ -59,7 +67,7 @@ function getDimensions( elem ) { offset: { top: 0, left: 0 } }; } - if ( $.isWindow( raw ) ) { + if ( isWindow( raw ) ) { return { width: elem.width(), height: elem.height(), @@ -86,9 +94,9 @@ $.position = { return cachedScrollbarWidth; } var w1, w2, - div = $( "
" + - "
" ), + div = $( "
" + + "
" ), innerDiv = div.children()[ 0 ]; $( "body" ).append( div ); @@ -121,12 +129,12 @@ $.position = { }, getWithinInfo: function( element ) { var withinElement = $( element || window ), - isWindow = $.isWindow( withinElement[ 0 ] ), + isElemWindow = isWindow( withinElement[ 0 ] ), isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9, - hasOffset = !isWindow && !isDocument; + hasOffset = !isElemWindow && !isDocument; return { element: withinElement, - isWindow: isWindow, + isWindow: isElemWindow, isDocument: isDocument, offset: hasOffset ? $( element ).offset() : { left: 0, top: 0 }, scrollLeft: withinElement.scrollLeft(), @@ -146,7 +154,12 @@ $.fn.position = function( options ) { options = $.extend( {}, options ); var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions, - target = $( options.of ), + + // Make sure string options are treated as CSS selectors + target = typeof options.of === "string" ? + $( document ).find( options.of ) : + $( options.of ), + within = $.position.getWithinInfo( options.within ), scrollInfo = $.position.getScrollInfo( within ), collision = ( options.collision || "flip" ).split( " " ), @@ -497,4 +510,4 @@ $.ui.position = { return $.ui.position; -} ) ); +} ); diff --git a/vendor/assets/javascripts/jquery-ui/safe-active-element.js b/vendor/assets/javascripts/jquery-ui/safe-active-element.js deleted file mode 100644 index 69061ea709c..00000000000 --- a/vendor/assets/javascripts/jquery-ui/safe-active-element.js +++ /dev/null @@ -1,42 +0,0 @@ -//= require jquery-ui/version - -( function( factory ) { - if ( typeof define === "function" && define.amd ) { - - // AMD. Register as an anonymous module. - define( [ "jquery", "./version" ], factory ); - } else { - - // Browser globals - factory( jQuery ); - } -} ( function( $ ) { -return $.ui.safeActiveElement = function( document ) { - var activeElement; - - // Support: IE 9 only - // IE9 throws an "Unspecified error" accessing document.activeElement from an