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

[Watcher] Migrate all usages of EuiPage*_Deprecated #163128

Merged
merged 6 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions x-pack/plugins/watcher/public/application/license_prompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiEmptyPrompt, EuiLink, EuiPageContent_Deprecated as EuiPageContent } from '@elastic/eui';
import { EuiEmptyPrompt, EuiLink, EuiPageSection } from '@elastic/eui';
import { LicenseManagementLocator } from '@kbn/license-management-plugin/public/locator';

export const LicensePrompt = ({
Expand Down Expand Up @@ -41,7 +41,7 @@ export const LicensePrompt = ({
</>
);
return (
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="danger">
<EuiPageSection alignment="center" color="danger">
<EuiEmptyPrompt
iconType="warning"
title={
Expand All @@ -55,6 +55,6 @@ export const LicensePrompt = ({
body={promptBody}
actions={[promptAction]}
/>
</EuiPageContent>
</EuiPageSection>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@

import React, { useContext, useState } from 'react';

import {
EuiPageHeader,
EuiSpacer,
EuiPageContentBody_Deprecated as EuiPageContentBody,
} from '@elastic/eui';
import { EuiPageHeader, EuiSpacer, EuiPageSection } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { ExecuteDetails } from '../../../../models/execute_details';
import { getActionType } from '../../../../../../common/lib/get_action_type';
Expand Down Expand Up @@ -94,7 +90,7 @@ export const JsonWatchEdit = ({ pageTitle }: { pageTitle: string }) => {
);

return (
<EuiPageContentBody restrictWidth style={{ width: '100%' }}>
<EuiPageSection restrictWidth style={{ width: '100%' }}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified ✅
Screenshot 2023-08-22 at 13 16 01

<EuiPageHeader
pageTitle={<span data-test-subj="pageTitle">{pageTitle}</span>}
bottomBorder
Expand Down Expand Up @@ -128,6 +124,6 @@ export const JsonWatchEdit = ({ pageTitle }: { pageTitle: string }) => {
)}

{selectedTab === WATCH_EDIT_TAB && <JsonWatchEditForm />}
</EuiPageContentBody>
</EuiPageSection>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React, { useContext } from 'react';

import { EuiPageContent_Deprecated as EuiPageContent, EuiEmptyPrompt, EuiLink } from '@elastic/eui';
import { EuiPageSection, EuiEmptyPrompt, EuiLink } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { reactRouterNavigate } from '@kbn/kibana-react-plugin/public';
import { WatchContext } from '../../watch_context';
Expand All @@ -28,7 +28,7 @@ export const MonitoringWatchEdit = ({ pageTitle }: { pageTitle: string }) => {
);

return (
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="subdued">
<EuiPageSection alignment="center" color="subdued">
<EuiEmptyPrompt
iconType=""
title={<h1>{pageTitle}</h1>}
Expand All @@ -42,6 +42,6 @@ export const MonitoringWatchEdit = ({ pageTitle }: { pageTitle: string }) => {
</EuiLink>,
]}
/>
</EuiPageContent>
</EuiPageSection>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
EuiText,
EuiTitle,
EuiPageHeader,
EuiPageContentBody_Deprecated as EuiPageContentBody,
EuiPageSection,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
Expand Down Expand Up @@ -236,7 +236,7 @@ export const ThresholdWatchEdit = ({ pageTitle }: { pageTitle: string }) => {
};

return (
<EuiPageContentBody restrictWidth style={{ width: '100%' }}>
<EuiPageSection restrictWidth style={{ width: '100%' }}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified ✅
Screenshot 2023-08-22 at 13 17 38

<EuiPageHeader
pageTitle={<span data-test-subj="pageTitle">{pageTitle}</span>}
description={watch.titleDescription}
Expand Down Expand Up @@ -953,6 +953,6 @@ export const ThresholdWatchEdit = ({ pageTitle }: { pageTitle: string }) => {
close={() => setIsRequestVisible(false)}
/>
) : null}
</EuiPageContentBody>
</EuiPageSection>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React, { useEffect, useReducer } from 'react';
import { isEqual } from 'lodash';

import { EuiPageContent_Deprecated as EuiPageContent } from '@elastic/eui';
import { EuiPageSection } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';

Expand Down Expand Up @@ -134,9 +134,9 @@ export const WatchEditPage = ({
const errorCode = getPageErrorCode(loadError);
if (errorCode) {
return (
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="danger">
<EuiPageSection alignment="center" color="danger">
<PageError errorCode={errorCode} id={id} />
</EuiPageContent>
</EuiPageSection>
);
} else if (loadError) {
return (
Expand All @@ -154,14 +154,14 @@ export const WatchEditPage = ({

if (!watch) {
return (
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="subdued">
<EuiPageSection alignment="center" color="subdued">
<SectionLoading>
<FormattedMessage
id="xpack.watcher.sections.watchEdit.loadingWatchDescription"
defaultMessage="Loading watch…"
/>
</SectionLoading>
</EuiPageContent>
</EuiPageSection>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
EuiInMemoryTable,
EuiIcon,
EuiLink,
EuiPageContent_Deprecated as EuiPageContent,
EuiPageSection,
EuiSpacer,
EuiText,
EuiToolTip,
Expand Down Expand Up @@ -173,23 +173,23 @@ export const WatchListPage = () => {

if (isWatchesLoading) {
return (
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="subdued">
<EuiPageSection alignment="center" color="subdued">
<SectionLoading>
<FormattedMessage
id="xpack.watcher.sections.watchList.loadingWatchesDescription"
defaultMessage="Loading watches…"
/>
</SectionLoading>
</EuiPageContent>
</EuiPageSection>
);
}

const errorCode = getPageErrorCode(error);
if (errorCode) {
return (
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="danger">
<EuiPageSection alignment="center" color="danger">
<PageError errorCode={errorCode} />
</EuiPageContent>
</EuiPageSection>
);
} else if (error) {
return (
Expand Down Expand Up @@ -221,7 +221,7 @@ export const WatchListPage = () => {
);

return (
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="subdued">
<EuiPageSection alignment="center" color="subdued">
<EuiEmptyPrompt
iconType="managementApp"
title={
Expand All @@ -236,7 +236,7 @@ export const WatchListPage = () => {
actions={createWatchContextMenu}
data-test-subj="emptyPrompt"
/>
</EuiPageContent>
</EuiPageSection>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React, { useEffect, useState } from 'react';
import {
EuiPageContent_Deprecated as EuiPageContent,
EuiPageSection,
EuiSpacer,
EuiToolTip,
EuiBadge,
Expand Down Expand Up @@ -77,22 +77,22 @@ export const WatchStatusPage = ({

if (isWatchDetailLoading) {
return (
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="subdued">
<EuiPageSection alignment="center" color="subdued">
<SectionLoading>
<FormattedMessage
id="xpack.watcher.sections.watchStatus.loadingWatchDetailsDescription"
defaultMessage="Loading watch details…"
/>
</SectionLoading>
</EuiPageContent>
</EuiPageSection>
);
}

if (errorCode) {
return (
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="danger">
<EuiPageSection alignment="center" color="danger">
<PageError errorCode={errorCode} id={id} />
</EuiPageContent>
</EuiPageSection>
);
}

Expand Down