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

Migrates all security and spaces usage of deprecated Eui Page components #167078

Merged
merged 9 commits into from
Sep 29, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
EuiIconTip,
EuiKeyPadMenu,
EuiKeyPadMenuItem,
EuiPageTemplate_Deprecated as EuiPageTemplate,
EuiPopover,
EuiSpacer,
EuiText,
Expand All @@ -39,6 +38,7 @@ import type { CoreStart, IUiSettingsClient } from '@kbn/core/public';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template';
import type { DarkModeValue, UserProfileData } from '@kbn/user-profile-components';
import { UserAvatar, useUpdateUserProfile } from '@kbn/user-profile-components';

Expand Down Expand Up @@ -750,17 +750,16 @@ export const UserProfile: FunctionComponent<UserProfileProps> = ({ user, data })
/>
) : null}

<EuiPageTemplate
className="eui-fullHeight"
pageHeader={{
pageTitle: (
<KibanaPageTemplate className="eui-fullHeight" restrictWidth={1000}>
<KibanaPageTemplate.Header
pageTitle={
<FormattedMessage
id="xpack.security.accountManagement.userProfile.title"
defaultMessage="Profile"
/>
),
pageTitleProps: { id: titleId },
rightSideItems: rightSideItems.reverse().map((item) => (
}
id={titleId}
rightSideItems={rightSideItems.reverse().map((item) => (
<EuiDescriptionList
textStyle="reverse"
listItems={[
Expand Down Expand Up @@ -791,28 +790,31 @@ export const UserProfile: FunctionComponent<UserProfileProps> = ({ user, data })
]}
compressed
/>
)),
}}
bottomBar={formChanges.count > 0 ? <SaveChangesBottomBar /> : null}
bottomBarProps={{ paddingSize: 'm', position: 'fixed' }}
restrictWidth={1000}
>
<Form aria-labelledby={titleId}>
<UserDetailsEditor user={user} />
{isCloudUser ? null : <UserAvatarEditor user={user} formik={formik} />}
<UserPasswordEditor
user={user}
onShowPasswordForm={() => setShowChangePasswordForm(true)}
/>
{isCloudUser ? null : (
<UserSettingsEditor
formik={formik}
isThemeOverridden={isThemeOverridden}
isOverriddenThemeDarkMode={isOverriddenThemeDarkMode}
))}
/>
<KibanaPageTemplate.Section>
<Form aria-labelledby={titleId}>
<UserDetailsEditor user={user} />
{isCloudUser ? null : <UserAvatarEditor user={user} formik={formik} />}
<UserPasswordEditor
user={user}
onShowPasswordForm={() => setShowChangePasswordForm(true)}
/>
)}
</Form>
</EuiPageTemplate>
{isCloudUser ? null : (
<UserSettingsEditor
formik={formik}
isThemeOverridden={isThemeOverridden}
isOverriddenThemeDarkMode={isOverriddenThemeDarkMode}
/>
)}
</Form>
</KibanaPageTemplate.Section>
{formChanges.count > 0 ? (
<KibanaPageTemplate.BottomBar paddingSize="m" position="fixed">
<SaveChangesBottomBar />
</KibanaPageTemplate.BottomBar>
) : null}
</KibanaPageTemplate>
</Breadcrumb>
</FormChangesProvider>
</FormikProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface CreateRoleMappingButtonProps {
export const CreateRoleMappingButton = ({ history }: CreateRoleMappingButtonProps) => {
return (
<EuiButton
iconType="plusInCircle"
iconType="plusInCircleFilled"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just to make this page consistent with our other pages. It is unrelated to the main changes of the PR.

data-test-subj="createRoleMappingButton"
{...reactRouterNavigate(history, EDIT_ROLE_MAPPING_PATH)}
fill
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
* 2.0.
*/

import { EuiEmptyPrompt, EuiPageContent_Deprecated as EuiPageContent } from '@elastic/eui';
import { EuiEmptyPrompt, EuiPageSection } from '@elastic/eui';
import React from 'react';

import { FormattedMessage } from '@kbn/i18n-react';

export const PermissionDenied = () => (
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="danger">
<EuiPageSection alignment="center" color="danger">
<EuiEmptyPrompt
iconType="securityApp"
title={
Expand All @@ -31,5 +31,5 @@ export const PermissionDenied = () => (
</p>
}
/>
</EuiPageContent>
</EuiPageSection>
);
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import {
EuiFlexItem,
EuiInMemoryTable,
EuiLink,
EuiPageContent_Deprecated as EuiPageContent,
EuiPageHeader,
EuiPageSection,
EuiSpacer,
EuiSwitch,
} from '@elastic/eui';
Expand Down Expand Up @@ -85,7 +85,7 @@ export class UsersGridPage extends Component<Props, State> {
if (permissionDenied) {
return (
<EuiFlexGroup gutterSize="none">
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="danger">
<EuiPageSection alignment="center" color="danger">
<EuiEmptyPrompt
iconType="securityApp"
title={
Expand All @@ -105,7 +105,7 @@ export class UsersGridPage extends Component<Props, State> {
</p>
}
/>
</EuiPageContent>
</EuiPageSection>
</EuiFlexGroup>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import {
EuiButtonEmpty,
EuiFlexGroup,
EuiFlexItem,
EuiPageContent_Deprecated as EuiPageContent,
EuiPageContentBody_Deprecated as EuiPageContentBody,
EuiPageHeader,
EuiPageSection,
EuiSpacer,
hexToHsv,
hsvToHex,
Expand Down Expand Up @@ -119,9 +118,9 @@ export class ManageSpacePage extends Component<Props, State> {
public render() {
if (!this.props.capabilities.spaces.manage) {
return (
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="danger">
<EuiPageSection alignment="center" color="danger">
<UnauthorizedPrompt />
</EuiPageContent>
</EuiPageSection>
);
}

Expand All @@ -130,24 +129,24 @@ export class ManageSpacePage extends Component<Props, State> {
}

return (
<EuiPageContentBody restrictWidth>
<EuiPageSection restrictWidth>
<EuiPageHeader pageTitle={this.getTitle()} description={getSpacesFeatureDescription()} />
<EuiSpacer size="l" />

{this.getForm()}
</EuiPageContentBody>
</EuiPageSection>
);
}

public getLoadingIndicator = () => (
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="subdued">
<EuiPageSection alignment="center" color="subdued">
<SectionLoading>
<FormattedMessage
id="xpack.spaces.management.manageSpacePage.loadingMessage"
defaultMessage="Loading…"
/>
</SectionLoading>
</EuiPageContent>
</EuiPageSection>
);

public getForm = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
EuiInMemoryTable,
EuiLink,
EuiLoadingSpinner,
EuiPageContent_Deprecated as EuiPageContent,
EuiPageHeader,
EuiPageSection,
EuiSpacer,
EuiText,
} from '@elastic/eui';
Expand Down Expand Up @@ -108,9 +108,9 @@ export class SpacesGridPage extends Component<Props, State> {
public getPageContent() {
if (!this.props.capabilities.spaces.manage) {
return (
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="danger">
<EuiPageSection alignment="center" color="danger">
<UnauthorizedPrompt />
</EuiPageContent>
</EuiPageSection>
);
}

Expand Down
Loading