Skip to content

Commit 8ca7654

Browse files
Fixed an issue where permissions page is not completely accessible on full scroll. #9721
1 parent f49c967 commit 8ca7654

File tree

2 files changed

+35
-23
lines changed

2 files changed

+35
-23
lines changed

web/pgadmin/dashboard/static/js/Dashboard.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ function Dashboard({
10641064
{!_.isUndefined(preferences) && preferences.show_activity && (
10651065
<Fragment>
10661066
<CustomRefresh refresh={refresh} setRefresh={setRefresh}/>
1067-
<SectionContainer title={gettext('Sessions')}>
1067+
<SectionContainer title={gettext('Sessions')} resizable={true}>
10681068
<PgTable
10691069
caveTable={false}
10701070
tableNoBorder={false}
@@ -1074,15 +1074,15 @@ function Dashboard({
10741074
schema={activeQSchemaObj}
10751075
></PgTable>
10761076
</SectionContainer>
1077-
<SectionContainer title={gettext('Locks')}>
1077+
<SectionContainer title={gettext('Locks')} resizable={true}>
10781078
<PgTable
10791079
caveTable={false}
10801080
tableNoBorder={false}
10811081
columns={databaseLocksColumns}
10821082
data={(dashData?.[0]?.['locks']) || []}
10831083
></PgTable>
10841084
</SectionContainer>
1085-
<SectionContainer title={gettext('Prepared Transactions')}>
1085+
<SectionContainer title={gettext('Prepared Transactions')} resizable={true}>
10861086
<PgTable
10871087
caveTable={false}
10881088
tableNoBorder={false}

web/pgadmin/dashboard/static/js/components/SectionContainer.jsx

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,28 +39,38 @@ const StyledBox = styled(Box)(({theme}) => ({
3939
},
4040
}));
4141

42-
export default function SectionContainer({title, titleExtras, children, style}) {
42+
export default function SectionContainer({title, titleExtras, children, style, resizable = false, defaultHeight = 200}) {
43+
const content = (
44+
<>
45+
<Box className='SectionContainer-cardHeader' title={title}>
46+
<div className='SectionContainer-cardTitle'>{title}</div>
47+
<div style={{marginLeft: 'auto'}}>
48+
{titleExtras}
49+
</div>
50+
</Box>
51+
<Box height="100%" display="flex" flexDirection="column" minHeight={0}>
52+
{children}
53+
</Box>
54+
</>
55+
);
56+
4357
return (
4458
<StyledBox className='SectionContainer-root' style={style}>
45-
<Resizable
46-
enable={{ bottom: true }}
47-
defaultSize={{ height: 200, width: '100%' }}
48-
minHeight={25}
49-
style={{
50-
display: 'flex',
51-
flexDirection: 'column'
52-
}}
53-
>
54-
<Box className='SectionContainer-cardHeader' title={title}>
55-
<div className='SectionContainer-cardTitle'>{title}</div>
56-
<div style={{marginLeft: 'auto'}}>
57-
{titleExtras}
58-
</div>
59-
</Box>
60-
<Box height="100%" display="flex" flexDirection="column" minHeight={0}>
61-
{children}
62-
</Box>
63-
</Resizable>
59+
{resizable ? (
60+
<Resizable
61+
enable={{ bottom: true }}
62+
defaultSize={{ height: defaultHeight, width: '100%' }}
63+
minHeight={25}
64+
style={{
65+
display: 'flex',
66+
flexDirection: 'column'
67+
}}
68+
>
69+
{content}
70+
</Resizable>
71+
) : (
72+
content
73+
)}
6474
</StyledBox>
6575
);
6676
}
@@ -70,4 +80,6 @@ SectionContainer.propTypes = {
7080
titleExtras: PropTypes.node,
7181
children: PropTypes.node.isRequired,
7282
style: PropTypes.object,
83+
resizable: PropTypes.bool,
84+
defaultHeight: PropTypes.number,
7385
};

0 commit comments

Comments
 (0)