From 55cb7061e072b92625c8032703cf26501c24c9ca Mon Sep 17 00:00:00 2001 From: Joshua Grime Date: Mon, 4 Sep 2023 14:10:12 +0100 Subject: [PATCH] Fixed table sort bug in NewRelicComponent Signed-off-by: Joshua Grime --- .changeset/mean-queens-act.md | 5 +++++ .../NewRelicFetchComponent.tsx | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 .changeset/mean-queens-act.md diff --git a/.changeset/mean-queens-act.md b/.changeset/mean-queens-act.md new file mode 100644 index 0000000000..a895ba5705 --- /dev/null +++ b/.changeset/mean-queens-act.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-newrelic': patch +--- + +Fixed bug in NewRelicComponent component where table would not sort correctly for numerical values. diff --git a/plugins/newrelic/src/components/NewRelicFetchComponent/NewRelicFetchComponent.tsx b/plugins/newrelic/src/components/NewRelicFetchComponent/NewRelicFetchComponent.tsx index e626e6a6d2..0cd1c3b14c 100644 --- a/plugins/newrelic/src/components/NewRelicFetchComponent/NewRelicFetchComponent.tsx +++ b/plugins/newrelic/src/components/NewRelicFetchComponent/NewRelicFetchComponent.tsx @@ -25,9 +25,9 @@ import { useApi } from '@backstage/core-plugin-api'; export const NewRelicAPMTable = ({ applications }: NewRelicApplications) => { const columns: TableColumn[] = [ { title: 'Application', field: 'name' }, - { title: 'Response Time', field: 'responseTime' }, - { title: 'Throughput', field: 'throughput' }, - { title: 'Error Rate', field: 'errorRate' }, + { title: 'Response Time (ms)', field: 'responseTime' }, + { title: 'Throughput (rpm)', field: 'throughput' }, + { title: 'Error Rate (%)', field: 'errorRate' }, { title: 'Instance Count', field: 'instanceCount' }, { title: 'Apdex', field: 'apdexScore' }, ]; @@ -43,9 +43,9 @@ export const NewRelicAPMTable = ({ applications }: NewRelicApplications) => { return { name, - responseTime: `${responseTime} ms`, - throughput: `${throughput} rpm`, - errorRate: `${errorRate}%`, + responseTime, + throughput, + errorRate, instanceCount, apdexScore, };