mirror of
https://github.com/apache/superset.git
synced 2024-09-06 22:07:34 -04:00
fix(chart): replace viz_type with viz name from registry for list view (#12144)
This commit is contained in:
parent
585c8acd75
commit
de047c6c31
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user