refactor: Remove obsolete variant prop from Entity card components.
Signed-off-by: Johan Persson <johanopersson@gmail.com>
This commit is contained in:
@@ -18,7 +18,6 @@ export type ComponentsGridClassKey =
|
||||
|
||||
// @public (undocumented)
|
||||
export const EntityGroupProfileCard: (props: {
|
||||
variant?: string;
|
||||
showLinks?: boolean;
|
||||
}) => JSX_2.Element;
|
||||
|
||||
@@ -48,7 +47,6 @@ export type EntityRelationAggregation = 'direct' | 'aggregated';
|
||||
|
||||
// @public (undocumented)
|
||||
export const EntityUserProfileCard: (props: {
|
||||
variant?: string;
|
||||
showLinks?: boolean;
|
||||
maxRelations?: number;
|
||||
hideIcons?: boolean;
|
||||
@@ -56,7 +54,6 @@ export const EntityUserProfileCard: (props: {
|
||||
|
||||
// @public (undocumented)
|
||||
export const GroupProfileCard: (props: {
|
||||
variant?: string;
|
||||
showLinks?: boolean;
|
||||
}) => JSX_2.Element;
|
||||
|
||||
@@ -116,7 +113,6 @@ export type OwnershipCardClassKey =
|
||||
|
||||
// @public (undocumented)
|
||||
export const UserProfileCard: (props: {
|
||||
variant?: string;
|
||||
showLinks?: boolean;
|
||||
maxRelations?: number;
|
||||
hideIcons?: boolean;
|
||||
|
||||
@@ -80,14 +80,8 @@ const CardTitle = (props: { title: string; pictureSrc?: string }) => (
|
||||
);
|
||||
|
||||
/** @public */
|
||||
export const GroupProfileCard = (props: {
|
||||
// Accepted for API compatibility but not applied.
|
||||
// The new entity page layout handles card sizing.
|
||||
// TODO: Discuss removal in code review.
|
||||
variant?: string;
|
||||
showLinks?: boolean;
|
||||
}) => {
|
||||
const { variant: _variant } = props;
|
||||
export const GroupProfileCard = (props: { showLinks?: boolean }) => {
|
||||
const { showLinks } = props;
|
||||
const catalogApi = useApi(catalogApiRef);
|
||||
const alertApi = useApi(alertApiRef);
|
||||
const { entity: group } = useEntity<GroupEntity>();
|
||||
@@ -237,7 +231,7 @@ export const GroupProfileCard = (props: {
|
||||
secondary={t('groupProfileCard.listItemTitle.childGroups')}
|
||||
/>
|
||||
</ListItem>
|
||||
{props?.showLinks && <LinksGroup links={links} />}
|
||||
{showLinks && <LinksGroup links={links} />}
|
||||
</List>
|
||||
</Box>
|
||||
</EntityInfoCard>
|
||||
|
||||
@@ -55,7 +55,7 @@ export const Default = () => (
|
||||
<EntityProvider entity={defaultEntity}>
|
||||
<Grid container spacing={4}>
|
||||
<Grid item xs={12} md={4}>
|
||||
<UserProfileCard variant="gridItem" />
|
||||
<UserProfileCard />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</EntityProvider>
|
||||
@@ -82,7 +82,7 @@ export const NoImage = () => (
|
||||
<EntityProvider entity={noImageEntity}>
|
||||
<Grid container spacing={4}>
|
||||
<Grid item xs={12} md={4}>
|
||||
<UserProfileCard variant="gridItem" />
|
||||
<UserProfileCard />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</EntityProvider>
|
||||
@@ -134,7 +134,7 @@ export const ExtraDetails = () => (
|
||||
<EntityProvider entity={extraDetailsEntity}>
|
||||
<Grid container spacing={4}>
|
||||
<Grid item xs={12} md={4}>
|
||||
<UserProfileCard variant="gridItem" />
|
||||
<UserProfileCard />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</EntityProvider>
|
||||
|
||||
@@ -51,7 +51,7 @@ describe('UserSummary Test', () => {
|
||||
it('Display Profile Card', async () => {
|
||||
await renderInTestApp(
|
||||
<EntityProvider entity={userEntity}>
|
||||
<UserProfileCard variant="gridItem" />
|
||||
<UserProfileCard />
|
||||
</EntityProvider>,
|
||||
{
|
||||
mountedRoutes: {
|
||||
@@ -87,7 +87,7 @@ describe('UserSummary Test', () => {
|
||||
it('Should limit the number of displayed groups in the card', async () => {
|
||||
await renderInTestApp(
|
||||
<EntityProvider entity={entity}>
|
||||
<UserProfileCard variant="gridItem" maxRelations={3} />
|
||||
<UserProfileCard maxRelations={3} />
|
||||
</EntityProvider>,
|
||||
{
|
||||
mountedRoutes: {
|
||||
@@ -109,7 +109,7 @@ describe('UserSummary Test', () => {
|
||||
it('Show more groups button when there are more user relations than the maximum', async () => {
|
||||
await renderInTestApp(
|
||||
<EntityProvider entity={entity}>
|
||||
<UserProfileCard variant="gridItem" maxRelations={3} />
|
||||
<UserProfileCard maxRelations={3} />
|
||||
</EntityProvider>,
|
||||
{
|
||||
mountedRoutes: {
|
||||
@@ -128,7 +128,7 @@ describe('UserSummary Test', () => {
|
||||
it('Hide more groups button when limit value is less than or equal to user relations', async () => {
|
||||
await renderInTestApp(
|
||||
<EntityProvider entity={entity}>
|
||||
<UserProfileCard variant="gridItem" maxRelations={5} />
|
||||
<UserProfileCard maxRelations={5} />
|
||||
</EntityProvider>,
|
||||
{
|
||||
mountedRoutes: {
|
||||
@@ -148,7 +148,7 @@ describe('UserSummary Test', () => {
|
||||
it('Hide all groups when max relations is equals to zero', async () => {
|
||||
await renderInTestApp(
|
||||
<EntityProvider entity={entity}>
|
||||
<UserProfileCard variant="gridItem" maxRelations={0} />
|
||||
<UserProfileCard maxRelations={0} />
|
||||
</EntityProvider>,
|
||||
{
|
||||
mountedRoutes: {
|
||||
@@ -193,7 +193,7 @@ describe('Edit Button', () => {
|
||||
|
||||
await renderInTestApp(
|
||||
<EntityProvider entity={userEntity}>
|
||||
<UserProfileCard variant="gridItem" />
|
||||
<UserProfileCard />
|
||||
</EntityProvider>,
|
||||
{
|
||||
mountedRoutes: {
|
||||
@@ -234,7 +234,7 @@ describe('Edit Button', () => {
|
||||
|
||||
await renderInTestApp(
|
||||
<EntityProvider entity={userEntity}>
|
||||
<UserProfileCard variant="gridItem" />
|
||||
<UserProfileCard />
|
||||
</EntityProvider>,
|
||||
{
|
||||
mountedRoutes: {
|
||||
@@ -285,7 +285,7 @@ describe('Edit Button', () => {
|
||||
|
||||
await renderInTestApp(
|
||||
<EntityProvider entity={userEntity}>
|
||||
<UserProfileCard variant="gridItem" />
|
||||
<UserProfileCard />
|
||||
</EntityProvider>,
|
||||
{
|
||||
mountedRoutes: {
|
||||
@@ -337,7 +337,7 @@ describe('Edit Button', () => {
|
||||
|
||||
await renderInTestApp(
|
||||
<EntityProvider entity={userEntity}>
|
||||
<UserProfileCard showLinks variant="gridItem" />
|
||||
<UserProfileCard showLinks />
|
||||
</EntityProvider>,
|
||||
{
|
||||
mountedRoutes: {
|
||||
|
||||
@@ -96,12 +96,11 @@ export const UserProfileCard = (props: {
|
||||
// Accepted for API compatibility but not applied.
|
||||
// The new entity page layout handles card sizing.
|
||||
// TODO: Discuss removal in code review.
|
||||
variant?: string;
|
||||
showLinks?: boolean;
|
||||
maxRelations?: number;
|
||||
hideIcons?: boolean;
|
||||
}) => {
|
||||
const { maxRelations, hideIcons, variant: _variant } = props;
|
||||
const { maxRelations, hideIcons } = props;
|
||||
|
||||
const classes = useStyles();
|
||||
const { entity: user } = useEntity<UserEntity>();
|
||||
|
||||
Reference in New Issue
Block a user