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

Use different path for friendly promotions #13

Merged
merged 4 commits into from
Oct 6, 2023

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Oct 4, 2023

No description provided.

For the transition process between the two promotion systems, we want
the admins to still have access to the legacy promotions. Prior to this
commit, this access was thwarted as we used the exact same paths as core
Solidus. This adds an extra `friendly/` to the path, so that the paths
can be distinguished. This in turn revealed we have to use the right
routing proxy for the promotions controller, otherwise we'd be sent to
actions in the Solidus world.
This commit isn't super clear cut but really small: It adds a link to
the top of the promotions index to the legacy Solidus promotions
overview, and it also switches out some of the uses of the legacy system
for our system.
@mamhoff mamhoff force-pushed the use-different-path-for-friendly-promotions branch from b5ba4be to e3fb85a Compare October 5, 2023 09:54
The controller code we were using relied on a patch to Solidus[1] that will
only be released with Solidus 4.2. We want to be compatible with Solidus
4 though, so we're incorporating that patch into our own BaseController
  and use that instead of Solidus' ResourceController.

[1] solidusio/solidus#5219
@mamhoff mamhoff force-pushed the use-different-path-for-friendly-promotions branch from cd0556f to f47f8b9 Compare October 5, 2023 11:42
@davecandlescience
Copy link
Collaborator

There are a few places in the views where the spree.___path is being used instead of the solidus_friendly_promotions.___path that cause 404s or unexpected navigations.

admin/promotion_rules/new.html.erb
admin/promotion_rules/_promotion_rule.html.erb
admin/promotion_codes/index.html.erb

There were many references to the promotion system in solidus core in
our views folder still. This commit changes them.
Copy link
Collaborator

@davecandlescience davecandlescience left a comment

Choose a reason for hiding this comment

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

LGTM

@mamhoff mamhoff merged commit e2f5611 into main Oct 6, 2023
@mamhoff mamhoff deleted the use-different-path-for-friendly-promotions branch October 6, 2023 13:20
mamhoff added a commit that referenced this pull request Jul 1, 2024
…dly-promotions

Use different path for friendly promotions
mamhoff added a commit that referenced this pull request Oct 25, 2024
…dly-promotions

Use different path for friendly promotions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants