Skip to content

Incorrect input field selection when adding multiple 'replaceAlias' functions in a metrics query #2042

Open
@WilliamFitzjohn

Description

@WilliamFitzjohn

Describe the bug
Some very buggy behaviour is happening when I'm using multiple replaceAlias functions inside a metrics query of my zabbix datasource. When I create a second replaceAlias, a second function is created but its prepopulated with the existing replaceAlias parameters. Furthermore, when I go to click the "new" empty function, it automatically repopulates with the original parameters (see screenshots).
This is making my team scared of editing these panels because they never know what functions are real or not.
Thanks for any help!

Expected behavior
When adding a new replaceAlias, existing replaceAlias functions should stay the same, and you should be editing the newly created replaceAlias function.

Screenshots
Adding 1 replaceAlias function is good:
Image
Click + to create a new replaceAlias, I am now automatically editing the second function, but the input text is copied from the first replaceAlias function, and the function on the left has been "reset":
Image
Then click the function on the left, and it repopulates the original parameters:
Image
We are now left with 2 functions but this interaction is making my team scared to edit any alias functions.
To be clear, after creating the first function I did not touch my keyboard once. Simply clicking on the function changed/copied the data.

Network data
No data required because this is in the query builder.

Software versions

Grafana Zabbix Grafana-Zabbix Plugin
12.0.0 5.0.42 5.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions