diff --git a/admin/app/components/solidus_admin/feedback/component.rb b/admin/app/components/solidus_admin/feedback/component.rb deleted file mode 100644 index dcb136b5897..00000000000 --- a/admin/app/components/solidus_admin/feedback/component.rb +++ /dev/null @@ -1,4 +0,0 @@ -# frozen_string_literal: true - -class SolidusAdmin::Feedback::Component < SolidusAdmin::BaseComponent -end diff --git a/admin/app/components/solidus_admin/feedback/component.html.erb b/admin/app/components/solidus_admin/layout/feedback/component.html.erb similarity index 100% rename from admin/app/components/solidus_admin/feedback/component.html.erb rename to admin/app/components/solidus_admin/layout/feedback/component.html.erb diff --git a/admin/app/components/solidus_admin/layout/feedback/component.rb b/admin/app/components/solidus_admin/layout/feedback/component.rb new file mode 100644 index 00000000000..4bf7f631b20 --- /dev/null +++ b/admin/app/components/solidus_admin/layout/feedback/component.rb @@ -0,0 +1,4 @@ +# frozen_string_literal: true + +class SolidusAdmin::Layout::Feedback::Component < SolidusAdmin::BaseComponent +end diff --git a/admin/app/components/solidus_admin/feedback/component.yml b/admin/app/components/solidus_admin/layout/feedback/component.yml similarity index 100% rename from admin/app/components/solidus_admin/feedback/component.yml rename to admin/app/components/solidus_admin/layout/feedback/component.yml diff --git a/admin/app/components/solidus_admin/sidebar/account_nav/component.html.erb b/admin/app/components/solidus_admin/layout/navigation/account/component.html.erb similarity index 100% rename from admin/app/components/solidus_admin/sidebar/account_nav/component.html.erb rename to admin/app/components/solidus_admin/layout/navigation/account/component.html.erb diff --git a/admin/app/components/solidus_admin/sidebar/account_nav/component.rb b/admin/app/components/solidus_admin/layout/navigation/account/component.rb similarity index 81% rename from admin/app/components/solidus_admin/sidebar/account_nav/component.rb rename to admin/app/components/solidus_admin/layout/navigation/account/component.rb index 59df8c445c7..d9337c5a928 100644 --- a/admin/app/components/solidus_admin/sidebar/account_nav/component.rb +++ b/admin/app/components/solidus_admin/layout/navigation/account/component.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Account navigation -class SolidusAdmin::Sidebar::AccountNav::Component < SolidusAdmin::BaseComponent +class SolidusAdmin::Layout::Navigation::Account::Component < SolidusAdmin::BaseComponent # @param user_label [String] # @param account_path [String] # @param logout_path [String] diff --git a/admin/app/components/solidus_admin/sidebar/account_nav/component.yml b/admin/app/components/solidus_admin/layout/navigation/account/component.yml similarity index 100% rename from admin/app/components/solidus_admin/sidebar/account_nav/component.yml rename to admin/app/components/solidus_admin/layout/navigation/account/component.yml diff --git a/admin/app/components/solidus_admin/sidebar/component.html.erb b/admin/app/components/solidus_admin/layout/navigation/component.html.erb similarity index 89% rename from admin/app/components/solidus_admin/sidebar/component.html.erb rename to admin/app/components/solidus_admin/layout/navigation/component.html.erb index ca22223caa0..fe5aacf0b79 100644 --- a/admin/app/components/solidus_admin/sidebar/component.html.erb +++ b/admin/app/components/solidus_admin/layout/navigation/component.html.erb @@ -17,7 +17,7 @@ <% end %>
@@ -29,7 +29,7 @@
- <%= render component("sidebar/account_nav").new( + <%= render component("layout/navigation/account").new( user_label: helpers.current_solidus_admin_user.email, account_path: solidus_admin.account_path, logout_path: helpers.solidus_admin_logout_path, diff --git a/admin/app/components/solidus_admin/sidebar/component.js b/admin/app/components/solidus_admin/layout/navigation/component.js similarity index 100% rename from admin/app/components/solidus_admin/sidebar/component.js rename to admin/app/components/solidus_admin/layout/navigation/component.js diff --git a/admin/app/components/solidus_admin/sidebar/component.rb b/admin/app/components/solidus_admin/layout/navigation/component.rb similarity index 86% rename from admin/app/components/solidus_admin/sidebar/component.rb rename to admin/app/components/solidus_admin/layout/navigation/component.rb index a259ac52732..ccddd86e5a0 100644 --- a/admin/app/components/solidus_admin/sidebar/component.rb +++ b/admin/app/components/solidus_admin/layout/navigation/component.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Renders the sidebar -class SolidusAdmin::Sidebar::Component < SolidusAdmin::BaseComponent +class SolidusAdmin::Layout::Navigation::Component < SolidusAdmin::BaseComponent def initialize( store:, logo_path: SolidusAdmin::Config.logo_path, diff --git a/admin/app/components/solidus_admin/sidebar/component.yml b/admin/app/components/solidus_admin/layout/navigation/component.yml similarity index 100% rename from admin/app/components/solidus_admin/sidebar/component.yml rename to admin/app/components/solidus_admin/layout/navigation/component.yml diff --git a/admin/app/components/solidus_admin/sidebar/item/component.html.erb b/admin/app/components/solidus_admin/layout/navigation/item/component.html.erb similarity index 100% rename from admin/app/components/solidus_admin/sidebar/item/component.html.erb rename to admin/app/components/solidus_admin/layout/navigation/item/component.html.erb diff --git a/admin/app/components/solidus_admin/sidebar/item/component.rb b/admin/app/components/solidus_admin/layout/navigation/item/component.rb similarity index 87% rename from admin/app/components/solidus_admin/sidebar/item/component.rb rename to admin/app/components/solidus_admin/layout/navigation/item/component.rb index a410f4e72f8..04261e09dfa 100644 --- a/admin/app/components/solidus_admin/sidebar/item/component.rb +++ b/admin/app/components/solidus_admin/layout/navigation/item/component.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Menu item within a {Sidebar} -class SolidusAdmin::Sidebar::Item::Component < SolidusAdmin::BaseComponent +class SolidusAdmin::Layout::Navigation::Item::Component < SolidusAdmin::BaseComponent with_collection_parameter :item # @param item [SolidusAdmin::MainNavItem diff --git a/admin/app/components/solidus_admin/layout/page_helpers.rb b/admin/app/components/solidus_admin/layout/page_helpers.rb index 7bf7bfb409f..bd196e59b1d 100644 --- a/admin/app/components/solidus_admin/layout/page_helpers.rb +++ b/admin/app/components/solidus_admin/layout/page_helpers.rb @@ -7,7 +7,7 @@ def page(**attrs, &block) def page_header_actions(&block) tag.div(safe_join([ - render(component("feedback").new), + render(component("layout/feedback").new), capture(&block), ]), class: "flex gap-2 items-center") end diff --git a/admin/app/components/solidus_admin/skip_link/component.rb b/admin/app/components/solidus_admin/layout/skip_link/component.rb similarity index 85% rename from admin/app/components/solidus_admin/skip_link/component.rb rename to admin/app/components/solidus_admin/layout/skip_link/component.rb index b9857bb6b5d..821c4092ae5 100644 --- a/admin/app/components/solidus_admin/skip_link/component.rb +++ b/admin/app/components/solidus_admin/layout/skip_link/component.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Skip to content link -class SolidusAdmin::SkipLink::Component < SolidusAdmin::BaseComponent +class SolidusAdmin::Layout::SkipLink::Component < SolidusAdmin::BaseComponent # @param href [String] the href attribute for the skip link def initialize(href:) @href = href diff --git a/admin/app/components/solidus_admin/skip_link/component.yml b/admin/app/components/solidus_admin/layout/skip_link/component.yml similarity index 100% rename from admin/app/components/solidus_admin/skip_link/component.yml rename to admin/app/components/solidus_admin/layout/skip_link/component.yml diff --git a/admin/app/views/layouts/solidus_admin/application.html.erb b/admin/app/views/layouts/solidus_admin/application.html.erb index 9a2b99d122f..d994b6d2e52 100644 --- a/admin/app/views/layouts/solidus_admin/application.html.erb +++ b/admin/app/views/layouts/solidus_admin/application.html.erb @@ -8,11 +8,11 @@ - <%= render component("skip_link").new(href: "#main") %> + <%= render component("layout/skip_link").new(href: "#main") %>
- <%= render component("sidebar").new(store: current_store) %> + <%= render component("layout/navigation").new(store: current_store) %>
diff --git a/admin/spec/components/previews/solidus_admin/feedback/component_preview.rb b/admin/spec/components/previews/solidus_admin/layout/feedback/component_preview.rb similarity index 53% rename from admin/spec/components/previews/solidus_admin/feedback/component_preview.rb rename to admin/spec/components/previews/solidus_admin/layout/feedback/component_preview.rb index 312b691254a..a13f22022fb 100644 --- a/admin/spec/components/previews/solidus_admin/feedback/component_preview.rb +++ b/admin/spec/components/previews/solidus_admin/layout/feedback/component_preview.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true -# @component "ui/feedback" -class SolidusAdmin::Feedback::ComponentPreview < ViewComponent::Preview +class SolidusAdmin::Layout::Feedback::ComponentPreview < ViewComponent::Preview include SolidusAdmin::Preview def overview diff --git a/admin/spec/components/previews/solidus_admin/feedback/component_preview/overview.html.erb b/admin/spec/components/previews/solidus_admin/layout/feedback/component_preview/overview.html.erb similarity index 100% rename from admin/spec/components/previews/solidus_admin/feedback/component_preview/overview.html.erb rename to admin/spec/components/previews/solidus_admin/layout/feedback/component_preview/overview.html.erb diff --git a/admin/spec/components/previews/solidus_admin/sidebar/account_nav/component_preview.rb b/admin/spec/components/previews/solidus_admin/layout/navigation/account/component_preview.rb similarity index 67% rename from admin/spec/components/previews/solidus_admin/sidebar/account_nav/component_preview.rb rename to admin/spec/components/previews/solidus_admin/layout/navigation/account/component_preview.rb index 26762c361ab..b46f8c1cd22 100644 --- a/admin/spec/components/previews/solidus_admin/sidebar/account_nav/component_preview.rb +++ b/admin/spec/components/previews/solidus_admin/layout/navigation/account/component_preview.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -# @component "sidebar/account_nav" -class SolidusAdmin::Sidebar::AccountNav::ComponentPreview < ViewComponent::Preview +# @component "layout/navigation/account" +class SolidusAdmin::Layout::Navigation::Account::ComponentPreview < ViewComponent::Preview include SolidusAdmin::Preview def overview diff --git a/admin/spec/components/previews/solidus_admin/sidebar/account_nav/component_preview/overview.html.erb b/admin/spec/components/previews/solidus_admin/layout/navigation/account/component_preview/overview.html.erb similarity index 100% rename from admin/spec/components/previews/solidus_admin/sidebar/account_nav/component_preview/overview.html.erb rename to admin/spec/components/previews/solidus_admin/layout/navigation/account/component_preview/overview.html.erb diff --git a/admin/spec/components/previews/solidus_admin/sidebar/account_nav/component_preview/playground.html.erb b/admin/spec/components/previews/solidus_admin/layout/navigation/account/component_preview/playground.html.erb similarity index 100% rename from admin/spec/components/previews/solidus_admin/sidebar/account_nav/component_preview/playground.html.erb rename to admin/spec/components/previews/solidus_admin/layout/navigation/account/component_preview/playground.html.erb diff --git a/admin/spec/components/previews/solidus_admin/sidebar/component_preview.rb b/admin/spec/components/previews/solidus_admin/layout/navigation/component_preview.rb similarity index 83% rename from admin/spec/components/previews/solidus_admin/sidebar/component_preview.rb rename to admin/spec/components/previews/solidus_admin/layout/navigation/component_preview.rb index eb136a97cfb..22d9004c239 100644 --- a/admin/spec/components/previews/solidus_admin/sidebar/component_preview.rb +++ b/admin/spec/components/previews/solidus_admin/layout/navigation/component_preview.rb @@ -2,8 +2,8 @@ require "solidus_admin/main_nav_item" -# @component "sidebar" -class SolidusAdmin::Sidebar::ComponentPreview < ViewComponent::Preview +# @component "layout/navigation" +class SolidusAdmin::Layout::Navigation::ComponentPreview < ViewComponent::Preview include SolidusAdmin::Preview # The item component is used to render main navigation items, which are @@ -17,7 +17,7 @@ class SolidusAdmin::Sidebar::ComponentPreview < ViewComponent::Preview # key: :overview, # position: 80 # ) - # render component("sidebar/item", item: item) + # render component("layout/navigation/item", item: item) # ``` # # @param store_name text diff --git a/admin/spec/components/previews/solidus_admin/sidebar/item/component_preview.rb b/admin/spec/components/previews/solidus_admin/layout/navigation/item/component_preview.rb similarity index 88% rename from admin/spec/components/previews/solidus_admin/sidebar/item/component_preview.rb rename to admin/spec/components/previews/solidus_admin/layout/navigation/item/component_preview.rb index cb90bdb0ea2..494ee181f61 100644 --- a/admin/spec/components/previews/solidus_admin/sidebar/item/component_preview.rb +++ b/admin/spec/components/previews/solidus_admin/layout/navigation/item/component_preview.rb @@ -2,8 +2,8 @@ require "solidus_admin/main_nav_item" -# @component "sidebar/item" -class SolidusAdmin::Sidebar::Item::ComponentPreview < ViewComponent::Preview +# @component "layout/navigation/item" +class SolidusAdmin::Layout::Navigation::Item::ComponentPreview < ViewComponent::Preview include SolidusAdmin::Preview DUMMY_ROUTE = :foo_path diff --git a/admin/spec/components/previews/solidus_admin/sidebar/item/component_preview/overview.html.erb b/admin/spec/components/previews/solidus_admin/layout/navigation/item/component_preview/overview.html.erb similarity index 100% rename from admin/spec/components/previews/solidus_admin/sidebar/item/component_preview/overview.html.erb rename to admin/spec/components/previews/solidus_admin/layout/navigation/item/component_preview/overview.html.erb diff --git a/admin/spec/components/previews/solidus_admin/skip_link/component_preview.rb b/admin/spec/components/previews/solidus_admin/layout/skip_link/component_preview.rb similarity index 65% rename from admin/spec/components/previews/solidus_admin/skip_link/component_preview.rb rename to admin/spec/components/previews/solidus_admin/layout/skip_link/component_preview.rb index 11dad7b89b4..0e77ca3f9a8 100644 --- a/admin/spec/components/previews/solidus_admin/skip_link/component_preview.rb +++ b/admin/spec/components/previews/solidus_admin/layout/skip_link/component_preview.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -# @component "skip_link" -class SolidusAdmin::SkipLink::ComponentPreview < ViewComponent::Preview +# @component "layout/skip_link" +class SolidusAdmin::Layout::SkipLink::ComponentPreview < ViewComponent::Preview include SolidusAdmin::Preview # Click on the "Preview" window area and press "Tab" to see the skip link diff --git a/admin/spec/components/solidus_admin/skip_link/component_spec.rb b/admin/spec/components/solidus_admin/layout/feedback/component_spec.rb similarity index 63% rename from admin/spec/components/solidus_admin/skip_link/component_spec.rb rename to admin/spec/components/solidus_admin/layout/feedback/component_spec.rb index e62f2f2c3ba..f9afb51f097 100644 --- a/admin/spec/components/solidus_admin/skip_link/component_spec.rb +++ b/admin/spec/components/solidus_admin/layout/feedback/component_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe SolidusAdmin::SkipLink::Component, type: :component do +RSpec.describe SolidusAdmin::Layout::Feedback::Component, type: :component do it "renders the overview preview" do render_preview(:overview) end diff --git a/admin/spec/components/solidus_admin/sidebar/account_nav/component_spec.rb b/admin/spec/components/solidus_admin/layout/navigation/account/component_spec.rb similarity index 89% rename from admin/spec/components/solidus_admin/sidebar/account_nav/component_spec.rb rename to admin/spec/components/solidus_admin/layout/navigation/account/component_spec.rb index 5a1cb4e5fe4..56d4d80b0eb 100644 --- a/admin/spec/components/solidus_admin/sidebar/account_nav/component_spec.rb +++ b/admin/spec/components/solidus_admin/layout/navigation/account/component_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe SolidusAdmin::Sidebar::AccountNav::Component, type: :component do +RSpec.describe SolidusAdmin::Layout::Navigation::Account::Component, type: :component do it "renders the overview preview" do render_preview(:overview) end diff --git a/admin/spec/components/solidus_admin/sidebar/component_spec.rb b/admin/spec/components/solidus_admin/layout/navigation/component_spec.rb similarity index 81% rename from admin/spec/components/solidus_admin/sidebar/component_spec.rb rename to admin/spec/components/solidus_admin/layout/navigation/component_spec.rb index 34f754af6cd..b537c744526 100644 --- a/admin/spec/components/solidus_admin/sidebar/component_spec.rb +++ b/admin/spec/components/solidus_admin/layout/navigation/component_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe SolidusAdmin::Sidebar::Component, type: :component do +RSpec.describe SolidusAdmin::Layout::Navigation::Component, type: :component do before { allow(vc_test_controller).to receive(:spree_current_user).and_return(build(:user)) } it "renders the overview preview" do @@ -32,7 +32,7 @@ end it "renders the account nav component" do - account_nav_component = mock_component do + account_component = mock_component do def call "account nav" end @@ -42,7 +42,7 @@ def call items: [], ) allow(component).to receive(:component).and_call_original - allow(component).to receive(:component).with('sidebar/account_nav').and_return(account_nav_component) + allow(component).to receive(:component).with('layout/navigation/account').and_return(account_component) render_inline(component) diff --git a/admin/spec/components/solidus_admin/sidebar/item/component_spec.rb b/admin/spec/components/solidus_admin/layout/navigation/item/component_spec.rb similarity index 96% rename from admin/spec/components/solidus_admin/sidebar/item/component_spec.rb rename to admin/spec/components/solidus_admin/layout/navigation/item/component_spec.rb index 9725d134ab5..566ec3fbf79 100644 --- a/admin/spec/components/solidus_admin/sidebar/item/component_spec.rb +++ b/admin/spec/components/solidus_admin/layout/navigation/item/component_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe SolidusAdmin::Sidebar::Item::Component, type: :component do +RSpec.describe SolidusAdmin::Layout::Navigation::Item::Component, type: :component do def url_helpers(solidus_admin: {}, spree: {}) double( solidus_admin: double(**solidus_admin), diff --git a/admin/spec/components/solidus_admin/feedback/component_spec.rb b/admin/spec/components/solidus_admin/layout/skip_link/component_spec.rb similarity index 63% rename from admin/spec/components/solidus_admin/feedback/component_spec.rb rename to admin/spec/components/solidus_admin/layout/skip_link/component_spec.rb index 58f4c0b1819..a5614da73e5 100644 --- a/admin/spec/components/solidus_admin/feedback/component_spec.rb +++ b/admin/spec/components/solidus_admin/layout/skip_link/component_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe SolidusAdmin::Feedback::Component, type: :component do +RSpec.describe SolidusAdmin::Layout::SkipLink::Component, type: :component do it "renders the overview preview" do render_preview(:overview) end