Skip to content

Commit

Permalink
Merge pull request #113728 from cockroachdb/blathers/backport-release…
Browse files Browse the repository at this point in the history
…-23.2-113710

release-23.2: ui: remove duplicates of metrics on tooltip
  • Loading branch information
maryliag committed Nov 7, 2023
2 parents bf05922 + ca71cc9 commit c9ed4dc
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -52,6 +52,7 @@ import { isSecondaryTenant } from "src/redux/tenants";
import { Tooltip } from "antd";
import "antd/lib/tooltip/style";
import { MonitoringIcon } from "src/views/shared/components/icons/monitoring";
import { unique } from "src/util/arrays";

type TSResponse = protos.cockroach.ts.tspb.TimeSeriesQueryResponse;

Expand Down Expand Up @@ -402,14 +403,15 @@ export class InternalLineGraph extends React.Component<LineGraphProps, {}> {
</>
);
} else if (data?.results?.length > 1) {
const metrics = unique(data.results.map(m => m.query.name));
tt = (
<>
{tt}
{addLines}
Metrics:
<ul>
{data.results.map(m => (
<li key={m.query.name}>{m.query.name}</li>
{metrics.map(m => (
<li key={m}>{m}</li>
))}
</ul>
</>
Expand Down

0 comments on commit c9ed4dc

Please sign in to comment.