Skip to content

Commit

Permalink
[Fleet] Remove usage of deprecated component EuiPageContent_Deprecated (
Browse files Browse the repository at this point in the history
#162390)

Fixes #161418

## Summary
Removing usage of deprecated component `EuiPageContent_Deprecated` and
replacing with `EuiPageSection`.

Also removed two unused components.

The two components look like this:

<img width="1001" alt="Screenshot 2023-07-20 at 17 03 05"
src="https://github.com/elastic/kibana/assets/16084106/82798d53-30ae-455b-b0fc-216461f8d1b8">

<img width="1683" alt="Screenshot 2023-07-24 at 11 02 57"
src="https://github.com/elastic/kibana/assets/16084106/f6ca00a5-49b3-481e-9152-d1f2a77d4495">


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 <[email protected]>
  • Loading branch information
criamico and kibanamachine authored Jul 24, 2023
1 parent 8fcd199 commit cb54c98
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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';
Expand All @@ -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 (
<WithoutHeaderLayout>
<EuiPageBody restrictWidth={820}>
<EuiPageContent hasBorder={true} hasShadow={false}>
<StyledPageBody restrictWidth={820}>
<EuiPageSection color="transparent">
<EuiCallOut
title={i18n.translate('xpack.fleet.setupPage.missingRequirementsCalloutTitle', {
defaultMessage: 'Missing security requirements',
Expand Down Expand Up @@ -141,8 +149,8 @@ xpack.security.authc.api_key.enabled: true`}
),
}}
/>
</EuiPageContent>
</EuiPageBody>
</EuiPageSection>
</StyledPageBody>
</WithoutHeaderLayout>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -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<LayoutProps> = withRouter<
any,
React.FunctionComponent<LayoutProps>
>(({ actionSection, title, modalClosePath, children }: React.PropsWithChildren<LayoutProps>) => {
>(({ actionSection, title, children }: React.PropsWithChildren<LayoutProps>) => {
return (
<EuiFlexGroup justifyContent="spaceAround">
<EuiFlexItem grow={false}>
<EuiPageContent>
<EuiPageSection color="transparent">
<EuiEmptyPrompt
color="plain"
iconType="logoBeats"
title={<h2>{title}</h2>}
body={children}
actions={actionSection}
/>
</EuiPageContent>
</EuiPageSection>
</EuiFlexItem>
</EuiFlexGroup>
);
Expand Down

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions x-pack/plugins/translations/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 0 additions & 4 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "エージェントポリシーを更新できません",
Expand Down Expand Up @@ -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": "行の削除",
Expand Down
4 changes: 0 additions & 4 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "无法更新代理策略",
Expand Down Expand Up @@ -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": "删除行",
Expand Down

0 comments on commit cb54c98

Please sign in to comment.