Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Another batch of sidebar improvements

Damian Legawiecd4d63e805166
diff --git a/admin/app/assets/stylesheets/spree/admin/components/_main.scss b/admin/app/assets/stylesheets/spree/admin/components/_main.scss
index 2065b24a64..0158305847 100644
--- a/admin/app/assets/stylesheets/spree/admin/components/_main.scss
+++ b/admin/app/assets/stylesheets/spree/admin/components/_main.scss
@@ -64,7 +64,6 @@ turbo-frame[loading] .spinner-border, turbo-frame[busy] .spinner-border {
.ti {
font-size: 1.125rem;
margin-right: 0.5rem;
- color: $gray-500;
}
&:hover {
@@ -138,6 +137,7 @@ turbo-frame[loading] .spinner-border, turbo-frame[busy] .spinner-border {
padding-left: 1rem;
border-left: 0;
border-right: 0;
+ border-bottom: 0;
border-radius: 0;
font-size: $font-size-sm;
margin-bottom: 0;
diff --git a/admin/app/helpers/spree/admin/base_helper.rb b/admin/app/helpers/spree/admin/base_helper.rb
index 3d693f1308..9c167cdd2d 100644
--- a/admin/app/helpers/spree/admin/base_helper.rb
+++ b/admin/app/helpers/spree/admin/base_helper.rb
@@ -15,6 +15,15 @@ module Spree
@spree_update_available ||= !Rails.env.test? && spree_updater.update_available?
end
+ def settings_active?
+ %w[stores zones shipping_methods oauth_applications
+ payment_methods refund_reasons reimbursement_types
+ shipping_categories store_credit_categories
+ syncs tax_categories tax_rates webhooks accounts
+ custom_domains audits exports imports return_authorization_reasons
+ documents stripe_tax_registrations members subscriptions stock_locations webhooks_subscribers].include?(controller_name)
+ end
+
def available_countries_iso
@available_countries_iso ||= current_store.countries_available_for_checkout.pluck(:iso)
end
diff --git a/admin/app/views/spree/admin/shared/_sidebar.html.erb b/admin/app/views/spree/admin/shared/_sidebar.html.erb
index c982fab299..ec1fa0d65a 100644
--- a/admin/app/views/spree/admin/shared/_sidebar.html.erb
+++ b/admin/app/views/spree/admin/shared/_sidebar.html.erb
@@ -6,8 +6,10 @@
<%= render 'spree/admin/shared/sidebar/store_nav' %>
<% end %>
- <section class="position-sticky d-none d-lg-block w-100 z-index-1000 mt-auto py-2 bottom-0">
- <%= render 'spree/admin/shared/sidebar/enterprise_edition_notice' %>
- <%= render 'spree/admin/shared/user_dropdown' %>
- </section>
+ <% unless settings_active? %>
+ <section class="position-sticky d-none d-lg-block w-100 z-index-1000 mt-auto py-2 bottom-0">
+ <%= render 'spree/admin/shared/sidebar/enterprise_edition_notice' %>
+ <%= render 'spree/admin/shared/user_dropdown' %>
+ </section>
+ <% end %>
</aside>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/shared/_user_dropdown.html.erb b/admin/app/views/spree/admin/shared/_user_dropdown.html.erb
index 22cd93d418..7d4d888d40 100644
--- a/admin/app/views/spree/admin/shared/_user_dropdown.html.erb
+++ b/admin/app/views/spree/admin/shared/_user_dropdown.html.erb
@@ -1,5 +1,5 @@
<% if try_spree_current_user.present? %>
- <div class="dropdown bg-gray-25" id="<%= dom_id(try_spree_current_user, 'account-dropdown') %>" data-turbo-permanent>
+ <div class="dropdown pt-2 bg-gray-25 border-top" id="<%= dom_id(try_spree_current_user, 'account-dropdown') %>" data-turbo-permanent>
<button type="button"
class="btn d-flex align-items-center justify-content-between text-left w-100"
data-toggle="dropdown" aria-expanded="false" id="accountNav">
diff --git a/admin/app/views/spree/admin/shared/sidebar/_store_nav.html.erb b/admin/app/views/spree/admin/shared/sidebar/_store_nav.html.erb
index 3606a1b040..ceff52fb0a 100644
--- a/admin/app/views/spree/admin/shared/sidebar/_store_nav.html.erb
+++ b/admin/app/views/spree/admin/shared/sidebar/_store_nav.html.erb
@@ -1,12 +1,6 @@
-<% settings_active = %w[stores zones shipping_methods oauth_applications
- payment_methods refund_reasons reimbursement_types
- shipping_categories store_credit_categories
- syncs tax_categories tax_rates webhooks accounts
- custom_domains audits exports imports return_authorization_reasons
- documents stripe_tax_registrations members subscriptions stock_locations webhooks_subscribers].include?(controller_name) %>
-<% if settings_active %>
+<% if settings_active? %>
<ul class="nav flex-column">
- <li class="nav-item mb-3">
+ <li class="nav-item mb-1 py-2 border-bottom border-bottom-dashed">
<%= active_link_to_with_icon('chevron-left', Spree.t('admin.back_to_dashboard'), spree.admin_dashboard_path, class: 'nav-link') %>
</li>