-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Maps] layer group wizard #144129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
[Maps] layer group wizard #144129
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3b61860
[Maps] layer group wizard
nreese 3b7bd21
create editor
nreese 8e8f2cc
open parent layer details on adding child
nreese a8ecd65
show combining highlight instead of selected layer highlight
nreese 7db75fd
do not delete layers added to preview layer group
nreese 8ca2925
reuse settingsPanel.layerNameLabel tag so label is consistent in edit…
nreese 675599f
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine f53fa62
checks fix
nreese 244cdfb
Merge branch 'main' into layer_group_wizard
kibanamachine 3f35d84
Merge branch 'main' into layer_group_wizard
kibanamachine 0ff59a3
layer group description copy update
nreese File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
28 changes: 28 additions & 0 deletions
28
x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/config.tsx
This file contains hidden or 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,28 @@ | ||
| /* | ||
| * 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 { i18n } from '@kbn/i18n'; | ||
| import React from 'react'; | ||
| import { LayerWizard, RenderWizardArguments } from '../layer_wizard_registry'; | ||
| import { LayerGroupWizard } from './wizard'; | ||
| import { WIZARD_ID } from '../../../../../common/constants'; | ||
|
|
||
| export const layerGroupWizardConfig: LayerWizard = { | ||
| id: WIZARD_ID.LAYER_GROUP, | ||
| order: 10, | ||
| categories: [], | ||
| description: i18n.translate('xpack.maps.layerGroupWizard.description', { | ||
| defaultMessage: 'Organize related layers in a hierarchy', | ||
| }), | ||
| icon: 'layers', | ||
| renderWizard: (renderWizardArguments: RenderWizardArguments) => { | ||
| return <LayerGroupWizard {...renderWizardArguments} />; | ||
| }, | ||
| title: i18n.translate('xpack.maps.layerGroupWizard.title', { | ||
| defaultMessage: 'Layer group', | ||
| }), | ||
| }; |
8 changes: 8 additions & 0 deletions
8
x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/index.ts
This file contains hidden or 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 { layerGroupWizardConfig } from './config'; |
57 changes: 57 additions & 0 deletions
57
x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/wizard.tsx
This file contains hidden or 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,57 @@ | ||
| /* | ||
| * 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 { i18n } from '@kbn/i18n'; | ||
| import React, { ChangeEvent, Component } from 'react'; | ||
| import { EuiFieldText, EuiFormRow, EuiPanel } from '@elastic/eui'; | ||
| import { RenderWizardArguments } from '../layer_wizard_registry'; | ||
| import { DEFAULT_LAYER_GROUP_LABEL, LayerGroup } from '../../layer_group'; | ||
|
|
||
| interface State { | ||
| label: string; | ||
| } | ||
|
|
||
| export class LayerGroupWizard extends Component<RenderWizardArguments, State> { | ||
| state: State = { | ||
| label: DEFAULT_LAYER_GROUP_LABEL, | ||
| }; | ||
|
|
||
| componentDidMount() { | ||
| this._previewLayer(); | ||
| } | ||
|
|
||
| _onLabelChange = (e: ChangeEvent<HTMLInputElement>) => { | ||
| this.setState( | ||
| { | ||
| label: e.target.value, | ||
| }, | ||
| this._previewLayer | ||
| ); | ||
| }; | ||
|
|
||
| _previewLayer() { | ||
| const layerDescriptor = LayerGroup.createDescriptor({ | ||
| label: this.state.label, | ||
| }); | ||
|
|
||
| this.props.previewLayers([layerDescriptor]); | ||
| } | ||
|
|
||
| render() { | ||
| return ( | ||
| <EuiPanel> | ||
| <EuiFormRow | ||
| label={i18n.translate('xpack.maps.layerPanel.settingsPanel.layerNameLabel', { | ||
| defaultMessage: 'Name', | ||
| })} | ||
| > | ||
| <EuiFieldText value={this.state.label} onChange={this._onLabelChange} /> | ||
| </EuiFormRow> | ||
| </EuiPanel> | ||
| ); | ||
| } | ||
| } |
This file contains hidden or 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
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.