Skip to content

Commit

Permalink
fix: improve the alerts & reports modal layout on small screens
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomedina248 committed Mar 21, 2022
1 parent 9ae51f7 commit a932cdd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion superset-frontend/src/components/TimezoneSelector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,13 @@ const matchTimezoneToOptions = (timezone: string) =>
export type TimezoneSelectorProps = {
onTimezoneChange: (value: string) => void;
timezone?: string | null;
minWidth?: string;
};

export default function TimezoneSelector({
onTimezoneChange,
timezone,
minWidth = MIN_SELECT_WIDTH, // smallest size for current values
}: TimezoneSelectorProps) {
const validTimezone = useMemo(
() => matchTimezoneToOptions(timezone || moment.tz.guess()),
Expand All @@ -125,7 +127,7 @@ export default function TimezoneSelector({
return (
<Select
ariaLabel={t('Timezone selector')}
css={{ minWidth: MIN_SELECT_WIDTH }} // smallest size for current values
css={{ minWidth }}
onChange={tz => onTimezoneChange(tz as string)}
value={validTimezone}
options={TIMEZONE_OPTIONS}
Expand Down
5 changes: 4 additions & 1 deletion superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ const DEFAULT_ALERT = {
};

const StyledModal = styled(Modal)`
max-width: 1200px;
width: 100%;
.ant-modal-body {
overflow: initial;
}
Expand All @@ -165,7 +168,6 @@ const StyledIcon = (theme: SupersetTheme) => css`

const StyledSectionContainer = styled.div`
display: flex;
min-width: 1000px;
flex-direction: column;
.header-section {
Expand Down Expand Up @@ -1242,6 +1244,7 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
<TimezoneSelector
onTimezoneChange={onTimezoneChange}
timezone={currentAlert?.timezone}
minWidth="100%"
/>
</div>
<StyledSectionTitle>
Expand Down

0 comments on commit a932cdd

Please sign in to comment.