From fb2185c73aca661b5aed8546a8f3bcf5ccf2eb6a Mon Sep 17 00:00:00 2001 From: gitstart Date: Fri, 4 Aug 2023 00:24:44 +0000 Subject: [PATCH 1/3] [Index Management] Migrate all usages of EuiPage*_Deprecated Co-authored-by: LuisChiej <54555805+LuisChiej@users.noreply.github.com> Co-authored-by: gitstart_bot --- .../component_template_create.tsx | 10 +++------- .../component_template_edit.tsx | 10 +++------- .../home/data_stream_list/data_stream_list.tsx | 6 +++--- .../home/index_list/index_table/index_table.js | 15 +++++---------- .../sections/template_clone/template_clone.tsx | 6 +++--- .../sections/template_create/template_create.tsx | 6 +++--- .../sections/template_edit/template_edit.tsx | 10 +++------- 7 files changed, 23 insertions(+), 40 deletions(-) diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_create/component_template_create.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_create/component_template_create.tsx index a7e9a504eb8cc..548577c486aca 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_create/component_template_create.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_create/component_template_create.tsx @@ -8,11 +8,7 @@ import React, { useState, useEffect } from 'react'; import { RouteComponentProps } from 'react-router-dom'; import { FormattedMessage } from '@kbn/i18n-react'; -import { - EuiPageContentBody_Deprecated as EuiPageContentBody, - EuiSpacer, - EuiPageHeader, -} from '@elastic/eui'; +import { EuiPageSection, EuiSpacer, EuiPageHeader } from '@elastic/eui'; import { ComponentTemplateDeserialized } from '../../shared_imports'; import { useComponentTemplatesContext } from '../../component_templates_context'; @@ -63,7 +59,7 @@ export const ComponentTemplateCreate: React.FunctionComponent + @@ -85,6 +81,6 @@ export const ComponentTemplateCreate: React.FunctionComponent - + ); }; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_edit/component_template_edit.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_edit/component_template_edit.tsx index 38e45ade11d01..8fa4694ee033a 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_edit/component_template_edit.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_edit/component_template_edit.tsx @@ -9,11 +9,7 @@ import React, { useState, useEffect, useMemo, useCallback } from 'react'; import { RouteComponentProps } from 'react-router-dom'; import { FormattedMessage } from '@kbn/i18n-react'; import { toMountPoint } from '@kbn/kibana-react-plugin/public'; -import { - EuiPageContentBody_Deprecated as EuiPageContentBody, - EuiPageHeader, - EuiSpacer, -} from '@elastic/eui'; +import { EuiPageSection, EuiPageHeader, EuiSpacer } from '@elastic/eui'; import { History } from 'history'; import { useComponentTemplatesContext } from '../../component_templates_context'; @@ -165,7 +161,7 @@ export const ComponentTemplateEdit: React.FunctionComponent + @@ -192,6 +188,6 @@ export const ComponentTemplateEdit: React.FunctionComponent - + ); }; diff --git a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx index ecce9b92ffc2f..0d17936ec7553 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx @@ -16,7 +16,7 @@ import { EuiText, EuiIconTip, EuiSpacer, - EuiPageContent_Deprecated as EuiPageContent, + EuiPageSection, EuiEmptyPrompt, EuiLink, } from '@elastic/eui'; @@ -270,7 +270,7 @@ export const DataStreamList: React.FunctionComponent + {renderHeader()} @@ -285,7 +285,7 @@ export const DataStreamList: React.FunctionComponent - + ); } diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.js index 65efc158fbf42..672c4a6e81a0d 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.js +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.js @@ -19,7 +19,7 @@ import { EuiCheckbox, EuiFlexGroup, EuiFlexItem, - EuiPageContent_Deprecated as EuiPageContent, + EuiPageSection, EuiScreenReaderOnly, EuiSpacer, EuiSearchBar, @@ -476,14 +476,9 @@ export class IndexTable extends Component { }; return ( - + {renderNoContent()} - + ); } @@ -496,7 +491,7 @@ export class IndexTable extends Component { const { extensionsService } = services; return ( - + @@ -665,7 +660,7 @@ export class IndexTable extends Component { {indices.length > 0 ? this.renderPager() : null} - + ); }} diff --git a/x-pack/plugins/index_management/public/application/sections/template_clone/template_clone.tsx b/x-pack/plugins/index_management/public/application/sections/template_clone/template_clone.tsx index 3a49237a517c9..4b87a4f889110 100644 --- a/x-pack/plugins/index_management/public/application/sections/template_clone/template_clone.tsx +++ b/x-pack/plugins/index_management/public/application/sections/template_clone/template_clone.tsx @@ -8,7 +8,7 @@ import React, { useEffect, useState } from 'react'; import { RouteComponentProps } from 'react-router-dom'; import { FormattedMessage } from '@kbn/i18n-react'; -import { EuiPageContentBody_Deprecated as EuiPageContentBody } from '@elastic/eui'; +import { EuiPageSection } from '@elastic/eui'; import { ScopedHistory } from '@kbn/core/public'; import { PageLoading, PageError, Error } from '../../../shared_imports'; @@ -98,7 +98,7 @@ export const TemplateClone: React.FunctionComponent + - + ); }; diff --git a/x-pack/plugins/index_management/public/application/sections/template_create/template_create.tsx b/x-pack/plugins/index_management/public/application/sections/template_create/template_create.tsx index cb8f29d222d63..e0608d06add66 100644 --- a/x-pack/plugins/index_management/public/application/sections/template_create/template_create.tsx +++ b/x-pack/plugins/index_management/public/application/sections/template_create/template_create.tsx @@ -8,7 +8,7 @@ import React, { useEffect, useState } from 'react'; import { RouteComponentProps } from 'react-router-dom'; import { FormattedMessage } from '@kbn/i18n-react'; -import { EuiPageContentBody_Deprecated as EuiPageContentBody } from '@elastic/eui'; +import { EuiPageSection } from '@elastic/eui'; import { useLocation } from 'react-router-dom'; import { parse } from 'query-string'; import { ScopedHistory } from '@kbn/core/public'; @@ -52,7 +52,7 @@ export const TemplateCreate: React.FunctionComponent = ({ h }, []); return ( - + = ({ h isLegacy={isLegacy} history={history as ScopedHistory} /> - + ); }; diff --git a/x-pack/plugins/index_management/public/application/sections/template_edit/template_edit.tsx b/x-pack/plugins/index_management/public/application/sections/template_edit/template_edit.tsx index c96502fd15066..b2212d5603247 100644 --- a/x-pack/plugins/index_management/public/application/sections/template_edit/template_edit.tsx +++ b/x-pack/plugins/index_management/public/application/sections/template_edit/template_edit.tsx @@ -9,11 +9,7 @@ import React, { useEffect, useState, Fragment } from 'react'; import { RouteComponentProps } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { - EuiPageContentBody_Deprecated as EuiPageContentBody, - EuiSpacer, - EuiCallOut, -} from '@elastic/eui'; +import { EuiPageSection, EuiSpacer, EuiCallOut } from '@elastic/eui'; import { ScopedHistory } from '@kbn/core/public'; import { TemplateDeserialized } from '../../../../common'; @@ -125,7 +121,7 @@ export const TemplateEdit: React.FunctionComponent + {isSystemTemplate && ( - + ); }; From 97dea3d3ff2393da64353ebdd95b08145e0a78f7 Mon Sep 17 00:00:00 2001 From: gitstart Date: Wed, 16 Aug 2023 07:54:00 +0000 Subject: [PATCH 2/3] [Index Management] Migrate all usages of EuiPage*_Deprecated Co-authored-by: LuisChiej <54555805+LuisChiej@users.noreply.github.com> Co-authored-by: gitstart_bot --- .../sections/home/index_list/index_table/index_table.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.js index 672c4a6e81a0d..8f7bf1aa8ab31 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.js +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.js @@ -476,9 +476,7 @@ export class IndexTable extends Component { }; return ( - - {renderNoContent()} - + {renderNoContent()} ); } From d8f29a4909cad44932b48a78b599883c4e0fa1a7 Mon Sep 17 00:00:00 2001 From: gitstart Date: Fri, 18 Aug 2023 18:46:30 +0000 Subject: [PATCH 3/3] [Index Management] Migrate all usages of EuiPage*_Deprecated Co-authored-by: LuisChiej <54555805+LuisChiej@users.noreply.github.com> Co-authored-by: gitstart_bot --- .../index_list/index_table/index_table.js | 58 +++++++++---------- 1 file changed, 26 insertions(+), 32 deletions(-) diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.js index 8f7bf1aa8ab31..5f2bfb3de011b 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.js +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.js @@ -435,49 +435,43 @@ export class IndexTable extends Component { const hasContent = !indicesLoading && !indicesError; if (!hasContent) { - const renderNoContent = () => { - if (indicesLoading) { - return ( - - - - ); - } - - if (indicesError) { - if (indicesError.status === 403) { - return ( - - } - /> - ); - } + if (indicesLoading) { + return ( + + + + ); + } + if (indicesError) { + if (indicesError.status === 403) { return ( } - error={indicesError.body} /> ); } - }; - return ( - {renderNoContent()} - ); + return ( + + } + error={indicesError.body} + /> + ); + } } const { selectedIndicesMap } = this.state;