-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add max row limit #3546
feat: add max row limit #3546
Conversation
✅ Deploy Preview for peaceful-bassi-cbf284 canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice one! looks good 😚 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. Also great job with everything that is not code related: adding env variable, asking the community..
onLimitChange, | ||
}) => { | ||
const { health } = useApp(); | ||
const methods = useForm<{ limit: string }>({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is the limit a string and not a number ?
methods={methods} | ||
onSubmit={handleSubmit} | ||
> | ||
<Input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not using a numeric input ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a really annoying behaviour when editing a number in the numeric input.
Eg: limit is 500 but you want 600. So the user deletes the 5 to then type 6. But the input instantly converts the 00
to 0 to be a valid number.
@@ -45,3 +45,8 @@ export const isValidEmailDomain: FieldValidator<string[]> = | |||
: undefined; | |||
} | |||
}; | |||
|
|||
export const isOnlyNumbers: FieldValidator<string> = (fieldName) => (value) => | |||
!value || value.match(/\D/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good stuff
useEffect(() => { | ||
setValue('limit', limit?.toString()); | ||
}, [limit, setValue]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
form has defaultValues
option that you can use instead
|
||
const handleSubmit = useCallback( | ||
(data: { limit: string }) => { | ||
console.log('handleSubmit'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log
🎉 This PR is included in version 0.297.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Closes: #3498
Description:
New env
LIGHTDASH_QUERY_MAX_LIMIT
that defaults to 5000Error for saved queries that exceed the limit.