mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
refactor(Radio): Upgrade Radio Component to Ant Design 5 (#32004)
This commit is contained in:
@@ -41,7 +41,7 @@ import TimezoneSelector from 'src/components/TimezoneSelector';
|
||||
import LabeledErrorBoundInput from 'src/components/Form/LabeledErrorBoundInput';
|
||||
import Icons from 'src/components/Icons';
|
||||
import { CronError } from 'src/components/CronPicker';
|
||||
import { RadioChangeEvent } from 'src/components';
|
||||
import { Radio, RadioChangeEvent } from 'src/components/Radio';
|
||||
import { Input } from 'src/components/Input';
|
||||
import withToasts from 'src/components/MessageToasts/withToasts';
|
||||
import { ChartState } from 'src/explore/types';
|
||||
@@ -68,8 +68,6 @@ import {
|
||||
TimezoneHeaderStyle,
|
||||
SectionHeaderStyle,
|
||||
StyledMessageContentTitle,
|
||||
StyledRadio,
|
||||
StyledRadioGroup,
|
||||
} from './styles';
|
||||
|
||||
interface ReportProps {
|
||||
@@ -257,24 +255,32 @@ function ReportModal({
|
||||
<h4>{t('Message content')}</h4>
|
||||
</StyledMessageContentTitle>
|
||||
<div className="inline-container">
|
||||
<StyledRadioGroup
|
||||
<Radio.GroupWrapper
|
||||
spaceConfig={{
|
||||
direction: 'vertical',
|
||||
size: 'middle',
|
||||
align: 'start',
|
||||
wrap: false,
|
||||
}}
|
||||
onChange={(event: RadioChangeEvent) => {
|
||||
setCurrentReport({ report_format: event.target.value });
|
||||
}}
|
||||
value={currentReport.report_format || defaultNotificationFormat}
|
||||
>
|
||||
{isTextBasedChart && (
|
||||
<StyledRadio value={NotificationFormats.Text}>
|
||||
{t('Text embedded in email')}
|
||||
</StyledRadio>
|
||||
)}
|
||||
<StyledRadio value={NotificationFormats.PNG}>
|
||||
{t('Image (PNG) embedded in email')}
|
||||
</StyledRadio>
|
||||
<StyledRadio value={NotificationFormats.CSV}>
|
||||
{t('Formatted CSV attached in email')}
|
||||
</StyledRadio>
|
||||
</StyledRadioGroup>
|
||||
options={[
|
||||
{
|
||||
label: t('Text embedded in email'),
|
||||
value: NotificationFormats.Text,
|
||||
},
|
||||
{
|
||||
label: t('Image (PNG) embedded in email'),
|
||||
value: NotificationFormats.PNG,
|
||||
},
|
||||
{
|
||||
label: t('Formatted CSV attached in email'),
|
||||
value: NotificationFormats.CSV,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -108,10 +108,6 @@ export const StyledRadio = styled(Radio)`
|
||||
line-height: ${({ theme }) => theme.gridUnit * 8}px;
|
||||
`;
|
||||
|
||||
export const StyledRadioGroup = styled(Radio.Group)`
|
||||
margin-left: ${({ theme }) => theme.gridUnit * 0.5}px;
|
||||
`;
|
||||
|
||||
export const antDErrorAlertStyles = (theme: SupersetTheme) => css`
|
||||
margin: ${theme.gridUnit * 4}px;
|
||||
margin-top: 0;
|
||||
|
||||
Reference in New Issue
Block a user