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

[Bug] Dashboard links not updated when changing variables #12506

Closed
gretamosa opened this Issue Jul 4, 2018 · 14 comments

Comments

Projects
None yet
3 participants
@gretamosa
Copy link

gretamosa commented Jul 4, 2018

Please include this information:

What Grafana version are you using?

Grafana v5.2.0-pre1 (cce9632)

I have found some problems with dashlinks and templating variables. By clicking into dashlink, anchor href is not updated :(

Reviewing public/app/features/dashlinks/module.ts I have found some stranger things:

  • Line 48 - function update - there are lines with anchor variable (bad idea) and lines with elem.find('a') (good idea).

I have replaced anchor variable by elem.find('a') and it solved the problem. Consider to submit please.

There is a similar problem with span variable and elem.find('span')

Regards,

@marefr

This comment has been minimized.

Copy link
Member

marefr commented Jul 5, 2018

Could you please explain what you mean by "anchor href is not updated" - screenshot?

@gretamosa

This comment has been minimized.

Copy link
Author

gretamosa commented Jul 5, 2018

It is difficult to take a screenshot with this situation because I was debugging with Chrome inspector in module.ts line 52.

anchor.attr('href', linkInfo.href);

This line updates anchor variable but not the original DOM.

@marefr

This comment has been minimized.

Copy link
Member

marefr commented Jul 5, 2018

But is it a bug in UI - screenshot possible, or javascript error? At least include how you've configured your dashboard and the steps involved getting to module.ts line 52. Is a link not updating when changing template variable or what?

@gretamosa

This comment has been minimized.

Copy link
Author

gretamosa commented Jul 5, 2018

I think it's a javascript error. I attached a screenshot with the dashlink href and adhoc filter "Filter" with a value. Do you need another screenshot with javascript info?

Hope it helps.

captura de pantalla 2018-07-05 a las 11 58 15

@marefr

This comment has been minimized.

Copy link
Member

marefr commented Jul 5, 2018

I don't see any problems in the markup. Yes please include javascript errors and what you expected to happen and what did happen that made you open this issue.

@gretamosa

This comment has been minimized.

Copy link
Author

gretamosa commented Jul 5, 2018

50% markup problem, 50% javascript error :)

This HTML line
<a class="pointer gf-form-label" href="dashboard/db/netflow-custom-topo-real-time?from=now-1h&amp;to=now&amp;var-expIP=All&amp;var-criteria=iBytes" data-placement="bottom"><i></i> <span>netflow custom topo real-time</span></a>

should be (like url browser bar shows)

<a class="pointer gf-form-label" href="dashboard/db/netflow-custom-topo-real-time?from=now-1h&amp;to=now&amp;var-expIP=All&amp;var-criteria=iBytes&var-Filter=srcIP%7C%3D%7C150.100.246.43" data-placement="bottom"><i></i> <span>netflow custom topo real-time</span></a>

This is a breakpoint when javascript error occurs.

captura de pantalla 2018-07-05 a las 12 35 07

@marefr

This comment has been minimized.

Copy link
Member

marefr commented Jul 5, 2018

Can't reproduce on latest master 5.3.0-pre1. Please try and upgrade to latest. But are you not asking of the same feature as in #12338 here?

@gretamosa

This comment has been minimized.

Copy link
Author

gretamosa commented Jul 5, 2018

They are related but are not the same issue. #12338 is about to extend dashlink functionalities (in the same way that dashboard list panel) and this issue is about a possible dashlink bug.

I'll upgrade to latest commit and report my results because module.ts between 5.2.0-pre1 and 5.3.0-pre1 is the same. The use of anchor variable and elem.find('a') is unclear.

@gretamosa

This comment has been minimized.

Copy link
Author

gretamosa commented Jul 5, 2018

Tested with 5.3.0-pre1 and happened the same issue. I've tried with new dashboards and templating variables and they are not shared between dashboards. How do you test this behavior? just for trying to reproduce.

@marefr

This comment has been minimized.

Copy link
Member

marefr commented Jul 5, 2018

Okay. Can you share your dashboard json and explain when the javascript error occur, when clicking on a link or when changing variable/adhoc filters?

@gretamosa

This comment has been minimized.

Copy link
Author

gretamosa commented Jul 5, 2018

I've reproduced the issue with these simplified dashboards and default datasource.

Steps:

  1. Load test1 dashboard
  2. Change a templating variable with b value.
  3. Click into dashlink test2
  4. In my browser, I see a value in a templating variable.

dashboards.zip

@marefr

This comment has been minimized.

Copy link
Member

marefr commented Jul 6, 2018

Bug reproduced. Will submit a PR to fix this. Thank you.

@marefr marefr changed the title Dashlist bug? [Bug] Dashboard links not updated when changing variables Jul 6, 2018

@marefr marefr added this to the 5.3 milestone Jul 6, 2018

@marefr marefr closed this in #12518 Jul 6, 2018

marefr added a commit that referenced this issue Jul 6, 2018

@marefr marefr modified the milestones: 5.3, 5.2.2 Jul 6, 2018

marefr added a commit that referenced this issue Jul 6, 2018

ryantxu added a commit to ryantxu/grafana that referenced this issue Jul 8, 2018

Merge remote-tracking branch 'grafana/master' into lazy-load-panels
* grafana/master: (78 commits)
  devenv: updated devenv provision scripts
  ux: minor fix/tweak to inactive view mode, think logo should be visible & fixes dashboard title alignment
  changelog: add notes about closing grafana#12379
  Fix datasource sorting with template variables
  changelog: add notes about closing grafana#12484
  changelog: add notes about closing grafana#12506
  changelog: add notes about closing grafana#12506
  fix links not updating after changing variables
  prometheus heatmap: fix unhandled error when some points are missing
  fix caret for help button is ds http settings
  changelog: add notes about closing grafana#11618 grafana#11619
  Basic cleanup
  Add mocks in test file
  Remove q and stub
  Add Jest stubs
  Remove async
  Remove logs and comments
  Start elastic ds test conversion
  run enterprise build only on master for now
  refix the settings indentation
  ...
@AndrewStickler

This comment has been minimized.

Copy link

AndrewStickler commented Jul 25, 2018

Does this bug explain why the current value of variables are not carried forward when switching from one dashboard to another? That capability seemed to regress with 5.2.1.

@marefr

This comment has been minimized.

Copy link
Member

marefr commented Jul 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.