feat: Support member list scrollable when parent has specified height

Signed-off-by: rui ma <ruima@alauda.io>
This commit is contained in:
rui ma
2023-11-15 22:28:59 +08:00
parent 4378dba2b3
commit 3a65d9c4d7
3 changed files with 19 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-org': patch
---
Support member list scrollable when parent has specified height
+1
View File
@@ -462,3 +462,4 @@ zod
Zolotusky
zoomable
zsh
scrollable
@@ -119,6 +119,15 @@ const MemberComponent = (props: { member: UserEntity }) => {
);
};
const useListStyles = makeStyles(() => ({
root: {
height: '100%',
},
cardContent: {
overflow: 'auto',
},
}));
/** @public */
export const MembersListCard = (props: {
memberDisplayTitle?: string;
@@ -130,6 +139,7 @@ export const MembersListCard = (props: {
pageSize = 50,
showAggregateMembersToggle,
} = props;
const classes = useListStyles();
const { entity: groupEntity } = useEntity<GroupEntity>();
const {
@@ -210,13 +220,15 @@ export const MembersListCard = (props: {
);
return (
<Grid item>
<Grid item className={classes.root}>
<InfoCard
title={`${memberDisplayTitle} (${
members?.length || 0
}${paginationLabel})`}
subheader={`of ${displayName}`}
{...(nbPages <= 1 ? {} : { actions: pagination })}
className={classes.root}
cardClassName={classes.cardContent}
>
{showAggregateMembersToggle && (
<>