From 121353cf457efe957662bf18d867ba76ffb4100e Mon Sep 17 00:00:00 2001
From: Cee Chen <549407+cee-chen@users.noreply.github.com>
Date: Wed, 18 Oct 2023 10:18:42 -0700
Subject: [PATCH] [rollup][licensing_management][grokdebugger] Migrate
deprecated `EuiPage*` components (#168300)
## Summary
EUI will shortly be removing several deprecated `EuiPage*` components,
and we're updating a few remaining Kibana usages of these deprecated
components ahead of time.
See https://github.com/elastic/kibana/issues/161872 for other similar
tasks with more information about this effort.
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
---
.../components/grok_debugger/grok_debugger.js | 60 +-
.../public/components/inactive_license.js | 87 +-
.../upload_license.test.tsx.snap | 993 +++++++++---------
.../public/application/app.js | 20 +-
.../license_dashboard/license_dashboard.js | 10 +-
.../sections/upload_license/upload_license.js | 12 +-
.../sections/job_create/job_create.js | 6 +-
.../crud_app/sections/job_list/job_list.js | 21 +-
8 files changed, 604 insertions(+), 605 deletions(-)
diff --git a/x-pack/plugins/grokdebugger/public/components/grok_debugger/grok_debugger.js b/x-pack/plugins/grokdebugger/public/components/grok_debugger/grok_debugger.js
index 7eb4e9412edaa..cfae6749879f3 100644
--- a/x-pack/plugins/grokdebugger/public/components/grok_debugger/grok_debugger.js
+++ b/x-pack/plugins/grokdebugger/public/components/grok_debugger/grok_debugger.js
@@ -11,15 +11,7 @@ import { i18n } from '@kbn/i18n';
// eslint-disable-next-line no-restricted-imports
import isEmpty from 'lodash/isEmpty';
-import {
- EuiForm,
- EuiButton,
- EuiPage,
- EuiPageBody,
- EuiPageContent_Deprecated as EuiPageContent,
- EuiPageContentBody_Deprecated as EuiPageContentBody,
- EuiSpacer,
-} from '@elastic/eui';
+import { EuiForm, EuiButton, EuiPage, EuiPageBody, EuiPageSection, EuiSpacer } from '@elastic/eui';
import { EventInput } from '../event_input';
import { PatternInput } from '../pattern_input';
import { CustomPatternsInput } from '../custom_patterns_input';
@@ -126,33 +118,31 @@ export class GrokDebuggerComponent extends React.Component {
return (
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
);
diff --git a/x-pack/plugins/grokdebugger/public/components/inactive_license.js b/x-pack/plugins/grokdebugger/public/components/inactive_license.js
index f373c65bf9bb1..b9abdd6a4706f 100644
--- a/x-pack/plugins/grokdebugger/public/components/inactive_license.js
+++ b/x-pack/plugins/grokdebugger/public/components/inactive_license.js
@@ -13,8 +13,7 @@ import {
EuiCode,
EuiPage,
EuiPageBody,
- EuiPageContent_Deprecated as EuiPageContent,
- EuiPageContentBody_Deprecated as EuiPageContentBody,
+ EuiPageSection,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
@@ -43,49 +42,47 @@ export const InactiveLicenseSlate = () => {
return (
-
-
-
-
-
-
- {trialLicense}, {basicLicense},{' '}
- {goldLicense}
- >
- ),
- platinumLicenseType: {platinumLicense},
- }}
- />
-
-
-
- {registerLicenseLinkLabel}
-
- ),
- }}
- />
-
-
-
-
-
+
+
+
+
+
+ {trialLicense}, {basicLicense},{' '}
+ {goldLicense}
+ >
+ ),
+ platinumLicenseType: {platinumLicense},
+ }}
+ />
+
+
+
+ {registerLicenseLinkLabel}
+
+ ),
+ }}
+ />
+
+
+
+
);
diff --git a/x-pack/plugins/license_management/__jest__/__snapshots__/upload_license.test.tsx.snap b/x-pack/plugins/license_management/__jest__/__snapshots__/upload_license.test.tsx.snap
index 1ce5f5a38b043..8a845149b95e8 100644
--- a/x-pack/plugins/license_management/__jest__/__snapshots__/upload_license.test.tsx.snap
+++ b/x-pack/plugins/license_management/__jest__/__snapshots__/upload_license.test.tsx.snap
@@ -1,675 +1,690 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`UploadLicense should display a modal when license requires acknowledgement 1`] = `
-
-
- Upload your license
-
-
-
-
- Your license key is a JSON file with a signature attached.
-
-
- Uploading a license will replace your current
-
- license.
-
-
-
-
+
`;
exports[`UploadLicense should display an error when ES says license is expired 1`] = `
-
-
- Upload your license
-
-
-
-
- Your license key is a JSON file with a signature attached.
-
-
- Uploading a license will replace your current
-
- license.
-
-
-
-
+
`;
exports[`UploadLicense should display an error when ES says license is invalid 1`] = `
-
-
- Upload your license
-
-
-
- Your license key is a JSON file with a signature attached.
-
-
- Uploading a license will replace your current
-
- license.
-
-
-
-
-
+
`;
exports[`UploadLicense should display an error when submitting invalid JSON 1`] = `
-
-
- Upload your license
-
-
-
- Your license key is a JSON file with a signature attached.
-
-
- Uploading a license will replace your current
-
- license.
-
-
-
-
-
+
`;
exports[`UploadLicense should display error when ES returns error 1`] = `
-
-
- Upload your license
-
-
-
-
- Your license key is a JSON file with a signature attached.
-
-
- Uploading a license will replace your current
-
- license.
-
-
-
-
+
`;
diff --git a/x-pack/plugins/license_management/public/application/app.js b/x-pack/plugins/license_management/public/application/app.js
index e1b2ea7fb6b2e..8932193b01f4a 100644
--- a/x-pack/plugins/license_management/public/application/app.js
+++ b/x-pack/plugins/license_management/public/application/app.js
@@ -11,11 +11,7 @@ import { LicenseDashboard, UploadLicense } from './sections';
import { Routes, Route } from '@kbn/shared-ux-router';
import { APP_PERMISSION } from '../../common/constants';
import { SectionLoading, useExecutionContext } from '../shared_imports';
-import {
- EuiPageContent_Deprecated as EuiPageContent,
- EuiPageBody,
- EuiEmptyPrompt,
-} from '@elastic/eui';
+import { EuiPageSection, EuiPageBody, EuiEmptyPrompt } from '@elastic/eui';
import { UPLOAD_LICENSE_ROUTE } from '../locator';
export const App = ({
@@ -37,14 +33,14 @@ export const App = ({
if (permissionsLoading) {
return (
-
+
-
+
);
}
@@ -52,8 +48,9 @@ export const App = ({
const error = permissionsError?.data?.message;
return (
-
+
@@ -65,14 +62,15 @@ export const App = ({
}
body={error ? {error}
: null}
/>
-
+
);
}
if (!hasPermission) {
return (
-
+
@@ -94,7 +92,7 @@ export const App = ({
}
/>
-
+
);
}
diff --git a/x-pack/plugins/license_management/public/application/sections/license_dashboard/license_dashboard.js b/x-pack/plugins/license_management/public/application/sections/license_dashboard/license_dashboard.js
index ce5048679ffeb..d412415752944 100644
--- a/x-pack/plugins/license_management/public/application/sections/license_dashboard/license_dashboard.js
+++ b/x-pack/plugins/license_management/public/application/sections/license_dashboard/license_dashboard.js
@@ -6,11 +6,7 @@
*/
import React, { useEffect } from 'react';
-import {
- EuiPageContentBody_Deprecated as EuiPageContentBody,
- EuiFlexGroup,
- EuiFlexItem,
-} from '@elastic/eui';
+import { EuiPageSection, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { StartTrial } from './start_trial';
import { LicensePageHeader } from './license_page_header';
@@ -27,7 +23,7 @@ export const LicenseDashboard = ({ setBreadcrumb, telemetry } = { setBreadcrumb:
<>
-
+
@@ -36,7 +32,7 @@ export const LicenseDashboard = ({ setBreadcrumb, telemetry } = { setBreadcrumb:
-
+
>
);
};
diff --git a/x-pack/plugins/license_management/public/application/sections/upload_license/upload_license.js b/x-pack/plugins/license_management/public/application/sections/upload_license/upload_license.js
index 09b076cc4efc9..b637b9a29f2fc 100644
--- a/x-pack/plugins/license_management/public/application/sections/upload_license/upload_license.js
+++ b/x-pack/plugins/license_management/public/application/sections/upload_license/upload_license.js
@@ -17,8 +17,8 @@ import {
EuiTitle,
EuiFlexGroup,
EuiFlexItem,
- EuiPageContent_Deprecated as EuiPageContent,
- EuiPageContentBody_Deprecated as EuiPageContentBody,
+ EuiPageSection,
+ EuiPanel,
} from '@elastic/eui';
import { TelemetryOptIn } from '../../components/telemetry_opt_in';
import { shouldShowTelemetryOptIn } from '../../lib/telemetry';
@@ -126,8 +126,8 @@ export class UploadLicense extends React.PureComponent {
const { currentLicenseType, applying, telemetry, history } = this.props;
return (
-
-
+
+
-
-
+
+
);
}
}
diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/job_create.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/job_create.js
index a0defbc7e1d9f..c782e8646b714 100644
--- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/job_create.js
+++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/job_create.js
@@ -18,7 +18,7 @@ import {
EuiCallOut,
EuiLoadingLogo,
EuiOverlayMask,
- EuiPageContentBody_Deprecated as EuiPageContentBody,
+ EuiPageSection,
EuiPageHeader,
EuiSpacer,
EuiStepsHorizontal,
@@ -543,7 +543,7 @@ export class JobCreateUi extends Component {
}
return (
-
+
+
);
}
diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.js b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.js
index 89ef725ad05ae..83641d6483817 100644
--- a/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.js
+++ b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.js
@@ -15,7 +15,7 @@ import {
EuiButtonEmpty,
EuiEmptyPrompt,
EuiPageHeader,
- EuiPageContent_Deprecated as EuiPageContent,
+ EuiPageSection,
EuiSpacer,
} from '@elastic/eui';
@@ -87,8 +87,9 @@ export class JobListUi extends Component {
defaultMessage: 'Permission error',
});
return (
-
+
{title}}
@@ -101,7 +102,7 @@ export class JobListUi extends Component {
}
/>
-
+
);
}
@@ -115,8 +116,9 @@ export class JobListUi extends Component {
});
return (
-
+
{title}}
@@ -126,14 +128,15 @@ export class JobListUi extends Component {
}
/>
-
+
);
}
renderEmpty() {
return (
-
+
}
/>
-
+
);
}
renderLoading() {
return (
-
+
-
+
);
}