From af661ceee2bf0f57743bd33a0dcbe78b034d60a6 Mon Sep 17 00:00:00 2001 From: Lily Kuang Date: Wed, 4 Oct 2023 12:07:27 -0700 Subject: [PATCH] chore(tags): move tags column in dashboard and chart list (#25504) --- .../src/pages/ChartList/index.tsx | 42 +++++++-------- .../src/pages/DashboardList/index.tsx | 51 +++++++++---------- 2 files changed, 46 insertions(+), 47 deletions(-) diff --git a/superset-frontend/src/pages/ChartList/index.tsx b/superset-frontend/src/pages/ChartList/index.tsx index 6f97b938b..14ff62695 100644 --- a/superset-frontend/src/pages/ChartList/index.tsx +++ b/superset-frontend/src/pages/ChartList/index.tsx @@ -407,6 +407,27 @@ function ChartList(props: ChartListProps) { size: 'xxl', hidden: true, }, + { + Cell: ({ + row: { + original: { tags = [] }, + }, + }: any) => ( + // Only show custom type tags + + 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 - - 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 = () => diff --git a/superset-frontend/src/pages/DashboardList/index.tsx b/superset-frontend/src/pages/DashboardList/index.tsx index d7760ffbb..97898b372 100644 --- a/superset-frontend/src/pages/DashboardList/index.tsx +++ b/superset-frontend/src/pages/DashboardList/index.tsx @@ -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 + 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 - 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 = () =>