dosubot[bot] commented on issue #28712:
URL: https://github.com/apache/superset/issues/28712#issuecomment-2133341727

   <!-- Greeting -->
   Hey @steele-boolkin! I'm here to help you with any bugs, questions, or 
contributions. Let's tackle this together!
   
   <!-- Answer -->
   The issue you're experiencing with specifying recipients for Slack or email 
notifications in Superset Reports, while not occurring in Superset Alerts, is 
due to differences in the implementation of the user interface and 
configuration handling between these two features.
   
   In Superset Alerts, the `AlertReportModal` component allows users to 
dynamically add and configure notification methods, including specifying 
recipients for each method. This is facilitated by the `NotificationMethod` 
component, which provides a user interface for selecting notification methods 
and entering recipient details.
   
   Here is a relevant part of the code from `AlertReportModal.tsx`:
   
   ```tsx
   const NotificationMethodAdd: FunctionComponent<NotificationMethodAddProps> = 
({
     status = 'active',
     onClick,
   }) => {
     if (status === 'hidden') {
       return null;
     }
   
     const checkStatus = () => {
       if (status !== 'disabled') {
         onClick();
       }
     };
   
     return (
       <StyledNotificationAddButton className={status} onClick={checkStatus}>
         <i className="fa fa-plus" />{' '}
         {status === 'active'
           ? t('Add another notification method')
           : t('Add delivery method')}
       </StyledNotificationAddButton>
     );
   };
   ```
   
   This component allows users to add multiple notification methods and specify 
recipients for each method dynamically.
   
   In contrast, Superset Reports do not provide a similar interface for 
dynamically adding and configuring notification methods and recipients. The 
recipient configuration for reports is predefined and not adjustable at 
runtime, which is why you can't specify a recipient for Slack or email 
notifications in Superset Reports.
   
   Additionally, the `ReportSchedule` model in `superset/reports/models.py` 
defines the structure for report schedules, including the relationship with 
`ReportRecipients`. However, the configuration for recipients is predefined and 
not designed to be dynamically adjusted through the user interface:
   
   ```py
   class ReportRecipients(Model, AuditMixinNullable):
       """
       Report Recipients, meant to support multiple notification types, eg: 
Slack, email
       """
   
       __tablename__ = "report_recipient"
       id = Column(Integer, primary_key=True)
       type = Column(String(50), nullable=False)
       recipient_config_json = Column(MediumText(), default="{}")
       report_schedule_id = Column(
           Integer, ForeignKey("report_schedule.id"), nullable=False
       )
       report_schedule = relationship(
           ReportSchedule,
           backref=backref("recipients", cascade="all,delete,delete-orphan"),
           foreign_keys=[report_schedule_id],
       )
   ```
   
   This difference in implementation results in the observed behavior where 
specifying recipients is possible for alerts but not for reports 
<sup>[[1]](https://github.com/apache/superset/blob/master/superset-frontend/src/features/alerts/AlertReportModal.tsx)</sup><sup>[[2]](https://github.com/apache/superset/blob/master/superset/reports/models.py)</sup>.
   
   
   <!-- Dosu Comment Footer -->
   <details open>
   <summary>
   
   #### Details
   </summary>
   
   **About Dosu**
   This response is meant to be useful and save you time. It is **not meant to 
be a precise solution**, but rather a starting point for your own research.
   
   Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is 
irrelevant.
   </details>
   
   *To continue the conversation, mention @dosu.*
   


-- 
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: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to