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

VizPanel: Do not apply the visualization's field config to annotation data frames #659

Merged
merged 3 commits into from
Apr 5, 2024

Conversation

javiruiz01
Copy link
Contributor

  • Avoid adding default fieldConfig to annotations, follow what we do in grafana (link)

Why? When adding links to a panel like so:

fieldConfig: {
  defaults: {
    ...
    links: [
      {some link}
    ],
  },
},

The links were getting added not only to the series, but also to each field in the annotations, resulting in the annotation having repeated links that did not belong there.

Copy link
Member

@torkelo torkelo left a comment

Choose a reason for hiding this comment

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

Wont this undo #540 ?

@javiruiz01
Copy link
Contributor Author

Actually it still works since we're still running the field overrides, it's just that we won't be applying the default config to the annotations, before we were not running applyFieldOverrides at all, that's why it was breaking

@javiruiz01 javiruiz01 force-pushed the javier/fix_annotations_getting_field_links branch from 3e2418e to c9c8f19 Compare April 1, 2024 13:44
@javiruiz01
Copy link
Contributor Author

I updated the test by adding a link to the annotations test data to ensure we're not losing it after calling applyFieldOverrides

@javiruiz01 javiruiz01 requested a review from torkelo April 4, 2024 13:01
@torkelo torkelo changed the title Fix annotations getting field links VizPanel: Do not apply the visualization's field config to annotation data frames Apr 5, 2024
@torkelo torkelo added the minor Increment the minor version when merged label Apr 5, 2024
@javiruiz01 javiruiz01 added the release Create a release when this pr is merged label Apr 5, 2024
@javiruiz01 javiruiz01 merged commit c68c61d into main Apr 5, 2024
3 checks passed
@javiruiz01 javiruiz01 deleted the javier/fix_annotations_getting_field_links branch April 5, 2024 07:06
@grafanabot
Copy link
Contributor

🚀 PR was released in v4.5.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Increment the minor version when merged release Create a release when this pr is merged released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants