rusackas commented on code in PR #36127:
URL: https://github.com/apache/superset/pull/36127#discussion_r2621565180


##########
superset-frontend/src/features/reports/types.ts:
##########
@@ -23,7 +23,7 @@
 export type ReportScheduleType = 'Alert' | 'Report';
 export type ReportCreationMethod = 'charts' | 'dashboards' | 'alerts_reports';
 
-export type ReportRecipientType = 'Email' | 'Slack';
+export type ReportRecipientType = 'Email' | 'Slack' | 'Webhook';

Review Comment:
   Likely Not Valid
   Looking at typical Superset patterns and the actual usage:
   
   ReportRecipientType is just a discriminant literal union — it identifies 
what kind of recipient this is
   recipient_config_json is stored as a string in the database and parsed at 
runtime (see backend: 
json.loads(self._recipient.recipient_config_json)["target"])
   There's no TypeScript discriminated union mapping each ReportRecipientType 
to a specific config shape
   
   The frontend doesn't type-check the internal structure of 
recipient_config_json — it's treated as an opaque JSON string. The actual shape 
validation happens in Python.
   
   Evidence from this PR: The NotificationMethod.tsx component handles Webhook 
config by simply storing {"target": "<url>"} in the JSON string, same pattern 
as Email/Slack. No type-level config discrimination exists.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to