feat(catalog): show entity tags in the catalog table
This commit is contained in:
@@ -127,7 +127,8 @@ function convertColumns<T extends object>(
|
||||
): TableColumn<T>[] {
|
||||
return columns.map(column => {
|
||||
const headerStyle: React.CSSProperties = {};
|
||||
const cellStyle: React.CSSProperties = {};
|
||||
const cellStyle: React.CSSProperties =
|
||||
typeof column.cellStyle === 'object' ? column.cellStyle : {};
|
||||
|
||||
if (column.highlight) {
|
||||
headerStyle.color = theme.palette.textContrast;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
import { Entity, LocationSpec } from '@backstage/catalog-model';
|
||||
import { Table, TableColumn, TableProps } from '@backstage/core';
|
||||
import { Link } from '@material-ui/core';
|
||||
import { Link, Chip } from '@material-ui/core';
|
||||
import Edit from '@material-ui/icons/Edit';
|
||||
import GitHub from '@material-ui/icons/GitHub';
|
||||
import { Alert } from '@material-ui/lab';
|
||||
@@ -63,6 +63,21 @@ const columns: TableColumn<Entity>[] = [
|
||||
title: 'Description',
|
||||
field: 'metadata.description',
|
||||
},
|
||||
{
|
||||
title: 'Tags',
|
||||
field: 'metadata.tags',
|
||||
cellStyle: {
|
||||
padding: '0px 16px 0px 20px',
|
||||
},
|
||||
render: (entity: Entity) => (
|
||||
<>
|
||||
{entity.metadata.tags &&
|
||||
entity.metadata.tags.map(t => (
|
||||
<Chip label={t} color="secondary" style={{ marginBottom: '0px' }} />
|
||||
))}
|
||||
</>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
type CatalogTableProps = {
|
||||
|
||||
Reference in New Issue
Block a user