diff --git a/.changeset/five-peaches-guess.md b/.changeset/five-peaches-guess.md new file mode 100644 index 0000000000..bc278cc665 --- /dev/null +++ b/.changeset/five-peaches-guess.md @@ -0,0 +1,13 @@ +--- +'@backstage/plugin-org': patch +--- + +For the component `EntityMembersListCard` you can now specify the pageSize. For example: + +```tsx + + + +``` + +If left empty it will by default use 50. diff --git a/plugins/org/api-report.md b/plugins/org/api-report.md index c042ae38af..19f5acda69 100644 --- a/plugins/org/api-report.md +++ b/plugins/org/api-report.md @@ -27,6 +27,7 @@ export const EntityGroupProfileCard: ({ export const EntityMembersListCard: (_props: { entity?: GroupEntity | undefined; memberDisplayTitle?: string | undefined; + pageSize?: number | undefined; }) => JSX.Element; // Warning: (ae-missing-release-tag) "EntityOwnershipCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) @@ -67,6 +68,7 @@ export const GroupProfileCard: ({ export const MembersListCard: (_props: { entity?: GroupEntity; memberDisplayTitle?: string; + pageSize?: number; }) => JSX.Element; // Warning: (ae-missing-release-tag) "orgPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) diff --git a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx index 66d1042e28..8aca65f1d4 100644 --- a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx +++ b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx @@ -112,9 +112,10 @@ export const MembersListCard = (_props: { /** @deprecated The entity is now grabbed from context instead */ entity?: GroupEntity; memberDisplayTitle?: string; + pageSize?: number; }) => { const { entity: groupEntity } = useEntity(); - let { memberDisplayTitle } = _props; + let { memberDisplayTitle, pageSize } = _props; const { metadata: { name: groupName, namespace: grpNamespace }, spec: { profile }, @@ -129,7 +130,7 @@ export const MembersListCard = (_props: { const pageChange = (_: React.ChangeEvent, pageIndex: number) => { setPage(pageIndex); }; - const pageSize = 50; + pageSize = pageSize ? pageSize : 50; memberDisplayTitle = memberDisplayTitle ? memberDisplayTitle : 'Members'; const {