Skip to content
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

Added sortBy parameter to Table panel #612

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

Git-Lior
Copy link
Contributor

What does this do?

This change allows sorting table rows by their fields

Why is it a good idea?

This is a useful feature which is supported in grafana v8:
https://grafana.com/docs/grafana/v8.0/panels/visualizations/table/#sort-column

Context

sortBy in grafana's Table panel options:
https://github.com/grafana/grafana/blob/v8.0.x/public/app/plugins/panel/table/models.gen.ts#L17

The name for TableSortByField was inspired by the matching type in grafana:
https://github.com/grafana/grafana/blob/main/packages/grafana-ui/src/components/Table/types.ts#L24

Copy link
Collaborator

@JamesGibo JamesGibo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR looks good, thanks for your contribution.
I think it would be good to add a validator to the sortBy variable and have added a suggestion for you to test

grafanalib/core.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@JamesGibo JamesGibo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JamesGibo JamesGibo merged commit 019b34b into weaveworks:main Sep 7, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants