Fixed an issue where permissions page is not completely accessible on full scroll. #9721

pull/9723/head
Rohit Bhati 2026-03-10 12:59:42 +05:30 committed by GitHub
parent f49c967bfd
commit 8ca765478f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 35 additions and 23 deletions

View File

@ -1064,7 +1064,7 @@ function Dashboard({
{!_.isUndefined(preferences) && preferences.show_activity && (
<Fragment>
<CustomRefresh refresh={refresh} setRefresh={setRefresh}/>
<SectionContainer title={gettext('Sessions')}>
<SectionContainer title={gettext('Sessions')} resizable={true}>
<PgTable
caveTable={false}
tableNoBorder={false}
@ -1074,7 +1074,7 @@ function Dashboard({
schema={activeQSchemaObj}
></PgTable>
</SectionContainer>
<SectionContainer title={gettext('Locks')}>
<SectionContainer title={gettext('Locks')} resizable={true}>
<PgTable
caveTable={false}
tableNoBorder={false}
@ -1082,7 +1082,7 @@ function Dashboard({
data={(dashData?.[0]?.['locks']) || []}
></PgTable>
</SectionContainer>
<SectionContainer title={gettext('Prepared Transactions')}>
<SectionContainer title={gettext('Prepared Transactions')} resizable={true}>
<PgTable
caveTable={false}
tableNoBorder={false}

View File

@ -39,28 +39,38 @@ const StyledBox = styled(Box)(({theme}) => ({
},
}));
export default function SectionContainer({title, titleExtras, children, style}) {
export default function SectionContainer({title, titleExtras, children, style, resizable = false, defaultHeight = 200}) {
const content = (
<>
<Box className='SectionContainer-cardHeader' title={title}>
<div className='SectionContainer-cardTitle'>{title}</div>
<div style={{marginLeft: 'auto'}}>
{titleExtras}
</div>
</Box>
<Box height="100%" display="flex" flexDirection="column" minHeight={0}>
{children}
</Box>
</>
);
return (
<StyledBox className='SectionContainer-root' style={style}>
<Resizable
enable={{ bottom: true }}
defaultSize={{ height: 200, width: '100%' }}
minHeight={25}
style={{
display: 'flex',
flexDirection: 'column'
}}
>
<Box className='SectionContainer-cardHeader' title={title}>
<div className='SectionContainer-cardTitle'>{title}</div>
<div style={{marginLeft: 'auto'}}>
{titleExtras}
</div>
</Box>
<Box height="100%" display="flex" flexDirection="column" minHeight={0}>
{children}
</Box>
</Resizable>
{resizable ? (
<Resizable
enable={{ bottom: true }}
defaultSize={{ height: defaultHeight, width: '100%' }}
minHeight={25}
style={{
display: 'flex',
flexDirection: 'column'
}}
>
{content}
</Resizable>
) : (
content
)}
</StyledBox>
);
}
@ -70,4 +80,6 @@ SectionContainer.propTypes = {
titleExtras: PropTypes.node,
children: PropTypes.node.isRequired,
style: PropTypes.object,
resizable: PropTypes.bool,
defaultHeight: PropTypes.number,
};