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

feat: allow more HTML tags in report description #20908

Merged
merged 2 commits into from
Jul 29, 2022

Conversation

ktmud
Copy link
Member

@ktmud ktmud commented Jul 28, 2022

SUMMARY

Our users want to write multi-line descriptions for alerts & reports. This PR adds <br>, <p>, <div>, as well as HTML table related tags to the list of allowed tags.

Slack messages need to be handled differently. We'll address it in future PRs if necessary.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

Unit test

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

"p",
"strong",
"ul",
] + TABLE_TAGS
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is basically bleach.ALLOWED_TAGS + ["br", "p", "div"]. Enumerate all of them so you don't have to jump to the source code of bleach to see the full list.

@codecov
Copy link

codecov bot commented Jul 28, 2022

Codecov Report

Merging #20908 (6ad00dc) into master (50d2e5a) will decrease coverage by 11.44%.
The diff coverage is 55.55%.

❗ Current head 6ad00dc differs from pull request most recent head 0c44dee. Consider uploading reports for the commit 0c44dee to get more accurate results

@@             Coverage Diff             @@
##           master   #20908       +/-   ##
===========================================
- Coverage   66.31%   54.86%   -11.45%     
===========================================
  Files        1758     1758               
  Lines       67008    67010        +2     
  Branches     7107     7107               
===========================================
- Hits        44437    36766     -7671     
- Misses      20749    28422     +7673     
  Partials     1822     1822               
Flag Coverage Δ
hive 53.25% <44.44%> (+<0.01%) ⬆️
mysql ?
postgres ?
presto 53.15% <44.44%> (+<0.01%) ⬆️
python 57.90% <55.55%> (-23.65%) ⬇️
sqlite ?
unit 50.60% <55.55%> (+0.35%) ⬆️

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

Impacted Files Coverage Δ
superset/models/helpers.py 37.32% <20.00%> (-3.46%) ⬇️
superset/reports/notifications/email.py 77.14% <100.00%> (-22.86%) ⬇️
superset/utils/core.py 62.88% <100.00%> (-27.36%) ⬇️
superset/utils/dashboard_import_export.py 0.00% <0.00%> (-100.00%) ⬇️
superset/key_value/commands/update.py 0.00% <0.00%> (-88.89%) ⬇️
superset/key_value/commands/delete.py 0.00% <0.00%> (-85.30%) ⬇️
superset/key_value/commands/delete_expired.py 0.00% <0.00%> (-80.77%) ⬇️
superset/dashboards/commands/importers/v0.py 15.62% <0.00%> (-76.25%) ⬇️
superset/datasets/commands/update.py 25.30% <0.00%> (-68.68%) ⬇️
superset/datasets/commands/create.py 29.41% <0.00%> (-68.63%) ⬇️
... and 280 more

Help us with your feedback. Take ten seconds to tell us how you rate us.

@@ -23,6 +23,7 @@
from typing import Any, Dict, Optional

import bleach

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ktmud you'll have to remove this to get CI to pass.

@ktmud ktmud force-pushed the report-description-allow-more-tags branch from 5eeb6a7 to 8a6eaa7 Compare July 29, 2022 07:45
@ktmud ktmud force-pushed the report-description-allow-more-tags branch from 8a6eaa7 to 0c44dee Compare July 29, 2022 08:38
@ktmud ktmud merged commit e739ff5 into apache:master Jul 29, 2022
@john-bodley john-bodley deleted the report-description-allow-more-tags branch February 17, 2023 22:16
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/M 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants