mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[SLO] file reorg, improvements to badge (#213597)
This commit is contained in:
parent
ecdea5abaa
commit
311417d78e
7 changed files with 15 additions and 17 deletions
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import React, { useMemo } from 'react';
|
||||
import React from 'react';
|
||||
import { EuiBadge, EuiFlexItem, EuiSkeletonText, EuiToolTip } from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { SLOWithSummaryResponse } from '@kbn/slo-schema';
|
||||
|
@ -23,15 +23,13 @@ export function SloValueBadge({ slo, isLoading }: SloStatusProps) {
|
|||
const { uiSettings } = useKibana().services;
|
||||
const percentFormat = uiSettings.get('format:percent:defaultPattern');
|
||||
|
||||
const badgeDisplayText = useMemo(() => {
|
||||
return i18n.translate('xpack.slo.sloStatusBadge.sloObjectiveValue', {
|
||||
defaultMessage: '{value} / {objective} (Objective)',
|
||||
values: {
|
||||
value: hasNoData ? '-' : numeral(slo.summary.sliValue).format(percentFormat),
|
||||
objective: numeral(slo.objective.target).format(percentFormat),
|
||||
},
|
||||
});
|
||||
}, [slo, percentFormat, hasNoData]);
|
||||
const badgeDisplayText = i18n.translate('xpack.slo.sloStatusBadge.sloObjectiveValue', {
|
||||
defaultMessage: '{value} ({objective} objective)',
|
||||
values: {
|
||||
value: hasNoData ? '-' : numeral(slo.summary.sliValue).format(percentFormat),
|
||||
objective: numeral(slo.objective.target).format(percentFormat),
|
||||
},
|
||||
});
|
||||
|
||||
if (isLoading || !slo) {
|
||||
return <EuiSkeletonText lines={2} data-test-subj="loadingTitle" />;
|
||||
|
|
|
@ -23,10 +23,10 @@ import {
|
|||
toDurationLabel,
|
||||
toIndicatorTypeLabel,
|
||||
} from '../../../../utils/slo/labels';
|
||||
import { ApmIndicatorOverview } from './apm_indicator_overview';
|
||||
import { DisplayQuery } from './display_query';
|
||||
import { ApmIndicatorOverview } from '../overview/apm_indicator_overview';
|
||||
import { DisplayQuery } from '../overview/display_query';
|
||||
import { DefinitionItem } from './definition_item';
|
||||
import { SyntheticsIndicatorOverview } from './synthetics_indicator_overview';
|
||||
import { SyntheticsIndicatorOverview } from '../overview/synthetics_indicator_overview';
|
||||
|
||||
export interface Props {
|
||||
slo: SLOWithSummaryResponse;
|
|
@ -16,7 +16,7 @@ import {
|
|||
import React from 'react';
|
||||
import { useKibana } from '../../../../hooks/use_kibana';
|
||||
import { convertSliApmParamsToApmAppDeeplinkUrl } from '../../../../utils/slo/convert_sli_apm_params_to_apm_app_deeplink_url';
|
||||
import { DefinitionItem } from './definition_item';
|
||||
import { DefinitionItem } from '../definition/definition_item';
|
||||
|
||||
interface Props {
|
||||
slo: SLOWithSummaryResponse;
|
||||
|
|
|
@ -10,7 +10,7 @@ import { ComponentStory } from '@storybook/react';
|
|||
|
||||
import { KibanaReactStorybookDecorator } from '../../../../utils/kibana_react.storybook_decorator';
|
||||
import { buildSlo } from '../../../../data/slo/slo';
|
||||
import { Definition as Component, Props } from './definition';
|
||||
import { Definition as Component, Props } from '../definition/definition';
|
||||
|
||||
export default {
|
||||
component: Component,
|
||||
|
|
|
@ -14,7 +14,7 @@ import {
|
|||
syntheticsMonitorLocationQueryLocatorID,
|
||||
} from '@kbn/observability-plugin/common';
|
||||
import { useKibana } from '../../../../hooks/use_kibana';
|
||||
import { DefinitionItem } from './definition_item';
|
||||
import { DefinitionItem } from '../definition/definition_item';
|
||||
|
||||
interface Props {
|
||||
slo: SLOWithSummaryResponse;
|
||||
|
|
|
@ -13,7 +13,7 @@ import { BurnRatePanel } from './burn_rate_panel/burn_rate_panel';
|
|||
import { EventsChartPanel } from './events_chart_panel/events_chart_panel';
|
||||
import { HistoricalDataCharts } from './historical_data_charts';
|
||||
import { SLODetailsHistory } from './history/slo_details_history';
|
||||
import { Definition } from './overview/definition';
|
||||
import { Definition } from './definition/definition';
|
||||
import { SloDetailsAlerts } from './slo_detail_alerts';
|
||||
import { SloHealthCallout } from './slo_health_callout';
|
||||
import { SloRemoteCallout } from './slo_remote_callout';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue