From d6f066b191363ba5d7cf074abf597c2de2e5ef5a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Cjeramysoucy=E2=80=9D?=
Date: Fri, 22 Sep 2023 14:17:06 -0400
Subject: [PATCH 1/7] Migrates usages of Eui Page components to non-deprecated
components
---
.../user_profile/user_profile.tsx | 121 ++++++++++--------
.../roles_grid_page.test.tsx.snap | 59 +++++----
.../permission_denied/permission_denied.tsx | 6 +-
.../users/users_grid/users_grid_page.tsx | 6 +-
.../edit_space/manage_space_page.tsx | 15 +--
.../spaces_grid/spaces_grid_page.tsx | 6 +-
6 files changed, 112 insertions(+), 101 deletions(-)
diff --git a/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx b/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx
index 7d11da956acaf..6d8747110a1bb 100644
--- a/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx
+++ b/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx
@@ -22,7 +22,7 @@ import {
EuiIconTip,
EuiKeyPadMenu,
EuiKeyPadMenuItem,
- EuiPageTemplate_Deprecated as EuiPageTemplate,
+ EuiPageTemplate,
EuiPopover,
EuiSpacer,
EuiText,
@@ -752,66 +752,75 @@ export const UserProfile: FunctionComponent = ({ user, data })
+
- ),
- pageTitleProps: { id: titleId },
- rightSideItems: rightSideItems.reverse().map((item) => (
-
-
- {item.title}
-
-
-
-
-
- ),
- description: (
-
- {item.description || (
-
-
-
- )}
-
- ),
- },
- ]}
- compressed
- />
- )),
- }}
- bottomBar={formChanges.count > 0 ? : null}
- bottomBarProps={{ paddingSize: 'm', position: 'fixed' }}
- restrictWidth={1000}
- >
-
+
+ {(formChanges.count > 0 ?
+
+
+ : null)}
diff --git a/x-pack/plugins/security/public/management/roles/roles_grid/__snapshots__/roles_grid_page.test.tsx.snap b/x-pack/plugins/security/public/management/roles/roles_grid/__snapshots__/roles_grid_page.test.tsx.snap
index 84e29df8fef7d..f9de5da1a1467 100644
--- a/x-pack/plugins/security/public/management/roles/roles_grid/__snapshots__/roles_grid_page.test.tsx.snap
+++ b/x-pack/plugins/security/public/management/roles/roles_grid/__snapshots__/roles_grid_page.test.tsx.snap
@@ -1,50 +1,53 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[` renders permission denied if required 1`] = `
-
-
-
-
-
- You need permission to manage roles
-
-
+
+
-
+ You need permission to manage roles
+
+
+
- Contact your system administrator.
-
+
+ Contact your system administrator.
+
+
-
+
`;
diff --git a/x-pack/plugins/security/public/management/roles/roles_grid/permission_denied/permission_denied.tsx b/x-pack/plugins/security/public/management/roles/roles_grid/permission_denied/permission_denied.tsx
index 170327ac24541..f132a8791e75b 100644
--- a/x-pack/plugins/security/public/management/roles/roles_grid/permission_denied/permission_denied.tsx
+++ b/x-pack/plugins/security/public/management/roles/roles_grid/permission_denied/permission_denied.tsx
@@ -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 = () => (
-
+
(
}
/>
-
+
);
diff --git a/x-pack/plugins/security/public/management/users/users_grid/users_grid_page.tsx b/x-pack/plugins/security/public/management/users/users_grid/users_grid_page.tsx
index fa4fb04099b72..c44d7f83f6c11 100644
--- a/x-pack/plugins/security/public/management/users/users_grid/users_grid_page.tsx
+++ b/x-pack/plugins/security/public/management/users/users_grid/users_grid_page.tsx
@@ -13,7 +13,7 @@ import {
EuiFlexItem,
EuiInMemoryTable,
EuiLink,
- EuiPageContent_Deprecated as EuiPageContent,
+ EuiPageSection,
EuiPageHeader,
EuiSpacer,
EuiSwitch,
@@ -85,7 +85,7 @@ export class UsersGridPage extends Component {
if (permissionDenied) {
return (
-
+
{
}
/>
-
+
);
}
diff --git a/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.tsx b/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.tsx
index f5b82b8fdafd2..4c01567ce6c8a 100644
--- a/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.tsx
+++ b/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.tsx
@@ -10,8 +10,7 @@ import {
EuiButtonEmpty,
EuiFlexGroup,
EuiFlexItem,
- EuiPageContent_Deprecated as EuiPageContent,
- EuiPageContentBody_Deprecated as EuiPageContentBody,
+ EuiPageSection,
EuiPageHeader,
EuiSpacer,
hexToHsv,
@@ -119,9 +118,9 @@ export class ManageSpacePage extends Component {
public render() {
if (!this.props.capabilities.spaces.manage) {
return (
-
+
-
+
);
}
@@ -130,24 +129,24 @@ export class ManageSpacePage extends Component {
}
return (
-
+
{this.getForm()}
-
+
);
}
public getLoadingIndicator = () => (
-
+
-
+
);
public getForm = () => {
diff --git a/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_page.tsx b/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_page.tsx
index 39fd408930fe9..93f2993b60fb1 100644
--- a/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_page.tsx
+++ b/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_page.tsx
@@ -12,7 +12,7 @@ import {
EuiInMemoryTable,
EuiLink,
EuiLoadingSpinner,
- EuiPageContent_Deprecated as EuiPageContent,
+ EuiPageSection,
EuiPageHeader,
EuiSpacer,
EuiText,
@@ -108,9 +108,9 @@ export class SpacesGridPage extends Component {
public getPageContent() {
if (!this.props.capabilities.spaces.manage) {
return (
-
+
-
+
);
}
From fd7e63f07cf126838348390c2c5ccc61a2b86589 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Cjeramysoucy=E2=80=9D?=
Date: Fri, 22 Sep 2023 15:51:55 -0400
Subject: [PATCH 2/7] Sets offset to 0 for user profile page template
---
.../public/account_management/user_profile/user_profile.tsx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx b/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx
index 6d8747110a1bb..5bec4a9825a75 100644
--- a/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx
+++ b/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx
@@ -751,11 +751,12 @@ export const UserProfile: FunctionComponent = ({ user, data })
) : null}
Date: Fri, 22 Sep 2023 15:58:17 -0400
Subject: [PATCH 3/7] Replaces EuiPageTemplate with KibanaPageTemplate
---
.../public/account_management/user_profile/user_profile.tsx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx b/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx
index 5bec4a9825a75..4b4d052f3c8d7 100644
--- a/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx
+++ b/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx
@@ -62,6 +62,7 @@ import { FormLabel } from '../../components/form_label';
import { FormRow, OptionalText } from '../../components/form_row';
import { ChangePasswordModal } from '../../management/users/edit_user/change_password_modal';
import { isUserReserved } from '../../management/users/user_utils';
+import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template';
export interface UserProfileProps {
user: AuthenticatedUser;
@@ -750,8 +751,7 @@ export const UserProfile: FunctionComponent = ({ user, data })
/>
) : null}
-
@@ -822,7 +822,7 @@ export const UserProfile: FunctionComponent = ({ user, data })
>
: null)}
-
+
From 7d71a61d30b583362b6b5645e65663e85c941073 Mon Sep 17 00:00:00 2001
From: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Date: Fri, 22 Sep 2023 20:05:02 +0000
Subject: [PATCH 4/7] [CI] Auto-commit changed files from 'node
scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'
---
.../user_profile/user_profile.tsx | 86 +++++++++----------
1 file changed, 40 insertions(+), 46 deletions(-)
diff --git a/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx b/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx
index 4b4d052f3c8d7..1187631643207 100644
--- a/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx
+++ b/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx
@@ -39,6 +39,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';
@@ -62,7 +63,6 @@ import { FormLabel } from '../../components/form_label';
import { FormRow, OptionalText } from '../../components/form_row';
import { ChangePasswordModal } from '../../management/users/edit_user/change_password_modal';
import { isUserReserved } from '../../management/users/user_utils';
-import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template';
export interface UserProfileProps {
user: AuthenticatedUser;
@@ -751,12 +751,9 @@ export const UserProfile: FunctionComponent = ({ user, data })
/>
) : null}
-
+
= ({ user, data })
/>
}
id={titleId}
- rightSideItems={
- rightSideItems.reverse().map((item) => (
-
-
- {item.title}
-
-
-
-
-
- ),
- description: (
-
- {item.description || (
-
-
-
- )}
-
- ),
- },
- ]}
- compressed
- />
- ))}
+ rightSideItems={rightSideItems.reverse().map((item) => (
+
+
+ {item.title}
+
+
+
+
+
+ ),
+ description: (
+
+ {item.description || (
+
+
+
+ )}
+
+ ),
+ },
+ ]}
+ compressed
+ />
+ ))}
/>
- {(formChanges.count > 0 ?
-
-
- : null)}
+ {formChanges.count > 0 ? (
+
+
+
+ ) : null}
From b5f0ff20805694b255621b5afd52ee6a3e7c98cb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Cjeramysoucy=E2=80=9D?=
Date: Fri, 22 Sep 2023 16:17:00 -0400
Subject: [PATCH 5/7] Replaces EuiPageTemplate subcomponents in user profile
page.
---
.../account_management/user_profile/user_profile.tsx | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx b/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx
index 1187631643207..337938713bdac 100644
--- a/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx
+++ b/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx
@@ -22,7 +22,6 @@ import {
EuiIconTip,
EuiKeyPadMenu,
EuiKeyPadMenuItem,
- EuiPageTemplate,
EuiPopover,
EuiSpacer,
EuiText,
@@ -752,8 +751,7 @@ export const UserProfile: FunctionComponent = ({ user, data })
) : null}
- = ({ user, data })
/>
))}
/>
-
+
-
+
{formChanges.count > 0 ? (
-
+
-
+
) : null}
From 396fe10192aa34eb29d189a4bf93f71b2ce3e2b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Cjeramysoucy=E2=80=9D?=
Date: Fri, 22 Sep 2023 16:43:42 -0400
Subject: [PATCH 6/7] Updates role mapping button to use plus circle filled
icon for consistency
---
.../create_role_mapping_button/create_role_mapping_button.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/x-pack/plugins/security/public/management/role_mappings/role_mappings_grid/create_role_mapping_button/create_role_mapping_button.tsx b/x-pack/plugins/security/public/management/role_mappings/role_mappings_grid/create_role_mapping_button/create_role_mapping_button.tsx
index ab9ce044f7b4c..512e46ebfe185 100644
--- a/x-pack/plugins/security/public/management/role_mappings/role_mappings_grid/create_role_mapping_button/create_role_mapping_button.tsx
+++ b/x-pack/plugins/security/public/management/role_mappings/role_mappings_grid/create_role_mapping_button/create_role_mapping_button.tsx
@@ -21,7 +21,7 @@ interface CreateRoleMappingButtonProps {
export const CreateRoleMappingButton = ({ history }: CreateRoleMappingButtonProps) => {
return (
Date: Fri, 22 Sep 2023 21:18:09 +0000
Subject: [PATCH 7/7] [CI] Auto-commit changed files from 'node scripts/eslint
--no-cache --fix'
---
.../roles_grid/permission_denied/permission_denied.tsx | 2 +-
.../public/management/users/users_grid/users_grid_page.tsx | 2 +-
.../public/management/edit_space/manage_space_page.tsx | 6 +++---
.../public/management/spaces_grid/spaces_grid_page.tsx | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/x-pack/plugins/security/public/management/roles/roles_grid/permission_denied/permission_denied.tsx b/x-pack/plugins/security/public/management/roles/roles_grid/permission_denied/permission_denied.tsx
index f132a8791e75b..77825c4256cce 100644
--- a/x-pack/plugins/security/public/management/roles/roles_grid/permission_denied/permission_denied.tsx
+++ b/x-pack/plugins/security/public/management/roles/roles_grid/permission_denied/permission_denied.tsx
@@ -11,7 +11,7 @@ import React from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
export const PermissionDenied = () => (
-
+
{
public render() {
if (!this.props.capabilities.spaces.manage) {
return (
-
+
);
@@ -139,7 +139,7 @@ export class ManageSpacePage extends Component {
}
public getLoadingIndicator = () => (
-
+