mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
[Upgrade Assistant] Migrate all usages of EuiPage*_Deprecated (#163127)
This commit is contained in:
parent
9c17de6bdb
commit
b5af8c880e
8 changed files with 97 additions and 154 deletions
|
@ -12,8 +12,14 @@ import { EuiEmptyPrompt } from '@elastic/eui';
|
||||||
interface Props {
|
interface Props {
|
||||||
title: React.ReactNode;
|
title: React.ReactNode;
|
||||||
message: React.ReactNode | string;
|
message: React.ReactNode | string;
|
||||||
|
dataTestSubj?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NotAuthorizedSection = ({ title, message }: Props) => (
|
export const NotAuthorizedSection = ({ title, message, dataTestSubj }: Props) => (
|
||||||
<EuiEmptyPrompt iconType="securityApp" title={<h2>{title}</h2>} body={<p>{message}</p>} />
|
<EuiEmptyPrompt
|
||||||
|
iconType="securityApp"
|
||||||
|
data-test-subj={dataTestSubj ? dataTestSubj : 'notAuthorizedSection'}
|
||||||
|
title={<h2>{title}</h2>}
|
||||||
|
body={<p>{message}</p>}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
|
|
|
@ -11,11 +11,7 @@ import { Redirect } from 'react-router-dom';
|
||||||
import { Router, Routes, Route } from '@kbn/shared-ux-router';
|
import { Router, Routes, Route } from '@kbn/shared-ux-router';
|
||||||
|
|
||||||
import { FormattedMessage } from '@kbn/i18n-react';
|
import { FormattedMessage } from '@kbn/i18n-react';
|
||||||
import {
|
import { EuiLoadingSpinner, EuiPageTemplate } from '@elastic/eui';
|
||||||
EuiEmptyPrompt,
|
|
||||||
EuiPageContent_Deprecated as EuiPageContent,
|
|
||||||
EuiLoadingSpinner,
|
|
||||||
} from '@elastic/eui';
|
|
||||||
import { ScopedHistory } from '@kbn/core/public';
|
import { ScopedHistory } from '@kbn/core/public';
|
||||||
|
|
||||||
import { API_BASE_PATH } from '../../common/constants';
|
import { API_BASE_PATH } from '../../common/constants';
|
||||||
|
@ -52,94 +48,72 @@ const AppHandlingClusterUpgradeState: React.FunctionComponent = () => {
|
||||||
|
|
||||||
if (missingManageSpacesPrivilege) {
|
if (missingManageSpacesPrivilege) {
|
||||||
return (
|
return (
|
||||||
<EuiPageContent
|
<NotAuthorizedSection
|
||||||
verticalPosition="center"
|
dataTestSubj="missingKibanaPrivilegesMessage"
|
||||||
horizontalPosition="center"
|
title={
|
||||||
color="subdued"
|
<FormattedMessage
|
||||||
data-test-subj="missingKibanaPrivilegesMessage"
|
id="xpack.upgradeAssistant.app.deniedPrivilegeTitle"
|
||||||
>
|
defaultMessage="Kibana admin role required"
|
||||||
<NotAuthorizedSection
|
/>
|
||||||
title={
|
}
|
||||||
<FormattedMessage
|
message={
|
||||||
id="xpack.upgradeAssistant.app.deniedPrivilegeTitle"
|
<FormattedMessage
|
||||||
defaultMessage="Kibana admin role required"
|
id="xpack.upgradeAssistant.app.deniedPrivilegeDescription"
|
||||||
/>
|
defaultMessage="To use Upgrade Assistant and resolve deprecation issues, you must have access to manage all Kibana spaces."
|
||||||
}
|
/>
|
||||||
message={
|
}
|
||||||
<FormattedMessage
|
/>
|
||||||
id="xpack.upgradeAssistant.app.deniedPrivilegeDescription"
|
|
||||||
defaultMessage="To use Upgrade Assistant and resolve deprecation issues, you must have access to manage all Kibana spaces."
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</EuiPageContent>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clusterUpgradeState === 'isUpgrading') {
|
if (clusterUpgradeState === 'isUpgrading') {
|
||||||
return (
|
return (
|
||||||
<EuiPageContent
|
<EuiPageTemplate.EmptyPrompt
|
||||||
hasShadow={false}
|
iconType="logoElasticsearch"
|
||||||
paddingSize="none"
|
title={
|
||||||
verticalPosition="center"
|
<h1>
|
||||||
horizontalPosition="center"
|
<FormattedMessage
|
||||||
data-test-subj="isUpgradingMessage"
|
id="xpack.upgradeAssistant.upgradingTitle"
|
||||||
>
|
defaultMessage="Your cluster is upgrading"
|
||||||
<EuiEmptyPrompt
|
/>
|
||||||
iconType="logoElasticsearch"
|
</h1>
|
||||||
title={
|
}
|
||||||
<h1>
|
body={
|
||||||
<FormattedMessage
|
<p>
|
||||||
id="xpack.upgradeAssistant.upgradingTitle"
|
<FormattedMessage
|
||||||
defaultMessage="Your cluster is upgrading"
|
id="xpack.upgradeAssistant.upgradingDescription"
|
||||||
/>
|
defaultMessage="One or more Elasticsearch nodes have a newer version of
|
||||||
</h1>
|
|
||||||
}
|
|
||||||
body={
|
|
||||||
<p>
|
|
||||||
<FormattedMessage
|
|
||||||
id="xpack.upgradeAssistant.upgradingDescription"
|
|
||||||
defaultMessage="One or more Elasticsearch nodes have a newer version of
|
|
||||||
Elasticsearch than Kibana. Once all your nodes are upgraded, upgrade Kibana."
|
Elasticsearch than Kibana. Once all your nodes are upgraded, upgrade Kibana."
|
||||||
/>
|
/>
|
||||||
</p>
|
</p>
|
||||||
}
|
}
|
||||||
data-test-subj="emptyPrompt"
|
data-test-subj="isUpgradingMessage"
|
||||||
/>
|
/>
|
||||||
</EuiPageContent>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clusterUpgradeState === 'isUpgradeComplete') {
|
if (clusterUpgradeState === 'isUpgradeComplete') {
|
||||||
return (
|
return (
|
||||||
<EuiPageContent
|
<EuiPageTemplate.EmptyPrompt
|
||||||
hasShadow={false}
|
iconType="logoElasticsearch"
|
||||||
paddingSize="none"
|
title={
|
||||||
verticalPosition="center"
|
<h1>
|
||||||
horizontalPosition="center"
|
<FormattedMessage
|
||||||
|
id="xpack.upgradeAssistant.upgradedTitle"
|
||||||
|
defaultMessage="Your cluster has been upgraded"
|
||||||
|
/>
|
||||||
|
</h1>
|
||||||
|
}
|
||||||
|
body={
|
||||||
|
<p>
|
||||||
|
<FormattedMessage
|
||||||
|
id="xpack.upgradeAssistant.upgradedDescription"
|
||||||
|
defaultMessage="All Elasticsearch nodes have been upgraded. You may now upgrade Kibana."
|
||||||
|
/>
|
||||||
|
</p>
|
||||||
|
}
|
||||||
data-test-subj="isUpgradeCompleteMessage"
|
data-test-subj="isUpgradeCompleteMessage"
|
||||||
>
|
/>
|
||||||
<EuiEmptyPrompt
|
|
||||||
iconType="logoElasticsearch"
|
|
||||||
title={
|
|
||||||
<h1>
|
|
||||||
<FormattedMessage
|
|
||||||
id="xpack.upgradeAssistant.upgradedTitle"
|
|
||||||
defaultMessage="Your cluster has been upgraded"
|
|
||||||
/>
|
|
||||||
</h1>
|
|
||||||
}
|
|
||||||
body={
|
|
||||||
<p>
|
|
||||||
<FormattedMessage
|
|
||||||
id="xpack.upgradeAssistant.upgradedDescription"
|
|
||||||
defaultMessage="All Elasticsearch nodes have been upgraded. You may now upgrade Kibana."
|
|
||||||
/>
|
|
||||||
</p>
|
|
||||||
}
|
|
||||||
data-test-subj="emptyPrompt"
|
|
||||||
/>
|
|
||||||
</EuiPageContent>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,16 +144,7 @@ export const App = ({ history }: { history: ScopedHistory }) => {
|
||||||
|
|
||||||
// Prevent flicker of the underlying UI while we wait for the status to fetch.
|
// Prevent flicker of the underlying UI while we wait for the status to fetch.
|
||||||
if (isLoading && isInitialRequest) {
|
if (isLoading && isInitialRequest) {
|
||||||
return (
|
return <EuiPageTemplate.EmptyPrompt body={<EuiLoadingSpinner size="l" />} />;
|
||||||
<EuiPageContent
|
|
||||||
hasShadow={false}
|
|
||||||
paddingSize="none"
|
|
||||||
verticalPosition="center"
|
|
||||||
horizontalPosition="center"
|
|
||||||
>
|
|
||||||
<EuiEmptyPrompt body={<EuiLoadingSpinner size="l" />} />
|
|
||||||
</EuiPageContent>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -12,7 +12,7 @@ import {
|
||||||
EuiButtonEmpty,
|
EuiButtonEmpty,
|
||||||
EuiSpacer,
|
EuiSpacer,
|
||||||
EuiPageBody,
|
EuiPageBody,
|
||||||
EuiPageContentBody_Deprecated as EuiPageContentBody,
|
EuiPageSection,
|
||||||
} from '@elastic/eui';
|
} from '@elastic/eui';
|
||||||
import { i18n } from '@kbn/i18n';
|
import { i18n } from '@kbn/i18n';
|
||||||
import { METRIC_TYPE } from '@kbn/analytics';
|
import { METRIC_TYPE } from '@kbn/analytics';
|
||||||
|
@ -40,7 +40,7 @@ export const EsDeprecationLogs: FunctionComponent = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<EuiPageBody restrictWidth={true} data-test-subj="esDeprecationLogs">
|
<EuiPageBody restrictWidth={true} data-test-subj="esDeprecationLogs">
|
||||||
<EuiPageContentBody color="transparent" paddingSize="none">
|
<EuiPageSection color="transparent" paddingSize="none">
|
||||||
<EuiPageHeader
|
<EuiPageHeader
|
||||||
bottomBorder
|
bottomBorder
|
||||||
pageTitle={i18n.translate('xpack.upgradeAssistant.esDeprecationLogs.pageTitle', {
|
pageTitle={i18n.translate('xpack.upgradeAssistant.esDeprecationLogs.pageTitle', {
|
||||||
|
@ -68,7 +68,7 @@ export const EsDeprecationLogs: FunctionComponent = () => {
|
||||||
<EuiSpacer size="l" />
|
<EuiSpacer size="l" />
|
||||||
|
|
||||||
<FixDeprecationLogs />
|
<FixDeprecationLogs />
|
||||||
</EuiPageContentBody>
|
</EuiPageSection>
|
||||||
</EuiPageBody>
|
</EuiPageBody>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,13 +8,7 @@
|
||||||
import React, { useEffect, useMemo } from 'react';
|
import React, { useEffect, useMemo } from 'react';
|
||||||
import { withRouter, RouteComponentProps } from 'react-router-dom';
|
import { withRouter, RouteComponentProps } from 'react-router-dom';
|
||||||
|
|
||||||
import {
|
import { EuiPageHeader, EuiSpacer, EuiLink, EuiCallOut } from '@elastic/eui';
|
||||||
EuiPageHeader,
|
|
||||||
EuiSpacer,
|
|
||||||
EuiPageContent_Deprecated as EuiPageContent,
|
|
||||||
EuiLink,
|
|
||||||
EuiCallOut,
|
|
||||||
} from '@elastic/eui';
|
|
||||||
import { i18n } from '@kbn/i18n';
|
import { i18n } from '@kbn/i18n';
|
||||||
import { FormattedMessage } from '@kbn/i18n-react';
|
import { FormattedMessage } from '@kbn/i18n-react';
|
||||||
import { DocLinksStart } from '@kbn/core/public';
|
import { DocLinksStart } from '@kbn/core/public';
|
||||||
|
@ -155,21 +149,15 @@ export const EsDeprecations = withRouter(({ history }: RouteComponentProps) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return (
|
return <SectionLoading>{i18nTexts.isLoading}</SectionLoading>;
|
||||||
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="subdued">
|
|
||||||
<SectionLoading>{i18nTexts.isLoading}</SectionLoading>
|
|
||||||
</EuiPageContent>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (esDeprecations?.deprecations?.length === 0) {
|
if (esDeprecations?.deprecations?.length === 0) {
|
||||||
return (
|
return (
|
||||||
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="subdued">
|
<NoDeprecationsPrompt
|
||||||
<NoDeprecationsPrompt
|
deprecationType="Elasticsearch"
|
||||||
deprecationType="Elasticsearch"
|
navigateToOverviewPage={() => history.push('/overview')}
|
||||||
navigateToOverviewPage={() => history.push('/overview')}
|
/>
|
||||||
/>
|
|
||||||
</EuiPageContent>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,12 +8,7 @@
|
||||||
import React, { useEffect, useState, useCallback, useMemo } from 'react';
|
import React, { useEffect, useState, useCallback, useMemo } from 'react';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
import { withRouter, RouteComponentProps } from 'react-router-dom';
|
import { withRouter, RouteComponentProps } from 'react-router-dom';
|
||||||
import {
|
import { EuiPageHeader, EuiSpacer, EuiCallOut } from '@elastic/eui';
|
||||||
EuiPageContent_Deprecated as EuiPageContent,
|
|
||||||
EuiPageHeader,
|
|
||||||
EuiSpacer,
|
|
||||||
EuiCallOut,
|
|
||||||
} from '@elastic/eui';
|
|
||||||
import { i18n } from '@kbn/i18n';
|
import { i18n } from '@kbn/i18n';
|
||||||
import { METRIC_TYPE } from '@kbn/analytics';
|
import { METRIC_TYPE } from '@kbn/analytics';
|
||||||
|
|
||||||
|
@ -234,21 +229,15 @@ export const KibanaDeprecations = withRouter(({ history }: RouteComponentProps)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return (
|
return <SectionLoading>{i18nTexts.isLoading}</SectionLoading>;
|
||||||
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="subdued">
|
|
||||||
<SectionLoading>{i18nTexts.isLoading}</SectionLoading>
|
|
||||||
</EuiPageContent>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kibanaDeprecations?.length === 0) {
|
if (kibanaDeprecations?.length === 0) {
|
||||||
return (
|
return (
|
||||||
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="subdued">
|
<NoDeprecationsPrompt
|
||||||
<NoDeprecationsPrompt
|
deprecationType={i18nTexts.deprecationLabel}
|
||||||
deprecationType={i18nTexts.deprecationLabel}
|
navigateToOverviewPage={() => history.push('/overview')}
|
||||||
navigateToOverviewPage={() => history.push('/overview')}
|
/>
|
||||||
/>
|
|
||||||
</EuiPageContent>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ import {
|
||||||
EuiSpacer,
|
EuiSpacer,
|
||||||
EuiLink,
|
EuiLink,
|
||||||
EuiPageBody,
|
EuiPageBody,
|
||||||
EuiPageContentBody_Deprecated as EuiPageContentBody,
|
EuiPageSection,
|
||||||
} from '@elastic/eui';
|
} from '@elastic/eui';
|
||||||
import type { EuiStepProps } from '@elastic/eui/src/components/steps/step';
|
import type { EuiStepProps } from '@elastic/eui/src/components/steps/step';
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ export const Overview = withRouter(({ history }: RouteComponentProps) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<EuiPageBody restrictWidth={true} data-test-subj="overview">
|
<EuiPageBody restrictWidth={true} data-test-subj="overview">
|
||||||
<EuiPageContentBody color="transparent" paddingSize="none">
|
<EuiPageSection color="transparent" paddingSize="none">
|
||||||
<EuiPageHeader
|
<EuiPageHeader
|
||||||
bottomBorder
|
bottomBorder
|
||||||
pageTitle={i18n.translate('xpack.upgradeAssistant.overview.pageTitle', {
|
pageTitle={i18n.translate('xpack.upgradeAssistant.overview.pageTitle', {
|
||||||
|
@ -135,7 +135,7 @@ export const Overview = withRouter(({ history }: RouteComponentProps) => {
|
||||||
].filter(Boolean) as EuiStepProps[]
|
].filter(Boolean) as EuiStepProps[]
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</EuiPageContentBody>
|
</EuiPageSection>
|
||||||
</EuiPageBody>
|
</EuiPageBody>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { FunctionComponent } from 'react';
|
import React, { FunctionComponent } from 'react';
|
||||||
import { EuiPageContent_Deprecated as EuiPageContent, EuiEmptyPrompt } from '@elastic/eui';
|
import { EuiPageTemplate } from '@elastic/eui';
|
||||||
import { i18n } from '@kbn/i18n';
|
import { i18n } from '@kbn/i18n';
|
||||||
|
|
||||||
import { DeprecationSource } from '../../../../common/types';
|
import { DeprecationSource } from '../../../../common/types';
|
||||||
|
@ -20,23 +20,18 @@ export const DeprecationsPageLoadingError: FunctionComponent<Props> = ({
|
||||||
deprecationSource,
|
deprecationSource,
|
||||||
message,
|
message,
|
||||||
}) => (
|
}) => (
|
||||||
<EuiPageContent
|
<EuiPageTemplate.EmptyPrompt
|
||||||
verticalPosition="center"
|
|
||||||
horizontalPosition="center"
|
|
||||||
color="danger"
|
color="danger"
|
||||||
|
iconType="warning"
|
||||||
data-test-subj="deprecationsPageLoadingError"
|
data-test-subj="deprecationsPageLoadingError"
|
||||||
>
|
title={
|
||||||
<EuiEmptyPrompt
|
<h2>
|
||||||
iconType="warning"
|
{i18n.translate('xpack.upgradeAssistant.deprecationsPageLoadingError.title', {
|
||||||
title={
|
defaultMessage: 'Could not retrieve {deprecationSource} deprecation issues',
|
||||||
<h2>
|
values: { deprecationSource },
|
||||||
{i18n.translate('xpack.upgradeAssistant.deprecationsPageLoadingError.title', {
|
})}
|
||||||
defaultMessage: 'Could not retrieve {deprecationSource} deprecation issues',
|
</h2>
|
||||||
values: { deprecationSource },
|
}
|
||||||
})}
|
body={message}
|
||||||
</h2>
|
/>
|
||||||
}
|
|
||||||
body={message}
|
|
||||||
/>
|
|
||||||
</EuiPageContent>
|
|
||||||
);
|
);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
import React, { FunctionComponent } from 'react';
|
import React, { FunctionComponent } from 'react';
|
||||||
|
|
||||||
import { EuiLink, EuiEmptyPrompt } from '@elastic/eui';
|
import { EuiLink, EuiPageTemplate } from '@elastic/eui';
|
||||||
import { i18n } from '@kbn/i18n';
|
import { i18n } from '@kbn/i18n';
|
||||||
import { FormattedMessage } from '@kbn/i18n-react';
|
import { FormattedMessage } from '@kbn/i18n-react';
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ export const NoDeprecationsPrompt: FunctionComponent<Props> = ({
|
||||||
navigateToOverviewPage,
|
navigateToOverviewPage,
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<EuiEmptyPrompt
|
<EuiPageTemplate.EmptyPrompt
|
||||||
iconType="check"
|
iconType="check"
|
||||||
data-test-subj="noDeprecationsPrompt"
|
data-test-subj="noDeprecationsPrompt"
|
||||||
title={<h2>{i18nTexts.getEmptyPromptTitle(deprecationType)}</h2>}
|
title={<h2>{i18nTexts.getEmptyPromptTitle(deprecationType)}</h2>}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue