From af98aeb6d34c38b682ca369cd01940f603c20317 Mon Sep 17 00:00:00 2001
From: gitstart
Date: Thu, 3 Aug 2023 22:01:14 +0000
Subject: [PATCH 1/6] [Upgrade Assistant] Migrate all usages of
EuiPage*_Deprecated
Co-authored-by: LuisChiej <54555805+LuisChiej@users.noreply.github.com>
Co-authored-by: gitstart_bot
---
.../public/application/app.tsx | 40 +++++--------------
.../es_deprecation_logs.tsx | 6 +--
.../es_deprecations/es_deprecations.tsx | 16 +++-----
.../kibana_deprecations.tsx | 15 +++----
.../components/overview/overview.tsx | 6 +--
.../deprecations_page_loading_error.tsx | 11 ++---
6 files changed, 30 insertions(+), 64 deletions(-)
diff --git a/x-pack/plugins/upgrade_assistant/public/application/app.tsx b/x-pack/plugins/upgrade_assistant/public/application/app.tsx
index a61468e2e5ebe..60421acd718df 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/app.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/app.tsx
@@ -11,11 +11,7 @@ import { Redirect } from 'react-router-dom';
import { Router, Routes, Route } from '@kbn/shared-ux-router';
import { FormattedMessage } from '@kbn/i18n-react';
-import {
- EuiEmptyPrompt,
- EuiPageContent_Deprecated as EuiPageContent,
- EuiLoadingSpinner,
-} from '@elastic/eui';
+import { EuiEmptyPrompt, EuiPageSection, EuiLoadingSpinner } from '@elastic/eui';
import { ScopedHistory } from '@kbn/core/public';
import { API_BASE_PATH } from '../../common/constants';
@@ -52,9 +48,8 @@ const AppHandlingClusterUpgradeState: React.FunctionComponent = () => {
if (missingManageSpacesPrivilege) {
return (
-
@@ -72,19 +67,13 @@ const AppHandlingClusterUpgradeState: React.FunctionComponent = () => {
/>
}
/>
-
+
);
}
if (clusterUpgradeState === 'isUpgrading') {
return (
-
+
{
}
data-test-subj="emptyPrompt"
/>
-
+
);
}
if (clusterUpgradeState === 'isUpgradeComplete') {
return (
-
{
}
data-test-subj="emptyPrompt"
/>
-
+
);
}
@@ -171,14 +158,9 @@ export const App = ({ history }: { history: ScopedHistory }) => {
// Prevent flicker of the underlying UI while we wait for the status to fetch.
if (isLoading && isInitialRequest) {
return (
-
+
} />
-
+
);
}
diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/es_deprecation_logs.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/es_deprecation_logs.tsx
index e9025783a94d5..fedde5a0bdc6a 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/es_deprecation_logs.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/es_deprecation_logs.tsx
@@ -12,7 +12,7 @@ import {
EuiButtonEmpty,
EuiSpacer,
EuiPageBody,
- EuiPageContentBody_Deprecated as EuiPageContentBody,
+ EuiPageSection,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { METRIC_TYPE } from '@kbn/analytics';
@@ -40,7 +40,7 @@ export const EsDeprecationLogs: FunctionComponent = () => {
return (
-
+
{
-
+
);
};
diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/es_deprecations.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/es_deprecations.tsx
index 7674fab8be2d5..8ec33d4278813 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/es_deprecations.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/es_deprecations.tsx
@@ -8,13 +8,7 @@
import React, { useEffect, useMemo } from 'react';
import { withRouter, RouteComponentProps } from 'react-router-dom';
-import {
- EuiPageHeader,
- EuiSpacer,
- EuiPageContent_Deprecated as EuiPageContent,
- EuiLink,
- EuiCallOut,
-} from '@elastic/eui';
+import { EuiPageHeader, EuiSpacer, EuiPageSection, EuiLink, EuiCallOut } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { DocLinksStart } from '@kbn/core/public';
@@ -156,20 +150,20 @@ export const EsDeprecations = withRouter(({ history }: RouteComponentProps) => {
if (isLoading) {
return (
-
+
{i18nTexts.isLoading}
-
+
);
}
if (esDeprecations?.deprecations?.length === 0) {
return (
-
+
history.push('/overview')}
/>
-
+
);
}
diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/kibana_deprecations/kibana_deprecations.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/kibana_deprecations/kibana_deprecations.tsx
index b28fa1180bda9..766064edda561 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/components/kibana_deprecations/kibana_deprecations.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/components/kibana_deprecations/kibana_deprecations.tsx
@@ -8,12 +8,7 @@
import React, { useEffect, useState, useCallback, useMemo } from 'react';
import { v4 as uuidv4 } from 'uuid';
import { withRouter, RouteComponentProps } from 'react-router-dom';
-import {
- EuiPageContent_Deprecated as EuiPageContent,
- EuiPageHeader,
- EuiSpacer,
- EuiCallOut,
-} from '@elastic/eui';
+import { EuiPageSection, EuiPageHeader, EuiSpacer, EuiCallOut } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { METRIC_TYPE } from '@kbn/analytics';
@@ -235,20 +230,20 @@ export const KibanaDeprecations = withRouter(({ history }: RouteComponentProps)
if (isLoading) {
return (
-
+
{i18nTexts.isLoading}
-
+
);
}
if (kibanaDeprecations?.length === 0) {
return (
-
+
history.push('/overview')}
/>
-
+
);
}
diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/overview/overview.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/overview/overview.tsx
index 878f84864c302..cc28b2e152e23 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/components/overview/overview.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/components/overview/overview.tsx
@@ -15,7 +15,7 @@ import {
EuiSpacer,
EuiLink,
EuiPageBody,
- EuiPageContentBody_Deprecated as EuiPageContentBody,
+ EuiPageSection,
} from '@elastic/eui';
import type { EuiStepProps } from '@elastic/eui/src/components/steps/step';
@@ -69,7 +69,7 @@ export const Overview = withRouter(({ history }: RouteComponentProps) => {
return (
-
+
{
].filter(Boolean) as EuiStepProps[]
}
/>
-
+
);
});
diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/shared/deprecations_page_loading_error.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/shared/deprecations_page_loading_error.tsx
index 79556766c0dfe..68675838fdcca 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/components/shared/deprecations_page_loading_error.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/components/shared/deprecations_page_loading_error.tsx
@@ -6,7 +6,7 @@
*/
import React, { FunctionComponent } from 'react';
-import { EuiPageContent_Deprecated as EuiPageContent, EuiEmptyPrompt } from '@elastic/eui';
+import { EuiPageSection, EuiEmptyPrompt } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { DeprecationSource } from '../../../../common/types';
@@ -20,12 +20,7 @@ export const DeprecationsPageLoadingError: FunctionComponent = ({
deprecationSource,
message,
}) => (
-
+
= ({
}
body={message}
/>
-
+
);
From e5782c001a8f881dc727d259b1d71d118f861b2b Mon Sep 17 00:00:00 2001
From: gitstart
Date: Mon, 7 Aug 2023 22:09:48 +0000
Subject: [PATCH 2/6] [Upgrade Assistant] Migrate all usages of
EuiPage*_Deprecated
Co-authored-by: LuisChiej <54555805+LuisChiej@users.noreply.github.com>
Co-authored-by: gitstart_bot
---
.../public/application/app.tsx | 96 ++++++++-----------
.../es_deprecations/es_deprecations.tsx | 18 ++--
.../kibana_deprecations.tsx | 18 ++--
.../deprecations_page_loading_error.tsx | 28 +++---
.../components/shared/no_deprecations.tsx | 4 +-
5 files changed, 69 insertions(+), 95 deletions(-)
diff --git a/x-pack/plugins/upgrade_assistant/public/application/app.tsx b/x-pack/plugins/upgrade_assistant/public/application/app.tsx
index 60421acd718df..6de6328ae0755 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/app.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/app.tsx
@@ -11,7 +11,7 @@ import { Redirect } from 'react-router-dom';
import { Router, Routes, Route } from '@kbn/shared-ux-router';
import { FormattedMessage } from '@kbn/i18n-react';
-import { EuiEmptyPrompt, EuiPageSection, EuiLoadingSpinner } from '@elastic/eui';
+import { EuiPageSection, EuiLoadingSpinner, EuiPageTemplate } from '@elastic/eui';
import { ScopedHistory } from '@kbn/core/public';
import { API_BASE_PATH } from '../../common/constants';
@@ -73,60 +73,52 @@ const AppHandlingClusterUpgradeState: React.FunctionComponent = () => {
if (clusterUpgradeState === 'isUpgrading') {
return (
-
-
-
-
- }
- body={
-
-
+
+
+ }
+ body={
+
+
-
- }
- data-test-subj="emptyPrompt"
- />
-
+ />
+
+ }
+ data-test-subj="emptyPrompt"
+ />
);
}
if (clusterUpgradeState === 'isUpgradeComplete') {
return (
-
-
-
-
- }
- body={
-
-
-
- }
- data-test-subj="emptyPrompt"
- />
-
+
+
+
+ }
+ body={
+
+
+
+ }
+ data-test-subj="emptyPrompt"
+ />
);
}
@@ -157,11 +149,7 @@ export const App = ({ history }: { history: ScopedHistory }) => {
// Prevent flicker of the underlying UI while we wait for the status to fetch.
if (isLoading && isInitialRequest) {
- return (
-
- } />
-
- );
+ return } />;
}
return (
diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/es_deprecations.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/es_deprecations.tsx
index 8ec33d4278813..adb6feeba1cbf 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/es_deprecations.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/es_deprecations.tsx
@@ -8,7 +8,7 @@
import React, { useEffect, useMemo } from 'react';
import { withRouter, RouteComponentProps } from 'react-router-dom';
-import { EuiPageHeader, EuiSpacer, EuiPageSection, EuiLink, EuiCallOut } from '@elastic/eui';
+import { EuiPageHeader, EuiSpacer, EuiLink, EuiCallOut } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { DocLinksStart } from '@kbn/core/public';
@@ -149,21 +149,15 @@ export const EsDeprecations = withRouter(({ history }: RouteComponentProps) => {
}
if (isLoading) {
- return (
-
- {i18nTexts.isLoading}
-
- );
+ return {i18nTexts.isLoading};
}
if (esDeprecations?.deprecations?.length === 0) {
return (
-
- history.push('/overview')}
- />
-
+ history.push('/overview')}
+ />
);
}
diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/kibana_deprecations/kibana_deprecations.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/kibana_deprecations/kibana_deprecations.tsx
index 766064edda561..25e96108044c8 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/components/kibana_deprecations/kibana_deprecations.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/components/kibana_deprecations/kibana_deprecations.tsx
@@ -8,7 +8,7 @@
import React, { useEffect, useState, useCallback, useMemo } from 'react';
import { v4 as uuidv4 } from 'uuid';
import { withRouter, RouteComponentProps } from 'react-router-dom';
-import { EuiPageSection, EuiPageHeader, EuiSpacer, EuiCallOut } from '@elastic/eui';
+import { EuiPageHeader, EuiSpacer, EuiCallOut } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { METRIC_TYPE } from '@kbn/analytics';
@@ -229,21 +229,15 @@ export const KibanaDeprecations = withRouter(({ history }: RouteComponentProps)
}
if (isLoading) {
- return (
-
- {i18nTexts.isLoading}
-
- );
+ return {i18nTexts.isLoading};
}
if (kibanaDeprecations?.length === 0) {
return (
-
- history.push('/overview')}
- />
-
+ history.push('/overview')}
+ />
);
}
diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/shared/deprecations_page_loading_error.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/shared/deprecations_page_loading_error.tsx
index 68675838fdcca..053a26a315d8d 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/components/shared/deprecations_page_loading_error.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/components/shared/deprecations_page_loading_error.tsx
@@ -6,7 +6,7 @@
*/
import React, { FunctionComponent } from 'react';
-import { EuiPageSection, EuiEmptyPrompt } from '@elastic/eui';
+import { EuiPageTemplate } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { DeprecationSource } from '../../../../common/types';
@@ -20,18 +20,16 @@ export const DeprecationsPageLoadingError: FunctionComponent = ({
deprecationSource,
message,
}) => (
-
-
- {i18n.translate('xpack.upgradeAssistant.deprecationsPageLoadingError.title', {
- defaultMessage: 'Could not retrieve {deprecationSource} deprecation issues',
- values: { deprecationSource },
- })}
-
- }
- body={message}
- />
-
+
+ {i18n.translate('xpack.upgradeAssistant.deprecationsPageLoadingError.title', {
+ defaultMessage: 'Could not retrieve {deprecationSource} deprecation issues',
+ values: { deprecationSource },
+ })}
+
+ }
+ body={message}
+ />
);
diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/shared/no_deprecations.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/shared/no_deprecations.tsx
index 6e06ffe03f904..dda89bfd45f1a 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/components/shared/no_deprecations.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/components/shared/no_deprecations.tsx
@@ -7,7 +7,7 @@
import React, { FunctionComponent } from 'react';
-import { EuiLink, EuiEmptyPrompt } from '@elastic/eui';
+import { EuiLink, EuiPageTemplate } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
@@ -46,7 +46,7 @@ export const NoDeprecationsPrompt: FunctionComponent = ({
navigateToOverviewPage,
}) => {
return (
- {i18nTexts.getEmptyPromptTitle(deprecationType)}}
From c93eb6e33aa8fdc21711d6d69b741be5f0fbc76a Mon Sep 17 00:00:00 2001
From: gitstart
Date: Wed, 16 Aug 2023 05:26:06 +0000
Subject: [PATCH 3/6] chore: remove redundant PageSection
Co-authored-by: LuisChiej <54555805+LuisChiej@users.noreply.github.com>
Co-authored-by: gitstart_bot
---
.../public/application/app.tsx | 36 ++++++++-----------
1 file changed, 15 insertions(+), 21 deletions(-)
diff --git a/x-pack/plugins/upgrade_assistant/public/application/app.tsx b/x-pack/plugins/upgrade_assistant/public/application/app.tsx
index 6de6328ae0755..60be5129768e2 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/app.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/app.tsx
@@ -11,7 +11,7 @@ import { Redirect } from 'react-router-dom';
import { Router, Routes, Route } from '@kbn/shared-ux-router';
import { FormattedMessage } from '@kbn/i18n-react';
-import { EuiPageSection, EuiLoadingSpinner, EuiPageTemplate } from '@elastic/eui';
+import { EuiLoadingSpinner, EuiPageTemplate } from '@elastic/eui';
import { ScopedHistory } from '@kbn/core/public';
import { API_BASE_PATH } from '../../common/constants';
@@ -48,26 +48,20 @@ const AppHandlingClusterUpgradeState: React.FunctionComponent = () => {
if (missingManageSpacesPrivilege) {
return (
-
-
- }
- message={
-
- }
- />
-
+
+ }
+ message={
+
+ }
+ />
);
}
From 022cc26216f038856f89ad0c6b46e22fcbc426a8 Mon Sep 17 00:00:00 2001
From: gitstart
Date: Thu, 17 Aug 2023 10:27:41 +0000
Subject: [PATCH 4/6] [Upgrade Assistant] Migrate all usages of
EuiPage*_Deprecated
Co-authored-by: LuisChiej <54555805+LuisChiej@users.noreply.github.com>
Co-authored-by: gitstart_bot
---
.../components/shared/deprecations_page_loading_error.tsx | 1 +
1 file changed, 1 insertion(+)
diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/shared/deprecations_page_loading_error.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/shared/deprecations_page_loading_error.tsx
index 053a26a315d8d..ed6b99205e428 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/components/shared/deprecations_page_loading_error.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/components/shared/deprecations_page_loading_error.tsx
@@ -21,6 +21,7 @@ export const DeprecationsPageLoadingError: FunctionComponent = ({
message,
}) => (
From c2ab78fa9228ed23e4e0dd4c04b400475f3dd9f4 Mon Sep 17 00:00:00 2001
From: gitstart
Date: Fri, 18 Aug 2023 08:55:13 +0000
Subject: [PATCH 5/6] fix: added data-test-subj to fix failing tests
Co-authored-by: LuisChiej <54555805+LuisChiej@users.noreply.github.com>
Co-authored-by: gitstart_bot
---
.../components/not_authorized_section.tsx | 12 +++++++++---
.../upgrade_assistant/public/application/app.tsx | 5 +++--
.../shared/deprecations_page_loading_error.tsx | 1 +
3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/src/plugins/es_ui_shared/__packages_do_not_import__/authorization/components/not_authorized_section.tsx b/src/plugins/es_ui_shared/__packages_do_not_import__/authorization/components/not_authorized_section.tsx
index da3454b5faa3f..0a81102d6a515 100644
--- a/src/plugins/es_ui_shared/__packages_do_not_import__/authorization/components/not_authorized_section.tsx
+++ b/src/plugins/es_ui_shared/__packages_do_not_import__/authorization/components/not_authorized_section.tsx
@@ -7,13 +7,19 @@
*/
import React from 'react';
-import { EuiEmptyPrompt } from '@elastic/eui';
+import { EuiPageTemplate } from '@elastic/eui';
interface Props {
title: React.ReactNode;
message: React.ReactNode | string;
+ dataTestSubj?: string;
}
-export const NotAuthorizedSection = ({ title, message }: Props) => (
- {title}} body={{message}
} />
+export const NotAuthorizedSection = ({ title, message, dataTestSubj }: Props) => (
+ {title}}
+ body={{message}
}
+ />
);
diff --git a/x-pack/plugins/upgrade_assistant/public/application/app.tsx b/x-pack/plugins/upgrade_assistant/public/application/app.tsx
index 60be5129768e2..90de3755c0d76 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/app.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/app.tsx
@@ -49,6 +49,7 @@ const AppHandlingClusterUpgradeState: React.FunctionComponent = () => {
if (missingManageSpacesPrivilege) {
return (
{
/>
}
- data-test-subj="emptyPrompt"
+ data-test-subj="isUpgradingMessage"
/>
);
}
@@ -111,7 +112,7 @@ const AppHandlingClusterUpgradeState: React.FunctionComponent = () => {
/>
}
- data-test-subj="emptyPrompt"
+ data-test-subj="isUpgradeCompleteMessage"
/>
);
}
diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/shared/deprecations_page_loading_error.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/shared/deprecations_page_loading_error.tsx
index ed6b99205e428..171dc50bcb6b8 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/components/shared/deprecations_page_loading_error.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/components/shared/deprecations_page_loading_error.tsx
@@ -23,6 +23,7 @@ export const DeprecationsPageLoadingError: FunctionComponent = ({
{i18n.translate('xpack.upgradeAssistant.deprecationsPageLoadingError.title', {
From e257e68ae79299a9650d05a3ee9c949e1e463882 Mon Sep 17 00:00:00 2001
From: Alison Goryachev
Date: Mon, 21 Aug 2023 12:10:53 -0400
Subject: [PATCH 6/6] revert migration changes to not_authorized_section
---
.../authorization/components/not_authorized_section.tsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/plugins/es_ui_shared/__packages_do_not_import__/authorization/components/not_authorized_section.tsx b/src/plugins/es_ui_shared/__packages_do_not_import__/authorization/components/not_authorized_section.tsx
index 0a81102d6a515..f896826eca6d5 100644
--- a/src/plugins/es_ui_shared/__packages_do_not_import__/authorization/components/not_authorized_section.tsx
+++ b/src/plugins/es_ui_shared/__packages_do_not_import__/authorization/components/not_authorized_section.tsx
@@ -7,7 +7,7 @@
*/
import React from 'react';
-import { EuiPageTemplate } from '@elastic/eui';
+import { EuiEmptyPrompt } from '@elastic/eui';
interface Props {
title: React.ReactNode;
@@ -16,7 +16,7 @@ interface Props {
}
export const NotAuthorizedSection = ({ title, message, dataTestSubj }: Props) => (
- {title}}