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.

Update naming of link.rb to display_link.rb

Matthew Kennedy8a23412ef6a0
diff --git a/backend/app/views/spree/admin/menu_items/_form.html.erb b/backend/app/views/spree/admin/menu_items/_form.html.erb
index 456100ae34..4179038170 100644
--- a/backend/app/views/spree/admin/menu_items/_form.html.erb
+++ b/backend/app/views/spree/admin/menu_items/_form.html.erb
@@ -8,6 +8,9 @@
<div class="card-body">
<%= f.field_container :item_type, class: ['form-group'] do %>
<%= f.label :item_type, Spree.t('admin.navigation.item_type') %>
+ <span class="d-none" id="usingContainerInfo" data-show-info data-alert-message="<%= Spree.t('admin.navigation.menu_item_type_container_message') %>">
+ <%= svg_icon name: "info.svg", width: '15', height: '15' %>
+ </span>
<%= f.select(:item_type, @menu_item_types, {include_blank: false}) %>
<%= f.error_message_on :item_type %>
<% end %>
@@ -29,13 +32,6 @@
<%= Spree.t('admin.navigation.nested_under_info') %>
</small>
<% end %>
-
- <div class="d-none" id="usingContainerInfo">
- <hr>
- <div class="alert alert-info mt-3 mb-0">
- <%= raw Spree.t('admin.navigation.menu_item_type_container_message') %>
- </div>
- </div>
</div>
</div>
</div>
diff --git a/core/app/models/concerns/spree/link.rb b/core/app/models/concerns/spree/display_link.rb
similarity index 93%
rename from core/app/models/concerns/spree/link.rb
rename to core/app/models/concerns/spree/display_link.rb
index 8e68f03e2b..ab28e755e0 100644
--- a/core/app/models/concerns/spree/link.rb
+++ b/core/app/models/concerns/spree/display_link.rb
@@ -1,7 +1,5 @@
module Spree
- module Link
- extend ActiveSupport::Concern
-
+ module DisplayLink
def link
case linked_resource_type
when 'Spree::Taxon'
diff --git a/core/app/models/spree/menu_item.rb b/core/app/models/spree/menu_item.rb
index 4d2c72fe1c..5bc491c79b 100644
--- a/core/app/models/spree/menu_item.rb
+++ b/core/app/models/spree/menu_item.rb
@@ -1,6 +1,6 @@
module Spree
class MenuItem < Spree::Base
- include Spree::Link
+ include Spree::DisplayLink
acts_as_nested_set dependent: :destroy
diff --git a/core/config/locales/en.yml b/core/config/locales/en.yml
index 5ab9da9f1f..fa8ed5b1a3 100644
--- a/core/config/locales/en.yml
+++ b/core/config/locales/en.yml
@@ -601,7 +601,7 @@ en:
open_link_in_new_window: Open this link in a new window
menu_item_type_message: "For more information about Menu Item Types, Nesting and using Codes, visit the documentation by
<a href='https://guides.spreecommerce.org/user/configuration/configuring_geography.html#zones' target='_blank' class='alert-link'>clicking here</a>."
- menu_item_type_container_message: "<b>Containers</b> are used to organize other Menu Items, such as Links, or Promotions into groups using the Menu Item code.<ul><li>Containers do not link to a location.</li></ul> To learn more, please see the <a href='https://guides.spreecommerce.org/user/configuration/configuring_geography.html#zones' target='_blank' class='alert-link'>documentation</a>."
+ menu_item_type_container_message: Use containers to organize menu items into groups.
menus: Menus
menu_items: '%{menu_name} Items'
public_details: Public Details