mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
# Backport This will backport the following commits from `main` to `8.17`: - [[Spaces UI] Role Editor Flyout Should Match in Roles Mgmt (#198182)](https://github.com/elastic/kibana/pull/198182) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Tim Sullivan","email":"tsullivan@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-11-20T14:39:41Z","message":"[Spaces UI] Role Editor Flyout Should Match in Roles Mgmt (#198182)\n\n## Summary\r\n\r\nPart of https://github.com/elastic/kibana-team/issues/1242\r\n\r\n**Fixes for alignment of the Role editor flyout**\r\n1. Remove the warning callout regarding global privileges that impact\r\nother privileges\r\n1. Unify the info callouts regarding combination of privileges\r\n1. set \"Customize\" as the default selected option when assigning new\r\nprivileges\r\n1. update placeholders for selector box when assigning privileges\r\n1. Hide privileges controls if no spaces are selected\r\n1. Update button group label text to \"Define privileges\" and align\r\nhelper texts below\r\n1. Align headers for assign/edit states\r\n1. Remove descriptions under headers\r\n1. Update size of info callout above button group to small\r\n1. Reduce text size for the \"Manage roles\" link\r\n1. Remove the \"Additional Stack Management permissions can be found\r\noutside of this menu...\" test for the Spaces Management context.\r\n\r\n**Polish fixes**\r\n1. Remove features visible column\r\n1. ~~Remove identifier column from spaces grid~~\r\n1. Fix vertical alignment of non-current space name in table\r\n1. Ordered the listing of assigned roles during and after search\r\n1. Removing a role from the space shows a confirmation modal\r\n1. Update columns widths in the spaces grid\r\n1. Remove the \"By default your current view is Classic\" callout\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] Any UI touched in this PR is usable by keyboard only (learn more\r\nabout [keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n- [x] Any UI touched in this PR does not create any new axe failures\r\n(run axe in browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n- [x] This renders correctly on smaller devices using a responsive\r\nlayout. (You can test this [in your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n- [x] This was checked for [cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)","sha":"226924eafebff8852a67723a49e8f4fdbb6ed869","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport missing","v9.0.0","ci:cloud-deploy","backport:version","v8.17.0"],"number":198182,"url":"https://github.com/elastic/kibana/pull/198182","mergeCommit":{"message":"[Spaces UI] Role Editor Flyout Should Match in Roles Mgmt (#198182)\n\n## Summary\r\n\r\nPart of https://github.com/elastic/kibana-team/issues/1242\r\n\r\n**Fixes for alignment of the Role editor flyout**\r\n1. Remove the warning callout regarding global privileges that impact\r\nother privileges\r\n1. Unify the info callouts regarding combination of privileges\r\n1. set \"Customize\" as the default selected option when assigning new\r\nprivileges\r\n1. update placeholders for selector box when assigning privileges\r\n1. Hide privileges controls if no spaces are selected\r\n1. Update button group label text to \"Define privileges\" and align\r\nhelper texts below\r\n1. Align headers for assign/edit states\r\n1. Remove descriptions under headers\r\n1. Update size of info callout above button group to small\r\n1. Reduce text size for the \"Manage roles\" link\r\n1. Remove the \"Additional Stack Management permissions can be found\r\noutside of this menu...\" test for the Spaces Management context.\r\n\r\n**Polish fixes**\r\n1. Remove features visible column\r\n1. ~~Remove identifier column from spaces grid~~\r\n1. Fix vertical alignment of non-current space name in table\r\n1. Ordered the listing of assigned roles during and after search\r\n1. Removing a role from the space shows a confirmation modal\r\n1. Update columns widths in the spaces grid\r\n1. Remove the \"By default your current view is Classic\" callout\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] Any UI touched in this PR is usable by keyboard only (learn more\r\nabout [keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n- [x] Any UI touched in this PR does not create any new axe failures\r\n(run axe in browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n- [x] This renders correctly on smaller devices using a responsive\r\nlayout. (You can test this [in your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n- [x] This was checked for [cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)","sha":"226924eafebff8852a67723a49e8f4fdbb6ed869"}},"sourceBranch":"main","suggestedTargetBranches":["8.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198182","number":198182,"mergeCommit":{"message":"[Spaces UI] Role Editor Flyout Should Match in Roles Mgmt (#198182)\n\n## Summary\r\n\r\nPart of https://github.com/elastic/kibana-team/issues/1242\r\n\r\n**Fixes for alignment of the Role editor flyout**\r\n1. Remove the warning callout regarding global privileges that impact\r\nother privileges\r\n1. Unify the info callouts regarding combination of privileges\r\n1. set \"Customize\" as the default selected option when assigning new\r\nprivileges\r\n1. update placeholders for selector box when assigning privileges\r\n1. Hide privileges controls if no spaces are selected\r\n1. Update button group label text to \"Define privileges\" and align\r\nhelper texts below\r\n1. Align headers for assign/edit states\r\n1. Remove descriptions under headers\r\n1. Update size of info callout above button group to small\r\n1. Reduce text size for the \"Manage roles\" link\r\n1. Remove the \"Additional Stack Management permissions can be found\r\noutside of this menu...\" test for the Spaces Management context.\r\n\r\n**Polish fixes**\r\n1. Remove features visible column\r\n1. ~~Remove identifier column from spaces grid~~\r\n1. Fix vertical alignment of non-current space name in table\r\n1. Ordered the listing of assigned roles during and after search\r\n1. Removing a role from the space shows a confirmation modal\r\n1. Update columns widths in the spaces grid\r\n1. Remove the \"By default your current view is Classic\" callout\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] Any UI touched in this PR is usable by keyboard only (learn more\r\nabout [keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n- [x] Any UI touched in this PR does not create any new axe failures\r\n(run axe in browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n- [x] This renders correctly on smaller devices using a responsive\r\nlayout. (You can test this [in your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n- [x] This was checked for [cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)","sha":"226924eafebff8852a67723a49e8f4fdbb6ed869"}},{"branch":"8.x","label":"v8.17.0","labelRegex":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
This commit is contained in:
parent
b4432ecde2
commit
65f69e3760
18 changed files with 271 additions and 495 deletions
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"type": "shared-common",
|
||||
"type": "shared-browser",
|
||||
"id": "@kbn/security-ui-components",
|
||||
"owner": "@elastic/kibana-security"
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ const setup = (config: TestConfig) => {
|
|||
kibanaPrivileges={kibanaPrivileges}
|
||||
onChange={onChange}
|
||||
onChangeAll={onChangeAll}
|
||||
showAdditionalPermissionsMessage={true}
|
||||
canCustomizeSubFeaturePrivileges={config.canCustomizeSubFeaturePrivileges}
|
||||
privilegeIndex={config.privilegeIndex}
|
||||
allSpacesSelected={true}
|
||||
|
|
|
@ -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<Props, State> {
|
|||
public static defaultProps = {
|
||||
privilegeIndex: -1,
|
||||
showLocks: true,
|
||||
showTitle: true,
|
||||
};
|
||||
|
||||
private featureCategories: Map<string, SecuredFeature[]> = new Map();
|
||||
|
@ -189,20 +185,7 @@ export class FeatureTable extends Component<Props, State> {
|
|||
return (
|
||||
<div>
|
||||
<EuiFlexGroup alignItems={'flexEnd'}>
|
||||
<EuiFlexItem>
|
||||
{this.props.showTitle && (
|
||||
<EuiText size="xs">
|
||||
<b>
|
||||
{i18n.translate(
|
||||
'xpack.security.management.editRole.featureTable.featureVisibilityTitle',
|
||||
{
|
||||
defaultMessage: 'Customize feature privileges',
|
||||
}
|
||||
)}
|
||||
</b>
|
||||
</EuiText>
|
||||
)}
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem />
|
||||
{!this.props.disabled && (
|
||||
<EuiFlexItem grow={false}>
|
||||
<ChangeAllPrivilegesControl
|
||||
|
@ -397,7 +380,7 @@ export class FeatureTable extends Component<Props, State> {
|
|||
};
|
||||
|
||||
private getCategoryHelpText = (category: AppCategory) => {
|
||||
if (category.id === 'management') {
|
||||
if (category.id === 'management' && this.props.showAdditionalPermissionsMessage) {
|
||||
return i18n.translate(
|
||||
'xpack.security.management.editRole.featureTable.managementCategoryHelpText',
|
||||
{
|
||||
|
|
|
@ -226,6 +226,7 @@ export class SimplePrivilegeSection extends Component<Props, State> {
|
|||
privilegeIndex={this.props.role.kibana.findIndex((k) =>
|
||||
isGlobalPrivilegeDefinition(k)
|
||||
)}
|
||||
showAdditionalPermissionsMessage={true}
|
||||
canCustomizeSubFeaturePrivileges={this.props.canCustomizeSubFeaturePrivileges}
|
||||
allSpacesSelected
|
||||
disabled={!this.props.editable}
|
||||
|
|
|
@ -19,7 +19,6 @@ import type { Space } from '@kbn/spaces-plugin/public';
|
|||
import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers';
|
||||
|
||||
import { PrivilegeSpaceForm } from './privilege_space_form';
|
||||
import { SpaceSelector } from './space_selector';
|
||||
import type { Role } from '../../../../../../../common';
|
||||
|
||||
const createRole = (kibana: Role['kibana'] = []): Role => {
|
||||
|
@ -57,7 +56,7 @@ const renderComponent = (props: React.ComponentProps<typeof PrivilegeSpaceForm>)
|
|||
};
|
||||
|
||||
describe('PrivilegeSpaceForm', () => {
|
||||
it('renders an empty form when the role contains no Kibana privileges', () => {
|
||||
it('renders no form when no role is selected', () => {
|
||||
const role = createRole();
|
||||
const kibanaPrivileges = createKibanaPrivileges(kibanaFeatures);
|
||||
|
||||
|
@ -71,40 +70,9 @@ describe('PrivilegeSpaceForm', () => {
|
|||
onCancel: jest.fn(),
|
||||
});
|
||||
|
||||
expect(
|
||||
wrapper.find(EuiButtonGroup).filter('[name="basePrivilegeButtonGroup"]').props().idSelected
|
||||
).toEqual(`basePrivilege_custom`);
|
||||
expect(wrapper.find(FeatureTable).props().disabled).toEqual(true);
|
||||
expect(getDisplayedFeaturePrivileges(wrapper)).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"excluded_from_base": Object {
|
||||
"primaryFeaturePrivilege": "none",
|
||||
"subFeaturePrivileges": Array [],
|
||||
},
|
||||
"no_sub_features": Object {
|
||||
"primaryFeaturePrivilege": "none",
|
||||
"subFeaturePrivileges": Array [],
|
||||
},
|
||||
"with_excluded_sub_features": Object {
|
||||
"primaryFeaturePrivilege": "none",
|
||||
"subFeaturePrivileges": Array [],
|
||||
},
|
||||
"with_require_all_spaces_for_feature_and_sub_features": Object {
|
||||
"primaryFeaturePrivilege": "none",
|
||||
"subFeaturePrivileges": Array [],
|
||||
},
|
||||
"with_require_all_spaces_sub_features": Object {
|
||||
"primaryFeaturePrivilege": "none",
|
||||
"subFeaturePrivileges": Array [],
|
||||
},
|
||||
"with_sub_features": Object {
|
||||
"primaryFeaturePrivilege": "none",
|
||||
"subFeaturePrivileges": Array [],
|
||||
},
|
||||
}
|
||||
`);
|
||||
|
||||
expect(findTestSubject(wrapper, 'spaceFormGlobalPermissionsSupersedeWarning')).toHaveLength(0);
|
||||
expect(wrapper.find(EuiButtonGroup).filter('[name="basePrivilegeButtonGroup"]')).toHaveLength(
|
||||
0
|
||||
);
|
||||
});
|
||||
|
||||
it('renders when a base privilege is selected', () => {
|
||||
|
@ -232,43 +200,6 @@ describe('PrivilegeSpaceForm', () => {
|
|||
expect(findTestSubject(wrapper, 'spaceFormGlobalPermissionsSupersedeWarning')).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('renders a warning when configuring a global privilege after space privileges are already defined', () => {
|
||||
const role = createRole([
|
||||
{
|
||||
base: [],
|
||||
feature: {
|
||||
with_sub_features: ['read'],
|
||||
},
|
||||
spaces: ['foo'],
|
||||
},
|
||||
{
|
||||
base: [],
|
||||
feature: {
|
||||
with_sub_features: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
]);
|
||||
|
||||
const kibanaPrivileges = createKibanaPrivileges(kibanaFeatures);
|
||||
|
||||
const wrapper = renderComponent({
|
||||
role,
|
||||
spaces: displaySpaces,
|
||||
kibanaPrivileges,
|
||||
privilegeIndex: -1,
|
||||
canCustomizeSubFeaturePrivileges: true,
|
||||
onChange: jest.fn(),
|
||||
onCancel: jest.fn(),
|
||||
});
|
||||
|
||||
wrapper.find(SpaceSelector).props().onChange(['*']);
|
||||
|
||||
wrapper.update();
|
||||
|
||||
expect(findTestSubject(wrapper, 'globalPrivilegeWarning')).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('renders a warning when space privileges are less permissive than configured global privileges', () => {
|
||||
const role = createRole([
|
||||
{
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import type { EuiButtonColor } from '@elastic/eui';
|
||||
import {
|
||||
EuiButton,
|
||||
EuiButtonEmpty,
|
||||
|
@ -21,7 +20,6 @@ import {
|
|||
EuiForm,
|
||||
EuiFormRow,
|
||||
EuiSpacer,
|
||||
EuiText,
|
||||
EuiTitle,
|
||||
} from '@elastic/eui';
|
||||
import { remove } from 'lodash';
|
||||
|
@ -105,20 +103,19 @@ export class PrivilegeSpaceForm extends Component<Props, State> {
|
|||
<EuiFlyoutHeader hasBorder>
|
||||
<EuiTitle size="m">
|
||||
<h2>
|
||||
<FormattedMessage
|
||||
id="xpack.security.management.editRole.spacePrivilegeForm.modalTitle"
|
||||
defaultMessage="Assign role to space"
|
||||
/>
|
||||
{this.state.mode === 'create' ? (
|
||||
<FormattedMessage
|
||||
id="xpack.security.management.editRole.spacePrivilegeForm.modalTitleCreate"
|
||||
defaultMessage="Assign role to spaces"
|
||||
/>
|
||||
) : (
|
||||
<FormattedMessage
|
||||
id="xpack.security.management.editRole.spacePrivilegeForm.modalTitleUpdate"
|
||||
defaultMessage="Edit role privileges for spaces"
|
||||
/>
|
||||
)}
|
||||
</h2>
|
||||
</EuiTitle>
|
||||
<EuiText size="s">
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="xpack.security.management.editRole.spacePrivilegeForm.modalHeadline"
|
||||
defaultMessage="This role will be granted access to the following spaces"
|
||||
/>
|
||||
</p>
|
||||
</EuiText>
|
||||
</EuiFlyoutHeader>
|
||||
<EuiFlyoutBody>
|
||||
<EuiErrorBoundary>{this.getForm()}</EuiErrorBoundary>
|
||||
|
@ -180,14 +177,13 @@ export class PrivilegeSpaceForm extends Component<Props, State> {
|
|||
label={i18n.translate(
|
||||
'xpack.security.management.editRole.spacePrivilegeForm.spaceSelectorFormLabel',
|
||||
{
|
||||
defaultMessage: 'Spaces',
|
||||
defaultMessage: 'Select spaces',
|
||||
}
|
||||
)}
|
||||
helpText={i18n.translate(
|
||||
'xpack.security.management.editRole.spacePrivilegeForm.spaceSelectorFormHelpText',
|
||||
{
|
||||
defaultMessage:
|
||||
'Select one or more Kibana spaces to which you wish to assign privileges.',
|
||||
defaultMessage: 'Users assigned to this role will gain access to selected spaces.',
|
||||
}
|
||||
)}
|
||||
>
|
||||
|
@ -198,99 +194,85 @@ export class PrivilegeSpaceForm extends Component<Props, State> {
|
|||
/>
|
||||
</EuiFormRow>
|
||||
|
||||
{this.getPrivilegeCallout()}
|
||||
{Boolean(this.state.selectedSpaceIds.length) && (
|
||||
<>
|
||||
<EuiFormRow fullWidth>
|
||||
<EuiCallOut
|
||||
color="primary"
|
||||
iconType="iInCircle"
|
||||
size="s"
|
||||
title={i18n.translate(
|
||||
'xpack.security.management.editRole.spacePrivilegeForm.privilegeCombinationMsg.title',
|
||||
{
|
||||
defaultMessage: `The user's resulting access depends on a combination of their role's global space privileges and specific privileges applied to this space.`,
|
||||
}
|
||||
)}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
|
||||
<EuiFormRow
|
||||
fullWidth
|
||||
label={i18n.translate(
|
||||
'xpack.security.management.editRole.spacePrivilegeForm.privilegeSelectorFormLabel',
|
||||
{
|
||||
defaultMessage: 'Privileges for all features',
|
||||
}
|
||||
)}
|
||||
helpText={i18n.translate(
|
||||
'xpack.security.management.editRole.spacePrivilegeForm.privilegeSelectorFormHelpText',
|
||||
{
|
||||
defaultMessage:
|
||||
'Assign the privilege level you wish to grant to all present and future features across this space.',
|
||||
}
|
||||
)}
|
||||
>
|
||||
<EuiButtonGroup
|
||||
name={`basePrivilegeButtonGroup`}
|
||||
data-test-subj={`basePrivilegeButtonGroup`}
|
||||
isFullWidth={true}
|
||||
color={'primary'}
|
||||
options={[
|
||||
{
|
||||
id: 'basePrivilege_all',
|
||||
label: 'All',
|
||||
['data-test-subj']: 'basePrivilege_all',
|
||||
},
|
||||
{
|
||||
id: 'basePrivilege_read',
|
||||
label: 'Read',
|
||||
['data-test-subj']: 'basePrivilege_read',
|
||||
},
|
||||
{
|
||||
id: 'basePrivilege_custom',
|
||||
label: 'Customize',
|
||||
['data-test-subj']: 'basePrivilege_custom',
|
||||
},
|
||||
]}
|
||||
idSelected={this.getDisplayedBasePrivilege()}
|
||||
isDisabled={!hasSelectedSpaces}
|
||||
onChange={this.onSpaceBasePrivilegeChange}
|
||||
legend={i18n.translate(
|
||||
'xpack.security.management.editRole.spacePrivilegeForm.basePrivilegeControlLegend',
|
||||
{
|
||||
defaultMessage: 'Privileges for all features',
|
||||
}
|
||||
)}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
<EuiFormRow
|
||||
fullWidth
|
||||
label={i18n.translate(
|
||||
'xpack.security.management.editRole.spacePrivilegeForm.privilegeSelectorFormLabel',
|
||||
{
|
||||
defaultMessage: 'Define privileges',
|
||||
}
|
||||
)}
|
||||
helpText={i18n.translate(
|
||||
'xpack.security.management.editRole.spacePrivilegeForm.privilegeSelectorFormHelpText',
|
||||
{
|
||||
defaultMessage:
|
||||
'Assign the privilege level you wish to grant to all present and future features across this space.',
|
||||
}
|
||||
)}
|
||||
>
|
||||
<EuiButtonGroup
|
||||
name={`basePrivilegeButtonGroup`}
|
||||
data-test-subj={`basePrivilegeButtonGroup`}
|
||||
isFullWidth={true}
|
||||
color={'primary'}
|
||||
options={[
|
||||
{
|
||||
id: 'basePrivilege_all',
|
||||
label: 'All',
|
||||
['data-test-subj']: 'basePrivilege_all',
|
||||
},
|
||||
{
|
||||
id: 'basePrivilege_read',
|
||||
label: 'Read',
|
||||
['data-test-subj']: 'basePrivilege_read',
|
||||
},
|
||||
{
|
||||
id: 'basePrivilege_custom',
|
||||
label: 'Customize',
|
||||
['data-test-subj']: 'basePrivilege_custom',
|
||||
},
|
||||
]}
|
||||
idSelected={this.getDisplayedBasePrivilege()}
|
||||
isDisabled={!hasSelectedSpaces}
|
||||
onChange={this.onSpaceBasePrivilegeChange}
|
||||
legend={i18n.translate(
|
||||
'xpack.security.management.editRole.spacePrivilegeForm.basePrivilegeControlLegend',
|
||||
{
|
||||
defaultMessage: 'Privileges for all features',
|
||||
}
|
||||
)}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
|
||||
<EuiSpacer />
|
||||
|
||||
<EuiTitle size="xxs">
|
||||
<h3>{this.getFeatureListLabel(this.state.selectedBasePrivilege.length > 0)}</h3>
|
||||
</EuiTitle>
|
||||
|
||||
<EuiSpacer size="xs" />
|
||||
|
||||
<EuiText size="s">
|
||||
<p>{this.getFeatureListDescription(this.state.selectedBasePrivilege.length > 0)}</p>
|
||||
</EuiText>
|
||||
|
||||
<EuiSpacer size="l" />
|
||||
|
||||
<KibanaPrivilegeTable
|
||||
role={this.state.role}
|
||||
privilegeCalculator={this.state.privilegeCalculator}
|
||||
onChange={this.onFeaturePrivilegesChange}
|
||||
onChangeAll={this.onChangeAllFeaturePrivileges}
|
||||
kibanaPrivileges={this.props.kibanaPrivileges}
|
||||
privilegeIndex={this.state.privilegeIndex}
|
||||
canCustomizeSubFeaturePrivileges={this.props.canCustomizeSubFeaturePrivileges}
|
||||
disabled={this.state.selectedBasePrivilege.length > 0 || !hasSelectedSpaces}
|
||||
allSpacesSelected={this.state.selectedSpaceIds.includes(ALL_SPACES_ID)}
|
||||
/>
|
||||
|
||||
{this.requiresGlobalPrivilegeWarning() && (
|
||||
<Fragment>
|
||||
<EuiSpacer size="l" />
|
||||
<EuiCallOut
|
||||
color="warning"
|
||||
iconType="warning"
|
||||
data-test-subj="globalPrivilegeWarning"
|
||||
title={
|
||||
<FormattedMessage
|
||||
id="xpack.security.management.editRole.spacePrivilegeForm.globalPrivilegeWarning"
|
||||
defaultMessage="Creating a global privilege might impact your other space privileges."
|
||||
/>
|
||||
}
|
||||
<KibanaPrivilegeTable
|
||||
role={this.state.role}
|
||||
privilegeCalculator={this.state.privilegeCalculator}
|
||||
onChange={this.onFeaturePrivilegesChange}
|
||||
onChangeAll={this.onChangeAllFeaturePrivileges}
|
||||
kibanaPrivileges={this.props.kibanaPrivileges}
|
||||
privilegeIndex={this.state.privilegeIndex}
|
||||
showAdditionalPermissionsMessage={true}
|
||||
canCustomizeSubFeaturePrivileges={this.props.canCustomizeSubFeaturePrivileges}
|
||||
disabled={this.state.selectedBasePrivilege.length > 0 || !hasSelectedSpaces}
|
||||
allSpacesSelected={this.state.selectedSpaceIds.includes(ALL_SPACES_ID)}
|
||||
/>
|
||||
</Fragment>
|
||||
</>
|
||||
)}
|
||||
</EuiForm>
|
||||
);
|
||||
|
@ -298,58 +280,34 @@ export class PrivilegeSpaceForm extends Component<Props, State> {
|
|||
|
||||
private getSaveButton = () => {
|
||||
const { mode } = this.state;
|
||||
const isGlobal = this.isDefiningGlobalPrivilege();
|
||||
let buttonText;
|
||||
switch (mode) {
|
||||
case 'create':
|
||||
if (isGlobal) {
|
||||
buttonText = (
|
||||
<FormattedMessage
|
||||
id="xpack.security.management.editRolespacePrivilegeForm.createGlobalPrivilegeButton"
|
||||
defaultMessage="Create global privilege"
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
buttonText = (
|
||||
<FormattedMessage
|
||||
id="xpack.security.management.editRolespacePrivilegeForm.createPrivilegeButton"
|
||||
defaultMessage="Add Kibana privilege"
|
||||
/>
|
||||
);
|
||||
}
|
||||
buttonText = (
|
||||
<FormattedMessage
|
||||
id="xpack.security.management.editRolespacePrivilegeForm.createPrivilegeButton"
|
||||
defaultMessage="Assign role"
|
||||
/>
|
||||
);
|
||||
break;
|
||||
case 'update':
|
||||
if (isGlobal) {
|
||||
buttonText = (
|
||||
<FormattedMessage
|
||||
id="xpack.security.management.editRolespacePrivilegeForm.updateGlobalPrivilegeButton"
|
||||
defaultMessage="Update global privilege"
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
buttonText = (
|
||||
<FormattedMessage
|
||||
id="xpack.security.management.editRolespacePrivilegeForm.updatePrivilegeButton"
|
||||
defaultMessage="Update space privilege"
|
||||
/>
|
||||
);
|
||||
}
|
||||
buttonText = (
|
||||
<FormattedMessage
|
||||
id="xpack.security.management.editRolespacePrivilegeForm.updatePrivilegeButton"
|
||||
defaultMessage="Update role privileges"
|
||||
/>
|
||||
);
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unsupported mode: ${mode}`);
|
||||
}
|
||||
|
||||
let buttonColor: EuiButtonColor = 'primary';
|
||||
if (this.requiresGlobalPrivilegeWarning()) {
|
||||
buttonColor = 'warning';
|
||||
}
|
||||
|
||||
return (
|
||||
<EuiButton
|
||||
onClick={this.onSaveClick}
|
||||
fill
|
||||
disabled={!this.canSave()}
|
||||
color={buttonColor}
|
||||
color="primary"
|
||||
data-test-subj={'createSpacePrivilegeButton'}
|
||||
>
|
||||
{buttonText}
|
||||
|
@ -357,65 +315,6 @@ export class PrivilegeSpaceForm extends Component<Props, State> {
|
|||
);
|
||||
};
|
||||
|
||||
private getFeatureListLabel = (disabled: boolean) => {
|
||||
if (disabled) {
|
||||
return i18n.translate(
|
||||
'xpack.security.management.editRole.spacePrivilegeForm.summaryOfFeaturePrivileges',
|
||||
{
|
||||
defaultMessage: 'Summary of feature privileges',
|
||||
}
|
||||
);
|
||||
} else {
|
||||
return i18n.translate(
|
||||
'xpack.security.management.editRole.spacePrivilegeForm.customizeFeaturePrivileges',
|
||||
{
|
||||
defaultMessage: 'Customize by feature',
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
private getFeatureListDescription = (disabled: boolean) => {
|
||||
if (disabled) {
|
||||
return i18n.translate(
|
||||
'xpack.security.management.editRole.spacePrivilegeForm.featurePrivilegeSummaryDescription',
|
||||
{
|
||||
defaultMessage:
|
||||
'Some features might be hidden by the space or affected by a global space privilege.',
|
||||
}
|
||||
);
|
||||
} else {
|
||||
return i18n.translate(
|
||||
'xpack.security.management.editRole.spacePrivilegeForm.customizeFeaturePrivilegeDescription',
|
||||
{
|
||||
defaultMessage:
|
||||
'Increase privilege levels on a per feature basis. Some features might be hidden by the space or affected by a global space privilege.',
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
private getPrivilegeCallout = () => {
|
||||
if (this.isDefiningGlobalPrivilege()) {
|
||||
return (
|
||||
<EuiFormRow fullWidth>
|
||||
<EuiCallOut
|
||||
color="primary"
|
||||
iconType="iInCircle"
|
||||
title={i18n.translate(
|
||||
'xpack.security.management.editRole.spacePrivilegeForm.globalPrivilegeNotice',
|
||||
{
|
||||
defaultMessage: 'These privileges will apply to all current and future spaces.',
|
||||
}
|
||||
)}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
private closeFlyout = () => {
|
||||
this.props.onCancel();
|
||||
};
|
||||
|
@ -594,13 +493,4 @@ export class PrivilegeSpaceForm extends Component<Props, State> {
|
|||
};
|
||||
|
||||
private isDefiningGlobalPrivilege = () => this.state.selectedSpaceIds.includes('*');
|
||||
|
||||
private requiresGlobalPrivilegeWarning = () => {
|
||||
const hasOtherSpacePrivilegesDefined = this.props.role.kibana.length > 0;
|
||||
return (
|
||||
this.state.mode === 'create' &&
|
||||
this.isDefiningGlobalPrivilege() &&
|
||||
hasOtherSpacePrivilegesDefined
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -57,6 +57,9 @@ export class SpaceSelector extends Component<Props, {}> {
|
|||
aria-label={i18n.translate('xpack.security.management.editRole.spaceSelectorLabel', {
|
||||
defaultMessage: 'Spaces',
|
||||
})}
|
||||
placeholder={i18n.translate('xpack.security.management.editRole.spaceSelectorPlaceholder', {
|
||||
defaultMessage: 'Add spaces...',
|
||||
})}
|
||||
fullWidth
|
||||
options={this.getOptions()}
|
||||
renderOption={renderOption}
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
import type { EuiSuperSelectOption, EuiThemeComputed } from '@elastic/eui';
|
||||
import {
|
||||
EuiBetaBadge,
|
||||
EuiCallOut,
|
||||
EuiFlexGroup,
|
||||
EuiFlexItem,
|
||||
EuiFormRow,
|
||||
|
@ -180,21 +179,6 @@ export const SolutionView: FunctionComponent<Props> = ({
|
|||
isInvalid={validator.validateSolutionView(space, isEditing).isInvalid}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
|
||||
{showClassicDefaultViewCallout && (
|
||||
<>
|
||||
<EuiSpacer size="m" />
|
||||
<EuiCallOut
|
||||
color="primary"
|
||||
size="s"
|
||||
iconType="iInCircle"
|
||||
title={i18n.translate(
|
||||
'xpack.spaces.management.manageSpacePage.solutionViewSelect.classicDefaultViewCallout',
|
||||
{ defaultMessage: 'By default your current view is Classic' }
|
||||
)}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</SectionPanel>
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui';
|
||||
import { EuiConfirmModal, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui';
|
||||
import type { FC } from 'react';
|
||||
import React, { useCallback, useEffect } from 'react';
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
import type { KibanaFeature } from '@kbn/features-plugin/common';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
@ -40,6 +40,8 @@ export const EditSpaceAssignedRolesTab: FC<Props> = ({ space, features, isReadOn
|
|||
invokeClient,
|
||||
} = services;
|
||||
|
||||
const [removeRoleConfirm, setRemoveRoleConfirm] = useState<Role | null>(null);
|
||||
|
||||
// Roles are already loaded in app state, refresh them when user navigates to this tab
|
||||
useEffect(() => {
|
||||
const getRoles = async () => {
|
||||
|
@ -175,7 +177,7 @@ export const EditSpaceAssignedRolesTab: FC<Props> = ({ space, features, isReadOn
|
|||
);
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<>
|
||||
<EuiFlexGroup direction="column">
|
||||
<EuiFlexItem>
|
||||
<EuiText>
|
||||
|
@ -194,8 +196,8 @@ export const EditSpaceAssignedRolesTab: FC<Props> = ({ space, features, isReadOn
|
|||
onClickBulkRemove={async (selectedRoles) => {
|
||||
await removeRole(selectedRoles);
|
||||
}}
|
||||
onClickRowRemoveAction={async (rowRecord) => {
|
||||
await removeRole([rowRecord]);
|
||||
onClickRemoveRoleConfirm={async (rowRecord) => {
|
||||
setRemoveRoleConfirm(rowRecord);
|
||||
}}
|
||||
onClickAssignNewRole={async () => {
|
||||
showRolesPrivilegeEditor();
|
||||
|
@ -203,6 +205,36 @@ export const EditSpaceAssignedRolesTab: FC<Props> = ({ space, features, isReadOn
|
|||
/>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</React.Fragment>
|
||||
{removeRoleConfirm && (
|
||||
<EuiConfirmModal
|
||||
aria-labelledby="remove-role-confirm-modal"
|
||||
titleProps={{ id: 'remove-role-confirm-modal' }}
|
||||
title={i18n.translate('xpack.spaces.management.spaceDetails.roles.removeRoleModalTitle', {
|
||||
defaultMessage: 'Remove role "{roleName}" from the space?',
|
||||
values: { roleName: removeRoleConfirm.name },
|
||||
})}
|
||||
cancelButtonText={i18n.translate(
|
||||
'xpack.spaces.management.spaceDetails.roles.removeRoleModalCancel',
|
||||
{ defaultMessage: 'Cancel' }
|
||||
)}
|
||||
confirmButtonText={i18n.translate(
|
||||
'xpack.spaces.management.spaceDetails.roles.removeRoleModalConfirm',
|
||||
{ defaultMessage: 'Confirm' }
|
||||
)}
|
||||
onCancel={() => setRemoveRoleConfirm(null)}
|
||||
onConfirm={() => {
|
||||
removeRole([removeRoleConfirm]);
|
||||
setRemoveRoleConfirm(null);
|
||||
}}
|
||||
>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="xpack.spaces.management.spaceDetails.roles.removeRoleModalBody"
|
||||
defaultMessage="You can't undo this operation."
|
||||
/>
|
||||
</p>
|
||||
</EuiConfirmModal>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -20,7 +20,6 @@ import {
|
|||
EuiFormRow,
|
||||
EuiLink,
|
||||
EuiLoadingSpinner,
|
||||
EuiSpacer,
|
||||
EuiText,
|
||||
EuiTitle,
|
||||
useGeneratedHtmlId,
|
||||
|
@ -31,7 +30,6 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
|||
|
||||
import type { KibanaFeature, KibanaFeatureConfig } from '@kbn/features-plugin/common';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import type {
|
||||
RawKibanaPrivileges,
|
||||
Role,
|
||||
|
@ -157,7 +155,7 @@ export const PrivilegesRolesForm: FC<PrivilegesRolesFormProps> = (props) => {
|
|||
|
||||
const [roleSpacePrivilege, setRoleSpacePrivilege] = useState<KibanaRolePrivilege>(
|
||||
!selectedRoles.length || !selectedRolesCombinedPrivileges.length
|
||||
? FEATURE_PRIVILEGES_ALL
|
||||
? FEATURE_PRIVILEGES_CUSTOM
|
||||
: selectedRolesCombinedPrivileges[0]
|
||||
);
|
||||
|
||||
|
@ -378,17 +376,19 @@ export const PrivilegesRolesForm: FC<PrivilegesRolesFormProps> = (props) => {
|
|||
{ defaultMessage: 'Select roles' }
|
||||
)}
|
||||
labelAppend={
|
||||
<EuiLink
|
||||
id={manageRoleLinkId}
|
||||
href={getUrlForApp('management', { deepLinkId: 'roles' })}
|
||||
external={false}
|
||||
target="_blank"
|
||||
>
|
||||
{i18n.translate(
|
||||
'xpack.spaces.management.spaceDetails.roles.selectRolesFormRowLabelAnchor',
|
||||
{ defaultMessage: 'Manage roles' }
|
||||
)}
|
||||
</EuiLink>
|
||||
<EuiText size="xs">
|
||||
<EuiLink
|
||||
id={manageRoleLinkId}
|
||||
href={getUrlForApp('management', { deepLinkId: 'roles' })}
|
||||
external={false}
|
||||
target="_blank"
|
||||
>
|
||||
{i18n.translate(
|
||||
'xpack.spaces.management.spaceDetails.roles.selectRolesFormRowLabelAnchor',
|
||||
{ defaultMessage: 'Manage roles' }
|
||||
)}
|
||||
</EuiLink>
|
||||
</EuiText>
|
||||
}
|
||||
helpText={i18n.translate(
|
||||
'xpack.spaces.management.spaceDetails.roles.selectRolesHelp',
|
||||
|
@ -409,7 +409,7 @@ export const PrivilegesRolesForm: FC<PrivilegesRolesFormProps> = (props) => {
|
|||
)}
|
||||
placeholder={i18n.translate(
|
||||
'xpack.spaces.management.spaceDetails.roles.selectRolesPlaceholder',
|
||||
{ defaultMessage: 'Add a role...' }
|
||||
{ defaultMessage: 'Add roles...' }
|
||||
)}
|
||||
isLoading={fetchingDataDeps}
|
||||
options={createRolesComboBoxOptions(spaceUnallocatedRoles)}
|
||||
|
@ -452,9 +452,9 @@ export const PrivilegesRolesForm: FC<PrivilegesRolesFormProps> = (props) => {
|
|||
iconType="iInCircle"
|
||||
data-test-subj="privilege-info-callout"
|
||||
title={i18n.translate(
|
||||
'xpack.spaces.management.spaceDetails.roles.assign.privilegeConflictMsg.title',
|
||||
'xpack.spaces.management.spaceDetails.roles.assign.privilegeCombinationMsg.title',
|
||||
{
|
||||
defaultMessage: 'Privileges will apply only to this space.',
|
||||
defaultMessage: `The user's resulting access depends on a combination of their role's global space privileges and specific privileges applied to this space.`,
|
||||
}
|
||||
)}
|
||||
/>
|
||||
|
@ -464,7 +464,14 @@ export const PrivilegesRolesForm: FC<PrivilegesRolesFormProps> = (props) => {
|
|||
label={i18n.translate(
|
||||
'xpack.spaces.management.spaceDetails.roles.assign.privilegesLabelText',
|
||||
{
|
||||
defaultMessage: 'Define role privileges',
|
||||
defaultMessage: 'Define privileges',
|
||||
}
|
||||
)}
|
||||
helpText={i18n.translate(
|
||||
'xpack.spaces.management.spaceDetails.roles.assign.privilegesHelpText',
|
||||
{
|
||||
defaultMessage:
|
||||
'Assign the privilege level you wish to grant to all present and future features across this space.',
|
||||
}
|
||||
)}
|
||||
>
|
||||
|
@ -518,7 +525,6 @@ export const PrivilegesRolesForm: FC<PrivilegesRolesFormProps> = (props) => {
|
|||
<EuiLoadingSpinner size="l" />
|
||||
) : (
|
||||
<KibanaPrivilegeTable
|
||||
showTitle={false}
|
||||
disabled={roleSpacePrivilege !== FEATURE_PRIVILEGES_CUSTOM}
|
||||
role={roleCustomizationAnchor.value!}
|
||||
privilegeIndex={roleCustomizationAnchor.privilegeIndex}
|
||||
|
@ -597,6 +603,7 @@ export const PrivilegesRolesForm: FC<PrivilegesRolesFormProps> = (props) => {
|
|||
canCustomizeSubFeaturePrivileges={
|
||||
license?.getFeatures().allowSubFeaturePrivileges ?? false
|
||||
}
|
||||
showAdditionalPermissionsMessage={false}
|
||||
/>
|
||||
)}
|
||||
</React.Fragment>
|
||||
|
@ -643,10 +650,10 @@ export const PrivilegesRolesForm: FC<PrivilegesRolesFormProps> = (props) => {
|
|||
>
|
||||
{isEditOperation.current
|
||||
? i18n.translate('xpack.spaces.management.spaceDetails.roles.updateRoleButton', {
|
||||
defaultMessage: 'Update',
|
||||
defaultMessage: 'Update role privileges',
|
||||
})
|
||||
: i18n.translate('xpack.spaces.management.spaceDetails.roles.assignRoleButton', {
|
||||
defaultMessage: 'Assign',
|
||||
defaultMessage: 'Assign roles',
|
||||
})}
|
||||
</EuiButton>
|
||||
);
|
||||
|
@ -659,7 +666,7 @@ export const PrivilegesRolesForm: FC<PrivilegesRolesFormProps> = (props) => {
|
|||
<h2>
|
||||
{isEditOperation.current
|
||||
? i18n.translate('xpack.spaces.management.spaceDetails.roles.assignRoleButton', {
|
||||
defaultMessage: 'Edit role privileges',
|
||||
defaultMessage: 'Edit role privileges for space',
|
||||
})
|
||||
: i18n.translate(
|
||||
'xpack.spaces.management.spaceDetails.roles.assign.privileges.custom',
|
||||
|
@ -669,15 +676,6 @@ export const PrivilegesRolesForm: FC<PrivilegesRolesFormProps> = (props) => {
|
|||
)}
|
||||
</h2>
|
||||
</EuiTitle>
|
||||
<EuiSpacer size="s" />
|
||||
<EuiText size="s">
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="xpack.spaces.management.spaceDetails.privilegeForm.heading"
|
||||
defaultMessage="Define the privileges a given role should have in this space."
|
||||
/>
|
||||
</p>
|
||||
</EuiText>
|
||||
</EuiFlyoutHeader>
|
||||
<EuiFlyoutBody>{getForm()}</EuiFlyoutBody>
|
||||
<EuiFlyoutFooter>
|
||||
|
|
|
@ -18,7 +18,7 @@ const defaultProps: Pick<
|
|||
| 'onClickAssignNewRole'
|
||||
| 'onClickBulkRemove'
|
||||
| 'onClickRowEditAction'
|
||||
| 'onClickRowRemoveAction'
|
||||
| 'onClickRemoveRoleConfirm'
|
||||
| 'currentSpace'
|
||||
> = {
|
||||
currentSpace: {
|
||||
|
@ -29,7 +29,7 @@ const defaultProps: Pick<
|
|||
onClickBulkRemove: jest.fn(),
|
||||
onClickRowEditAction: jest.fn(),
|
||||
onClickAssignNewRole: jest.fn(),
|
||||
onClickRowRemoveAction: jest.fn(),
|
||||
onClickRemoveRoleConfirm: jest.fn(),
|
||||
};
|
||||
|
||||
const renderTestComponent = (
|
||||
|
|
|
@ -41,7 +41,7 @@ interface ISpaceAssignedRolesTableProps {
|
|||
assignedRoles: Map<Role['name'], Role>;
|
||||
onClickAssignNewRole: () => Promise<void>;
|
||||
onClickRowEditAction: (role: Role) => void;
|
||||
onClickRowRemoveAction: (role: Role) => void;
|
||||
onClickRemoveRoleConfirm: (role: Role) => void;
|
||||
supportsBulkAction?: boolean;
|
||||
onClickBulkRemove?: (selectedRoles: Role[]) => void;
|
||||
}
|
||||
|
@ -67,10 +67,10 @@ const getTableColumns = ({
|
|||
isReadOnly,
|
||||
currentSpace,
|
||||
onClickRowEditAction,
|
||||
onClickRowRemoveAction,
|
||||
onClickRemoveRoleConfirm,
|
||||
}: Pick<
|
||||
ISpaceAssignedRolesTableProps,
|
||||
'isReadOnly' | 'onClickRowEditAction' | 'onClickRowRemoveAction' | 'currentSpace'
|
||||
'isReadOnly' | 'onClickRowEditAction' | 'onClickRemoveRoleConfirm' | 'currentSpace'
|
||||
>) => {
|
||||
const columns: Array<EuiBasicTableColumn<Role>> = [
|
||||
{
|
||||
|
@ -205,7 +205,7 @@ const getTableColumns = ({
|
|||
{ defaultMessage: 'Click this action to remove the user from this space.' }
|
||||
),
|
||||
available: (rowRecord) => isEditableRole(rowRecord),
|
||||
onClick: onClickRowRemoveAction,
|
||||
onClick: onClickRemoveRoleConfirm,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
@ -237,14 +237,19 @@ export const SpaceAssignedRolesTable = ({
|
|||
onClickAssignNewRole,
|
||||
onClickBulkRemove,
|
||||
onClickRowEditAction,
|
||||
onClickRowRemoveAction,
|
||||
onClickRemoveRoleConfirm,
|
||||
isReadOnly = false,
|
||||
supportsBulkAction = false,
|
||||
}: ISpaceAssignedRolesTableProps) => {
|
||||
const tableColumns = useMemo(
|
||||
() =>
|
||||
getTableColumns({ isReadOnly, onClickRowEditAction, onClickRowRemoveAction, currentSpace }),
|
||||
[currentSpace, isReadOnly, onClickRowEditAction, onClickRowRemoveAction]
|
||||
getTableColumns({
|
||||
isReadOnly,
|
||||
onClickRowEditAction,
|
||||
onClickRemoveRoleConfirm,
|
||||
currentSpace,
|
||||
}),
|
||||
[currentSpace, isReadOnly, onClickRowEditAction, onClickRemoveRoleConfirm]
|
||||
);
|
||||
const [rolesInView, setRolesInView] = useState<Role[]>([]);
|
||||
const [selectedRoles, setSelectedRoles] = useState<Role[]>([]);
|
||||
|
@ -262,14 +267,17 @@ export const SpaceAssignedRolesTable = ({
|
|||
|
||||
const onSearchQueryChange = useCallback<NonNullable<NonNullable<EuiSearchBarProps['onChange']>>>(
|
||||
({ query }) => {
|
||||
const _assignedRolesTransformed = Array.from(assignedRoles.values());
|
||||
const assignedRolesTransformed = Array.from(assignedRoles.values());
|
||||
const sortedAssignedRolesTransformed = assignedRolesTransformed.sort(sortRolesForListing);
|
||||
|
||||
if (query?.text) {
|
||||
setRolesInView(
|
||||
_assignedRolesTransformed.filter((role) => role.name.includes(query.text.toLowerCase()))
|
||||
sortedAssignedRolesTransformed.filter((role) =>
|
||||
role.name.includes(query.text.toLowerCase())
|
||||
)
|
||||
);
|
||||
} else {
|
||||
setRolesInView(_assignedRolesTransformed);
|
||||
setRolesInView(sortedAssignedRolesTransformed);
|
||||
}
|
||||
},
|
||||
[assignedRoles]
|
||||
|
|
|
@ -153,12 +153,21 @@ describe('SpacesGridPage', () => {
|
|||
wrapper.update();
|
||||
|
||||
expect(wrapper.find('EuiInMemoryTable').prop('items')).toBe(spacesWithSolution);
|
||||
expect(wrapper.find('EuiInMemoryTable').prop('columns')).toContainEqual({
|
||||
field: 'solution',
|
||||
name: 'Solution view',
|
||||
sortable: true,
|
||||
render: expect.any(Function),
|
||||
});
|
||||
expect(wrapper.find('EuiInMemoryTable').prop('columns')).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({ name: '', field: 'initials' }),
|
||||
expect.objectContaining({ name: 'Space', field: 'name' }),
|
||||
expect.objectContaining({ name: 'Description', field: 'description' }),
|
||||
expect.objectContaining({ name: 'Solution view', field: 'solution' }),
|
||||
expect.objectContaining({
|
||||
actions: expect.arrayContaining([
|
||||
expect.objectContaining({ name: 'Edit', icon: 'pencil' }),
|
||||
expect.objectContaining({ name: 'Switch', icon: 'merge' }),
|
||||
expect.objectContaining({ name: 'Delete', icon: 'trash' }),
|
||||
]),
|
||||
}),
|
||||
])
|
||||
);
|
||||
});
|
||||
|
||||
it('renders a "current" badge for the current space', async () => {
|
||||
|
@ -410,4 +419,42 @@ describe('SpacesGridPage', () => {
|
|||
title: 'Error loading spaces',
|
||||
});
|
||||
});
|
||||
|
||||
it(`does not render the 'Features visible' column when serverless`, async () => {
|
||||
const httpStart = httpServiceMock.createStartContract();
|
||||
httpStart.get.mockResolvedValue([]);
|
||||
|
||||
const error = new Error('something awful happened');
|
||||
|
||||
const notifications = notificationServiceMock.createStartContract();
|
||||
|
||||
const wrapper = shallowWithIntl(
|
||||
<SpacesGridPage
|
||||
spacesManager={spacesManager}
|
||||
getFeatures={() => Promise.reject(error)}
|
||||
notifications={notifications}
|
||||
getUrlForApp={getUrlForApp}
|
||||
history={history}
|
||||
capabilities={{
|
||||
navLinks: {},
|
||||
management: {},
|
||||
catalogue: {},
|
||||
spaces: { manage: true },
|
||||
}}
|
||||
allowSolutionVisibility
|
||||
{...spacesGridCommonProps}
|
||||
/>
|
||||
);
|
||||
|
||||
// allow spacesManager to load spaces and lazy-load SpaceAvatar
|
||||
await act(async () => {});
|
||||
wrapper.update();
|
||||
|
||||
expect(wrapper.find('EuiInMemoryTable').prop('columns')).not.toContainEqual(
|
||||
expect.objectContaining({
|
||||
field: 'disabledFeatures',
|
||||
name: 'Features visible',
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -18,8 +18,6 @@ import {
|
|||
EuiPageHeader,
|
||||
EuiPageSection,
|
||||
EuiSpacer,
|
||||
EuiText,
|
||||
useIsWithinBreakpoints,
|
||||
} from '@elastic/eui';
|
||||
import React, { Component, lazy, Suspense } from 'react';
|
||||
|
||||
|
@ -36,17 +34,12 @@ import { reactRouterNavigate } from '@kbn/kibana-react-plugin/public';
|
|||
|
||||
import { addSpaceIdToPath, type Space } from '../../../common';
|
||||
import { isReservedSpace } from '../../../common';
|
||||
import {
|
||||
DEFAULT_SPACE_ID,
|
||||
ENTER_SPACE_PATH,
|
||||
SOLUTION_VIEW_CLASSIC,
|
||||
} from '../../../common/constants';
|
||||
import { DEFAULT_SPACE_ID, ENTER_SPACE_PATH } from '../../../common/constants';
|
||||
import { getSpacesFeatureDescription } from '../../constants';
|
||||
import { getSpaceAvatarComponent } from '../../space_avatar';
|
||||
import { SpaceSolutionBadge } from '../../space_solution_badge';
|
||||
import type { SpacesManager } from '../../spaces_manager';
|
||||
import { ConfirmDeleteModal, UnauthorizedPrompt } from '../components';
|
||||
import { getEnabledFeatures } from '../lib/feature_utils';
|
||||
|
||||
// No need to wrap LazySpaceAvatar in an error boundary, because it is one of the first chunks loaded when opening Kibana.
|
||||
const LazySpaceAvatar = lazy(() =>
|
||||
|
@ -254,8 +247,7 @@ export class SpacesGridPage extends Component<Props, State> {
|
|||
};
|
||||
|
||||
public getColumnConfig() {
|
||||
const { activeSpace, features } = this.state;
|
||||
const { solution: activeSolution } = activeSpace ?? {};
|
||||
const { activeSpace } = this.state;
|
||||
|
||||
const config: Array<EuiBasicTableColumn<Space>> = [
|
||||
{
|
||||
|
@ -283,15 +275,8 @@ export class SpacesGridPage extends Component<Props, State> {
|
|||
render: (value: string, rowRecord: Space) => {
|
||||
const SpaceName = () => {
|
||||
const isCurrent = this.state.activeSpace?.id === rowRecord.id;
|
||||
const isWide = useIsWithinBreakpoints(['xl']);
|
||||
const gridColumns = isCurrent && isWide ? 2 : 1;
|
||||
return (
|
||||
<EuiFlexGrid
|
||||
responsive={false}
|
||||
columns={gridColumns}
|
||||
alignItems="center"
|
||||
gutterSize="s"
|
||||
>
|
||||
<EuiFlexGrid responsive={false} columns={2} alignItems="center" gutterSize="s">
|
||||
<EuiFlexItem>
|
||||
<EuiLink
|
||||
{...reactRouterNavigate(this.props.history, this.getEditSpacePath(rowRecord))}
|
||||
|
@ -322,7 +307,7 @@ export class SpacesGridPage extends Component<Props, State> {
|
|||
return <SpaceName />;
|
||||
},
|
||||
'data-test-subj': 'spacesListTableRowNameCell',
|
||||
width: '15%',
|
||||
width: '20%',
|
||||
},
|
||||
{
|
||||
field: 'description',
|
||||
|
@ -331,54 +316,10 @@ export class SpacesGridPage extends Component<Props, State> {
|
|||
}),
|
||||
sortable: true,
|
||||
truncateText: true,
|
||||
width: '45%',
|
||||
width: '40%',
|
||||
},
|
||||
];
|
||||
|
||||
const shouldShowFeaturesColumn = !activeSolution || activeSolution === SOLUTION_VIEW_CLASSIC;
|
||||
if (shouldShowFeaturesColumn) {
|
||||
config.push({
|
||||
field: 'disabledFeatures',
|
||||
name: i18n.translate('xpack.spaces.management.spacesGridPage.featuresColumnName', {
|
||||
defaultMessage: 'Features visible',
|
||||
}),
|
||||
sortable: (space: Space) => {
|
||||
return getEnabledFeatures(features, space).length;
|
||||
},
|
||||
render: (_disabledFeatures: string[], rowRecord: Space) => {
|
||||
const enabledFeatureCount = getEnabledFeatures(features, rowRecord).length;
|
||||
if (enabledFeatureCount === features.length) {
|
||||
return (
|
||||
<FormattedMessage
|
||||
id="xpack.spaces.management.spacesGridPage.allFeaturesEnabled"
|
||||
defaultMessage="All features"
|
||||
/>
|
||||
);
|
||||
}
|
||||
if (enabledFeatureCount === 0) {
|
||||
return (
|
||||
<EuiText color={'danger'} size="s">
|
||||
<FormattedMessage
|
||||
id="xpack.spaces.management.spacesGridPage.noFeaturesEnabled"
|
||||
defaultMessage="No features visible"
|
||||
/>
|
||||
</EuiText>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<FormattedMessage
|
||||
id="xpack.spaces.management.spacesGridPage.someFeaturesEnabled"
|
||||
defaultMessage="{enabledFeatureCount} / {totalFeatureCount}"
|
||||
values={{
|
||||
enabledFeatureCount,
|
||||
totalFeatureCount: features.length,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
config.push({
|
||||
field: 'id',
|
||||
name: i18n.translate('xpack.spaces.management.spacesGridPage.identifierColumnName', {
|
||||
|
@ -403,6 +344,7 @@ export class SpacesGridPage extends Component<Props, State> {
|
|||
render: (solution: Space['solution'], record: Space) => (
|
||||
<SpaceSolutionBadge solution={solution} data-test-subj={`${record.id}-solution`} />
|
||||
),
|
||||
width: '10%',
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -3145,6 +3145,8 @@
|
|||
"esqlEditor.query.EnableWordWrapLabel": "Ajouter des sauts de ligne aux barres verticales",
|
||||
"esqlEditor.query.errorCount": "{count} {count, plural, one {erreur} other {erreurs}}",
|
||||
"esqlEditor.query.errorsTitle": "Erreurs",
|
||||
"esqlEditor.query.esqlQueriesCopy": "Copier la requête dans le presse-papier",
|
||||
"esqlEditor.query.esqlQueriesListRun": "Exécuter la requête",
|
||||
"esqlEditor.query.expandLabel": "Développer",
|
||||
"esqlEditor.query.feedback": "Commentaires",
|
||||
"esqlEditor.query.hideQueriesLabel": "Masquer les recherches récentes",
|
||||
|
@ -3154,8 +3156,6 @@
|
|||
"esqlEditor.query.lineNumber": "Ligne {lineNumber}",
|
||||
"esqlEditor.query.querieshistory.error": "La requête a échouée",
|
||||
"esqlEditor.query.querieshistory.success": "La requête a été exécuté avec succès",
|
||||
"esqlEditor.query.esqlQueriesCopy": "Copier la requête dans le presse-papier",
|
||||
"esqlEditor.query.esqlQueriesListRun": "Exécuter la requête",
|
||||
"esqlEditor.query.querieshistoryTable": "Tableau d'historique des recherches",
|
||||
"esqlEditor.query.recentQueriesColumnLabel": "Recherches récentes",
|
||||
"esqlEditor.query.refreshLabel": "Actualiser",
|
||||
|
@ -36568,7 +36568,6 @@
|
|||
"xpack.security.management.editRole.featureTable.cannotCustomizeSubFeaturesTooltip": "La personnalisation des privilèges de sous-fonctionnalité est une fonctionnalité soumise à abonnement.",
|
||||
"xpack.security.management.editRole.featureTable.customizeSubFeaturePrivilegesSwitchLabel": "Personnaliser les privilèges des sous-fonctionnalités",
|
||||
"xpack.security.management.editRole.featureTable.featureAccordionSwitchLabel": "{grantedCount}/{featureCount} {featureCount, plural, one {fonctionnalité accordée} other {fonctionnalités accordées}}",
|
||||
"xpack.security.management.editRole.featureTable.featureVisibilityTitle": "Personnaliser les privilèges des fonctionnalités",
|
||||
"xpack.security.management.editRole.featureTable.managementCategoryHelpText": "Des autorisations de gestion de suite supplémentaires sont disponibles en dehors de ce menu, dans les privilèges d'index et de cluster.",
|
||||
"xpack.security.management.editRole.featureTable.privilegeCustomizationTooltip": "La fonctionnalité possède des privilèges de sous-fonctionnalités personnalisés. Développez cette ligne pour en savoir plus.",
|
||||
"xpack.security.management.editRole.indexPrivilegeForm.clustersFormRowLabel": "Clusters distants",
|
||||
|
@ -36629,18 +36628,10 @@
|
|||
"xpack.security.management.editRole.spaceAwarePrivilegeForm.kibanaAdminTitle": "kibana_admin",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.basePrivilegeControlLegend": "Privilèges pour toutes les fonctionnalités",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.cancelButton": "Annuler",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.customizeFeaturePrivilegeDescription": "Augmentez les niveaux de privilèges sur la base de chaque fonctionnalité. Certaines fonctionnalités peuvent être masquées par l'espace ou concernées par un privilège d'espace global.",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.customizeFeaturePrivileges": "Personnaliser par fonctionnalité",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.featurePrivilegeSummaryDescription": "Certaines fonctionnalités peuvent être masquées par l'espace ou concernées par un privilège d'espace global.",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.globalPrivilegeNotice": "Ces privilèges s'appliqueront à tous les espaces, actuels et futurs.",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.globalPrivilegeWarning": "La création d'un privilège global peut impacter vos autres privilèges liés aux espaces.",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.modalHeadline": "Ce rôle aura accès aux espaces suivants",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.modalTitle": "Affecter un rôle à l'espace",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.privilegeSelectorFormHelpText": "Affectez le niveau de privilège que vous souhaitez accorder à toutes les fonctionnalités présentes et futures de cet espace.",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.privilegeSelectorFormLabel": "Privilèges pour toutes les fonctionnalités",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.spaceSelectorFormHelpText": "Sélectionnez un ou plusieurs espaces Kibana auxquels vous souhaitez affecter des privilèges.",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.spaceSelectorFormLabel": "Espaces",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.summaryOfFeaturePrivileges": "Résumé des privilèges des fonctionnalités",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.supersededWarning": "Les privilèges déclarés sont moins flexibles que les privilèges globaux configurés. Affichez le résumé des privilèges pour voir les privilèges effectifs.",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.supersededWarningTitle": "Remplacé par les privilèges globaux",
|
||||
"xpack.security.management.editRole.spacePrivilegeMatrix.globalSpaceName": "Tous les espaces",
|
||||
|
@ -36773,9 +36764,7 @@
|
|||
"xpack.security.management.editRoles.indexPrivilegeForm.grantedFieldsFormRowHelpText": "Si aucun champ n'est accordé, les utilisateurs affectés à ce rôle ne pourront voir aucune donnée pour cet index.",
|
||||
"xpack.security.management.editRoles.indexPrivilegeForm.grantedFieldsFormRowLabel": "Champs accordés",
|
||||
"xpack.security.management.editRoles.indexPrivilegeForm.grantFieldPrivilegesLabel": "Accorder l'accès aux champs spécifiques",
|
||||
"xpack.security.management.editRolespacePrivilegeForm.createGlobalPrivilegeButton": "Créer un privilège global",
|
||||
"xpack.security.management.editRolespacePrivilegeForm.createPrivilegeButton": "Ajouter un privilège Kibana",
|
||||
"xpack.security.management.editRolespacePrivilegeForm.updateGlobalPrivilegeButton": "Mettre à jour le privilège global",
|
||||
"xpack.security.management.editRolespacePrivilegeForm.updatePrivilegeButton": "Mettre à jour le privilège d'espace",
|
||||
"xpack.security.management.enabledBadge": "Activé",
|
||||
"xpack.security.management.readonlyBadge.text": "Lecture seule",
|
||||
|
@ -44893,7 +44882,6 @@
|
|||
"xpack.spaces.management.spaceDetails.footerActions.updateSpace": "Appliquer les modifications",
|
||||
"xpack.spaces.management.spaceDetails.keepEditingButton": "Enregistrer avant de quitter",
|
||||
"xpack.spaces.management.spaceDetails.leavePageButton": "Quitter",
|
||||
"xpack.spaces.management.spaceDetails.privilegeForm.heading": "Définissez les privilèges qu'un rôle donné devrait avoir dans cet espace.",
|
||||
"xpack.spaces.management.spaceDetails.roles.assign": "Attribuer de nouveaux rôles",
|
||||
"xpack.spaces.management.spaceDetails.roles.assign.privilegeConflictMsg.description": "La mise à jour en groupe des paramètres ici remplacera les paramètres individuels actuels.",
|
||||
"xpack.spaces.management.spaceDetails.roles.assign.privilegeConflictMsg.title": "Les privilèges s'appliqueront uniquement à cet espace.",
|
||||
|
@ -44944,7 +44932,6 @@
|
|||
"xpack.spaces.management.spaceIdentifier.kibanaURLForSpaceIdentifierDescription": "Vous ne pouvez pas modifier l'identifiant d'URL après sa création.",
|
||||
"xpack.spaces.management.spaceIdentifier.urlIdentifierTitle": "Identifiant d'URL",
|
||||
"xpack.spaces.management.spacesGridPage.actionsColumnName": "Actions",
|
||||
"xpack.spaces.management.spacesGridPage.allFeaturesEnabled": "Toutes les fonctionnalités",
|
||||
"xpack.spaces.management.spacesGridPage.createSpaceButtonLabel": "Créer l'espace",
|
||||
"xpack.spaces.management.spacesGridPage.currentSpaceMarkerText": "actuel",
|
||||
"xpack.spaces.management.spacesGridPage.deleteActionDescription": "Supprimer {spaceName}",
|
||||
|
@ -44954,13 +44941,10 @@
|
|||
"xpack.spaces.management.spacesGridPage.editSpaceActionDescription": "Modifier {spaceName}.",
|
||||
"xpack.spaces.management.spacesGridPage.editSpaceActionName": "Modifier",
|
||||
"xpack.spaces.management.spacesGridPage.errorTitle": "Erreur lors du chargement des espaces",
|
||||
"xpack.spaces.management.spacesGridPage.featuresColumnName": "Fonctionnalités visibles",
|
||||
"xpack.spaces.management.spacesGridPage.identifierColumnName": "Identificateur",
|
||||
"xpack.spaces.management.spacesGridPage.loadingTitle": "chargement…",
|
||||
"xpack.spaces.management.spacesGridPage.noFeaturesEnabled": "Aucune fonctionnalité visible",
|
||||
"xpack.spaces.management.spacesGridPage.searchPlaceholder": "Recherche",
|
||||
"xpack.spaces.management.spacesGridPage.solutionColumnName": "Afficher la solution",
|
||||
"xpack.spaces.management.spacesGridPage.someFeaturesEnabled": "{enabledFeatureCount}/{totalFeatureCount}",
|
||||
"xpack.spaces.management.spacesGridPage.spaceColumnName": "Espace",
|
||||
"xpack.spaces.management.spacesGridPage.spacesTitle": "Espaces",
|
||||
"xpack.spaces.management.spacesGridPage.switchSpaceActionDescription": "Basculer vers {spaceName}",
|
||||
|
|
|
@ -3139,6 +3139,8 @@
|
|||
"esqlEditor.query.EnableWordWrapLabel": "パイプの改行を追加",
|
||||
"esqlEditor.query.errorCount": "{count} {count, plural, other {# 件のエラー}}",
|
||||
"esqlEditor.query.errorsTitle": "エラー",
|
||||
"esqlEditor.query.esqlQueriesCopy": "クエリをクリップボードにコピー",
|
||||
"esqlEditor.query.esqlQueriesListRun": "クエリーを実行",
|
||||
"esqlEditor.query.expandLabel": "拡張",
|
||||
"esqlEditor.query.feedback": "フィードバック",
|
||||
"esqlEditor.query.hideQueriesLabel": "最近のクエリーを非表示",
|
||||
|
@ -3148,8 +3150,6 @@
|
|||
"esqlEditor.query.lineNumber": "行{lineNumber}",
|
||||
"esqlEditor.query.querieshistory.error": "クエリ失敗",
|
||||
"esqlEditor.query.querieshistory.success": "クエリは正常に実行されました",
|
||||
"esqlEditor.query.esqlQueriesCopy": "クエリをクリップボードにコピー",
|
||||
"esqlEditor.query.esqlQueriesListRun": "クエリーを実行",
|
||||
"esqlEditor.query.querieshistoryTable": "クエリ履歴テーブル",
|
||||
"esqlEditor.query.recentQueriesColumnLabel": "最近のクエリー",
|
||||
"esqlEditor.query.refreshLabel": "更新",
|
||||
|
@ -36536,7 +36536,6 @@
|
|||
"xpack.security.management.editRole.featureTable.cannotCustomizeSubFeaturesTooltip": "サブ機能権限のカスタマイズはサブスクリプション機能です。",
|
||||
"xpack.security.management.editRole.featureTable.customizeSubFeaturePrivilegesSwitchLabel": "サブ機能権限をカスタマイズする",
|
||||
"xpack.security.management.editRole.featureTable.featureAccordionSwitchLabel": "{grantedCount} / {featureCount} {featureCount, plural, other {機能}}が付与されました",
|
||||
"xpack.security.management.editRole.featureTable.featureVisibilityTitle": "機能権限をカスタマイズ",
|
||||
"xpack.security.management.editRole.featureTable.managementCategoryHelpText": "追加のスタック管理権限は、このメニューの外にあるインデックス権限とクラスター権限をご覧ください。",
|
||||
"xpack.security.management.editRole.featureTable.privilegeCustomizationTooltip": "機能でサブ機能の権限がカスタマイズされています。この行を展開すると詳細が表示されます。",
|
||||
"xpack.security.management.editRole.indexPrivilegeForm.clustersFormRowLabel": "リモートクラスター",
|
||||
|
@ -36597,18 +36596,10 @@
|
|||
"xpack.security.management.editRole.spaceAwarePrivilegeForm.kibanaAdminTitle": "kibana_admin",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.basePrivilegeControlLegend": "すべての機能の権限",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.cancelButton": "キャンセル",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.customizeFeaturePrivilegeDescription": "機能ごとに権限のレベルを上げます。機能によってはスペースごとに非表示になっているか、グローバルスペース権限による影響を受けているものもあります。",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.customizeFeaturePrivileges": "機能ごとにカスタマイズ",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.featurePrivilegeSummaryDescription": "機能によってはスペースごとに非表示になっているか、グローバルスペース権限による影響を受けているものもあります。",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.globalPrivilegeNotice": "これらの権限はすべての現在および未来のスペースに適用されます。",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.globalPrivilegeWarning": "グローバル権限の作成は他のスペース権限に影響を与える可能性があります。",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.modalHeadline": "このロールには、次のスペースへのアクセス権が付与されます",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.modalTitle": "ロールをスペースに割り当て",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.privilegeSelectorFormHelpText": "このスペース全体の現在と将来のすべての機能に対して、付与する権限レベルを割り当てます。",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.privilegeSelectorFormLabel": "すべての機能の権限",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.spaceSelectorFormHelpText": "権限を割り当てる1つ以上のKibanaスペースを選択します。",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.spaceSelectorFormLabel": "スペース",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.summaryOfFeaturePrivileges": "機能権限のサマリー",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.supersededWarning": "宣言された権限は、構成済みグローバル権限よりも許容度が低くなります。権限サマリーを表示すると有効な権限がわかります。",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.supersededWarningTitle": "グローバル権限に置き換え",
|
||||
"xpack.security.management.editRole.spacePrivilegeMatrix.globalSpaceName": "すべてのスペース",
|
||||
|
@ -36741,9 +36732,7 @@
|
|||
"xpack.security.management.editRoles.indexPrivilegeForm.grantedFieldsFormRowHelpText": "フィールドが提供されていない場合、このロールのユーザーはこのインデックスのデータを表示できません。",
|
||||
"xpack.security.management.editRoles.indexPrivilegeForm.grantedFieldsFormRowLabel": "許可されたフィールド",
|
||||
"xpack.security.management.editRoles.indexPrivilegeForm.grantFieldPrivilegesLabel": "特定のフィールドへのアクセスを許可",
|
||||
"xpack.security.management.editRolespacePrivilegeForm.createGlobalPrivilegeButton": "グローバル権限を作成",
|
||||
"xpack.security.management.editRolespacePrivilegeForm.createPrivilegeButton": "Kibanaの権限を追加",
|
||||
"xpack.security.management.editRolespacePrivilegeForm.updateGlobalPrivilegeButton": "グローバル特権を更新",
|
||||
"xpack.security.management.editRolespacePrivilegeForm.updatePrivilegeButton": "スペース権限を更新",
|
||||
"xpack.security.management.enabledBadge": "有効",
|
||||
"xpack.security.management.readonlyBadge.text": "読み取り専用",
|
||||
|
@ -44853,7 +44842,6 @@
|
|||
"xpack.spaces.management.spaceDetails.footerActions.updateSpace": "変更を適用",
|
||||
"xpack.spaces.management.spaceDetails.keepEditingButton": "移動する前に保存",
|
||||
"xpack.spaces.management.spaceDetails.leavePageButton": "移動",
|
||||
"xpack.spaces.management.spaceDetails.privilegeForm.heading": "このスペースで特定のロールに割り当てる権限を定義します。",
|
||||
"xpack.spaces.management.spaceDetails.roles.assign": "新しいロールを割り当て",
|
||||
"xpack.spaces.management.spaceDetails.roles.assign.privilegeConflictMsg.description": "ここで設定を一括更新すると、現在の個別の設定が上書きされます。",
|
||||
"xpack.spaces.management.spaceDetails.roles.assign.privilegeConflictMsg.title": "権限はこのスペースにのみ適用されます。",
|
||||
|
@ -44904,7 +44892,6 @@
|
|||
"xpack.spaces.management.spaceIdentifier.kibanaURLForSpaceIdentifierDescription": "作成した後はURL識別子を変更できません。",
|
||||
"xpack.spaces.management.spaceIdentifier.urlIdentifierTitle": "URL 識別子",
|
||||
"xpack.spaces.management.spacesGridPage.actionsColumnName": "アクション",
|
||||
"xpack.spaces.management.spacesGridPage.allFeaturesEnabled": "すべての機能",
|
||||
"xpack.spaces.management.spacesGridPage.createSpaceButtonLabel": "スペースを作成",
|
||||
"xpack.spaces.management.spacesGridPage.currentSpaceMarkerText": "現在",
|
||||
"xpack.spaces.management.spacesGridPage.deleteActionDescription": "{spaceName}を削除",
|
||||
|
@ -44914,13 +44901,10 @@
|
|||
"xpack.spaces.management.spacesGridPage.editSpaceActionDescription": "{spaceName} を編集。",
|
||||
"xpack.spaces.management.spacesGridPage.editSpaceActionName": "編集",
|
||||
"xpack.spaces.management.spacesGridPage.errorTitle": "スペースの読み込みエラー",
|
||||
"xpack.spaces.management.spacesGridPage.featuresColumnName": "表示される機能",
|
||||
"xpack.spaces.management.spacesGridPage.identifierColumnName": "識別子",
|
||||
"xpack.spaces.management.spacesGridPage.loadingTitle": "読み込み中…",
|
||||
"xpack.spaces.management.spacesGridPage.noFeaturesEnabled": "表示されている機能がありません",
|
||||
"xpack.spaces.management.spacesGridPage.searchPlaceholder": "検索",
|
||||
"xpack.spaces.management.spacesGridPage.solutionColumnName": "ソリューションビュー",
|
||||
"xpack.spaces.management.spacesGridPage.someFeaturesEnabled": "{enabledFeatureCount} / {totalFeatureCount}",
|
||||
"xpack.spaces.management.spacesGridPage.spaceColumnName": "スペース",
|
||||
"xpack.spaces.management.spacesGridPage.spacesTitle": "スペース",
|
||||
"xpack.spaces.management.spacesGridPage.switchSpaceActionDescription": "{spaceName}に切り替える",
|
||||
|
|
|
@ -3146,6 +3146,8 @@
|
|||
"esqlEditor.query.EnableWordWrapLabel": "在管道符上添加换行符",
|
||||
"esqlEditor.query.errorCount": "{count} 个{count, plural, other {错误}}",
|
||||
"esqlEditor.query.errorsTitle": "错误",
|
||||
"esqlEditor.query.esqlQueriesCopy": "复制查询到剪贴板",
|
||||
"esqlEditor.query.esqlQueriesListRun": "运行查询",
|
||||
"esqlEditor.query.expandLabel": "展开",
|
||||
"esqlEditor.query.feedback": "反馈",
|
||||
"esqlEditor.query.hideQueriesLabel": "隐藏最近查询",
|
||||
|
@ -3155,8 +3157,6 @@
|
|||
"esqlEditor.query.lineNumber": "第 {lineNumber} 行",
|
||||
"esqlEditor.query.querieshistory.error": "查询失败",
|
||||
"esqlEditor.query.querieshistory.success": "已成功运行查询",
|
||||
"esqlEditor.query.esqlQueriesCopy": "复制查询到剪贴板",
|
||||
"esqlEditor.query.esqlQueriesListRun": "运行查询",
|
||||
"esqlEditor.query.querieshistoryTable": "查询历史记录表",
|
||||
"esqlEditor.query.recentQueriesColumnLabel": "最近查询",
|
||||
"esqlEditor.query.refreshLabel": "刷新",
|
||||
|
@ -36602,7 +36602,6 @@
|
|||
"xpack.security.management.editRole.featureTable.cannotCustomizeSubFeaturesTooltip": "定制子功能权限为订阅功能。",
|
||||
"xpack.security.management.editRole.featureTable.customizeSubFeaturePrivilegesSwitchLabel": "定制子功能权限",
|
||||
"xpack.security.management.editRole.featureTable.featureAccordionSwitchLabel": "{grantedCount} / {featureCount} 项{featureCount, plural, other {功能}}已授予",
|
||||
"xpack.security.management.editRole.featureTable.featureVisibilityTitle": "定制功能权限",
|
||||
"xpack.security.management.editRole.featureTable.managementCategoryHelpText": "可以在此菜单以外、在索引和集群权限中找到其他堆栈管理权限。",
|
||||
"xpack.security.management.editRole.featureTable.privilegeCustomizationTooltip": "功能已定制子功能权限。展开此行以了解更多信息。",
|
||||
"xpack.security.management.editRole.indexPrivilegeForm.clustersFormRowLabel": "远程集群",
|
||||
|
@ -36663,18 +36662,10 @@
|
|||
"xpack.security.management.editRole.spaceAwarePrivilegeForm.kibanaAdminTitle": "kibana_admin",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.basePrivilegeControlLegend": "所有功能的权限",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.cancelButton": "取消",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.customizeFeaturePrivilegeDescription": "按功能提高权限级别。某些功能可能被工作区隐藏或受全局工作区权限影响。",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.customizeFeaturePrivileges": "按功能定制",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.featurePrivilegeSummaryDescription": "某些功能可能被工作区隐藏或受全局工作区权限影响。",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.globalPrivilegeNotice": "这些权限将应用到所有当前和未来工作区。",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.globalPrivilegeWarning": "创建全局权限可能会影响您的其他工作区权限。",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.modalHeadline": "必须向此角色授权以下工作区的访问权限",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.modalTitle": "将角色分配给工作区",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.privilegeSelectorFormHelpText": "分配您希望向此工作区的所有现有和未来功能授予的权限级别。",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.privilegeSelectorFormLabel": "所有功能的权限",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.spaceSelectorFormHelpText": "选择一个或多个希望分配权限的 Kibana 工作区。",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.spaceSelectorFormLabel": "工作区",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.summaryOfFeaturePrivileges": "功能权限的摘要",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.supersededWarning": "声明的权限相对配置的全局权限有较小的宽容度。查看权限摘要以查看有效的权限。",
|
||||
"xpack.security.management.editRole.spacePrivilegeForm.supersededWarningTitle": "已由全局权限取代",
|
||||
"xpack.security.management.editRole.spacePrivilegeMatrix.globalSpaceName": "所有工作区",
|
||||
|
@ -36807,9 +36798,7 @@
|
|||
"xpack.security.management.editRoles.indexPrivilegeForm.grantedFieldsFormRowHelpText": "如果未授权任何字段,则分配到此角色的用户将无法查看此索引的任何数据。",
|
||||
"xpack.security.management.editRoles.indexPrivilegeForm.grantedFieldsFormRowLabel": "已授权字段",
|
||||
"xpack.security.management.editRoles.indexPrivilegeForm.grantFieldPrivilegesLabel": "授予对特定字段的访问权限",
|
||||
"xpack.security.management.editRolespacePrivilegeForm.createGlobalPrivilegeButton": "创建全局权限",
|
||||
"xpack.security.management.editRolespacePrivilegeForm.createPrivilegeButton": "添加 Kibana 权限",
|
||||
"xpack.security.management.editRolespacePrivilegeForm.updateGlobalPrivilegeButton": "更新全局权限",
|
||||
"xpack.security.management.editRolespacePrivilegeForm.updatePrivilegeButton": "更新工作区权限",
|
||||
"xpack.security.management.enabledBadge": "已启用",
|
||||
"xpack.security.management.readonlyBadge.text": "只读",
|
||||
|
@ -44927,7 +44916,6 @@
|
|||
"xpack.spaces.management.spaceDetails.footerActions.updateSpace": "应用更改",
|
||||
"xpack.spaces.management.spaceDetails.keepEditingButton": "保存然后离开",
|
||||
"xpack.spaces.management.spaceDetails.leavePageButton": "离开",
|
||||
"xpack.spaces.management.spaceDetails.privilegeForm.heading": "定义给定角色在此工作区中应具有的权限。",
|
||||
"xpack.spaces.management.spaceDetails.roles.assign": "分配新角色",
|
||||
"xpack.spaces.management.spaceDetails.roles.assign.privilegeConflictMsg.description": "在此批量更新设置会覆盖当前的单个设置。",
|
||||
"xpack.spaces.management.spaceDetails.roles.assign.privilegeConflictMsg.title": "权限将仅适用于此工作区。",
|
||||
|
@ -44978,7 +44966,6 @@
|
|||
"xpack.spaces.management.spaceIdentifier.kibanaURLForSpaceIdentifierDescription": "创建后,将无法更改 URL 标识符。",
|
||||
"xpack.spaces.management.spaceIdentifier.urlIdentifierTitle": "URL 标识符",
|
||||
"xpack.spaces.management.spacesGridPage.actionsColumnName": "操作",
|
||||
"xpack.spaces.management.spacesGridPage.allFeaturesEnabled": "所有功能",
|
||||
"xpack.spaces.management.spacesGridPage.createSpaceButtonLabel": "创建工作区",
|
||||
"xpack.spaces.management.spacesGridPage.currentSpaceMarkerText": "当前",
|
||||
"xpack.spaces.management.spacesGridPage.deleteActionDescription": "删除 {spaceName}",
|
||||
|
@ -44988,13 +44975,10 @@
|
|||
"xpack.spaces.management.spacesGridPage.editSpaceActionDescription": "编辑 {spaceName}。",
|
||||
"xpack.spaces.management.spacesGridPage.editSpaceActionName": "编辑",
|
||||
"xpack.spaces.management.spacesGridPage.errorTitle": "加载工作区时出错",
|
||||
"xpack.spaces.management.spacesGridPage.featuresColumnName": "功能可见",
|
||||
"xpack.spaces.management.spacesGridPage.identifierColumnName": "标识符",
|
||||
"xpack.spaces.management.spacesGridPage.loadingTitle": "正在加载……",
|
||||
"xpack.spaces.management.spacesGridPage.noFeaturesEnabled": "没有可见功能",
|
||||
"xpack.spaces.management.spacesGridPage.searchPlaceholder": "搜索",
|
||||
"xpack.spaces.management.spacesGridPage.solutionColumnName": "解决方案视图",
|
||||
"xpack.spaces.management.spacesGridPage.someFeaturesEnabled": "{enabledFeatureCount}/{totalFeatureCount}",
|
||||
"xpack.spaces.management.spacesGridPage.spaceColumnName": "工作区",
|
||||
"xpack.spaces.management.spacesGridPage.spacesTitle": "工作区",
|
||||
"xpack.spaces.management.spacesGridPage.switchSpaceActionDescription": "切换到 {spaceName}",
|
||||
|
|
|
@ -14,6 +14,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
const a11y = getService('a11y');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const testSubjects = getService('testSubjects');
|
||||
const find = getService('find');
|
||||
const retry = getService('retry');
|
||||
const kibanaServer = getService('kibanaServer');
|
||||
|
||||
|
@ -82,6 +83,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
it('a11y test for customize feature privilege', async () => {
|
||||
await testSubjects.click('spaceSelectorComboBox');
|
||||
const globalSpaceOption = await find.byCssSelector(`#spaceOption_\\*`);
|
||||
await globalSpaceOption.click();
|
||||
await testSubjects.click('featureCategory_kibana');
|
||||
await a11y.testAppSnapshot();
|
||||
await testSubjects.click('cancelSpacePrivilegeButton');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue