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

[Backport 2.x] [Table Visualization][Bug] Fix Url content display in table #3084

Merged
merged 1 commit into from
Jan 3, 2023

Conversation

opensearch-trigger-bot[bot]
Copy link
Contributor

Backport b16ee64 from #2918.

Currently, the new table can not format Url. If we
set to use URL format in index pattern field, table
will display it as string.

In this PR, we switch the format from string to html.
To make html understandable by react as a DOM element,
we use dangerouslySetInnerHTML to transform it. For the
security, since the content is not from random input but
fetched from stored data, we should be safe as long as
data is not messed.

To provide more security protection, we also add dompurify
package to sanitize the html content.

Issue Resolved:
#2905

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
(cherry picked from commit b16ee64)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
@opensearch-trigger-bot opensearch-trigger-bot bot requested a review from a team as a code owner December 15, 2022 02:26
@codecov-commenter
Copy link

Codecov Report

Merging #3084 (32c9a2f) into 2.x (0a92e60) will increase coverage by 0.00%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##              2.x    #3084   +/-   ##
=======================================
  Coverage   66.67%   66.67%           
=======================================
  Files        3219     3219           
  Lines       61450    61450           
  Branches     9417     9417           
=======================================
+ Hits        40971    40973    +2     
+ Misses      18232    18231    -1     
+ Partials     2247     2246    -1     
Flag Coverage Δ
Linux 66.67% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ared/static/forms/hook_form_lib/hooks/use_field.ts 65.70% <0.00%> (-0.97%) ⬇️
packages/osd-optimizer/src/node/cache.ts 52.63% <0.00%> (+2.63%) ⬆️
...s/osd-optimizer/src/node/node_auto_tranpilation.ts 87.75% <0.00%> (+4.08%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@joshuarrrr joshuarrrr added the autocut Skip the changelog verification check on backports label Dec 15, 2022
@joshuarrrr joshuarrrr added the v2.5.0 'Issues and PRs related to version v2.5.0' label Dec 23, 2022
@kavilla kavilla merged commit f70a75f into 2.x Jan 3, 2023
@github-actions github-actions bot deleted the backport/backport-2918-to-2.x branch January 3, 2023 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autocut Skip the changelog verification check on backports v2.5.0 'Issues and PRs related to version v2.5.0'
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants