[Maps] Create drawing layer copy updates (#103791)

* [Maps] Create drawing layer copy updates

* tslint
This commit is contained in:
Nathan Reese 2021-06-30 08:30:44 -06:00 committed by GitHub
parent 5bb9691b55
commit 2f457da640
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 37 deletions

View file

@ -18,12 +18,11 @@ const ADD_VECTOR_DRAWING_LAYER = 'ADD_VECTOR_DRAWING_LAYER';
export const newVectorLayerWizardConfig: LayerWizard = {
categories: [LAYER_WIZARD_CATEGORY.ELASTICSEARCH],
description: i18n.translate('xpack.maps.newVectorLayerWizard.description', {
defaultMessage:
'Create an empty layer. Use this to create documents by drawing shapes on the map',
defaultMessage: 'Draw shapes on the map and index in Elasticsearch',
}),
disabledReason: i18n.translate('xpack.maps.newVectorLayerWizard.disabledDesc', {
defaultMessage:
'Unable to draw vector shapes, you are missing the Kibana privilege "Index Pattern Management".',
'Unable to create index, you are missing the Kibana privilege "Index Pattern Management".',
}),
getIsDisabled: async () => {
const hasImportPermission = await getFileUpload().hasImportPermission({
@ -38,7 +37,7 @@ export const newVectorLayerWizardConfig: LayerWizard = {
{
id: ADD_VECTOR_DRAWING_LAYER,
label: i18n.translate('xpack.maps.newVectorLayerWizard.indexNewLayer', {
defaultMessage: 'Index new layer',
defaultMessage: 'Create index',
}),
},
],
@ -47,6 +46,6 @@ export const newVectorLayerWizardConfig: LayerWizard = {
},
showFeatureEditTools: true,
title: i18n.translate('xpack.maps.newVectorLayerWizard.title', {
defaultMessage: 'Create new layer',
defaultMessage: 'Create index',
}),
};

View file

@ -5,8 +5,8 @@
* 2.0.
*/
import React, { Component, Fragment } from 'react';
import { EuiEmptyPrompt, EuiPanel, EuiCallOut } from '@elastic/eui';
import React, { Component } from 'react';
import { EuiPanel, EuiCallOut } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { createNewIndexAndPattern } from './create_new_index_pattern';
import { RenderWizardArguments } from '../layer_wizard_registry';
@ -125,36 +125,13 @@ export class NewVectorLayerEditor extends Component<RenderWizardArguments, State
const IndexNameForm = getIndexNameFormComponent();
return (
<EuiPanel>
<>
<EuiEmptyPrompt
title={
<h4>
{i18n.translate('xpack.maps.layers.newVectorLayerWizard.createNewLayer', {
defaultMessage: 'Create new layer',
})}
</h4>
}
body={
<Fragment>
<p>
{i18n.translate(
'xpack.maps.layers.newVectorLayerWizard.vectorEditorDescription',
{
defaultMessage: `Creates a new vector layer. This can be used to draw and store new shapes.`,
}
)}
</p>
</Fragment>
}
/>
<IndexNameForm
indexName={this.state.indexName}
indexNameError={this.state.indexNameError}
onIndexNameChange={this._onIndexChange}
onIndexNameValidationStart={() => {}}
onIndexNameValidationEnd={() => {}}
/>
</>
<IndexNameForm
indexName={this.state.indexName}
indexNameError={this.state.indexNameError}
onIndexNameChange={this._onIndexChange}
onIndexNameValidationStart={() => {}}
onIndexNameValidationEnd={() => {}}
/>
</EuiPanel>
);
}