-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move promotion backend controllers and views to legacy_promotions #5685
Conversation
5c4059a
to
ad5e56e
Compare
f3cac10
to
53afa71
Compare
53afa71
to
880b972
Compare
880b972
to
373a442
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5685 +/- ##
=======================================
Coverage 88.90% 88.91%
=======================================
Files 700 700
Lines 16642 16649 +7
=======================================
+ Hits 14796 14803 +7
Misses 1846 1846 ☔ View full report in Codecov by Sentry. |
b1ff45a
to
c7ebe82
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, nice
c7ebe82
to
01cc257
Compare
In order to move the promotion controller specs, we need the controller-specific helpers in our `spec/rails_helper.rb` file.
We want to move some backend functionality here, so we need solidus_backend.
The routes for the promotion admin are moving into solidus_legacy_promotions, but they are needed in solidus_admin.
The promotion routes will move to legacy_promotions.
We won't have the admin/promotions route available in backend for much longer.
Also moves all the promotion-related translations in the `spree` namespace that are used within these controllers and views.
Note that the promotion rules helper does not live under app/helpers/spree/admin, but the promotion helper does. Keeping it just the same.
01cc257
to
44e01f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Epic "Move". Thanks again Martin, looks well done.
Summary
This moves the promotion admin to the legacy_promotions gem. Admin means: The admin controllers and views for promotions, promotion actions, promotion rules, and promotion calculators. It also moves the translations used in these controllers.
This only tackles the backend controllers, not the ones in
solidus_admin
.This also does not tackle the backend Javascript related to promotions, because that's another slightly complicated PR. Because we depend on
solidus_backend
fromsolidus_legacy_promotions
now, these JS files are still around and working within the admin for now.Note that I'm moving the specs first, and then the implementation. I do that in order to keep every commit along the way green.
Best reviewed commit by commit. I promise this is just moving things.
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: