msyavuz commented on code in PR #33170:
URL: https://github.com/apache/superset/pull/33170#discussion_r2071192796
##########
superset-frontend/src/filters/components/Range/RangeFilterPlugin.tsx:
##########
@@ -90,14 +145,19 @@ const validateRange = (
): { isValid: boolean; errorMessage: string | null } => {
const [inputMin, inputMax] = values;
const requiredError = t('Filter value is required');
- const rangeError = t('Please provide a value within range');
+ const rangeError = t('Numbers must be within %(min)s and %(max)s', {
+ min,
+ max,
+ });
+
+ // Single value validation
if (enableSingleValue !== undefined) {
const isSingleMin =
enableSingleValue === SingleValueType.Minimum ||
enableSingleValue === SingleValueType.Exact;
const value = isSingleMin ? inputMin : inputMax;
- if (!value && enableEmptyFilter) {
+ if (!isNumber(value) && !enableEmptyFilter) {
Review Comment:
`enableEmptyFilter` is true when filter value is required. It's
counterintuitive, but I saw you handled it correctly in other parts of the
code. Also here it should be:
```suggestion
if (!isNumber(value) && enableEmptyFilter) {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]