chore(tags): move tags column in dashboard and chart list (#25504)

This commit is contained in:
Lily Kuang 2023-10-04 12:07:27 -07:00 committed by GitHub
parent 87c8e872ee
commit af661ceee2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 47 deletions

View File

@ -407,6 +407,27 @@ function ChartList(props: ChartListProps) {
size: 'xxl',
hidden: true,
},
{
Cell: ({
row: {
original: { tags = [] },
},
}: any) => (
// Only show custom type tags
<TagsList
tags={tags.filter((tag: Tag) =>
tag.type
? tag.type === 1 || tag.type === 'TagTypes.custom'
: true,
)}
maxTags={3}
/>
),
Header: t('Tags'),
accessor: 'tags',
disableSortBy: true,
hidden: !isFeatureEnabled(FeatureFlag.TAGGING_SYSTEM),
},
{
Cell: ({
row: {
@ -448,27 +469,6 @@ function ChartList(props: ChartListProps) {
disableSortBy: true,
size: 'xl',
},
{
Cell: ({
row: {
original: { tags = [] },
},
}: any) => (
// Only show custom type tags
<TagsList
tags={tags.filter((tag: Tag) =>
tag.type
? tag.type === 1 || tag.type === 'TagTypes.custom'
: true,
)}
maxTags={3}
/>
),
Header: t('Tags'),
accessor: 'tags',
disableSortBy: true,
hidden: !isFeatureEnabled(FeatureFlag.TAGGING_SYSTEM),
},
{
Cell: ({ row: { original } }: any) => {
const handleDelete = () =>

View File

@ -305,7 +305,31 @@ function DashboardList(props: DashboardListProps) {
Header: t('Title'),
accessor: 'dashboard_title',
},
{
Cell: ({
row: {
original: { tags = [] },
},
}: {
row: {
original: {
tags: Tag[];
};
};
}) => (
// Only show custom type tags
<TagsList
tags={tags.filter(
(tag: Tag) => tag.type === 'TagTypes.custom' || tag.type === 1,
)}
maxTags={3}
/>
),
Header: t('Tags'),
accessor: 'tags',
disableSortBy: true,
hidden: !isFeatureEnabled(FeatureFlag.TAGGING_SYSTEM),
},
{
Cell: ({
row: {
@ -360,31 +384,6 @@ function DashboardList(props: DashboardListProps) {
disableSortBy: true,
size: 'xl',
},
{
Cell: ({
row: {
original: { tags = [] },
},
}: {
row: {
original: {
tags: Tag[];
};
};
}) => (
// Only show custom type tags
<TagsList
tags={tags.filter(
(tag: Tag) => tag.type === 'TagTypes.custom' || tag.type === 1,
)}
maxTags={3}
/>
),
Header: t('Tags'),
accessor: 'tags',
disableSortBy: true,
hidden: !isFeatureEnabled(FeatureFlag.TAGGING_SYSTEM),
},
{
Cell: ({ row: { original } }: any) => {
const handleDelete = () =>