feat(catalog): Remove "in default" in component name

This commit is contained in:
Dimitri Lavrenük
2020-10-21 21:50:48 +02:00
parent d74d7832be
commit 60d40892cc
2 changed files with 11 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog': patch
---
Remove "in default" in component name
@@ -18,7 +18,7 @@ import { useParams, useNavigate } from 'react-router';
import { EntityContext } from '../../hooks/useEntity';
import { Page, Header, HeaderLabel, Content, Progress } from '@backstage/core';
import { Entity } from '@backstage/catalog-model';
import { Entity, ENTITY_DEFAULT_NAMESPACE } from '@backstage/catalog-model';
import { FavouriteEntity } from '../FavouriteEntity/FavouriteEntity';
import { Box } from '@material-ui/core';
import { EntityContextMenu } from '../EntityContextMenu/EntityContextMenu';
@@ -46,7 +46,11 @@ function headerProps(
entity: Entity | undefined,
): { headerTitle: string; headerType: string } {
return {
headerTitle: `${name}${namespace ? ` in ${namespace}` : ''}`,
headerTitle: `${name}${
namespace && namespace !== ENTITY_DEFAULT_NAMESPACE
? ` in ${namespace}`
: ''
}`,
headerType: (() => {
let t = kind.toLowerCase();
if (entity && entity.spec && 'type' in entity.spec) {