Skip to content

Commit d236c35

Browse files
phixMephix
andauthored
Scroll issues for drawer and status. (#2820)
Co-authored-by: phix <peter.hicks@astronomer.io>
1 parent f6da0b9 commit d236c35

8 files changed

Lines changed: 32 additions & 13 deletions

File tree

web/src/components/core/screen-load/MqScreenLoad.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
// Copyright 2018-2023 contributors to the Marquez project
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import { HEADER_HEIGHT } from '../../../helpers/theme'
54
import Box from '@mui/material/Box'
65
import CircularProgress from '@mui/material/CircularProgress/CircularProgress'
76
import React, { ReactElement } from 'react'
87

98
interface MqScreenLoadProps {
109
children?: ReactElement
1110
loading: boolean
12-
noHeader?: boolean
11+
customHeight?: string
1312
}
1413

15-
export const MqScreenLoad: React.FC<MqScreenLoadProps> = ({ loading, children, noHeader }) => {
14+
export const MqScreenLoad: React.FC<MqScreenLoadProps> = ({ loading, children, customHeight }) => {
1615
return loading || !children ? (
1716
<Box
18-
height={noHeader ? 'calc(100vh)' : `calc(100vh - ${HEADER_HEIGHT}px)`}
17+
height={customHeight ? customHeight : 'calc(100vh)'}
1918
display={'flex'}
2019
justifyContent={'center'}
2120
alignItems={'center'}

web/src/components/datasets/DatasetDetailPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ const DatasetDetailPage: FunctionComponent<IProps> = (props) => {
152152
<Box px={2}>
153153
<Box
154154
position={'sticky'}
155-
top={'98px'}
155+
top={0}
156156
bgcolor={theme.palette.background.default}
157157
pt={2}
158158
zIndex={theme.zIndex.appBar}

web/src/components/jobs/JobDetailPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ const JobDetailPage: FunctionComponent<IProps> = (props) => {
112112
<Box px={2} display='flex' flexDirection='column' justifyContent='space-between'>
113113
<Box
114114
position={'sticky'}
115-
top={'98px'}
115+
top={0}
116116
bgcolor={theme.palette.background.default}
117117
py={2}
118118
zIndex={theme.zIndex.appBar}

web/src/routes/column-level/ColumnLevel.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,15 @@ const ColumnLevel: React.FC<ColumnLevelProps> = ({
9090
open={!!searchParams.get('dataset')}
9191
onClose={() => setSearchParams({})}
9292
PaperProps={{
93-
sx: { backgroundColor: theme.palette.background.default, backgroundImage: 'none' },
93+
sx: {
94+
backgroundColor: theme.palette.background.default,
95+
backgroundImage: 'none',
96+
mt: '98px',
97+
height: 'calc(100vh - 98px)',
98+
},
9499
}}
95100
>
96-
<Box sx={{ pt: '98px' }}>
101+
<Box>
97102
<ColumnLevelDrawer />
98103
</Box>
99104
</Drawer>

web/src/routes/column-level/ColumnLevelDrawer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const ColumnLevelDrawer = ({
5959
<Box width={`${WIDTH}px`}>
6060
<Box
6161
position={'sticky'}
62-
top={'98px'}
62+
top={0}
6363
bgcolor={theme.palette.background.default}
6464
pt={2}
6565
zIndex={theme.zIndex.appBar}

web/src/routes/datasets/Datasets.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
} from '@mui/material'
1616
import { ChevronLeftRounded, ChevronRightRounded, Refresh } from '@mui/icons-material'
1717
import { Dataset } from '../../types/api'
18+
import { HEADER_HEIGHT } from '../../helpers/theme'
1819
import { IState } from '../../store/reducers'
1920
import { MqScreenLoad } from '../../components/core/screen-load/MqScreenLoad'
2021
import { Nullable } from '../../types/util/Nullable'
@@ -58,6 +59,7 @@ interface DispatchProps {
5859
type DatasetsProps = StateProps & DispatchProps
5960

6061
const PAGE_SIZE = 20
62+
const DATASET_HEADER_HEIGHT = 62
6163

6264
const Datasets: React.FC<DatasetsProps> = ({
6365
datasets,
@@ -129,7 +131,10 @@ const Datasets: React.FC<DatasetsProps> = ({
129131
</MQTooltip>
130132
</Box>
131133
</Box>
132-
<MqScreenLoad loading={isDatasetsLoading && !isDatasetsInit}>
134+
<MqScreenLoad
135+
loading={isDatasetsLoading && !isDatasetsInit}
136+
customHeight={`calc(100vh - ${HEADER_HEIGHT}px - ${DATASET_HEADER_HEIGHT}px)`}
137+
>
133138
<>
134139
{datasets.length === 0 ? (
135140
<Box p={2}>

web/src/routes/jobs/Jobs.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
createTheme,
1515
} from '@mui/material'
1616
import { ChevronLeftRounded, ChevronRightRounded, Refresh } from '@mui/icons-material'
17+
import { HEADER_HEIGHT } from '../../helpers/theme'
1718
import { IState } from '../../store/reducers'
1819
import { Job } from '../../types/api'
1920
import { MqScreenLoad } from '../../components/core/screen-load/MqScreenLoad'
@@ -54,6 +55,7 @@ interface DispatchProps {
5455
type JobsProps = StateProps & DispatchProps
5556

5657
const PAGE_SIZE = 20
58+
const JOB_HEADER_HEIGHT = 62
5759

5860
const Jobs: React.FC<JobsProps> = ({
5961
jobs,
@@ -125,7 +127,10 @@ const Jobs: React.FC<JobsProps> = ({
125127
</MQTooltip>
126128
</Box>
127129
</Box>
128-
<MqScreenLoad loading={isJobsLoading && !isJobsInit}>
130+
<MqScreenLoad
131+
loading={isJobsLoading && !isJobsInit}
132+
customHeight={`calc(100vh - ${HEADER_HEIGHT}px - ${JOB_HEADER_HEIGHT}px)`}
133+
>
129134
<>
130135
{jobs.length === 0 ? (
131136
<Box p={2}>

web/src/routes/table-level/TableLevel.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,15 @@ const ColumnLevel: React.FC<ColumnLevelProps> = ({
109109
open={!!searchParams.get('tableLevelNode')}
110110
onClose={() => setSearchParams({})}
111111
PaperProps={{
112-
sx: { backgroundColor: theme.palette.background.default, backgroundImage: 'none' },
112+
sx: {
113+
backgroundColor: theme.palette.background.default,
114+
backgroundImage: 'none',
115+
mt: '98px',
116+
height: 'calc(100vh - 98px)',
117+
},
113118
}}
114119
>
115-
<Box sx={{ pt: '98px' }}>
120+
<Box>
116121
<TableLevelDrawer />
117122
</Box>
118123
</Drawer>

0 commit comments

Comments
 (0)