mirror of https://github.com/apache/superset.git
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'> = {
|
||||
type: 'HiddenControl',
|
||||
initialValue: (control: ControlState, state: ControlPanelState) =>
|
||||
initialValue: (control: ControlState, state: ControlPanelState | null) =>
|
||||
Object.fromEntries(
|
||||
ensureIsArray<Record<string, any>>(state?.datasource?.columns)
|
||||
.filter(option => option.is_dttm)
|
||||
|
|
|
@ -39,7 +39,7 @@ export const xAxisMixin = {
|
|||
description: (state: ControlPanelState) =>
|
||||
getAxisLabel(state?.form_data).description,
|
||||
validators: [validateNonEmpty],
|
||||
initialValue: (control: ControlState, state: ControlPanelState) => {
|
||||
initialValue: (control: ControlState, state: ControlPanelState | null) => {
|
||||
if (
|
||||
isFeatureEnabled(FeatureFlag.GENERIC_CHART_AXES) &&
|
||||
state?.form_data?.granularity_sqla &&
|
||||
|
|
|
@ -172,10 +172,14 @@ const config: ControlPanelConfig = {
|
|||
label: t('Distribute across'),
|
||||
multi: true,
|
||||
description: t('Columns to calculate distribution across.'),
|
||||
initialValue: (control: ControlState, state: ControlPanelState) => {
|
||||
initialValue: (
|
||||
control: ControlState,
|
||||
state: ControlPanelState | null,
|
||||
) => {
|
||||
if (
|
||||
(state && !control?.value) ||
|
||||
(Array.isArray(control?.value) && control.value.length === 0)
|
||||
state &&
|
||||
(!control?.value ||
|
||||
(Array.isArray(control?.value) && control.value.length === 0))
|
||||
) {
|
||||
return [getTemporalColumns(state.datasource).defaultTemporalColumn];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue