Skip to content

Commit c687715

Browse files
authored
Merge branch 'main' into enhancement/improve-message-when-missing-resource-for-array-fields
2 parents 654d798 + 6100dac commit c687715

12 files changed

+60
-57
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ GEM
452452
puma (6.6.0)
453453
nio4r (~> 2.0)
454454
racc (1.8.1)
455-
rack (3.1.11)
455+
rack (3.1.12)
456456
rack-session (2.1.0)
457457
base64 (>= 0.1.0)
458458
rack (>= 3.0.0)

gemfiles/rails_7.1_ruby_3.1.4.gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ GEM
450450
puma (6.6.0)
451451
nio4r (~> 2.0)
452452
racc (1.8.1)
453-
rack (3.1.11)
453+
rack (3.1.12)
454454
rack-session (2.1.0)
455455
base64 (>= 0.1.0)
456456
rack (>= 3.0.0)

gemfiles/rails_7.1_ruby_3.3.0.gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ GEM
422422
puma (6.6.0)
423423
nio4r (~> 2.0)
424424
racc (1.8.1)
425-
rack (3.1.11)
425+
rack (3.1.12)
426426
rack-session (2.1.0)
427427
base64 (>= 0.1.0)
428428
rack (>= 3.0.0)

gemfiles/rails_8.0_ruby_3.3.0.gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ GEM
422422
puma (6.6.0)
423423
nio4r (~> 2.0)
424424
racc (1.8.1)
425-
rack (3.1.11)
425+
rack (3.1.12)
426426
rack-session (2.1.0)
427427
base64 (>= 0.1.0)
428428
rack (>= 3.0.0)

lib/avo/base_action.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ class BaseAction
44
include Avo::Concerns::HasActionStimulusControllers
55
include Avo::Concerns::Hydration
66

7-
DATA_ATTRIBUTES = {turbo_frame: Avo::MODAL_FRAME_ID}
7+
unless defined?(DATA_ATTRIBUTES)
8+
DATA_ATTRIBUTES = {turbo_frame: Avo::MODAL_FRAME_ID}
9+
end
810

911
class_attribute :name, default: nil
1012
class_attribute :message
Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,64 @@
11
require "rails_helper"
22

33
RSpec.describe Avo::CoverPhotoComponent, type: :component do
4-
let(:cover_photo) { double("cover_photo") }
5-
let(:resource) { double("resource", cover_photo: cover_photo) }
4+
# let(:cover_photo) { double("cover_photo") }
5+
# let(:resource) { double("resource", cover_photo: cover_photo) }
66

7-
describe "rendering" do
8-
context "when cover photo is present and visible in the current view" do
9-
before do
10-
allow(cover_photo).to receive(:present?).and_return(true)
11-
allow(cover_photo).to receive(:visible_in_current_view?).and_return(true)
12-
allow(cover_photo).to receive(:value).and_return("cover_photo_value")
13-
allow(cover_photo).to receive(:size).and_return(:md)
14-
end
7+
# describe "rendering" do
8+
# context "when cover photo is present and visible in the current view" do
9+
# before do
10+
# allow(cover_photo).to receive(:present?).and_return(true)
11+
# allow(cover_photo).to receive(:visible_in_current_view?).and_return(true)
12+
# allow(cover_photo).to receive(:value).and_return("cover_photo_value")
13+
# allow(cover_photo).to receive(:size).and_return(:md)
14+
# end
1515

16-
it "renders the component with the correct size and visibility settings" do
17-
render_inline(described_class.new(cover_photo: cover_photo))
16+
# it "renders the component with the correct size and visibility settings" do
17+
# render_inline(described_class.new(cover_photo: cover_photo))
1818

19-
expect(rendered_component).to have_css(".aspect-cover-md")
20-
expect(rendered_component).to have_selector("img[src='cover_photo_value']")
21-
end
22-
end
19+
# expect(rendered_component).to have_css(".aspect-cover-md")
20+
# expect(rendered_component).to have_selector("img[src='cover_photo_value']")
21+
# end
22+
# end
2323

24-
context "when cover photo is not present" do
25-
before do
26-
allow(cover_photo).to receive(:present?).and_return(false)
27-
end
24+
# context "when cover photo is not present" do
25+
# before do
26+
# allow(cover_photo).to receive(:present?).and_return(false)
27+
# end
2828

29-
it "does not render the component" do
30-
render_inline(described_class.new(cover_photo: cover_photo))
29+
# it "does not render the component" do
30+
# render_inline(described_class.new(cover_photo: cover_photo))
3131

32-
expect(rendered_component).to be_blank
33-
end
34-
end
32+
# expect(rendered_component).to be_blank
33+
# end
34+
# end
3535

36-
context "when cover photo is not visible in the current view" do
37-
before do
38-
allow(cover_photo).to receive(:visible_in_current_view?).and_return(false)
39-
end
36+
# context "when cover photo is not visible in the current view" do
37+
# before do
38+
# allow(cover_photo).to receive(:visible_in_current_view?).and_return(false)
39+
# end
4040

41-
it "does not render the component" do
42-
render_inline(described_class.new(cover_photo: cover_photo))
41+
# it "does not render the component" do
42+
# render_inline(described_class.new(cover_photo: cover_photo))
4343

44-
expect(rendered_component).to be_blank
45-
end
46-
end
44+
# expect(rendered_component).to be_blank
45+
# end
46+
# end
4747

48-
context "when cover photo source is a lambda" do
49-
let(:lambda_source) { -> { "dynamic_source_value" } }
48+
# context "when cover photo source is a lambda" do
49+
# let(:lambda_source) { -> { "dynamic_source_value" } }
5050

51-
before do
52-
allow(cover_photo).to receive(:present?).and_return(true)
53-
allow(cover_photo).to receive(:visible_in_current_view?).and_return(true)
54-
allow(cover_photo).to receive(:value).and_return(lambda_source.call)
55-
end
51+
# before do
52+
# allow(cover_photo).to receive(:present?).and_return(true)
53+
# allow(cover_photo).to receive(:visible_in_current_view?).and_return(true)
54+
# allow(cover_photo).to receive(:value).and_return(lambda_source.call)
55+
# end
5656

57-
it "correctly handles dynamic sources" do
58-
render_inline(described_class.new(cover_photo: cover_photo))
57+
# it "correctly handles dynamic sources" do
58+
# render_inline(described_class.new(cover_photo: cover_photo))
5959

60-
expect(rendered_component).to have_selector("img[src='dynamic_source_value']")
61-
end
62-
end
63-
end
60+
# expect(rendered_component).to have_selector("img[src='dynamic_source_value']")
61+
# end
62+
# end
63+
# end
6464
end

spec/features/action_icon_and_divider_spec.rb renamed to spec/features/avo/action_icon_and_divider_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
RSpec.describe "action icon and divider", type: :feature do
44
describe "icon and divider" do
5-
let(:user) { create(:user) }
6-
75
it "Viewing actions with icon and divider" do
86
visit "admin/resources/users"
97

spec/features/avo/generators/locales_generator_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
files << Rails.root.join("config", "locales", "pagy", "#{locale}.yml").to_s
2626
end
2727

28-
Rails::Generators.invoke("avo:locales", ["-q"], {destination_root: Rails.root})
28+
Rails::Generators.invoke("avo:locales", ["-q", "--skip"], {destination_root: Rails.root})
2929

3030
check_files_and_clean_up files
3131

File renamed without changes.

spec/rails_helper.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ def headless_download_setup(driver)
112112
config.use_transactional_fixtures = true
113113
config.filter_run focus: true
114114
config.run_all_when_everything_filtered = true
115+
config.before(:each) do
116+
Rails.application.try(:reload_routes_unless_loaded)
117+
end
115118

116119
config.before(:each, type: :system) {
117120
browser_options = {

0 commit comments

Comments
 (0)