From 1ab6a4cb26f09d441a5954e0ef5ec2f4c88fe826 Mon Sep 17 00:00:00 2001 From: GitStart <1501599+gitstart@users.noreply.github.com> Date: Thu, 17 Aug 2023 18:40:18 +0100 Subject: [PATCH] [CCR] Migrate all usages of EuiPage*_Deprecated (#163135) --- .../auto_follow_pattern_add.test.js | 4 +- .../follower_index_add.test.js | 4 +- .../public/app/app.tsx | 66 +++++++-------- .../auto_follow_pattern_add.js | 28 ++----- .../auto_follow_pattern_edit.js | 72 +++++++--------- .../follower_index_add/follower_index_add.js | 28 ++----- .../follower_index_edit.js | 71 +++++++--------- .../auto_follow_pattern_list.js | 83 ++++++++----------- .../follower_indices_list.js | 81 ++++++++---------- 9 files changed, 183 insertions(+), 254 deletions(-) diff --git a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/auto_follow_pattern_add.test.js b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/auto_follow_pattern_add.test.js index 7dee4fcac57f4..b2e04650f19af 100644 --- a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/auto_follow_pattern_add.test.js +++ b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/auto_follow_pattern_add.test.js @@ -31,8 +31,8 @@ describe('Create Auto-follow pattern', () => { }); test('should display a "loading remote clusters" indicator', () => { - expect(exists('remoteClustersLoading')).toBe(true); - expect(find('remoteClustersLoading').text()).toBe('Loading remote clusters…'); + expect(exists('sectionLoading')).toBe(true); + expect(find('sectionLoading').text()).toBe('Loading remote clusters…'); }); }); diff --git a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/follower_index_add.test.js b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/follower_index_add.test.js index b8566af668230..15aec9b1ececc 100644 --- a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/follower_index_add.test.js +++ b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/follower_index_add.test.js @@ -37,8 +37,8 @@ describe('Create Follower index', () => { }); test('should display a "loading remote clusters" indicator', () => { - expect(exists('remoteClustersLoading')).toBe(true); - expect(find('remoteClustersLoading').text()).toBe('Loading remote clusters…'); + expect(exists('sectionLoading')).toBe(true); + expect(find('sectionLoading').text()).toBe('Loading remote clusters…'); }); }); diff --git a/x-pack/plugins/cross_cluster_replication/public/app/app.tsx b/x-pack/plugins/cross_cluster_replication/public/app/app.tsx index accb15a31927e..dd46f772a3d55 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/app.tsx +++ b/x-pack/plugins/cross_cluster_replication/public/app/app.tsx @@ -13,7 +13,7 @@ import { ScopedHistory, ApplicationStart } from '@kbn/core/public'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { EuiEmptyPrompt, EuiPageContent_Deprecated as EuiPageContent } from '@elastic/eui'; +import { EuiPageTemplate } from '@elastic/eui'; import { getFatalErrors } from './services/notifications'; import { routing } from './services/routing'; @@ -109,14 +109,12 @@ class AppComponent extends Component { if (isFetchingPermissions) { return ( - - - - - + + + ); } @@ -136,32 +134,30 @@ class AppComponent extends Component { if (!hasPermission) { return ( - - - - - } - body={ -

- -

- } - /> -
+ + + + } + body={ +

+ +

+ } + /> ); } diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/auto_follow_pattern_add/auto_follow_pattern_add.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/auto_follow_pattern_add/auto_follow_pattern_add.js index 18658618b2bf4..a6ab123786c8e 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/auto_follow_pattern_add/auto_follow_pattern_add.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/auto_follow_pattern_add/auto_follow_pattern_add.js @@ -8,10 +8,7 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from '@kbn/i18n-react'; -import { - EuiPageContentBody_Deprecated as EuiPageContentBody, - EuiPageContent_Deprecated as EuiPageContent, -} from '@elastic/eui'; +import { EuiPageSection } from '@elastic/eui'; import { listBreadcrumb, addBreadcrumb, setBreadcrumbs } from '../../services/breadcrumbs'; import { @@ -50,24 +47,17 @@ export class AutoFollowPatternAdd extends PureComponent { {({ isLoading, error, remoteClusters }) => { if (isLoading) { return ( - - - - - + + + ); } return ( - + } /> - + ); }} diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/auto_follow_pattern_edit/auto_follow_pattern_edit.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/auto_follow_pattern_edit/auto_follow_pattern_edit.js index 483b8356c5ffb..deba7c063970f 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/auto_follow_pattern_edit/auto_follow_pattern_edit.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/auto_follow_pattern_edit/auto_follow_pattern_edit.js @@ -10,12 +10,7 @@ import PropTypes from 'prop-types'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { - EuiButton, - EuiPageContent_Deprecated as EuiPageContent, - EuiEmptyPrompt, - EuiPageContentBody_Deprecated as EuiPageContentBody, -} from '@elastic/eui'; +import { EuiButton, EuiPageSection, EuiPageTemplate } from '@elastic/eui'; import { listBreadcrumb, editBreadcrumb, setBreadcrumbs } from '../../services/breadcrumbs'; import { reactRouterNavigate } from '@kbn/kibana-react-plugin/public'; @@ -98,43 +93,38 @@ export class AutoFollowPatternEdit extends PureComponent { : error; return ( - - - - - } - body={

{errorMessage}

} - actions={ - - - - } - /> -
+ + + + } + body={

{errorMessage}

} + actions={ + + + + } + /> ); } renderLoading(loadingTitle) { - return ( - - {loadingTitle} - - ); + return {loadingTitle}; } render() { @@ -171,7 +161,7 @@ export class AutoFollowPatternEdit extends PureComponent { } return ( - + } /> - + ); }} diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/follower_index_add/follower_index_add.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/follower_index_add/follower_index_add.js index e1f49e8cdb60f..91e262fa84818 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/follower_index_add/follower_index_add.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/follower_index_add/follower_index_add.js @@ -8,10 +8,7 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from '@kbn/i18n-react'; -import { - EuiPageContentBody_Deprecated as EuiPageContentBody, - EuiPageContent_Deprecated as EuiPageContent, -} from '@elastic/eui'; +import { EuiPageSection } from '@elastic/eui'; import { setBreadcrumbs, listBreadcrumb, addBreadcrumb } from '../../services/breadcrumbs'; import { @@ -51,24 +48,17 @@ export class FollowerIndexAdd extends PureComponent { {({ isLoading, error, remoteClusters }) => { if (isLoading) { return ( - - - - - + + + ); } return ( - + } /> - + ); }} diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/follower_index_edit/follower_index_edit.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/follower_index_edit/follower_index_edit.js index e2dc0bc2ff06c..25b9fd844d0b0 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/follower_index_edit/follower_index_edit.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/follower_index_edit/follower_index_edit.js @@ -10,13 +10,7 @@ import PropTypes from 'prop-types'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { - EuiButton, - EuiConfirmModal, - EuiPageContentBody_Deprecated as EuiPageContentBody, - EuiPageContent_Deprecated as EuiPageContent, - EuiEmptyPrompt, -} from '@elastic/eui'; +import { EuiButton, EuiConfirmModal, EuiPageSection, EuiPageTemplate } from '@elastic/eui'; import { setBreadcrumbs, listBreadcrumb, editBreadcrumb } from '../../services/breadcrumbs'; import { reactRouterNavigate } from '@kbn/kibana-react-plugin/public'; @@ -103,11 +97,7 @@ export class FollowerIndexEdit extends PureComponent { closeConfirmModal = () => this.setState({ showConfirmModal: false }); renderLoading(loadingTitle) { - return ( - - {loadingTitle} - - ); + return {loadingTitle}; } renderGetFollowerIndexError(error) { @@ -131,33 +121,32 @@ export class FollowerIndexEdit extends PureComponent { : error; return ( - - - - - } - body={

{errorMessage}

} - actions={ - - - - } - /> -
+ + + + } + body={

{errorMessage}

} + actions={ + + + + } + /> ); } @@ -257,7 +246,7 @@ export class FollowerIndexEdit extends PureComponent { } return ( - + {showConfirmModal && this.renderConfirmModal()} - + ); }} diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/auto_follow_pattern_list.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/auto_follow_pattern_list.js index 2911cc6c65995..f7d944b56bdbf 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/auto_follow_pattern_list.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/auto_follow_pattern_list.js @@ -9,13 +9,7 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { - EuiPageContent_Deprecated as EuiPageContent, - EuiButton, - EuiEmptyPrompt, - EuiText, - EuiSpacer, -} from '@elastic/eui'; +import { EuiButton, EuiText, EuiSpacer, EuiPageTemplate } from '@elastic/eui'; import { reactRouterNavigate } from '@kbn/kibana-react-plugin/public'; import { extractQueryParams, PageError, PageLoading } from '../../../../shared_imports'; @@ -99,47 +93,40 @@ export class AutoFollowPatternList extends PureComponent { renderEmpty() { return ( - - - - - } - body={ -

- -

- } - actions={ - - - - } - /> -
+ + + + } + body={ +

+ +

+ } + actions={ + + + + } + /> ); } diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/follower_indices_list.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/follower_indices_list.js index c3cc15e016168..ab89dce7e7247 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/follower_indices_list.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/follower_indices_list.js @@ -9,13 +9,7 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { - EuiPageContent_Deprecated as EuiPageContent, - EuiButton, - EuiEmptyPrompt, - EuiText, - EuiSpacer, -} from '@elastic/eui'; +import { EuiButton, EuiText, EuiSpacer, EuiPageTemplate } from '@elastic/eui'; import { reactRouterNavigate } from '@kbn/kibana-react-plugin/public'; import { extractQueryParams, PageLoading, PageError } from '../../../../shared_imports'; @@ -94,46 +88,39 @@ export class FollowerIndicesList extends PureComponent { renderEmpty() { return ( - - - - - } - body={ -

- -

- } - actions={ - - - - } - /> -
+ + + + } + body={ +

+ +

+ } + actions={ + + + + } + /> ); }