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
Loki: Make label browser accessible in query builder #58525
Conversation
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/41584 |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/41761 |
it("doesn't render the label browser modal when closed", () => { | ||
render(<LabelBrowserModal {...props} isOpen={false} />); | ||
expect(screen.queryByRole('heading', { name: /label browser/i })).toBeNull(); | ||
}); |
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.
Would also love to have a test case for onChange
when we change the query. Feel free to drop it in another PR.
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 would be a good candidate for a follow-up task.
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.
Looks good! One minor adjustment and it's done.
public/app/plugins/datasource/loki/querybuilder/components/LabelBrowserModal.tsx
Outdated
Show resolved
Hide resolved
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.
One last change. Sorry I didn't see it before!
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/42918 |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/43029 |
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.
public/app/plugins/datasource/loki/components/LokiLabelBrowser.tsx
Outdated
Show resolved
Hide resolved
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/43109 |
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.
GJ!
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.
I left couple of feedback bellow. Also I remember that we talked about making it wider - slightly smaller than full screen, but taking advantage of the full screen size. Is there a reason you decided not to make it larger, now when we have modal and space?
@ivanahuckova i like these suggestions! i'll make a pr for these changes.
#58525 (comment) - I wasn't sure how this will effect any of the other modals that already exist. my plan was to take a look to see if theres a way to increase the size for only a specific modal, in this case the label browser. if you think i would be better to just increase the size for all of them please let me know. |
What is this feature?
This PR makes the Label browser accessible from both the query builder and the code mode
Why do we need this feature?
During user interviews we learned that some users switch from the query builder to the code mode just to use label browser and then go back to builder mode, which is unnecessary
Who is this feature for?
...
Which issue(s) does this PR fix?:
Fixes #57744
Special notes for your reviewer:
...
Before:
After: