superset icon indicating copy to clipboard operation
superset copied to clipboard

feat: Customizable email subject name

Open puridach-w opened this issue 2 years ago • 43 comments

SUMMARY

This feature allows users to customize the email subject when creating a report or an alert within Superset. This is driven by a need to include specific parameters within the email subject line, enhancing the specificity and resonance of alert or report notifications.

Changes:

  • Implementation of a new text input field within the 'create alert/report' interface, through which users can specify their desired email subject line.
  • If the text field is left blank, a default email subject line will be generated by the system.
  • The user interface will show the new text field solely when the email sending method is selected by a user.

This feature has been tested with Superset master branch. This proposed feature has already been discussed in the Superset Improvement Proposal (see https://github.com/apache/superset/issues/25945)

BEFORE SCREENSHOTS

image

image

AFTER SCREENSHOTS

image

image

TESTING INSTRUCTIONS

To verify the changes made, please follow these steps: (Assume that there TAG for alert and report and open)

  • Go to the Alert and report creation page
  • Create one of them
  • Fill all the information that required
  • Select Notification method as "Email"
  • You will see input box for "email subject name"
  • Fill the desired subject name and save it
  • Wait for email send and check the email subject name

ADDITIONAL INFORMATION

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

puridach-w avatar Dec 21 '23 05:12 puridach-w

Run: superset db downgrade

Screenshot 2566-12-21 at 12 53 24

Run: superset db upgrade

Screenshot 2566-12-21 at 12 53 35

puridach-w avatar Dec 21 '23 05:12 puridach-w

Thanks for contributing @puridach-w . I've added some minor suggestions and kicked off the build for you.

giftig avatar Dec 21 '23 10:12 giftig

Codecov Report

Attention: Patch coverage is 68.75000% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 69.81%. Comparing base (b25dd0c) to head (c78a4d1).

Files Patch % Lines
...-frontend/src/features/alerts/AlertReportModal.tsx 61.11% 4 Missing and 3 partials :warning:
.../features/alerts/components/NotificationMethod.tsx 60.00% 2 Missing :warning:
superset/commands/report/execute.py 80.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #26327      +/-   ##
==========================================
- Coverage   69.81%   69.81%   -0.01%     
==========================================
  Files        1910     1910              
  Lines       74827    74856      +29     
  Branches     8346     8357      +11     
==========================================
+ Hits        52243    52263      +20     
- Misses      20532    20538       +6     
- Partials     2052     2055       +3     
Flag Coverage Δ
hive 48.99% <44.44%> (+<0.01%) :arrow_up:
javascript 57.39% <60.86%> (+<0.01%) :arrow_up:
mysql 77.98% <88.88%> (-0.03%) :arrow_down:
postgres 78.12% <88.88%> (+<0.01%) :arrow_up:
presto 53.72% <44.44%> (+<0.01%) :arrow_up:
python 83.14% <88.88%> (+<0.01%) :arrow_up:
sqlite 77.55% <88.88%> (+<0.01%) :arrow_up:
unit 56.72% <44.44%> (+<0.01%) :arrow_up:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Dec 21 '23 10:12 codecov[bot]

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (8c32c6d) 69.18% compared to head (f7c7a9a) 59.04%. Report is 5 commits behind head on master.

Files Patch % Lines superset/commands/report/execute.py 0.00% 6 Missing ⚠️ Additional details and impacted files ☔ View full report in Codecov by Sentry. 📢 Have feedback on the report? Share it here.

What should I do with this? Can you suggest please.

puridach-w avatar Dec 21 '23 11:12 puridach-w

ping @eschutho and @lilykuang who are working on SIP-110.

john-bodley avatar Jan 02 '24 17:01 john-bodley

@giftig @john-bodley Could you please help me review this PR again?

puridach-w avatar Jan 09 '24 04:01 puridach-w

@puridach-w the code all looks ok to me but I'm not very familiar with the subject of reports. I think it'd be a good idea to get a review from @eschutho or @lilykuang since they're working on the related SIP John mentioned above; would be good to confirm what's done here aligns ok with that work.

giftig avatar Jan 09 '24 08:01 giftig

@kasiazjc and @yousoph for design feedback, too.

eschutho avatar Jan 09 '24 22:01 eschutho

/testenv up FEATURE_ALERT_REPORTS=true

eschutho avatar Jan 09 '24 22:01 eschutho

@eschutho Ephemeral environment spinning up at http://34.222.243.175:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Jan 09 '24 22:01 github-actions[bot]

Ping @eschutho I have already modified the code based on your comment.

puridach-w avatar Jan 10 '24 07:01 puridach-w

Ping @eschutho Could you please help me review this PR again?

puridach-w avatar Jan 17 '24 03:01 puridach-w

Ping @eschutho Could you please help me review this PR again?

puridach-w avatar Jan 30 '24 02:01 puridach-w

A rebase of this branch and running the pre-commit hook should fix the CI issues you're seeing. 🤞

rusackas avatar Jan 31 '24 04:01 rusackas

Hi @puridach-w ! Thanks for this new feature, it's looking good

About the subject line UI, I think we can make it a required field in the form, but filled out with the default report name when the form is opened and it can update as the user changes the inputs. If the user clears it they will see that the field is required. There should be patterns on the modal that you can look to for behavior of required fields (red asterisk for example), but let me know if there's anything you'd like help defining!

Thanks!

yousoph avatar Feb 10 '24 01:02 yousoph

Hello @puridach-w, feel free to ping me when you are ready for another round of review. Thanks!

geido avatar Feb 13 '24 17:02 geido

/testenv up FEATURE_ALERT_REPORTS=true

geido avatar Feb 19 '24 14:02 geido

@geido Ephemeral environment spinning up at http://18.246.236.152:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Feb 19 '24 14:02 github-actions[bot]

http://18.246.236.152:8080

/testenv up FEATURE_ALERT_REPORTS=true

FYI, I still haven't edited the code from yousoph comment. But I appreciate your care and attention. Thank you very much.

puridach-w avatar Feb 19 '24 14:02 puridach-w

Np @puridach-w. There are a few conflicts as I just merged a PR that changes the styles of the A&R modal. I hope that does not become too much of a hassle. Let me know!

geido avatar Feb 19 '24 15:02 geido

@puridach-w just messaged you on Apache Superset Slack to help with the CI issues

geido avatar Feb 26 '24 16:02 geido

Ping @eschutho @geido I request another review of my PR? Thank you!

puridach-w avatar Feb 29 '24 18:02 puridach-w

/testenv up FEATURE_ALERT_REPORTS=true

geido avatar Feb 29 '24 18:02 geido

@geido Ephemeral environment spinning up at http://35.93.23.71:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Feb 29 '24 18:02 github-actions[bot]

Hey @puridach-w doing some manual testing. It seems that the spacing is off here

Screenshot 2024-03-11 at 16 41 35

geido avatar Mar 11 '24 15:03 geido

Hey @puridach-w doing some manual testing. It seems that the spacing is off here

Screenshot 2024-03-11 at 16 41 35

Hi @geido, the modifications have been completed. Could you please review them once more?

puridach-w avatar Mar 12 '24 08:03 puridach-w

/testenv up FEATURE_ALERT_REPORTS=true

geido avatar Mar 15 '24 18:03 geido

@geido Ephemeral environment spinning up at http://35.91.216.144:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Mar 15 '24 18:03 github-actions[bot]

Hey @puridach-w if you look at the testenv above, you will see that there is a : in the placeholder. I think something might be broken in the placeholder logics.

Screenshot 2024-03-19 at 19 44 18

geido avatar Mar 19 '24 18:03 geido

Hey @puridach-w if you look at the testenv above, you will see that there is a : in the placeholder. I think something might be broken in the placeholder logics.

Screenshot 2024-03-19 at 19 44 18

Hi @geido , I've updated the placeholder logic. Please help me to review this PR again.

puridach-w avatar Mar 20 '24 07:03 puridach-w