From 3d47b7d1d70717e2395049cc28ddfc684b86fe1d Mon Sep 17 00:00:00 2001 From: Cody Leff Date: Mon, 12 Sep 2022 17:59:47 -0400 Subject: [PATCH] Add explanatory comment. --- .../src/shared-controls/dndControls.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/dndControls.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/dndControls.tsx index d0e0459250d4d..679ac940a5bec 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/dndControls.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/dndControls.tsx @@ -47,6 +47,16 @@ type Control = { default?: unknown; }; +/* + * Note: Previous to the commit that introduced this comment, the shared controls module + * would check feature flags at module execution time and expose a different control + * configuration (component + props) depending on the status of drag-and-drop feature + * flags. This commit combines those configs, merging the required props for both the + * drag-and-drop and non-drag-and-drop components, and renders a wrapper component that + * checks feature flags at component render time to avoid race conditions between when + * feature flags are set and when they're checked. + */ + export const dndGroupByControl: SharedControlConfig< 'DndColumnSelect' | 'SelectControl', ColumnMeta