grafana / grafonnet

Jsonnet library for generating Grafana dashboards.
https://grafana.github.io/grafonnet/
Apache License 2.0
322 stars 19 forks source link

Adding fieldConfig overrides in table panel #127

Closed vishnuchalla closed 9 months ago

vishnuchalla commented 9 months ago

Description

Adding filterable option in table panel. More context here: https://github.com/grafana/grafonnet/issues/126

Testing

Tested by building a grafana panel. Could see expected json and filter option in the table panel.

CLAassistant commented 9 months ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Vishnu Challa seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

vishnuchalla commented 9 months ago

@K-Phoen @iainlane Requesting a review.

Duologic commented 9 months ago

It exists in the schema, I've been looking through docs for relevance of this field, we can enable it here instead: https://github.com/grafana/grafonnet/blob/main/generator/core.libsonnet#L271

Duologic commented 9 months ago

Fixing this in #131

vishnuchalla commented 9 months ago

@Duologic

Fixing this in #131

I still do not understand the usage of it. It tried both

I think the field is not properly exposed yet for table panel atleast.

Duologic commented 9 months ago

Did you do a jb update?

vishnuchalla commented 9 months ago

I did update and retry this. when I do a table.fieldConfig.defaults.withFilterable, I still see this error

RUNTIME ERROR: field does not exist: fieldConfig

And when I do table.standardOptions.withFilterable, the filter seems to be getting applied but in a wrong place i.e fieldConfig.defaults.filterable instead of fieldConfig.defaults.custom.filterable. So I am unable to see filter options in my dashboard.

Duologic commented 9 months ago

Gotcha, so there is a distinct field fieldConfig.defaults.custom.filterable that is not in the table schema. Makes sense to investigate that deeper, I find a reference here which shows that there are more fields missing. Let's see how we can get those into Grafonnet too.

Duologic commented 9 months ago

134 makes an attempt to fix this again.

Duologic commented 9 months ago

134 got merged