-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Changes from 5 commits
7733535
15a9c50
171a567
99fe00c
8bfe096
c298f66
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,13 +7,14 @@ | |
|
||
import React from 'react'; | ||
|
||
import { EuiEmptyPrompt } from '@elastic/eui'; | ||
import { EuiPageTemplate } from '@elastic/eui'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
|
||
export function PageErrorNotExist({ id }: { id?: string }) { | ||
return ( | ||
<EuiEmptyPrompt | ||
<EuiPageTemplate.EmptyPrompt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
iconType="warning" | ||
color="danger" | ||
title={ | ||
<h1> | ||
<FormattedMessage | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 { EuiLink, EuiPageTemplate } from '@elastic/eui'; | ||
import { LicenseManagementLocator } from '@kbn/license-management-plugin/public/locator'; | ||
|
||
export const LicensePrompt = ({ | ||
|
@@ -41,20 +41,19 @@ export const LicensePrompt = ({ | |
</> | ||
); | ||
return ( | ||
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="danger"> | ||
<EuiEmptyPrompt | ||
iconType="warning" | ||
title={ | ||
<h1> | ||
<FormattedMessage | ||
id="xpack.watcher.app.licenseErrorTitle" | ||
defaultMessage="License error" | ||
/> | ||
</h1> | ||
} | ||
body={promptBody} | ||
actions={[promptAction]} | ||
/> | ||
</EuiPageContent> | ||
<EuiPageTemplate.EmptyPrompt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
iconType="warning" | ||
color="danger" | ||
title={ | ||
<h1> | ||
<FormattedMessage | ||
id="xpack.watcher.app.licenseErrorTitle" | ||
defaultMessage="License error" | ||
/> | ||
</h1> | ||
} | ||
body={promptBody} | ||
actions={[promptAction]} | ||
/> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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'; | ||
|
@@ -94,7 +90,7 @@ export const JsonWatchEdit = ({ pageTitle }: { pageTitle: string }) => { | |
); | ||
|
||
return ( | ||
<EuiPageContentBody restrictWidth style={{ width: '100%' }}> | ||
<EuiPageSection restrictWidth style={{ width: '100%' }}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
<EuiPageHeader | ||
pageTitle={<span data-test-subj="pageTitle">{pageTitle}</span>} | ||
bottomBorder | ||
|
@@ -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 |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
|
||
import React, { useContext } from 'react'; | ||
|
||
import { EuiPageContent_Deprecated as EuiPageContent, EuiEmptyPrompt, EuiLink } from '@elastic/eui'; | ||
import { EuiLink, EuiPageTemplate } from '@elastic/eui'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import { reactRouterNavigate } from '@kbn/kibana-react-plugin/public'; | ||
import { WatchContext } from '../../watch_context'; | ||
|
@@ -28,20 +28,18 @@ export const MonitoringWatchEdit = ({ pageTitle }: { pageTitle: string }) => { | |
); | ||
|
||
return ( | ||
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="subdued"> | ||
<EuiEmptyPrompt | ||
iconType="" | ||
title={<h1>{pageTitle}</h1>} | ||
body={<p>{systemWatchMessage}</p>} | ||
actions={[ | ||
<EuiLink {...reactRouterNavigate(history, `/watches/watch/${watch.id}/status`)}> | ||
<FormattedMessage | ||
id="xpack.watcher.sections.watchEdit.monitoring.header.watchLinkTitle" | ||
defaultMessage="View watch status" | ||
/> | ||
</EuiLink>, | ||
]} | ||
/> | ||
</EuiPageContent> | ||
<EuiPageTemplate.EmptyPrompt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. didn't verify this visually since I'm not sure, monitoring watches are still in use. The code changes LGTM |
||
iconType="" | ||
title={<h1>{pageTitle}</h1>} | ||
body={<p>{systemWatchMessage}</p>} | ||
actions={[ | ||
<EuiLink {...reactRouterNavigate(history, `/watches/watch/${watch.id}/status`)}> | ||
<FormattedMessage | ||
id="xpack.watcher.sections.watchEdit.monitoring.header.watchLinkTitle" | ||
defaultMessage="View watch status" | ||
/> | ||
</EuiLink>, | ||
]} | ||
/> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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'; | ||
|
@@ -236,7 +236,7 @@ export const ThresholdWatchEdit = ({ pageTitle }: { pageTitle: string }) => { | |
}; | ||
|
||
return ( | ||
<EuiPageContentBody restrictWidth style={{ width: '100%' }}> | ||
<EuiPageSection restrictWidth style={{ width: '100%' }}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
<EuiPageHeader | ||
pageTitle={<span data-test-subj="pageTitle">{pageTitle}</span>} | ||
description={watch.titleDescription} | ||
|
@@ -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 |
---|---|---|
|
@@ -8,10 +8,10 @@ | |
import React, { useEffect, useReducer } from 'react'; | ||
import { isEqual } from 'lodash'; | ||
|
||
import { EuiPageContent_Deprecated as EuiPageContent } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
|
||
import { EuiPageTemplate } from '@elastic/eui'; | ||
import { WATCH_TYPES } from '../../../../common/constants'; | ||
import { BaseWatch } from '../../../../common/types/watch_types'; | ||
import { getPageErrorCode, PageError, SectionLoading } from '../../components'; | ||
|
@@ -133,11 +133,7 @@ export const WatchEditPage = ({ | |
|
||
const errorCode = getPageErrorCode(loadError); | ||
if (errorCode) { | ||
return ( | ||
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="danger"> | ||
<PageError errorCode={errorCode} id={id} /> | ||
</EuiPageContent> | ||
); | ||
return <PageError errorCode={errorCode} id={id} />; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} else if (loadError) { | ||
return ( | ||
<GenericPageError | ||
|
@@ -154,14 +150,14 @@ export const WatchEditPage = ({ | |
|
||
if (!watch) { | ||
return ( | ||
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="subdued"> | ||
<EuiPageTemplate.EmptyPrompt> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
<SectionLoading> | ||
<FormattedMessage | ||
id="xpack.watcher.sections.watchEdit.loadingWatchDescription" | ||
defaultMessage="Loading watch…" | ||
/> | ||
</SectionLoading> | ||
</EuiPageContent> | ||
</EuiPageTemplate.EmptyPrompt> | ||
); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified ✅