feat(plugins/home/FeatureDocsCard): use EntityDisplayName rather then data direct
Signed-off-by: secustor <sebastian@poxhofer.at>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-home': patch
|
||||
'@backstage/plugin-home': minor
|
||||
---
|
||||
|
||||
Fall back to metadata.name if no metadata.title has been defined
|
||||
Use EntityDisplayName JSX element entity information directly for FeaturedDocsCard.
|
||||
|
||||
@@ -23,11 +23,16 @@ import {
|
||||
Progress,
|
||||
ErrorPanel,
|
||||
} from '@backstage/core-components';
|
||||
import { catalogApiRef, CatalogApi } from '@backstage/plugin-catalog-react';
|
||||
import {
|
||||
catalogApiRef,
|
||||
CatalogApi,
|
||||
EntityDisplayName,
|
||||
} from '@backstage/plugin-catalog-react';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
import { EntityFilterQuery } from '@backstage/catalog-client';
|
||||
|
||||
import { makeStyles, Typography } from '@material-ui/core';
|
||||
import { stringifyEntityRef } from '@backstage/catalog-model';
|
||||
|
||||
/**
|
||||
* Props customizing the <FeaturedDocsCard/> component.
|
||||
@@ -116,7 +121,7 @@ export const Content = (props: FeaturedDocsCardProps): JSX.Element => {
|
||||
}/`
|
||||
}
|
||||
>
|
||||
{d.metadata.title ?? d.metadata.name}
|
||||
<EntityDisplayName entityRef={stringifyEntityRef(d)} />
|
||||
</Link>
|
||||
{d.metadata.description && (
|
||||
<Typography className={styles.docDescription}>
|
||||
|
||||
Reference in New Issue
Block a user