Date: Wed, 20 Nov 2024 07:39:41 -0700
Subject: [PATCH 27/92] [Spaces UI] Role Editor Flyout Should Match in Roles
Mgmt (#198182)
## Summary
Part of https://github.com/elastic/kibana-team/issues/1242
**Fixes for alignment of the Role editor flyout**
1. Remove the warning callout regarding global privileges that impact
other privileges
1. Unify the info callouts regarding combination of privileges
1. set "Customize" as the default selected option when assigning new
privileges
1. update placeholders for selector box when assigning privileges
1. Hide privileges controls if no spaces are selected
1. Update button group label text to "Define privileges" and align
helper texts below
1. Align headers for assign/edit states
1. Remove descriptions under headers
1. Update size of info callout above button group to small
1. Reduce text size for the "Manage roles" link
1. Remove the "Additional Stack Management permissions can be found
outside of this menu..." test for the Spaces Management context.
**Polish fixes**
1. Remove features visible column
1. ~~Remove identifier column from spaces grid~~
1. Fix vertical alignment of non-current space name in table
1. Ordered the listing of assigned roles during and after search
1. Removing a role from the space shows a confirmation modal
1. Update columns widths in the spaces grid
1. Remove the "By default your current view is Classic" callout
### Checklist
Delete any items that are not applicable to this PR.
- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
---
.../security/ui_components/kibana.jsonc | 2 +-
.../feature_table.test.tsx | 1 +
.../kibana_privilege_table/feature_table.tsx | 23 +-
.../simple_privilege_section.tsx | 1 +
.../privilege_space_form.test.tsx | 77 +----
.../privilege_space_form.tsx | 318 ++++++------------
.../space_selector.tsx | 3 +
.../solution_view/solution_view.tsx | 16 -
.../edit_space/edit_space_roles_tab.tsx | 44 ++-
.../space_assign_role_privilege_form.tsx | 60 ++--
.../space_assigned_roles_table.test.tsx | 4 +-
.../component/space_assigned_roles_table.tsx | 28 +-
.../spaces_grid/spaces_grid_page.test.tsx | 59 +---
.../spaces_grid/spaces_grid_page.tsx | 71 +---
.../translations/translations/fr-FR.json | 20 +-
.../translations/translations/ja-JP.json | 20 +-
.../translations/translations/zh-CN.json | 20 +-
.../test/accessibility/apps/group1/roles.ts | 4 +
18 files changed, 235 insertions(+), 536 deletions(-)
diff --git a/x-pack/packages/security/ui_components/kibana.jsonc b/x-pack/packages/security/ui_components/kibana.jsonc
index 1aad2d80ed7f7..996f7b78e110a 100644
--- a/x-pack/packages/security/ui_components/kibana.jsonc
+++ b/x-pack/packages/security/ui_components/kibana.jsonc
@@ -1,5 +1,5 @@
{
- "type": "shared-common",
+ "type": "shared-browser",
"id": "@kbn/security-ui-components",
"owner": "@elastic/kibana-security"
}
diff --git a/x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.test.tsx b/x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.test.tsx
index 2ed172a49ad8b..6e55fa7ed7bbf 100644
--- a/x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.test.tsx
+++ b/x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.test.tsx
@@ -54,6 +54,7 @@ const setup = (config: TestConfig) => {
kibanaPrivileges={kibanaPrivileges}
onChange={onChange}
onChangeAll={onChangeAll}
+ showAdditionalPermissionsMessage={true}
canCustomizeSubFeaturePrivileges={config.canCustomizeSubFeaturePrivileges}
privilegeIndex={config.privilegeIndex}
allSpacesSelected={true}
diff --git a/x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.tsx b/x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.tsx
index 2f77b55ce5bac..9ee1ea3517dae 100644
--- a/x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.tsx
+++ b/x-pack/packages/security/ui_components/src/kibana_privilege_table/feature_table.tsx
@@ -45,13 +45,10 @@ interface Props {
privilegeIndex: number;
onChange: (featureId: string, privileges: string[]) => void;
onChangeAll: (privileges: string[]) => void;
+ showAdditionalPermissionsMessage: boolean;
canCustomizeSubFeaturePrivileges: boolean;
allSpacesSelected: boolean;
disabled?: boolean;
- /**
- * default is true, to remain backwards compatible
- */
- showTitle?: boolean;
}
interface State {
@@ -62,7 +59,6 @@ export class FeatureTable extends Component
{
public static defaultProps = {
privilegeIndex: -1,
showLocks: true,
- showTitle: true,
};
private featureCategories: Map = new Map();
@@ -189,20 +185,7 @@ export class FeatureTable extends Component {
return (