mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Re-add missing loading states for filter bar and snapshot components. (#30122)
This commit is contained in:
parent
3db812b08e
commit
dcc96365b7
3 changed files with 56 additions and 58 deletions
|
@ -11,54 +11,56 @@ import { FormattedMessage } from '@kbn/i18n/react';
|
|||
import React from 'react';
|
||||
|
||||
export const SnapshotLoading = () => (
|
||||
<React.Fragment>
|
||||
<EuiTitle size="xs">
|
||||
<h5>
|
||||
<FormattedMessage
|
||||
id="xpack.uptime.snapshot.endpointStatusTitle"
|
||||
defaultMessage="Endpoint status"
|
||||
/>
|
||||
</h5>
|
||||
</EuiTitle>
|
||||
<EuiPanel>
|
||||
<EuiFlexGroup justifyContent="spaceEvenly" gutterSize="xl">
|
||||
<EuiFlexItem>
|
||||
<EuiPanel>
|
||||
<EuiStat
|
||||
description={i18n.translate('xpack.uptime.snapshot.stats.upDescription', {
|
||||
defaultMessage: 'Up',
|
||||
})}
|
||||
textAlign="center"
|
||||
title="-"
|
||||
titleColor="primary"
|
||||
/>
|
||||
</EuiPanel>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiPanel>
|
||||
<EuiStat
|
||||
description={i18n.translate('xpack.uptime.snapshot.stats.downDescription', {
|
||||
defaultMessage: 'Down',
|
||||
})}
|
||||
textAlign="center"
|
||||
title="-"
|
||||
titleColor="danger"
|
||||
/>
|
||||
</EuiPanel>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiPanel>
|
||||
<EuiStat
|
||||
description={i18n.translate('xpack.uptime.snapshot.stats.totalDescription', {
|
||||
defaultMessage: 'Total',
|
||||
})}
|
||||
textAlign="center"
|
||||
title="-"
|
||||
titleColor="subdued"
|
||||
/>
|
||||
</EuiPanel>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiPanel>
|
||||
</React.Fragment>
|
||||
<EuiFlexGroup>
|
||||
<EuiFlexItem>
|
||||
<EuiTitle size="xs">
|
||||
<h5>
|
||||
<FormattedMessage
|
||||
id="xpack.uptime.snapshot.endpointStatusTitle"
|
||||
defaultMessage="Endpoint status"
|
||||
/>
|
||||
</h5>
|
||||
</EuiTitle>
|
||||
<EuiPanel>
|
||||
<EuiFlexGroup justifyContent="spaceEvenly" gutterSize="xl">
|
||||
<EuiFlexItem>
|
||||
<EuiPanel>
|
||||
<EuiStat
|
||||
description={i18n.translate('xpack.uptime.snapshot.stats.upDescription', {
|
||||
defaultMessage: 'Up',
|
||||
})}
|
||||
textAlign="center"
|
||||
title="-"
|
||||
titleColor="primary"
|
||||
/>
|
||||
</EuiPanel>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiPanel>
|
||||
<EuiStat
|
||||
description={i18n.translate('xpack.uptime.snapshot.stats.downDescription', {
|
||||
defaultMessage: 'Down',
|
||||
})}
|
||||
textAlign="center"
|
||||
title="-"
|
||||
titleColor="danger"
|
||||
/>
|
||||
</EuiPanel>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<EuiPanel>
|
||||
<EuiStat
|
||||
description={i18n.translate('xpack.uptime.snapshot.stats.totalDescription', {
|
||||
defaultMessage: 'Total',
|
||||
})}
|
||||
textAlign="center"
|
||||
title="-"
|
||||
titleColor="subdued"
|
||||
/>
|
||||
</EuiPanel>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiPanel>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
);
|
||||
|
|
|
@ -8,7 +8,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import React from 'react';
|
||||
import { Query } from 'react-apollo';
|
||||
import { UptimeCommonProps } from '../../../uptime_app';
|
||||
import { FilterBar } from '../../functional';
|
||||
import { FilterBar, FilterBarLoading } from '../../functional';
|
||||
import { getFilterBarQuery } from './get_filter_bar';
|
||||
|
||||
interface FilterBarProps {
|
||||
|
@ -31,9 +31,7 @@ export const FilterBarQuery = ({
|
|||
>
|
||||
{({ loading, error, data }) => {
|
||||
if (loading) {
|
||||
return i18n.translate('xpack.uptime.filterBar.loadingMessage', {
|
||||
defaultMessage: 'Loading…',
|
||||
});
|
||||
return <FilterBarLoading />;
|
||||
}
|
||||
if (error) {
|
||||
return i18n.translate('xpack.uptime.filterBar.errorMessage', {
|
||||
|
|
|
@ -8,7 +8,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import React from 'react';
|
||||
import { Query } from 'react-apollo';
|
||||
import { UptimeCommonProps } from '../../../uptime_app';
|
||||
import { Snapshot } from '../../functional';
|
||||
import { Snapshot, SnapshotLoading } from '../../functional';
|
||||
import { getSnapshotQuery } from './get_snapshot';
|
||||
|
||||
interface SnapshotProps {
|
||||
|
@ -32,9 +32,7 @@ export const SnapshotQuery = ({
|
|||
>
|
||||
{({ loading, error, data }) => {
|
||||
if (loading) {
|
||||
return i18n.translate('xpack.uptime.snapshot.loadingMessage', {
|
||||
defaultMessage: 'Loading…',
|
||||
});
|
||||
return <SnapshotLoading />;
|
||||
}
|
||||
if (error) {
|
||||
return i18n.translate('xpack.uptime.snapshot.errorMessage', {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue