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

onRender and onInit share the same "references" in the code editor #46

Open
ZuperZee opened this issue Oct 8, 2021 · 0 comments
Open
Labels
bug Something isn't working

Comments

@ZuperZee
Copy link
Contributor

ZuperZee commented Oct 8, 2021

What happened:
Writing code in onRender or onInit makes variables show in the other as references.
image

The code crashes if they are used.
image

What you expected to happen:
The editors shouldn't reference each other.

How to reproduce it (as minimally and precisely as possible):

  1. Create a variable in onInit
  2. Type out the variable in onRender
  3. Press ctrl + space (doesn't have to be the full variable name)

Panel options

{
    "onRender": "otherFile",
    "onInit": "const otherFile = \"Hey\";"
}

Anything else we need to know?:

Environment:

  • Grafana version: v8.2.0
  • Plugin (gapit-htmlgraphics-panel) version: v1.3.3
  • Data source type & version:
  • OS Grafana is installed on: Windows 10 (Ubuntu WSL)
  • User OS & Browser: Chrome
  • Grafana plugins:
  • Others:
@ZuperZee ZuperZee added the bug Something isn't working label Oct 8, 2021
@ZuperZee ZuperZee added this to the v1.5.0 milestone Oct 22, 2021
@ZuperZee ZuperZee removed this from the v1.5.0 milestone Nov 1, 2021
@ZuperZee ZuperZee changed the title onRender and onInit share the same "references" onRender and onInit share the same "references" in the code editor Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant