From 68f938f4ae4171ad6a5895c1150521a50d3616f2 Mon Sep 17 00:00:00 2001 From: Sina Date: Wed, 26 Jun 2024 11:33:30 +0200 Subject: [PATCH] [fix] fix benchmark item showing wrong severity (#260) --- .husky/pre-commit | 2 +- src/locales/de-DE/messages.po | 4 ++-- src/locales/en-US/messages.po | 4 ++-- src/pages/panel/benchmark-detail/BenchmarkDetailTree.tsx | 5 +++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 53a1db8c..37236231 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1 @@ -# yarn lint-staged +yarn lint-staged diff --git a/src/locales/de-DE/messages.po b/src/locales/de-DE/messages.po index 810b8430..100ff0ea 100644 --- a/src/locales/de-DE/messages.po +++ b/src/locales/de-DE/messages.po @@ -470,7 +470,7 @@ msgstr "Da die Daten über {0} liegen, werden nur die ersten {1} Elemente herunt msgid "below" msgstr "" -#: src/pages/panel/benchmark-detail/BenchmarkDetailTree.tsx:101 +#: src/pages/panel/benchmark-detail/BenchmarkDetailTree.tsx:102 #: src/pages/panel/user-settings/UserSettingsNotification.tsx:46 #: src/pages/panel/workspace-settings/workspace-alerting-settings/WorkspaceAlertingSettings.tsx:160 msgid "Benchmark" @@ -1214,7 +1214,7 @@ msgstr "Ignoriert" msgid "Improved" msgstr "Verbessert" -#: src/pages/panel/benchmark-detail/BenchmarkDetailTree.tsx:105 +#: src/pages/panel/benchmark-detail/BenchmarkDetailTree.tsx:106 msgid "in account" msgstr "" diff --git a/src/locales/en-US/messages.po b/src/locales/en-US/messages.po index 981af93e..483ef892 100644 --- a/src/locales/en-US/messages.po +++ b/src/locales/en-US/messages.po @@ -470,7 +470,7 @@ msgstr "Because the data is over {0} Only first {1} items will be downloaded" msgid "below" msgstr "below" -#: src/pages/panel/benchmark-detail/BenchmarkDetailTree.tsx:101 +#: src/pages/panel/benchmark-detail/BenchmarkDetailTree.tsx:102 #: src/pages/panel/user-settings/UserSettingsNotification.tsx:46 #: src/pages/panel/workspace-settings/workspace-alerting-settings/WorkspaceAlertingSettings.tsx:160 msgid "Benchmark" @@ -1214,7 +1214,7 @@ msgstr "Ignored" msgid "Improved" msgstr "Improved" -#: src/pages/panel/benchmark-detail/BenchmarkDetailTree.tsx:105 +#: src/pages/panel/benchmark-detail/BenchmarkDetailTree.tsx:106 msgid "in account" msgstr "in account" diff --git a/src/pages/panel/benchmark-detail/BenchmarkDetailTree.tsx b/src/pages/panel/benchmark-detail/BenchmarkDetailTree.tsx index 2660a6ea..161934f5 100644 --- a/src/pages/panel/benchmark-detail/BenchmarkDetailTree.tsx +++ b/src/pages/panel/benchmark-detail/BenchmarkDetailTree.tsx @@ -63,8 +63,9 @@ export const BenchmarkDetailTree = () => { } from.numberOfResourceFailing += to.numberOfResourceFailing if ( - !from.severity || - (to.severity && to.numberOfResourceFailing && sortedSeverities.indexOf(to.severity) < sortedSeverities.indexOf(from.severity)) + to.severity && + to.numberOfResourceFailing && + (!from.severity || sortedSeverities.indexOf(to.severity) < sortedSeverities.indexOf(from.severity)) ) { from.severity = to.severity }