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.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Standardize action text associations for page sections to use include… (#13028)
Damian Legawieca4798d91bf9f
diff --git a/core/app/models/spree/page_section.rb b/core/app/models/spree/page_section.rbindex 10ae06f737..551282295f 100644--- a/core/app/models/spree/page_section.rb+++ b/core/app/models/spree/page_section.rb@@ -23,11 +23,18 @@ module Spreehas_one_attached :asset, service: Spree.public_storage_service_namealias image asset+ #+ # Rich Text+ #+ has_rich_text :text+ has_rich_text :description+## Validations#validates :name, :pageable, presence: truevalidates :asset, content_type: Rails.application.config.active_storage.web_image_content_types+## Callbacks#diff --git a/core/app/models/spree/page_sections/announcement_bar.rb b/core/app/models/spree/page_sections/announcement_bar.rbindex 95f5ae6be0..463f61b7dd 100644--- a/core/app/models/spree/page_sections/announcement_bar.rb+++ b/core/app/models/spree/page_sections/announcement_bar.rb@@ -1,8 +1,6 @@module Spreemodule PageSectionsclass AnnouncementBar < Spree::PageSection- has_rich_text :text-before_validation :set_default_text, on: :createBACKGROUND_COLOR_DEFAULT = '#F5F5F4'diff --git a/core/app/models/spree/page_sections/featured_posts.rb b/core/app/models/spree/page_sections/featured_posts.rbindex 38e70d7c8c..b1b3fa1205 100644--- a/core/app/models/spree/page_sections/featured_posts.rb+++ b/core/app/models/spree/page_sections/featured_posts.rb@@ -1,8 +1,6 @@module Spreemodule PageSectionsclass FeaturedPosts < Spree::PageSection- has_rich_text :description-before_validation :make_heading_size_validbefore_validation :make_max_posts_to_show_validbefore_validation :make_alignment_validdiff --git a/core/app/models/spree/page_sections/featured_taxon.rb b/core/app/models/spree/page_sections/featured_taxon.rbindex 4b70f335ce..6efcba064a 100644--- a/core/app/models/spree/page_sections/featured_taxon.rb+++ b/core/app/models/spree/page_sections/featured_taxon.rb@@ -9,8 +9,6 @@ module Spreequeries.reduce(:or)}- has_rich_text :description-before_validation :make_heading_size_validbefore_validation :make_alignment_validbefore_validation :make_taxon_id_validdiff --git a/core/app/models/spree/page_sections/related_products.rb b/core/app/models/spree/page_sections/related_products.rbindex 28f2f51d10..a3f449a099 100644--- a/core/app/models/spree/page_sections/related_products.rb+++ b/core/app/models/spree/page_sections/related_products.rb@@ -1,8 +1,6 @@module Spreemodule PageSectionsclass RelatedProducts < Spree::PageSection- has_rich_text :description-before_validation :make_heading_size_validbefore_validation :make_alignment_validdiff --git a/storefront/app/helpers/spree/page_helper.rb b/storefront/app/helpers/spree/page_helper.rbindex e0a67d97c4..8dce65a158 100644--- a/storefront/app/helpers/spree/page_helper.rb+++ b/storefront/app/helpers/spree/page_helper.rb@@ -12,7 +12,7 @@ module Spreepage ||= current_pagesections = current_page_preview.present? ? current_page_preview.sections : page.sections- sections_html = sections.includes(:links, { asset_attachment: :blob }, { blocks: [:rich_text_text, :links] }).map do |section|+ sections_html = sections.includes(:links, :rich_text_text, :rich_text_description, { asset_attachment: :blob }, { blocks: [:rich_text_text, :links] }).map do |section|render_section(section, variables)end.join.html_safediff --git a/storefront/app/helpers/spree/theme_helper.rb b/storefront/app/helpers/spree/theme_helper.rbindex 0ba87db972..ad8100936c 100644--- a/storefront/app/helpers/spree/theme_helper.rb+++ b/storefront/app/helpers/spree/theme_helper.rb@@ -72,7 +72,7 @@ module Spree## @return [Hash] the theme layout sectionsdef theme_layout_sections- @theme_layout_sections ||= current_theme_or_preview.sections.includes(:links, { asset_attachment: :blob },+ @theme_layout_sections ||= current_theme_or_preview.sections.includes(:links, :rich_text_text, :rich_text_description, { asset_attachment: :blob },{ blocks: [:rich_text_text, :links] }).all.each_with_object({}) do |section, hash|hash[section.type.to_s.demodulize.underscore] = sectionend