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

   <!-- Greeting -->
   Hi @crazychaz!
   
   I'm here to help you with any bugs, questions, or contributions you have for 
the repository. Let me know how I can assist you!
   
   [Dosu](https://dosu.dev)
   
   <!-- Answer -->
   To resolve the issue where the screen crops to the left edge when sending 
alerts in Apache Superset version 3.1.1, you need to adjust the CSS styles for 
the `Alert` component. Specifically, ensure that the padding is correctly set 
to avoid cropping.
   
   Here is the relevant CSS snippet from the `Alert` component:
   
   ```tsx
   import React, { PropsWithChildren } from 'react';
   import AntdAlert, { AlertProps as AntdAlertProps } from 'antd/lib/alert';
   import { useTheme } from '@superset-ui/core';
   import Icons from 'src/components/Icons';
   
   export type AlertProps = PropsWithChildren<
     AntdAlertProps & { roomBelow?: boolean }
   >;
   
   export default function Alert(props: AlertProps) {
     const {
       type = 'info',
       description,
       showIcon = true,
       closable = true,
       roomBelow = false,
       children,
     } = props;
   
     const theme = useTheme();
     const { colors, typography, gridUnit } = theme;
     const { alert, error, info, success } = colors;
   
     let baseColor = info;
     let AlertIcon = Icons.InfoSolid;
     if (type === 'error') {
       baseColor = error;
       AlertIcon = Icons.ErrorSolid;
     } else if (type === 'warning') {
       baseColor = alert;
       AlertIcon = Icons.AlertSolid;
     } else if (type === 'success') {
       baseColor = success;
       AlertIcon = Icons.CircleCheckSolid;
     }
   
     return (
       <AntdAlert
         role="alert"
         showIcon={showIcon}
         icon={<AlertIcon aria-label={`${type} icon`} />}
         closeText={closable && <Icons.XSmall aria-label="close icon" />}
         css={{
           marginBottom: roomBelow ? gridUnit * 4 : 0,
           padding: `${gridUnit * 2}px ${gridUnit * 3}px`,
           alignItems: 'flex-start',
           border: 0,
           backgroundColor: baseColor.light2,
           '& .ant-alert-icon': {
             marginRight: gridUnit * 2,
           },
           '& .ant-alert-message': {
             color: baseColor.dark2,
             fontSize: typography.sizes.m,
             fontWeight: description
               ? typography.weights.bold
               : typography.weights.normal,
           },
           '& .ant-alert-description': {
             color: baseColor.dark2,
             fontSize: typography.sizes.m,
           },
         }}
         {...props}
       >
         {children}
       </AntdAlert>
     );
   }
   ```
   
   Ensure that the `padding` property is correctly set to avoid any cropping 
issues. The current padding is set to `${gridUnit * 2}px ${gridUnit * 3}px`, 
which should provide sufficient space on the left and right sides. If the issue 
persists, you might need to adjust the padding values or check for any other 
conflicting styles that might be causing the cropping 
<sup>[[1]](https://github.com/apache/superset/blob/master/superset-frontend/src/components/Alert/index.tsx)</sup>.
   
   Additionally, ensure that your `superset_config.py` or 
`superset_config_docker.py` is properly configured for alerts and reports. Make 
sure the `"ALERT_REPORTS"` feature flag is set to `True` and that the necessary 
configurations for email or Slack notifications are in place. This includes 
setting up the `beat_schedule` in CeleryConfig and configuring the headless 
browser for taking screenshots 
<sup>[[2]](https://github.com/apache/superset/blob/master/docs/docs/configuration/alerts-reports.mdx)</sup>.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://dosu.dev), 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