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

Automatically mount storefront where Solidus is mounted #359

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

kennyadsl
Copy link
Member

@kennyadsl kennyadsl commented Dec 1, 2023

Summary

Right now, no matter where Solidus is mounted, the storefront will live at the root of the application.

Most of the times, this is not the expected behavior because if Solidus lives at /store for example, the user probably also wants the storefront to live at that path.

This change will change the install template to detect where Solidus has been mounted and use that path as the scope of the routes.

Grouping the routes in a scope and in a separate file has the advantage to have all the injected routes isolated, which might help with having a clearer routes file in the application. On the other hand, when Solidus is mounted at /, the scope is useless and might be avoided, but I think we can live with that.

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.

@kennyadsl kennyadsl added the enhancement New feature or request label Dec 1, 2023
@kennyadsl kennyadsl requested a review from elia December 1, 2023 14:29
@kennyadsl kennyadsl self-assigned this Dec 1, 2023
kennyadsl added a commit to nebulab/solidus that referenced this pull request Dec 1, 2023
Since we moved the frontend as an injectable templating system,
there are some manual steps to do to make the application work
when a user wants to change the mount point of where Solidus is
installed.

With this change, along with solidusio/solidus_starter_frontend#359,
we allow the user to select the mount point during the install, and
all the changes required are handled by the install script.
kennyadsl added a commit to nebulab/solidus that referenced this pull request Dec 1, 2023
Since we moved the frontend as an injectable templating system,
there are some manual steps to do to make the application work
when a user wants to change the mount point of where Solidus is
installed.

With this change, along with solidusio/solidus_starter_frontend#359,
we allow the user to select the mount point during the install, and
all the changes required are handled by the install script.
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.

Looks great! Left a proposal for cleaning up the routes for your consideration, but I'm happy to merge as is 🙌

template.rb Outdated Show resolved Hide resolved
kennyadsl added a commit to nebulab/solidus that referenced this pull request Dec 1, 2023
Since we moved the frontend as an injectable templating system,
there are some manual steps to do to make the application work
when a user wants to change the mount point of where Solidus is
installed.

With this change, along with solidusio/solidus_starter_frontend#359,
we allow the user to select the mount point during the install, and
all the changes required are handled by the install script.
Right now, no matter where Solidus is mounted, the storefront
will live at the root of the application.

Most of the times, this is not the expected behavior because if
Solidus lives at /store for example, the user probably also wants
the storefront to live at that path.

This change will change the install template to detect where Solidus
has been mounted and use that path as the scope of the routes.

Grouping the routes in a scope and in a separate file has the advantage
to have all the injected routes isolated, which might help with having
a clearer routes file in the application. On the other hand, when
Solidus is mounted at /, the scope is useless and might be avoided,
but I think we can live with that.
@kennyadsl kennyadsl force-pushed the kennyadsl/mountpoint-storefront branch from fdcb0b2 to ce450b7 Compare December 1, 2023 17:45
@elia elia merged commit be2126d into main Dec 4, 2023
5 checks passed
@elia elia deleted the kennyadsl/mountpoint-storefront branch December 4, 2023 08:59
elia pushed a commit to nebulab/solidus that referenced this pull request Dec 4, 2023
Since we moved the frontend as an injectable templating system,
there are some manual steps to do to make the application work
when a user wants to change the mount point of where Solidus is
installed.

With this change, along with solidusio/solidus_starter_frontend#359,
we allow the user to select the mount point during the install, and
all the changes required are handled by the install script.
elia pushed a commit to nebulab/solidus that referenced this pull request Dec 5, 2023
Since we moved the frontend as an injectable templating system,
there are some manual steps to do to make the application work
when a user wants to change the mount point of where Solidus is
installed.

With this change, along with solidusio/solidus_starter_frontend#359,
we allow the user to select the mount point during the install, and
all the changes required are handled by the install script.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants