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(alert/reports): Pdf as attachment for alert and report #23170

Conversation

shailendrasingh98
Copy link

feat(alert/reports): Pdf as attachment for alert and report

SUMMARY

The old alert system has an option to send chart / dashboard report as PNG in the email/slack. This is adding the pdf file as an attachment to the alert/report system.

BEFORE SCREENSHOTS OR ANIMATED GIF

Screenshot 2023-02-23 at 3 48 37 PM

AFTER SCREENSHOTS OR ANIMATED GIF

Screenshot 2023-02-23 at 3 46 59 PM

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue: Support sending report in PDF & CSV #13177
  • 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

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

@shailendrasingh98
Copy link
Author

@srinisubramanian @betodealmeida @villebro I have raised this PR to have PDF report as in attachment for dashboard in alert and report section. Please review changes. i see there there is a lot of request for such feature.
I can also extend it to make downloadable from dashboard/charts

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

Great feature, especially for future work if we want to make it possible to export multiple tabs in one report 👍 A few comments, the main ones being:

  1. On the frontend I feel like we're introducing unnecessary complexity by having separate radio groups for chart and dashboard formats. For example, could we rather assemble an array of supported formats called supportedFormats that handles the conditionalities (is it a chart/dashboard? if it's a chart, does it support CSV? etc), and then render the radio group based on that? This way we wouldn't need two different radio groups with conditional rendering.
  2. On the backend, let's have a proper type for data_format so _get_notification_content` doesn't accept any string.

superset/reports/notifications/base.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Feb 27, 2023

Codecov Report

Merging #23170 (d3d079b) into master (42db7e5) will decrease coverage by 11.10%.
The diff coverage is 63.63%.

❗ Current head d3d079b differs from pull request most recent head 397770a. Consider uploading reports for the commit 397770a to get more accurate results

@@             Coverage Diff             @@
##           master   #23170       +/-   ##
===========================================
- Coverage   67.47%   56.37%   -11.10%     
===========================================
  Files        1906     1907        +1     
  Lines       73403    73485       +82     
  Branches     7958     7977       +19     
===========================================
- Hits        49527    41429     -8098     
- Misses      21835    30005     +8170     
- Partials     2041     2051       +10     
Flag Coverage Δ
hive 52.76% <59.48%> (+0.04%) ⬆️
javascript 53.77% <63.41%> (+0.04%) ⬆️
postgres ?
presto 52.69% <59.48%> (+0.06%) ⬆️
python 59.16% <63.79%> (-23.06%) ⬇️
sqlite ?
unit 52.46% <35.34%> (-0.02%) ⬇️

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

Impacted Files Coverage Δ
...t-frontend/src/dashboard/actions/dashboardState.js 55.76% <0.00%> (+1.30%) ⬆️
superset-frontend/src/dashboard/actions/hydrate.js 2.08% <0.00%> (+0.21%) ⬆️
...src/dashboard/components/DashboardBuilder/state.ts 70.37% <ø> (-2.05%) ⬇️
...tiveFilters/FilterBar/CrossFilters/CrossFilter.tsx 56.25% <0.00%> (ø)
...rontend/src/dashboard/containers/DashboardPage.tsx 8.79% <0.00%> (-0.10%) ⬇️
...ontrols/DndColumnSelectControl/DndFilterSelect.tsx 42.27% <ø> (ø)
...onents/controls/FilterControl/AdhocFilter/index.js 100.00% <ø> (+1.58%) ⬆️
...ontrols/FilterControl/AdhocFilterControl/index.jsx 47.05% <ø> (ø)
...ols/FilterControl/AdhocFilterEditPopover/index.jsx 70.21% <ø> (ø)
...l/AdhocFilterEditPopoverSimpleTabContent/index.tsx 64.59% <ø> (ø)
... and 363 more

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

@kasiazjc
Copy link
Contributor

Hi @shailendrasingh98! Thanks so much for working on this feature. I have some small design suggestions - this modal currently seems really cluttered in general, so I think it would be great if you could improve the spacings and alignment of the radi buttons and check box to make it even.

Here is the figma file in which you can check the spacings (the modal looks slightly different, but the only thing relevant is the section that you've been working on) - https://www.figma.com/file/2C46hz9VgPMKnU8CORU3kY/Project-Template-(Copy)?node-id=4%3A4427&t=qBgrNpkNiMg79e02-1

Would you be able to make the changes? Thank you!

@shailendrasingh98
Copy link
Author

@kasiazjc Thank you so much for feedback. I certainly can look into and make changes as needed. Currently i am just struggling to get integration tests run.

@villebro
Copy link
Member

@shailendrasingh98 can you rebase the PR to resolve the conflicts? After that I can re-review.

@EugeneTorap
Copy link
Contributor

Hi @shailendrasingh98! Any news?

@mike-fischer1
Copy link

is anyone going to review the pr and/or make changes?

@rusackas
Copy link
Member

@shailendrasingh98 I think there are a growing number of people that are eager to get their hands on what you've built. Is there any way we can help this along? It sounds like a rebase would be the first step, then hopefully we can help with tests and whatnot as well.

@mike-fischer1
Copy link

any updates?

@mdeshmu
Copy link
Contributor

mdeshmu commented Oct 5, 2023

@shailendrasingh98 will you be able to continue this work?

@eschutho
Copy link
Member

eschutho commented Oct 5, 2023

We have a new PR for this in progress that will use vector-based pdfs instead of rasterized ones. I'll close this PR for now.

@eschutho eschutho closed this Oct 5, 2023
@jcoelho-pt
Copy link

@eschutho the PR you mentioned is the #25696?

@galdropit
Copy link

We have a new PR for this in progress that will use vector-based pdfs instead of rasterized ones. I'll close this PR for now.

Hi @eschutho, do you have an ETA on when PDF reports might be available? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants