From cb54c985548cdf2f8a9fd53661727b213cba26a4 Mon Sep 17 00:00:00 2001 From: Cristina Amico Date: Mon, 24 Jul 2023 14:36:09 +0200 Subject: [PATCH] [Fleet] Remove usage of deprecated component EuiPageContent_Deprecated (#162390) Fixes https://github.com/elastic/kibana/issues/161418 ## Summary Removing usage of deprecated component `EuiPageContent_Deprecated` and replacing with `EuiPageSection`. Also removed two unused components. The two components look like this: Screenshot 2023-07-20 at 17 03 05 Screenshot 2023-07-24 at 11 02 57 To display them, I simply hardcoded `true` [here](https://github.com/elastic/kibana/blob/59450f0a22bb8c34598d7156dcbf144d41752259/x-pack/plugins/fleet/public/applications/fleet/sections/agents/index.tsx#L60) and [here](https://github.com/elastic/kibana/blob/59450f0a22bb8c34598d7156dcbf144d41752259/x-pack/plugins/fleet/public/applications/fleet/sections/agents/index.tsx#L66) --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../es_requirements_page.tsx | 20 +++++++++---- .../error_pages/components/no_data_layout.tsx | 15 ++++------ .../agents/error_pages/enforce_security.tsx | 28 ------------------ .../agents/error_pages/invalid_license.tsx | 29 ------------------- .../translations/translations/fr-FR.json | 4 --- .../translations/translations/ja-JP.json | 4 --- .../translations/translations/zh-CN.json | 4 --- 7 files changed, 19 insertions(+), 85 deletions(-) delete mode 100644 x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/enforce_security.tsx delete mode 100644 x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/invalid_license.tsx diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/es_requirements_page.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/es_requirements_page.tsx index 59f0df5045b3f..68f0205a40c7c 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/es_requirements_page.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/es_requirements_page.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPageBody, - EuiPageContent_Deprecated as EuiPageContent, + EuiPageSection, EuiText, EuiSpacer, EuiIcon, @@ -22,6 +22,8 @@ import { EuiLink, } from '@elastic/eui'; +import styled from 'styled-components'; + import { WithoutHeaderLayout } from '../../../layouts'; import type { GetFleetStatusResponse } from '../../../types'; import { useStartServices } from '../../../hooks'; @@ -48,15 +50,21 @@ export const RequirementItem: React.FunctionComponent<{ isMissing: boolean }> = ); }; +const borderColor = '#d3dae6'; + +const StyledPageBody = styled(EuiPageBody)` + border: 1px solid ${borderColor}; + border-radius: 5px; +`; + export const MissingESRequirementsPage: React.FunctionComponent<{ missingRequirements: GetFleetStatusResponse['missing_requirements']; }> = ({ missingRequirements }) => { const { docLinks } = useStartServices(); - return ( - - + + - - + + ); }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/components/no_data_layout.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/components/no_data_layout.tsx index 9d9703451dd7b..c37bce702e978 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/components/no_data_layout.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/components/no_data_layout.tsx @@ -5,36 +5,31 @@ * 2.0. */ -import { - EuiEmptyPrompt, - EuiFlexGroup, - EuiFlexItem, - EuiPageContent_Deprecated as EuiPageContent, -} from '@elastic/eui'; +import { EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem, EuiPageSection } from '@elastic/eui'; import React from 'react'; import { withRouter } from 'react-router-dom'; interface LayoutProps { title: string | React.ReactNode; actionSection?: React.ReactNode; - modalClosePath?: string; } export const NoDataLayout: React.FunctionComponent = withRouter< any, React.FunctionComponent ->(({ actionSection, title, modalClosePath, children }: React.PropsWithChildren) => { +>(({ actionSection, title, children }: React.PropsWithChildren) => { return ( - + {title}} body={children} actions={actionSection} /> - + ); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/enforce_security.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/enforce_security.tsx deleted file mode 100644 index 74475aca10d5d..0000000000000 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/enforce_security.tsx +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import { FormattedMessage, injectI18n } from '@kbn/i18n-react'; - -import { NoDataLayout } from './components/no_data_layout'; - -export const EnforceSecurityPage = injectI18n(({ intl }) => ( - -

- -

-
-)); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/invalid_license.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/invalid_license.tsx deleted file mode 100644 index 66f4d5fca19ca..0000000000000 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/invalid_license.tsx +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import { FormattedMessage, injectI18n } from '@kbn/i18n-react'; - -import { NoDataLayout } from './components/no_data_layout'; - -export const InvalidLicensePage = injectI18n(({ intl }) => ( - -

- -

-
-)); diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index cefb4ff467f55..a0aee9941fdb2 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -16371,8 +16371,6 @@ "xpack.fleet.deletePackagePolicy.failureSingleNotificationTitle": "Erreur lors de la suppression de l'intégration \"{id}\"", "xpack.fleet.deletePackagePolicy.fatalErrorNotificationTitle": "Erreur lors de la suppression de l'intégration", "xpack.fleet.deletePackagePolicy.successSingleNotificationTitle": "L'intégration \"{id}\" a été supprimée", - "xpack.fleet.disabledSecurityDescription": "Vous devez activer Security dans Kibana et Elasticsearch pour utiliser Elastic Fleet.", - "xpack.fleet.disabledSecurityTitle": "La fonctionnalité Security n'est pas activée", "xpack.fleet.editAgentPolicy.cancelButtonText": "Annuler", "xpack.fleet.editAgentPolicy.devtoolsRequestDescription": "Cette requête Kibana met à jour une politique d'agent.", "xpack.fleet.editAgentPolicy.errorNotificationTitle": "Impossible de mettre à jour la stratégie d'agent", @@ -16665,8 +16663,6 @@ "xpack.fleet.integrations.updatePackage.upgradePoliciesCheckboxLabel": "Mettre à niveau les stratégies d'intégration", "xpack.fleet.integrationsAppTitle": "Intégrations", "xpack.fleet.integrationsHeaderTitle": "Intégrations", - "xpack.fleet.invalidLicenseDescription": "Votre licence actuelle a expiré. Les agents Beats enregistrés continuent à fonctionner, mais vous avez besoin d'une licence valide pour accéder à l'interface d'Elastic Fleet.", - "xpack.fleet.invalidLicenseTitle": "Licence expirée", "xpack.fleet.multiRowInput.addAnotherUrl": "Ajouter une autre URL", "xpack.fleet.multiRowInput.addRow": "Ajouter une ligne", "xpack.fleet.multiRowInput.deleteButton": "Supprimer la ligne", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index d2dbfe186ec18..ef740e51567b1 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -16384,8 +16384,6 @@ "xpack.fleet.deletePackagePolicy.failureSingleNotificationTitle": "統合「{id}」の削除エラー", "xpack.fleet.deletePackagePolicy.fatalErrorNotificationTitle": "統合の削除エラー", "xpack.fleet.deletePackagePolicy.successSingleNotificationTitle": "統合「{id}」を削除しました", - "xpack.fleet.disabledSecurityDescription": "Elastic Fleet を使用するには、Kibana と Elasticsearch でセキュリティを有効にする必要があります。", - "xpack.fleet.disabledSecurityTitle": "セキュリティが有効ではありません", "xpack.fleet.editAgentPolicy.cancelButtonText": "キャンセル", "xpack.fleet.editAgentPolicy.devtoolsRequestDescription": "このKibanaリクエストにより、エージェントポリシーが更新されます。", "xpack.fleet.editAgentPolicy.errorNotificationTitle": "エージェントポリシーを更新できません", @@ -16678,8 +16676,6 @@ "xpack.fleet.integrations.updatePackage.upgradePoliciesCheckboxLabel": "統合ポリシーのアップグレード", "xpack.fleet.integrationsAppTitle": "統合", "xpack.fleet.integrationsHeaderTitle": "統合", - "xpack.fleet.invalidLicenseDescription": "現在のライセンスは期限切れです。登録されたビートエージェントは引き続き動作しますが、Elastic Fleetインターフェースにアクセスするには有効なライセンスが必要です。", - "xpack.fleet.invalidLicenseTitle": "ライセンスの期限切れ", "xpack.fleet.multiRowInput.addAnotherUrl": "別のURLを追加", "xpack.fleet.multiRowInput.addRow": "行の追加", "xpack.fleet.multiRowInput.deleteButton": "行の削除", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 48ee719357985..6144058cfd197 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -16384,8 +16384,6 @@ "xpack.fleet.deletePackagePolicy.failureSingleNotificationTitle": "删除集成“{id}”时出错", "xpack.fleet.deletePackagePolicy.fatalErrorNotificationTitle": "删除集成时出错", "xpack.fleet.deletePackagePolicy.successSingleNotificationTitle": "已删除集成“{id}”", - "xpack.fleet.disabledSecurityDescription": "必须在 Kibana 和 Elasticsearch 启用安全性,才能使用 Elastic Fleet。", - "xpack.fleet.disabledSecurityTitle": "安全性未启用", "xpack.fleet.editAgentPolicy.cancelButtonText": "取消", "xpack.fleet.editAgentPolicy.devtoolsRequestDescription": "此 Kibana 请求将更新代理策略。", "xpack.fleet.editAgentPolicy.errorNotificationTitle": "无法更新代理策略", @@ -16678,8 +16676,6 @@ "xpack.fleet.integrations.updatePackage.upgradePoliciesCheckboxLabel": "升级集成策略", "xpack.fleet.integrationsAppTitle": "集成", "xpack.fleet.integrationsHeaderTitle": "集成", - "xpack.fleet.invalidLicenseDescription": "您当前的许可证已过期。已注册 Beats 代理将继续工作,但您需要有效的许可证,才能访问 Elastic Fleet 界面。", - "xpack.fleet.invalidLicenseTitle": "已过期许可证", "xpack.fleet.multiRowInput.addAnotherUrl": "添加另一个 URL", "xpack.fleet.multiRowInput.addRow": "添加行", "xpack.fleet.multiRowInput.deleteButton": "删除行",