mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
feat(explorer): Add configs and formatting to discrete comparison columns (#29553)
This commit is contained in:
@@ -17,12 +17,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
import { useMemo, useState } from 'react';
|
||||
import {
|
||||
ChartDataResponseResult,
|
||||
useTheme,
|
||||
t,
|
||||
GenericDataType,
|
||||
} from '@superset-ui/core';
|
||||
import { useTheme, t, GenericDataType } from '@superset-ui/core';
|
||||
|
||||
import {
|
||||
COLUMN_NAME_ALIASES,
|
||||
@@ -39,7 +34,7 @@ import ControlHeader from '../../ControlHeader';
|
||||
|
||||
export type ColumnConfigControlProps<T extends ColumnConfig> =
|
||||
ControlComponentProps<Record<string, T>> & {
|
||||
queryResponse?: ChartDataResponseResult;
|
||||
columnsPropsObject?: { colnames: string[]; coltypes: GenericDataType[] };
|
||||
configFormLayout?: ColumnConfigFormLayout;
|
||||
appliedColumnNames?: string[];
|
||||
width?: number | string;
|
||||
@@ -55,7 +50,7 @@ const MAX_NUM_COLS = 10;
|
||||
* Add per-column config to queried results.
|
||||
*/
|
||||
export default function ColumnConfigControl<T extends ColumnConfig>({
|
||||
queryResponse,
|
||||
columnsPropsObject,
|
||||
appliedColumnNames = [],
|
||||
value,
|
||||
onChange,
|
||||
@@ -64,7 +59,7 @@ export default function ColumnConfigControl<T extends ColumnConfig>({
|
||||
height,
|
||||
...props
|
||||
}: ColumnConfigControlProps<T>) {
|
||||
const { colnames: _colnames, coltypes: _coltypes } = queryResponse || {};
|
||||
const { colnames: _colnames, coltypes: _coltypes } = columnsPropsObject || {};
|
||||
let colnames: string[] = [];
|
||||
let coltypes: GenericDataType[] = [];
|
||||
if (appliedColumnNames.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user