mirror of
https://github.com/apache/superset.git
synced 2026-04-12 04:37:49 +00:00
feat(explore): Remove default for time range filter and Metrics (#14661)
* feat(explore): Remove default for time range filter and Metrics * Merge errors with same messages * Fix e2e test * Rename a variable * Bump packages * Fix unit tests
This commit is contained in:
committed by
GitHub
parent
add35f9fe4
commit
63dc035d6a
@@ -40,15 +40,17 @@ function execControlValidator<T = ControlType>(
|
||||
processedState: ControlState<T>,
|
||||
) {
|
||||
const validators = control.validators as ControlValueValidator[] | undefined;
|
||||
const validationErrors: ValidationError[] = [];
|
||||
const { externalValidationErrors = [] } = control;
|
||||
const errors: ValidationError[] = [];
|
||||
if (validators && validators.length > 0) {
|
||||
validators.forEach(validator => {
|
||||
const error = validator.call(control, control.value, processedState);
|
||||
if (error) {
|
||||
validationErrors.push(error);
|
||||
errors.push(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
const validationErrors = [...errors, ...externalValidationErrors];
|
||||
// always reset validation errors even when there is no validator
|
||||
return { ...control, validationErrors };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user