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

Fix unsafe html view component, allow ViewComponent 3.21+ #6055

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Jan 3, 2025

Summary

This fixes the mock_component helper to always mock an actual constant, rather than just stubbing the name on it. view_component expects components to be actual 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 January 3, 2025 16:36
The mock component in the ComponentHelpers module was not a real
constant, which messes with ViewComponent's expectations about what
render_inline is given. Using `stub_const` in the helper allows us to
give it an actual name, and view_component > 3.21.0 will work for us.

The helper is only used in the base component spec. I could have spent
more time giving it an optional block, but this solution is the most
straightforward.
…mponent"

This reverts commit 9aa24a5, reversing
changes made to 9234436.
@tvdeyen tvdeyen merged commit fc5ce71 into solidusio:main Jan 6, 2025
13 of 14 checks passed
@tvdeyen tvdeyen added backport-v4.1 Backport this pull-request to v4.1 backport-v4.2 Backport this pull-request to v4.2 backport-v4.3 Backport this pull-request to v4.3 backport-v4.4 Backport this pull-request to v4.4 labels Jan 6, 2025
Copy link

github-actions bot commented Jan 6, 2025

💔 All backports failed

Status Branch Result
v4.1 Backport failed because of merge conflicts

You might need to backport the following PRs to v4.1:
- Revert "Merge pull request #6048 from solidusio/lock-view_component"
- Merge pull request #5999 from mamhoff/easier-user-class-handle
v4.2 Backport failed because of merge conflicts
v4.3 Backport failed because of merge conflicts
v4.4 Cherrypick failed because the selected commit (7bd0860) is empty. Did you already backport this commit?

Manual backport

To create the backport manually run:

backport --pr 6055

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

Copy link

github-actions bot commented Jan 6, 2025

💔 All backports failed

Status Branch Result
v4.1 Backport failed because of merge conflicts

You might need to backport the following PRs to v4.1:
- Revert "Merge pull request #6048 from solidusio/lock-view_component"
- Merge pull request #5999 from mamhoff/easier-user-class-handle
v4.2 Backport failed because of merge conflicts
v4.3 Backport failed because of merge conflicts
v4.4 Cherrypick failed because the selected commit (7bd0860) is empty. Did you already backport this commit?

Manual backport

To create the backport manually run:

backport --pr 6055

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

Copy link

github-actions bot commented Jan 6, 2025

💔 All backports failed

Status Branch Result
v4.1 Backport failed because of merge conflicts

You might need to backport the following PRs to v4.1:
- Revert "Merge pull request #6048 from solidusio/lock-view_component"
- Merge pull request #5999 from mamhoff/easier-user-class-handle
v4.2 Backport failed because of merge conflicts
v4.3 Backport failed because of merge conflicts
v4.4 Cherrypick failed because the selected commit (7bd0860) is empty. Did you already backport this commit?

Manual backport

To create the backport manually run:

backport --pr 6055

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

Copy link

github-actions bot commented Jan 6, 2025

💔 All backports failed

Status Branch Result
v4.1 Backport failed because of merge conflicts

You might need to backport the following PRs to v4.1:
- Revert "Merge pull request #6048 from solidusio/lock-view_component"
- Merge pull request #5999 from mamhoff/easier-user-class-handle
v4.2 Backport failed because of merge conflicts
v4.3 Backport failed because of merge conflicts
v4.4 Cherrypick failed because the selected commit (7bd0860) is empty. Did you already backport this commit?

Manual backport

To create the backport manually run:

backport --pr 6055

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v4.1 Backport this pull-request to v4.1 backport-v4.2 Backport this pull-request to v4.2 backport-v4.3 Backport this pull-request to v4.3 backport-v4.4 Backport this pull-request to v4.4 changelog:solidus_admin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants