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

[UI] Fix duplicated keys on /targets page #8456

Merged
merged 2 commits into from
Feb 8, 2021
Merged

[UI] Fix duplicated keys on /targets page #8456

merged 2 commits into from
Feb 8, 2021

Conversation

prymitive
Copy link
Contributor

No description provided.

I've noticed that I'm getting warnings about multiple children with the same key on /targets page.
This adds a test that fails when that happens.

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>
Since any URI we render on /targets page can have multi-value params we should use both name and value as components keys.

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>
@@ -27,7 +27,7 @@ const EndpointLink: FC<EndpointLinkProps> = ({ endpoint, globalUrl }) => {
{params.length > 0 ? <br /> : null}
{params.map(([labelName, labelValue]: [string, string]) => {
return (
<Badge color="primary" className={`mr-1 ${labelName}`} key={labelName}>
<Badge color="primary" className={`mr-1 ${labelName}`} key={`${labelName}/${labelValue}`}>
Copy link
Member

Choose a reason for hiding this comment

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

Oh I just noticed that we have a similar bug here (unrelated to your fix) as I fixed elsewhere in https://github.com/prometheus/prometheus/pull/7902/files, where the label name is put into a class name. Will send a fix for that as well.

@juliusv
Copy link
Member

juliusv commented Feb 8, 2021

👍 Thanks!

@juliusv juliusv merged commit 885674c into prometheus:master Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants