Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Infra UI][Stack Monitoring] Migrate EuiPage*_Depracated usage #161870

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 23 additions & 35 deletions x-pack/plugins/infra/public/pages/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,7 @@
* 2.0.
*/

import {
EuiCallOut,
EuiPage,
EuiPageBody,
EuiPageContent_Deprecated as EuiPageContent,
EuiPageHeader,
EuiPageHeaderSection,
EuiTitle,
} from '@elastic/eui';
import { EuiCallOut, EuiTitle, EuiPageTemplate } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import React from 'react';

Expand Down Expand Up @@ -41,31 +33,27 @@ export const Error: React.FC<Props> = ({ message }) => {

export const ErrorPageBody: React.FC<{ message: string }> = ({ message }) => {
return (
<EuiPage style={{ flex: '1 0 auto' }}>
<EuiPageBody>
<EuiPageHeader>
<EuiPageHeaderSection>
<EuiTitle size="m">
<h1>
<FormattedMessage
id="xpack.infra.errorPage.unexpectedErrorTitle"
defaultMessage="Oops!"
/>
</h1>
</EuiTitle>
</EuiPageHeaderSection>
</EuiPageHeader>
<EuiPageContent>
<EuiCallOut color="danger" title={message} iconType="error">
<p>
<FormattedMessage
id="xpack.infra.errorPage.tryAgainDescription "
defaultMessage="Please click the back button and try again."
/>
</p>
</EuiCallOut>
</EuiPageContent>
</EuiPageBody>
</EuiPage>
<EuiPageTemplate offset={0} restrictWidth={false} bottomBorder={false} grow={false}>
<EuiPageTemplate.Header>
<EuiTitle size="m">
<h1>
<FormattedMessage
id="xpack.infra.errorPage.unexpectedErrorTitle"
defaultMessage="Oops!"
/>
</h1>
</EuiTitle>
</EuiPageTemplate.Header>
<EuiPageTemplate.Section>
<EuiCallOut color="danger" title={message} iconType="error">
<p>
<FormattedMessage
id="xpack.infra.errorPage.tryAgainDescription "
defaultMessage="Please click the back button and try again."
/>
</p>
</EuiCallOut>
</EuiPageTemplate.Section>
</EuiPageTemplate>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@
* 2.0.
*/

import {
EuiCodeBlock,
EuiPage,
EuiPageBody,
EuiPageContent_Deprecated as EuiPageContent,
PropsOf,
} from '@elastic/eui';
import { EuiCodeBlock, EuiPage, EuiPageBody, EuiPanel, PropsOf } from '@elastic/eui';
import { I18nProvider } from '@kbn/i18n-react';
import { Meta, Story } from '@storybook/react/types-6-0';
import React from 'react';
Expand All @@ -36,9 +30,9 @@ export default {
>
<EuiPage restrictWidth>
<EuiPageBody>
<EuiPageContent>
<EuiPanel>
<WrappedStory />
</EuiPageContent>
</EuiPanel>
</EuiPageBody>
</EuiPage>
</MockIndexPatternsKibanaContextProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
TooltipProps,
Tooltip,
} from '@elastic/charts';
import { EuiPageContentBody_Deprecated as EuiPageContentBody } from '@elastic/eui';
import { EuiPageSection } from '@elastic/eui';
import { useIsDarkMode } from '../../../../hooks/use_is_dark_mode';
import { SeriesChart } from './series_chart';
import {
Expand Down Expand Up @@ -110,7 +110,7 @@ export const ChartSectionVis = ({
}

return (
<EuiPageContentBody>
<EuiPageSection>
<div className="infrastructureChart" style={{ height: 250, marginBottom: 16 }}>
<Chart>
<Axis
Expand Down Expand Up @@ -142,6 +142,6 @@ export const ChartSectionVis = ({
/>
</Chart>
</div>
</EuiPageContentBody>
</EuiPageSection>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import {
EuiFlexItem,
EuiPageContentBody_Deprecated as EuiPageContentBody,
EuiPageSection,
EuiPanel,
EuiProgress,
EuiSpacer,
Expand Down Expand Up @@ -54,7 +54,7 @@ export const GaugesSectionVis = ({
return null;
}
return (
<EuiPageContentBody>
<EuiPageSection>
<EuiSpacer size="m" />
<GroupBox>
{metric.series.map((series) => {
Expand Down Expand Up @@ -93,7 +93,7 @@ export const GaugesSectionVis = ({
})}
</GroupBox>
<EuiSpacer size="m" />
</EuiPageContentBody>
</EuiPageSection>
);
};

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
* 2.0.
*/

import { EuiPanel } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { withTheme } from '@kbn/kibana-react-plugin/common';
import React from 'react';
import type { LayoutPropsWithTheme } from '../../types';
import { ChartSectionVis } from '../chart_section_vis';
import { LayoutContent } from '../layout_content';
import { MetadataDetails } from '../metadata_details';
import { Section } from '../section';
import { SubSection } from '../sub_section';
Expand All @@ -28,7 +28,7 @@ export const AwsEC2Layout = withTheme(
'cloud.project.id',
]}
/>
<LayoutContent>
<EuiPanel>
<Section
navLabel="AWS EC2"
sectionLabel={i18n.translate(
Expand Down Expand Up @@ -129,7 +129,7 @@ export const AwsEC2Layout = withTheme(
/>
</SubSection>
</Section>
</LayoutContent>
</EuiPanel>
</React.Fragment>
)
);
Loading