Skip to content

Commit

Permalink
Merge branch 'main' into solidus-order-index-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
magpieuk authored Nov 18, 2024
2 parents 06c2755 + 5b2e560 commit f01bacb
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 19 deletions.
12 changes: 12 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@
- changed-files:
- any-glob-to-any-file:
- "admin/**/*"
"changelog:solidus_promotions":
- any:
- changed-files:
- any-glob-to-any-file:
- "promotions/**/*"
"changelog:solidus_legacy_promotions":
- any:
- changed-files:
- any-glob-to-any-file:
- "legacy_promotions/**/*"
"changelog:solidus_sample":
- any:
- changed-files:
Expand All @@ -40,6 +50,8 @@
- "!backend/**/*"
- "!api/**/*"
- "!admin/**/*"
- "!promotions/**/*"
- "!legacy_promotions/**/*"
- "!sample/**/*"
- "!lib/**/*"
- "!README.md"
Expand Down
4 changes: 4 additions & 0 deletions admin/app/components/solidus_admin/base_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ def missing_translation(key, options)
end
end

def self.i18n_scope
@i18n_scope ||= name.underscore.tr("/", ".")
end

def self.stimulus_id
@stimulus_id ||= name.underscore
.sub(/^solidus_admin\/(.*)\/component$/, '\1')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@import "spree/backend/themes/classic";
@import "spree/backend/globals/variables";

@import "solidus_legacy_promotions/promotions/edit";
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
en:
columns:
items:
one: 1 Item
other: '%{count} Items'
filters:
status: Status
shipment_state: Shipment State
payment_state: Payment State
promotions: Promotions
date:
formats:
short: '%d %b %y'
scopes:
all_orders: All
canceled: Canceled
complete: Complete
returned: Returned
in_progress: In Progress
promotions: Promotions
11 changes: 8 additions & 3 deletions legacy_promotions/lib/solidus_legacy_promotions/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,17 @@ class Engine < ::Rails::Engine
end

initializer "solidus_legacy_promotions", after: "spree.load_config_initializers" do
Spree::Config.order_contents_class = "Spree::OrderContents"
Spree::Config.promotions = SolidusLegacyPromotions::Configuration.new
Spree::Config.adjustment_promotion_source_types << "Spree::PromotionAction"
# Only set these if there is no promotion configuration set. In this case,
# we're running on a store without the new `solidus_promotions` gem and we
# need to set the configuration to the legacy one.
if Spree::Config.promotions.is_a?(Spree::Core::NullPromotionConfiguration)
Spree::Config.order_contents_class = "Spree::OrderContents"
Spree::Config.promotions = SolidusLegacyPromotions::Configuration.new
end

Spree::Api::Config.adjustment_attributes << :promotion_code_id
Spree::Api::Config.adjustment_attributes << :eligible
Spree::Config.adjustment_promotion_source_types << "Spree::PromotionAction"
end
end
end
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
en:
filters:
promotions: Promotions
scopes:
promotions: Promotions

0 comments on commit f01bacb

Please sign in to comment.