From 1f46dda2a2c9ed1ed0b21896acc5d67640c83617 Mon Sep 17 00:00:00 2001 From: Dario Gieselaar Date: Thu, 10 Sep 2020 14:52:32 +0200 Subject: [PATCH] Review feedback --- x-pack/plugins/apm/common/anomaly_detection.ts | 11 ++++------- .../apm/server/lib/helpers/get_bucket_size/index.ts | 2 -- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/x-pack/plugins/apm/common/anomaly_detection.ts b/x-pack/plugins/apm/common/anomaly_detection.ts index bce46721c5259..23d2d03caca1b 100644 --- a/x-pack/plugins/apm/common/anomaly_detection.ts +++ b/x-pack/plugins/apm/common/anomaly_detection.ts @@ -54,11 +54,9 @@ export function getSeverityColor(theme: EuiTheme, severity?: Severity) { } export function getSeverityLabel(severity?: Severity) { - let label: string = ''; - switch (severity) { case Severity.critical: - label = i18n.translate( + return i18n.translate( 'xpack.apm.servicesTable.serviceHealthStatus.critical', { defaultMessage: 'Critical', @@ -68,7 +66,7 @@ export function getSeverityLabel(severity?: Severity) { case Severity.major: case Severity.minor: - label = i18n.translate( + return i18n.translate( 'xpack.apm.servicesTable.serviceHealthStatus.warning', { defaultMessage: 'Warning', @@ -77,7 +75,7 @@ export function getSeverityLabel(severity?: Severity) { break; case Severity.warning: - label = i18n.translate( + return i18n.translate( 'xpack.apm.servicesTable.serviceHealthStatus.healthy', { defaultMessage: 'Healthy', @@ -86,7 +84,7 @@ export function getSeverityLabel(severity?: Severity) { break; default: - label = i18n.translate( + return i18n.translate( 'xpack.apm.servicesTable.serviceHealthStatus.unknown', { defaultMessage: 'Unknown', @@ -94,7 +92,6 @@ export function getSeverityLabel(severity?: Severity) { ); break; } - return label; } export const ML_ERRORS = { diff --git a/x-pack/plugins/apm/server/lib/helpers/get_bucket_size/index.ts b/x-pack/plugins/apm/server/lib/helpers/get_bucket_size/index.ts index 3f193b2b20ca1..5b78d97d5b681 100644 --- a/x-pack/plugins/apm/server/lib/helpers/get_bucket_size/index.ts +++ b/x-pack/plugins/apm/server/lib/helpers/get_bucket_size/index.ts @@ -7,8 +7,6 @@ import moment from 'moment'; // @ts-expect-error import { calculateAuto } from './calculate_auto'; -// @ts-expect-error -import { unitToSeconds } from './unit_to_seconds'; export function getBucketSize( start: number,