fix(chart): replace viz_type with viz name from registry for list view (#12144)

This commit is contained in:
ʈᵃᵢ 2020-12-18 23:22:47 -08:00 committed by GitHub
parent 585c8acd75
commit de047c6c31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -63,6 +63,8 @@ const CONFIRM_OVERWRITE_MESSAGE = t(
'sure you want to overwrite?',
);
const registry = getChartMetadataRegistry();
const createFetchDatasets = (handleError: (err: Response) => void) => async (
filterValue = '',
pageIndex?: number,
@ -214,7 +216,7 @@ function ChartList(props: ChartListProps) {
row: {
original: { viz_type: vizType },
},
}: any) => vizType,
}: any) => registry.get(vizType)?.name || vizType,
Header: t('Visualization Type'),
accessor: 'viz_type',
size: 'xxl',
@ -412,9 +414,9 @@ function ChartList(props: ChartListProps) {
input: 'select',
operator: FilterOperators.equals,
unfilteredLabel: 'All',
selects: getChartMetadataRegistry()
selects: registry
.keys()
.map(k => ({ label: k, value: k }))
.map(k => ({ label: registry.get(k)?.name || k, value: k }))
.sort((a, b) => {
if (!a.label || !b.label) {
return 0;