-
Notifications
You must be signed in to change notification settings - Fork 53
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
Add a predefined TimeRange filter if there is at least one DateTime* column #304
Conversation
The default behavior of other datasources is to restrict timerange to the current value. For example, query:
@bossinc what if we change the default query builder behavior to detect a first |
@mshustov, how do you select the DateTime column in that case? |
I suggest providing a column selection and setting the value to |
…hboard-range-filter # Conflicts: # src/components/queryBuilder/Filters.tsx
Now it is like this: Screen.Recording.2023-02-23.at.17.20.16.movWDYT? |
@slvrtrn. Should the user have the ability to remove the filter? The current implementation doesn't support deletion. |
I simplified the logic now; the deletion bug should be gone. |
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.
This is good!
I think I found one area where we have a user experience hole: removing all the filters. We should account for a user who removes the filters but then changes their mind.
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.
Nicely done! 🏆
Demo:
Screen.Recording.2023-02-23.at.00.16.05.mov
Full description:
There was a request from our users to restrict the query to the dashboard range automatically.
After some consideration, we decided to add a (removable) pre-defined filter that appears when we switch the tables if and only if we have at least one DateTime column. If we find some, the first DateTime column is picked, and we add the
WithInGrafanaTimeRange
filter automatically.What is interesting about this filter is that the column selection there is restricted to DateTime (could be also *64 or Nullable) types only, so it is convenient to switch to another column if we failed to pick the right one, and the type of the filter is
WithInGrafanaTimeRange
by default.If a user does not need this type of filter, they can delete it and just add another one.
I also added a convenience ClickHouse container to the
docker-compose.yml
.