Merge pull request #8943 from djamaile/master

feat(org): expose pageSize prop for MembersListCard component
This commit is contained in:
Fredrik Adelöw
2022-01-17 09:39:58 +01:00
committed by GitHub
3 changed files with 18 additions and 2 deletions
+13
View File
@@ -0,0 +1,13 @@
---
'@backstage/plugin-org': patch
---
For the component `EntityMembersListCard` you can now specify the pageSize. For example:
```tsx
<Grid item xs={12}>
<EntityMembersListCard pageSize={100} />
</Grid>
```
If left empty it will by default use 50.
+2
View File
@@ -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)
@@ -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<GroupEntity>();
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<unknown>, pageIndex: number) => {
setPage(pageIndex);
};
const pageSize = 50;
pageSize = pageSize ? pageSize : 50;
memberDisplayTitle = memberDisplayTitle ? memberDisplayTitle : 'Members';
const {