Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rollup][licensing_management][grokdebugger] Migrate deprecated EuiPage* components #168300

Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a062e53
[license_management] Migrate deprecated `EuiPage*` components
cee-chen Oct 6, 2023
8e67911
[rollup] Migrate deprecated `EuiPage*` components
cee-chen Oct 6, 2023
f05a176
[grokdebugger] Migrate deprecated `EuiPage*` components
cee-chen Oct 6, 2023
45588c3
Fix/migrate center alignment prop
cee-chen Oct 6, 2023
32df270
Update snapshots
cee-chen Oct 6, 2023
f1d639a
Merge branch 'main' into eui-page-deprecated/platform-deployment-mana…
kibanamachine Oct 6, 2023
bea08fe
Merge branch 'main' into eui-page-deprecated/platform-deployment-mana…
cee-chen Oct 9, 2023
abd6c62
Merge branch 'main' into eui-page-deprecated/platform-deployment-mana…
kibanamachine Oct 12, 2023
9b9122c
Merge branch 'main' into eui-page-deprecated/platform-deployment-mana…
cee-chen Oct 17, 2023
68c1167
[grok_debugger] Fix background color regression
cee-chen Oct 17, 2023
fe70f98
[rollup] Fix empty prompt regressions
cee-chen Oct 17, 2023
624b6e4
[rollup] Fix buggy vertical spacing
cee-chen Oct 17, 2023
9833f2f
[grok_debugger] Fix license callout
cee-chen Oct 17, 2023
8731782
[license_management] Fix center aligned layouts
cee-chen Oct 17, 2023
f627a54
Merge branch 'main' into eui-page-deprecated/platform-deployment-mana…
cee-chen Oct 17, 2023
9d36e86
Merge branch 'main' into eui-page-deprecated/platform-deployment-mana…
cee-chen Oct 18, 2023
9e237dc
Merge branch 'main' into eui-page-deprecated/platform-deployment-mana…
cee-chen Oct 18, 2023
2e4c800
[grok_debugger] Fix missing `grow`
cee-chen Oct 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -126,33 +118,31 @@ export class GrokDebuggerComponent extends React.Component {
return (
<EuiPage>
<EuiPageBody>
<EuiPageContent>
<EuiPageContentBody>
<EuiForm className="grokdebugger-container" data-test-subj="grokDebuggerContainer">
<EventInput value={this.state.rawEvent} onChange={this.onRawEventChange} />
<PatternInput value={this.state.pattern} onChange={this.onPatternChange} />
<EuiSpacer />
<CustomPatternsInput
value={this.state.customPatterns}
onChange={this.onCustomPatternsChange}
<EuiPageSection>
cee-chen marked this conversation as resolved.
Show resolved Hide resolved
<EuiForm className="grokdebugger-container" data-test-subj="grokDebuggerContainer">
<EventInput value={this.state.rawEvent} onChange={this.onRawEventChange} />
<PatternInput value={this.state.pattern} onChange={this.onPatternChange} />
<EuiSpacer />
<CustomPatternsInput
value={this.state.customPatterns}
onChange={this.onCustomPatternsChange}
/>
<EuiSpacer />
<EuiButton
fill
onClick={this.onSimulateClick}
isDisabled={this.isSimulateDisabled()}
data-test-subj="btnSimulate"
>
<FormattedMessage
id="xpack.grokDebugger.simulateButtonLabel"
defaultMessage="Simulate"
/>
<EuiSpacer />
<EuiButton
fill
onClick={this.onSimulateClick}
isDisabled={this.isSimulateDisabled()}
data-test-subj="btnSimulate"
>
<FormattedMessage
id="xpack.grokDebugger.simulateButtonLabel"
defaultMessage="Simulate"
/>
</EuiButton>
<EuiSpacer />
<EventOutput value={this.state.structuredEvent} />
</EuiForm>
</EuiPageContentBody>
</EuiPageContent>
</EuiButton>
<EuiSpacer />
<EventOutput value={this.state.structuredEvent} />
</EuiForm>
</EuiPageSection>
</EuiPageBody>
</EuiPage>
);
Expand Down
87 changes: 42 additions & 45 deletions x-pack/plugins/grokdebugger/public/components/inactive_license.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -43,49 +42,47 @@ export const InactiveLicenseSlate = () => {
return (
<EuiPage>
<EuiPageBody component="div">
<EuiPageContent verticalPosition="center" horizontalPosition="center">
<EuiPageContentBody>
<EuiCallOut
title={i18n.translate('xpack.grokDebugger.licenseErrorMessageTitle', {
defaultMessage: 'License error',
})}
color="danger"
iconType="warning"
style={{ padding: '16px' }}
>
<EuiText size="s">
<p>
<FormattedMessage
id="xpack.grokDebugger.licenseErrorMessageDescription"
defaultMessage="The Grok Debugger requires an active license ({licenseTypeList} or {platinumLicenseType}), but none were found in your cluster."
values={{
licenseTypeList: (
<>
<EuiCode>{trialLicense}</EuiCode>, <EuiCode>{basicLicense}</EuiCode>,{' '}
<EuiCode>{goldLicense}</EuiCode>
</>
),
platinumLicenseType: <EuiCode>{platinumLicense}</EuiCode>,
}}
/>
</p>
<p>
<FormattedMessage
id="xpack.grokDebugger.registerLicenseDescription"
defaultMessage="Please {registerLicenseLink} to continue using the Grok Debugger"
values={{
registerLicenseLink: (
<EuiLink href="https://www.elastic.co/subscriptions" rel="noopener">
{registerLicenseLinkLabel}
</EuiLink>
),
}}
/>
</p>
</EuiText>
</EuiCallOut>
</EuiPageContentBody>
</EuiPageContent>
<EuiPageSection alignment="center">
<EuiCallOut
title={i18n.translate('xpack.grokDebugger.licenseErrorMessageTitle', {
defaultMessage: 'License error',
})}
color="danger"
iconType="warning"
style={{ padding: '16px' }}
>
<EuiText size="s">
<p>
<FormattedMessage
id="xpack.grokDebugger.licenseErrorMessageDescription"
defaultMessage="The Grok Debugger requires an active license ({licenseTypeList} or {platinumLicenseType}), but none were found in your cluster."
values={{
licenseTypeList: (
<>
<EuiCode>{trialLicense}</EuiCode>, <EuiCode>{basicLicense}</EuiCode>,{' '}
<EuiCode>{goldLicense}</EuiCode>
</>
),
platinumLicenseType: <EuiCode>{platinumLicense}</EuiCode>,
}}
/>
</p>
<p>
<FormattedMessage
id="xpack.grokDebugger.registerLicenseDescription"
defaultMessage="Please {registerLicenseLink} to continue using the Grok Debugger"
values={{
registerLicenseLink: (
<EuiLink href="https://www.elastic.co/subscriptions" rel="noopener">
{registerLicenseLinkLabel}
</EuiLink>
),
}}
/>
</p>
</EuiText>
</EuiCallOut>
</EuiPageSection>
</EuiPageBody>
</EuiPage>
);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 7 additions & 11 deletions x-pack/plugins/license_management/public/application/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ({
Expand All @@ -37,22 +33,22 @@ export const App = ({

if (permissionsLoading) {
return (
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="subdued">
<EuiPageSection alignment="center" color="subdued">
<SectionLoading>
<FormattedMessage
id="xpack.licenseMgmt.app.loadingPermissionsDescription"
defaultMessage="Checking permissions…"
/>
</SectionLoading>
</EuiPageContent>
</EuiPageSection>
);
}

if (permissionsError) {
const error = permissionsError?.data?.message;

return (
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="danger">
<EuiPageSection alignment="center" color="danger">
<EuiEmptyPrompt
iconType="warning"
title={
Expand All @@ -65,13 +61,13 @@ export const App = ({
}
body={error ? <p>{error}</p> : null}
/>
</EuiPageContent>
</EuiPageSection>
);
}

if (!hasPermission) {
return (
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="subdued">
<EuiPageSection alignment="center" color="subdued">
<EuiEmptyPrompt
iconType="securityApp"
title={
Expand All @@ -94,7 +90,7 @@ export const App = ({
</p>
}
/>
</EuiPageContent>
</EuiPageSection>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -27,7 +23,7 @@ export const LicenseDashboard = ({ setBreadcrumb, telemetry } = { setBreadcrumb:
<>
<LicensePageHeader />

<EuiPageContentBody>
<EuiPageSection>
<EuiFlexGroup justifyContent="spaceAround">
<EuiFlexItem>
<AddLicense />
Expand All @@ -36,7 +32,7 @@ export const LicenseDashboard = ({ setBreadcrumb, telemetry } = { setBreadcrumb:
<RequestTrialExtension />
<RevertToBasic />
</EuiFlexGroup>
</EuiPageContentBody>
</EuiPageSection>
</>
);
};
Loading