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

Remove dependency on truncate_html gem #387

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

forkata
Copy link
Contributor

@forkata forkata commented Nov 29, 2024

Summary

This doesn't seem to be used anywhere and is a relic from a 2013
change1.
Additionally, this can now be achieved purely using Rails built-in
helpers, as such

include ActionView::Helpers::SanitizeHelper
include ActionView::Helpers::TextHelper

sanitize("<div> hello world".truncate(10))
# => "<div> h...</div>"

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.

Footnotes

  1. https://github.com/spree/spree/pull/2518

@forkata
Copy link
Contributor Author

forkata commented Dec 5, 2024

@jarednorman can you retry the build here 🙏🏼 We identified a flaky test and working with @benjaminwil to fix it, but it is not related to these changes.

@jarednorman
Copy link
Member

I don't have permission on CircleCI. ☹️

You'll have to amend your commit and re-push.

@kennyadsl
Copy link
Member

Re-running specs, but a rebase is needed now.

Copy link

codecov bot commented Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.95%. Comparing base (6255e88) to head (833eaa0).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #387      +/-   ##
==========================================
- Coverage   95.98%   95.95%   -0.04%     
==========================================
  Files         207      206       -1     
  Lines        4880     4815      -65     
==========================================
- Hits         4684     4620      -64     
+ Misses        196      195       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This doesn't seem to be used anywhere and is a relic from a 2013
change[^1].
Additionally, this can now be achieved purely using Rails built-in
helpers, as such

```ruby
include ActionView::Helpers::SanitizeHelper
include ActionView::Helpers::TextHelper

sanitize("<div> hello world".truncate(10))
```

[^1]: spree/spree#2518

Co-authored-by: Benjamin Willems <[email protected]>
Co-authored-by: Andrew Stewart <[email protected]>
@benjaminwil benjaminwil force-pushed the feature/remove-dependency-on-truncate-html-gem branch from 833eaa0 to 99a8930 Compare December 19, 2024 17:12
@benjaminwil
Copy link
Contributor

Rebased. 👍

@fthobe
Copy link
Contributor

fthobe commented Jan 8, 2025

@jarednorman @kennyadsl also this one looks ready for merge, but I am unsure on the test. Could you give a look and merge if possible.

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.

5 participants