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

Auto-create HTML links for URLs, and strip HTML tags where they can't be rendered #3981

Merged
merged 12 commits into from
Oct 15, 2023

Conversation

cmdcolin
Copy link
Collaborator

Fixes #3975

@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Oct 14, 2023
@codecov
Copy link

codecov bot commented Oct 14, 2023

Codecov Report

Merging #3981 (b37db97) into main (6a6e5c3) will increase coverage by 0.00%.
The diff coverage is 57.40%.

@@           Coverage Diff           @@
##             main    #3981   +/-   ##
=======================================
  Coverage   63.75%   63.76%           
=======================================
  Files        1020     1022    +2     
  Lines       30134    30145   +11     
  Branches     7194     7188    -6     
=======================================
+ Hits        19213    19221    +8     
- Misses      10756    10759    +3     
  Partials      165      165           
Files Coverage Δ
...eatureWidget/BaseFeatureDetail/DataGridDetails.tsx 3.44% <ø> (+0.32%) ⬆️
packages/core/ui/SanitizedHTML.tsx 87.50% <100.00%> (+0.83%) ⬆️
packages/core/util/index.ts 82.58% <100.00%> (+1.92%) ⬆️
packages/core/util/offscreenCanvasUtils.tsx 90.24% <ø> (ø)
...iew/src/LinearGenomeView/components/TrackLabel.tsx 90.00% <ø> (-2.60%) ⬇️
...nearGenomeView/components/TrackLabelDragHandle.tsx 100.00% <100.00%> (ø)
...s/linear-genome-view/src/LinearGenomeView/index.ts 100.00% <100.00%> (ø)
...c/LinearGenomeView/svgcomponents/SVGTrackLabel.tsx 75.00% <100.00%> (+2.27%) ⬆️
packages/core/ui/MenuButton.tsx 88.88% <88.88%> (ø)
...TrackSelectorWidget/components/tree/TrackLabel.tsx 77.77% <50.00%> (-2.23%) ⬇️
... and 2 more

... and 3 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@cmdcolin cmdcolin changed the title Strip HTML tags from places where it can't be rendered correctly Strip HTML from UI where it can't be rendered, and add HTML links to bare http(s) URLs in track data Oct 14, 2023
@cmdcolin
Copy link
Collaborator Author

this PR also proposes adding URLs in text if it is detected, which removes the need to add HTML <a href>'s to the config.json, you can put a bare link in track description or metadata and it will display in about dialog, faceted selector columns, etc. (autolink is run as a pre-processing step for rendering the SanitizedHTML component)

@cmdcolin cmdcolin added enhancement New feature or request and removed needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) labels Oct 14, 2023
@cmdcolin cmdcolin changed the title Strip HTML from UI where it can't be rendered, and add HTML links to bare http(s) URLs in track data Strip HTML from UI where it can't be rendered, and auto-create HTML links for URLs in track data Oct 14, 2023
@cmdcolin cmdcolin changed the title Strip HTML from UI where it can't be rendered, and auto-create HTML links for URLs in track data Auto-create HTML links for URLs in track data, and strip HTML tags where it can't be rendered in UI Oct 14, 2023
@cmdcolin
Copy link
Collaborator Author

based on code from autolink-js...https://github.com/bryanwoods/autolink-js/blob/master/autolink.js just stripped it down to be more simple without some of the complex control options, it just always generates target="_blank" links

@cmdcolin cmdcolin changed the title Auto-create HTML links for URLs in track data, and strip HTML tags where it can't be rendered in UI Auto-create HTML links for URLs, and strip HTML tags where they can't be rendered Oct 14, 2023
@cmdcolin
Copy link
Collaborator Author

before
Screenshot from 2023-10-13 20-59-29

Screenshot from 2023-10-13 20-59-10

@cmdcolin cmdcolin merged commit 7e0c5fe into main Oct 15, 2023
@cmdcolin cmdcolin deleted the strip_html branch October 15, 2023 15:01
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.

Faceted track selector stripHTML
1 participant