Skip to content
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

Merged
merged 15 commits into from Mar 14, 2024

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Mar 7, 2024

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 from solidus_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:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@mamhoff mamhoff requested a review from a team as a code owner March 7, 2024 14:26
@github-actions github-actions bot added changelog:solidus_backend Changes to the solidus_backend gem changelog:repository Changes to the repository not within any gem labels Mar 7, 2024
@mamhoff mamhoff marked this pull request as draft March 7, 2024 14:29
@github-actions github-actions bot added the changelog:solidus_core Changes to the solidus_core gem label Mar 8, 2024
@mamhoff mamhoff force-pushed the move-promotion-admin branch 2 times, most recently from f3cac10 to 53afa71 Compare March 8, 2024 12:03
@mamhoff mamhoff changed the title [WIP] Move promotion admin Move promotion backend controllers and views to legacy_promotions Mar 8, 2024
@mamhoff mamhoff marked this pull request as ready for review March 8, 2024 12:07
Copy link

codecov bot commented Mar 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.91%. Comparing base (0870e75) to head (44e01f5).

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.
📢 Have feedback on the report? Share it here.

@mamhoff mamhoff force-pushed the move-promotion-admin branch 2 times, most recently from b1ff45a to c7ebe82 Compare March 8, 2024 16:55
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, nice

legacy_promotions/spec/features/admin/homepage_spec.rb Outdated Show resolved Hide resolved
admin/solidus_admin.gemspec Show resolved Hide resolved
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.
Copy link
Member

@elia elia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤩

Copy link
Member

@kennyadsl kennyadsl left a 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.

@kennyadsl kennyadsl merged commit 1f42077 into solidusio:main Mar 14, 2024
14 checks passed
@mamhoff mamhoff mentioned this pull request Mar 15, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:repository Changes to the repository not within any gem changelog:solidus_admin changelog:solidus_backend Changes to the solidus_backend gem changelog:solidus_core Changes to the solidus_core gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants