Skip to content

Commit e34b47c

Browse files
committed
Merge branch 'main' into 4-dev
2 parents 3772bc7 + 6b6f34e commit e34b47c

27 files changed

Lines changed: 187 additions & 136 deletions

.github/workflows/components-tests.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,12 @@ jobs:
3333
strategy:
3434
matrix:
3535
ruby:
36-
- '3.1.4'
37-
- '3.3.0'
36+
- '3.3'
37+
- '3.4'
3838
rails:
3939
- '6.1'
4040
- '7.1'
4141
- '8.0'
42-
exclude:
43-
- ruby: '3.1.4'
44-
rails: '8.0'
4542
runs-on: ubuntu-latest
4643

4744
env:
@@ -60,21 +57,12 @@ jobs:
6057
- name: Set up Ruby
6158
uses: ruby/setup-ruby@v1
6259
with:
63-
# bundler-cache: true
60+
bundler-cache: true
6461
bundler: default
6562
ruby-version: ${{ matrix.ruby }}
6663

67-
- uses: actions/cache@v4
68-
with:
69-
path: vendor/bundle
70-
key: ${{ runner.os }}-test-gems-${{ hashFiles('**/Gemfile.lock') }}
71-
restore-keys: |
72-
${{ runner.os }}-test-gems-${{ hashFiles('**/Gemfile.lock') }}
73-
74-
- name: Bundle install
64+
- name: Prepare database
7565
run: |
76-
bundle config path vendor/bundle
77-
bundle install --jobs 4 --retry 3
7866
bin/rails db:create
7967
bin/rails db:migrate
8068

.github/workflows/feature-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ jobs:
3737
strategy:
3838
matrix:
3939
ruby:
40-
- '3.3.0'
41-
- '3.4.5'
40+
- '3.3'
41+
- '3.4'
4242
rails:
4343
- '7.1'
4444
- '8.0'

.github/workflows/i18n-tests.yml

Lines changed: 4 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@ jobs:
3535
i18n_tests:
3636
strategy:
3737
matrix:
38-
ruby:
39-
- '3.3.0'
40-
rails:
41-
- '8.0'
38+
ruby: ['3.4']
39+
rails: ['8.0']
4240
runs-on: ubuntu-latest
4341

4442
env:
@@ -57,53 +55,15 @@ jobs:
5755
- name: Set up Ruby
5856
uses: ruby/setup-ruby@v1
5957
with:
60-
# bundler-cache: true
58+
bundler-cache: true
6159
bundler: default
6260
ruby-version: ${{ matrix.ruby }}
6361

64-
- uses: actions/cache@v4
65-
with:
66-
path: vendor/bundle
67-
key: ${{ runner.os }}-test-gems-${{ hashFiles('**/Gemfile.lock') }}
68-
restore-keys: |
69-
${{ runner.os }}-test-gems-${{ hashFiles('**/Gemfile.lock') }}
70-
71-
- name: Bundle install
62+
- name: Prepare database
7263
run: |
73-
bundle config path vendor/bundle
74-
bundle install --jobs 4 --retry 3
7564
bin/rails db:create
7665
bin/rails db:migrate
7766
78-
- name: Get yarn cache directory path
79-
id: test-yarn-cache-dir-path
80-
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
81-
82-
- uses: actions/cache@v4
83-
id: test-yarn-cache
84-
with:
85-
path: ${{ steps.test-yarn-cache-dir-path.outputs.dir }}
86-
key: ${{ runner.os }}-test-yarn-${{ hashFiles('**/yarn.lock') }}
87-
restore-keys: |
88-
${{ runner.os }}-test-yarn-${{ hashFiles('**/yarn.lock') }}
89-
90-
- name: Yarn install the dummy app
91-
run: |
92-
cd spec/dummy
93-
yarn
94-
95-
- name: Yarn install
96-
run: yarn
97-
98-
- name: Build assets
99-
env:
100-
RAILS_ENV: production
101-
NODE_ENV: production
102-
run: |
103-
yarn build:js
104-
yarn build:css
105-
yarn build:custom-js
106-
10767
- name: Run tests
10868
id: run_tests
10969
run: bundle exec rspec spec/system/i18n_spec.rb

.github/workflows/system-tests.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636
strategy:
3737
matrix:
3838
ruby:
39-
- '3.3.0'
40-
- '3.4.5'
39+
- '3.3'
40+
- '3.4'
4141
rails:
4242
- '7.1'
4343
- '8.0'
@@ -59,21 +59,12 @@ jobs:
5959
- name: Set up Ruby
6060
uses: ruby/setup-ruby@v1
6161
with:
62-
# bundler-cache: true
62+
bundler-cache: true
6363
bundler: default
6464
ruby-version: ${{ matrix.ruby }}
6565

66-
- uses: actions/cache@v4
67-
with:
68-
path: vendor/bundle
69-
key: ${{ runner.os }}-test-gems-${{ hashFiles('**/Gemfile.lock') }}
70-
restore-keys: |
71-
${{ runner.os }}-test-gems-${{ hashFiles('**/Gemfile.lock') }}
72-
73-
- name: Bundle install
66+
- name: Prepare database
7467
run: |
75-
bundle config path vendor/bundle
76-
bundle install --jobs 4 --retry 3
7768
bin/rails db:create
7869
bin/rails db:migrate
7970

.github/workflows/test-tailwindcss-integration.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,18 @@ jobs:
2121
with:
2222
repository: avo-hq/avo_tailwindcss_test_repo
2323

24-
- uses: actions/cache@v4
25-
with:
26-
path: vendor/bundle
27-
key: ${{ runner.os }}-test-gems-${{ hashFiles('**/Gemfile.lock') }}
28-
restore-keys: |
29-
${{ runner.os }}-test-gems-${{ hashFiles('**/Gemfile.lock') }}
30-
3124
- name: Set up Ruby
3225
uses: ruby/setup-ruby@v1
3326
with:
27+
bundler-cache: true
3428
bundler: default
3529
ruby-version: 3.3.0
3630

37-
- name: Bundle install
38-
run: |
39-
bundle config path vendor/bundle
40-
bundle install --jobs 4 --retry 3
41-
4231
- name: Add Avo
4332
run: |
33+
# ruby/setup-ruby with bundler-cache runs Bundler in a frozen/deployment-like mode.
34+
# This step intentionally changes the Gemfile.lock, so we must unfreeze Bundler here.
35+
bundle config set frozen false
4436
bundle add "avo" --git='https://github.com/avo-hq/avo.git' --ref="${{ github.sha }}"
4537
bundle install
4638
bin/rails generate avo:install

Appraisals

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
["3.3.0", "3.4.5"].each do |ruby_version|
1+
["3.3", "3.4"].each do |ruby_version|
22
["7.1", "8.0"].each do |rails_version|
33
appraise "rails-#{rails_version}-ruby-#{ruby_version}" do
44
gem "psych", "< 4"

app/components/avo/referrer_params_component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
<%= hidden_field_tag :via_record_id, params[:via_record_id] if params[:via_record_id] %>
55
<%= hidden_field_tag :via_relation, params[:via_relation] if params[:via_relation] %>
66
<%= hidden_field_tag :via_belongs_to_resource_class, params[:via_belongs_to_resource_class] if params[:via_belongs_to_resource_class] %>
7-
<%= hidden_field_tag :return_to, params[:return_to] if params[:return_to].present? %>
7+
<%= hidden_field_tag :return_to, e(params[:return_to]) if params[:return_to].present? %>
88
<%= hidden_field_tag :referrer, @back_path if params[:via_resource_class] %>

app/components/avo/views/resource_show_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def edit_path
5454
# When coming from a turbo frame, we don't want to return to that exact frame
5555
# for example when editing a has_one field we want to return to the parent frame
5656
# not the frame of the has_one field.
57-
args[:return_to] = request.url unless request.url.include?("turbo_frame=")
57+
args[:return_to] = e(request.fullpath) unless request.url.include?("turbo_frame=")
5858

5959
helpers.edit_resource_path(record: @resource.record, resource: @resource, **args)
6060
end

app/controllers/avo/base_application_controller.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ def raise_404
327327

328328
def decode_params
329329
if params[:return_to].present?
330-
params[:raw_return_to] = params[:return_to]
331330
params[:return_to] = d(params[:return_to])
332331
end
333332
end

app/controllers/avo/base_controller.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,9 @@ def redirect_path_from_resource_option(action = :after_update_path)
619619
return nil if @resource.class.send(action).blank?
620620

621621
extra_args = {}
622-
extra_args[:return_to] = params[:return_to] if params[:return_to].present?
622+
if params[:return_to].present?
623+
extra_args[:return_to] = e(params[:return_to])
624+
end
623625

624626
if @resource.class.send(action) == :index
625627
resources_path(resource: @resource, **extra_args)

0 commit comments

Comments
 (0)