mirror of
https://github.com/apache/superset.git
synced 2024-09-06 13:57:40 -04:00
fix(select): make to consider the case sensitive in case of d3 format selector (#19159)
This commit is contained in:
parent
3230415e22
commit
d099f5ed4a
@ -94,6 +94,11 @@ type Control = {
|
|||||||
default?: unknown;
|
default?: unknown;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type SelectDefaultOption = {
|
||||||
|
label: string;
|
||||||
|
value: string;
|
||||||
|
};
|
||||||
|
|
||||||
const groupByControl: SharedControlConfig<'SelectControl', ColumnMeta> = {
|
const groupByControl: SharedControlConfig<'SelectControl', ColumnMeta> = {
|
||||||
type: 'SelectControl',
|
type: 'SelectControl',
|
||||||
label: t('Group by'),
|
label: t('Group by'),
|
||||||
@ -430,7 +435,8 @@ const size: SharedControlConfig<'MetricsControl'> = {
|
|||||||
default: null,
|
default: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
const y_axis_format: SharedControlConfig<'SelectControl'> = {
|
const y_axis_format: SharedControlConfig<'SelectControl', SelectDefaultOption> =
|
||||||
|
{
|
||||||
type: 'SelectControl',
|
type: 'SelectControl',
|
||||||
freeForm: true,
|
freeForm: true,
|
||||||
label: t('Y Axis Format'),
|
label: t('Y Axis Format'),
|
||||||
@ -438,8 +444,11 @@ const y_axis_format: SharedControlConfig<'SelectControl'> = {
|
|||||||
default: DEFAULT_NUMBER_FORMAT,
|
default: DEFAULT_NUMBER_FORMAT,
|
||||||
choices: D3_FORMAT_OPTIONS,
|
choices: D3_FORMAT_OPTIONS,
|
||||||
description: D3_FORMAT_DOCS,
|
description: D3_FORMAT_DOCS,
|
||||||
|
filterOption: ({ data: option }, search) =>
|
||||||
|
option.label.includes(search) || option.value.includes(search),
|
||||||
mapStateToProps: state => {
|
mapStateToProps: state => {
|
||||||
const showWarning = state.controls?.comparison_type?.value === 'percentage';
|
const showWarning =
|
||||||
|
state.controls?.comparison_type?.value === 'percentage';
|
||||||
return {
|
return {
|
||||||
warning: showWarning
|
warning: showWarning
|
||||||
? t(
|
? t(
|
||||||
@ -450,9 +459,12 @@ const y_axis_format: SharedControlConfig<'SelectControl'> = {
|
|||||||
disabled: showWarning,
|
disabled: showWarning,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const x_axis_time_format: SharedControlConfig<'SelectControl'> = {
|
const x_axis_time_format: SharedControlConfig<
|
||||||
|
'SelectControl',
|
||||||
|
SelectDefaultOption
|
||||||
|
> = {
|
||||||
type: 'SelectControl',
|
type: 'SelectControl',
|
||||||
freeForm: true,
|
freeForm: true,
|
||||||
label: t('Time format'),
|
label: t('Time format'),
|
||||||
@ -460,6 +472,8 @@ const x_axis_time_format: SharedControlConfig<'SelectControl'> = {
|
|||||||
default: DEFAULT_TIME_FORMAT,
|
default: DEFAULT_TIME_FORMAT,
|
||||||
choices: D3_TIME_FORMAT_OPTIONS,
|
choices: D3_TIME_FORMAT_OPTIONS,
|
||||||
description: D3_TIME_FORMAT_DOCS,
|
description: D3_TIME_FORMAT_DOCS,
|
||||||
|
filterOption: ({ data: option }, search) =>
|
||||||
|
option.label.includes(search) || option.value.includes(search),
|
||||||
};
|
};
|
||||||
|
|
||||||
const adhoc_filters: SharedControlConfig<'AdhocFilterControl'> = {
|
const adhoc_filters: SharedControlConfig<'AdhocFilterControl'> = {
|
||||||
|
Loading…
Reference in New Issue
Block a user