-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Spaces and Roles] Updates for finalized contents and UX (#193923)
## Summary Follows #191795 * Minor content updates to Spaces Management * [spaces grid] More space for "description" column in Spaces Grid * [create space and edit space] Add "New" badge to Solution View picker * [create space and edit space] Move avatar section down * [create space] Remove the edit/update functionality from the Create Space page * [create space] Only show the Feature Visibility section if the selected solution is `classic` * [edit space] Rearrange the footer icons in the General tab * [edit space] Show callout when classic is selected by default * [edit space] Update the action icons shown on hover on the Assigned Roles table ### 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) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [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] 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)
- Loading branch information
Showing
25 changed files
with
372 additions
and
759 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
106 changes: 106 additions & 0 deletions
106
x-pack/plugins/spaces/public/management/components/customize_avatar/customize_avatar.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { EuiDescribedFormGroup, EuiLoadingSpinner, EuiTitle } from '@elastic/eui'; | ||
import React, { Component, lazy, Suspense } from 'react'; | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
|
||
import { CustomizeSpaceAvatar } from './customize_space_avatar'; | ||
import { getSpaceAvatarComponent } from '../../../space_avatar'; | ||
import type { SpaceValidator } from '../../lib'; | ||
import type { CustomizeSpaceFormValues } from '../../types'; | ||
import { SectionPanel } from '../section_panel'; | ||
|
||
// No need to wrap LazySpaceAvatar in an error boundary, because it is one of the first chunks loaded when opening Kibana. | ||
const LazySpaceAvatar = lazy(() => | ||
getSpaceAvatarComponent().then((component) => ({ default: component })) | ||
); | ||
|
||
interface Props { | ||
validator: SpaceValidator; | ||
space: CustomizeSpaceFormValues; | ||
onChange: (space: CustomizeSpaceFormValues) => void; | ||
title?: string; | ||
} | ||
|
||
interface State { | ||
customizingAvatar: boolean; | ||
usingCustomIdentifier: boolean; | ||
} | ||
|
||
export class CustomizeAvatar extends Component<Props, State> { | ||
public state = { | ||
customizingAvatar: false, | ||
usingCustomIdentifier: false, | ||
}; | ||
|
||
public render() { | ||
const { validator, space } = this.props; | ||
|
||
return ( | ||
<SectionPanel dataTestSubj="customizeAvatarSection"> | ||
<EuiDescribedFormGroup | ||
title={ | ||
<EuiTitle size="xs"> | ||
<h3> | ||
<FormattedMessage | ||
id="xpack.spaces.management.manageSpacePage.avatarTitle" | ||
defaultMessage="Define an avatar" | ||
/> | ||
</h3> | ||
</EuiTitle> | ||
} | ||
description={ | ||
<> | ||
<p> | ||
{i18n.translate('xpack.spaces.management.manageSpacePage.avatarDescription', { | ||
defaultMessage: 'Choose how your space avatar appears across Kibana.', | ||
})} | ||
</p> | ||
{space.avatarType === 'image' ? ( | ||
<Suspense fallback={<EuiLoadingSpinner />}> | ||
<LazySpaceAvatar | ||
space={{ | ||
...space, | ||
initials: '?', | ||
name: undefined, | ||
}} | ||
size="xl" | ||
/> | ||
</Suspense> | ||
) : ( | ||
<Suspense fallback={<EuiLoadingSpinner />}> | ||
<LazySpaceAvatar | ||
space={{ | ||
name: '?', | ||
...space, | ||
imageUrl: undefined, | ||
}} | ||
size="xl" | ||
/> | ||
</Suspense> | ||
)} | ||
</> | ||
} | ||
fullWidth | ||
> | ||
<CustomizeSpaceAvatar | ||
space={this.props.space} | ||
onChange={this.onAvatarChange} | ||
validator={validator} | ||
/> | ||
</EuiDescribedFormGroup> | ||
</SectionPanel> | ||
); | ||
} | ||
|
||
public onAvatarChange = (space: CustomizeSpaceFormValues) => { | ||
this.props.onChange(space); | ||
}; | ||
} |
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
x-pack/plugins/spaces/public/management/components/customize_avatar/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export { CustomizeAvatar } from './customize_avatar'; |
53 changes: 1 addition & 52 deletions
53
.../public/management/components/customize_space/__snapshots__/customize_space.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 9 additions & 8 deletions
17
...ublic/management/components/enabled_features/__snapshots__/enabled_features.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.