mirror of
https://github.com/apache/superset.git
synced 2024-09-06 22:07:34 -04:00
fix(plugin-chart-echarts): boxplot throw error in the dashboard (#21661)
This commit is contained in:
parent
4c17f0e71e
commit
61bd696226
@ -359,7 +359,7 @@ const show_empty_columns: SharedControlConfig<'CheckboxControl'> = {
|
|||||||
|
|
||||||
const datetime_columns_lookup: SharedControlConfig<'HiddenControl'> = {
|
const datetime_columns_lookup: SharedControlConfig<'HiddenControl'> = {
|
||||||
type: 'HiddenControl',
|
type: 'HiddenControl',
|
||||||
initialValue: (control: ControlState, state: ControlPanelState) =>
|
initialValue: (control: ControlState, state: ControlPanelState | null) =>
|
||||||
Object.fromEntries(
|
Object.fromEntries(
|
||||||
ensureIsArray<Record<string, any>>(state?.datasource?.columns)
|
ensureIsArray<Record<string, any>>(state?.datasource?.columns)
|
||||||
.filter(option => option.is_dttm)
|
.filter(option => option.is_dttm)
|
||||||
|
@ -39,7 +39,7 @@ export const xAxisMixin = {
|
|||||||
description: (state: ControlPanelState) =>
|
description: (state: ControlPanelState) =>
|
||||||
getAxisLabel(state?.form_data).description,
|
getAxisLabel(state?.form_data).description,
|
||||||
validators: [validateNonEmpty],
|
validators: [validateNonEmpty],
|
||||||
initialValue: (control: ControlState, state: ControlPanelState) => {
|
initialValue: (control: ControlState, state: ControlPanelState | null) => {
|
||||||
if (
|
if (
|
||||||
isFeatureEnabled(FeatureFlag.GENERIC_CHART_AXES) &&
|
isFeatureEnabled(FeatureFlag.GENERIC_CHART_AXES) &&
|
||||||
state?.form_data?.granularity_sqla &&
|
state?.form_data?.granularity_sqla &&
|
||||||
|
@ -172,10 +172,14 @@ const config: ControlPanelConfig = {
|
|||||||
label: t('Distribute across'),
|
label: t('Distribute across'),
|
||||||
multi: true,
|
multi: true,
|
||||||
description: t('Columns to calculate distribution across.'),
|
description: t('Columns to calculate distribution across.'),
|
||||||
initialValue: (control: ControlState, state: ControlPanelState) => {
|
initialValue: (
|
||||||
|
control: ControlState,
|
||||||
|
state: ControlPanelState | null,
|
||||||
|
) => {
|
||||||
if (
|
if (
|
||||||
(state && !control?.value) ||
|
state &&
|
||||||
(Array.isArray(control?.value) && control.value.length === 0)
|
(!control?.value ||
|
||||||
|
(Array.isArray(control?.value) && control.value.length === 0))
|
||||||
) {
|
) {
|
||||||
return [getTemporalColumns(state.datasource).defaultTemporalColumn];
|
return [getTemporalColumns(state.datasource).defaultTemporalColumn];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user