fix(explore): Prevent shared controls from checking feature flags outside React render (#21315)

This commit is contained in:
Cody Leff
2022-09-14 14:41:47 -04:00
committed by GitHub
parent 59ca7861c0
commit 2285ebe72e
21 changed files with 285 additions and 435 deletions

View File

@@ -49,7 +49,7 @@ const allColumns: typeof sharedControls.groupby = {
options: datasource?.columns || [],
queryMode: getQueryMode(controls),
externalValidationErrors:
isRawMode({ controls }) && ensureIsArray(controlState.value).length === 0
isRawMode({ controls }) && ensureIsArray(controlState?.value).length === 0
? [t('must have a value')]
: [],
}),
@@ -74,7 +74,7 @@ const dndAllColumns: typeof sharedControls.groupby = {
}
newState.queryMode = getQueryMode(controls);
newState.externalValidationErrors =
isRawMode({ controls }) && ensureIsArray(controlState.value).length === 0
isRawMode({ controls }) && ensureIsArray(controlState?.value).length === 0
? [t('must have a value')]
: [];
return newState;

View File

@@ -46,7 +46,7 @@ const percentMetrics: typeof sharedControls.metrics = {
externalValidationErrors: validateAggControlValues(controls, [
controls.groupby?.value,
controls.metrics?.value,
controlState.value,
controlState?.value,
]),
}),
rerender: ['groupby', 'metrics'],