From c9bbebd80bcaeff6ce76489a608a41ed9707425d Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Tue, 30 Mar 2021 14:08:37 -0600 Subject: [PATCH 01/15] [file upload] document file upload privileges and provide actionable UI when failures occur --- docs/maps/import-geospatial-data.asciidoc | 24 ++++++ x-pack/plugins/file_upload/common/types.ts | 5 +- .../components/import_complete_view.tsx | 86 +++++++++++++------ .../components/json_upload_and_parse.tsx | 5 ++ 4 files changed, 92 insertions(+), 28 deletions(-) diff --git a/docs/maps/import-geospatial-data.asciidoc b/docs/maps/import-geospatial-data.asciidoc index fb4250368086e..91af77ed3a82f 100644 --- a/docs/maps/import-geospatial-data.asciidoc +++ b/docs/maps/import-geospatial-data.asciidoc @@ -6,6 +6,30 @@ To import geospatical data into the Elastic Stack, the data must be indexed as { Geospatial data comes in many formats. Choose an import tool based on the format of your geospatial data. +[discrete] +[[import-geospatial-privileges]] +=== Security privileges + +The {stack-security-features} provide roles and privileges that control which users can upload files. +You can manage your roles, privileges, and +spaces in the **{stack-manage-app}** app in {kib}. For more information, see +{ref}/security-privileges.html[Security privileges], +<>, and <>. + +To upload GeoJson files in {kib} with *Maps*, you must have: +* [ ] `all` {kib} +privilege for the `Maps` feature +* [ ] `all` {kib} +privilege for the `Index Pattern Management` feature +* [ ] `create`, `create_index`, and `read` index privileges for destination indices. +Its recommended that users also have `view_index_metadata` index privilege for destination indices. + +To upload CSV files in {kib} with the *{file-data-viz}*, in addition to upload GeoJson privileges, to you must have: +* [ ] `manage_pipeline` cluster privilege +* [ ] `read` {kib} privilege for the `Machine Learning` feature +* [ ] `machine_learning_admin` or `machine_learning_user` role + + [discrete] === Upload CSV with latitude and longitude columns diff --git a/x-pack/plugins/file_upload/common/types.ts b/x-pack/plugins/file_upload/common/types.ts index 0fc59e2b525a8..11cf4ac3615bf 100644 --- a/x-pack/plugins/file_upload/common/types.ts +++ b/x-pack/plugins/file_upload/common/types.ts @@ -5,6 +5,7 @@ * 2.0. */ +import type { estypes } from '@elastic/elasticsearch'; import { ES_FIELD_TYPES } from '../../../../src/plugins/data/common'; export interface HasImportPermission { @@ -83,7 +84,9 @@ export interface ImportResponse { pipelineId?: string; docCount: number; failures: ImportFailure[]; - error?: any; + error?: { + error: estypes.ErrorCause; + }; ingestError?: boolean; } diff --git a/x-pack/plugins/file_upload/public/components/import_complete_view.tsx b/x-pack/plugins/file_upload/public/components/import_complete_view.tsx index 29aed0cd52f7e..f74be6a87fa53 100644 --- a/x-pack/plugins/file_upload/public/components/import_complete_view.tsx +++ b/x-pack/plugins/file_upload/public/components/import_complete_view.tsx @@ -7,6 +7,7 @@ import React, { Component, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n/react'; import { EuiButtonIcon, EuiCallOut, @@ -17,7 +18,6 @@ import { EuiText, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; import { CodeEditor, KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public'; import { getHttp, getUiSettings } from '../kibana_services'; import { ImportResults } from '../importer'; @@ -91,13 +91,32 @@ export class ImportCompleteView extends Component { _getStatusMsg() { if (!this.props.importResults || !this.props.importResults.success) { - return i18n.translate('xpack.fileUpload.uploadFailureMsg', { - defaultMessage: 'File upload failed.', - }); + const errorMsg = this.props.importResults.error + ? i18n.translate('xpack.fileUpload.uploadFailureMsgErrorBlock', { + defaultMessage: 'Error: {reason}', + values: { reason: this.props.importResults.error.error.reason }, + }) + : ''; + return ( + +

+ {i18n.translate('xpack.fileUpload.uploadFailureMsg', { + defaultMessage: 'Unable to upload file. {errorMsg}', + values: { errorMsg }, + })} +

+
+ ); } const successMsg = i18n.translate('xpack.fileUpload.uploadSuccessMsg', { - defaultMessage: 'File upload complete: indexed {numFeatures} features.', + defaultMessage: 'Indexed {numFeatures} features.', values: { numFeatures: this.props.importResults.docCount, }, @@ -112,15 +131,45 @@ export class ImportCompleteView extends Component { }) : ''; - return `${successMsg} ${failedFeaturesMsg}`; + return ( + +

{`${successMsg} ${failedFeaturesMsg}`}

+
+ ); + } + + _renderIndexManagementCallout() { + return this.props.importResults && this.props.importResults.success ? ( + +

+ + + + +

+
+ ) : null; } render() { return ( - -

{this._getStatusMsg()}

-
+ {this._getStatusMsg()} + {this._renderCodeEditor( this.props.importResults, i18n.translate('xpack.fileUpload.jsonImport.indexingResponse', { @@ -135,24 +184,7 @@ export class ImportCompleteView extends Component { }), 'indexPatternRespCopyButton' )} - -
- - - - -
-
+ {this._renderIndexManagementCallout()}
); } diff --git a/x-pack/plugins/file_upload/public/components/json_upload_and_parse.tsx b/x-pack/plugins/file_upload/public/components/json_upload_and_parse.tsx index 371d68443bc2c..626b935e7ab32 100644 --- a/x-pack/plugins/file_upload/public/components/json_upload_and_parse.tsx +++ b/x-pack/plugins/file_upload/public/components/json_upload_and_parse.tsx @@ -74,6 +74,10 @@ export class JsonUploadAndParse extends Component Date: Tue, 30 Mar 2021 15:55:02 -0600 Subject: [PATCH 02/15] doc link --- .../public/doc_links/doc_links_service.ts | 1 + .../components/import_complete_view.tsx | 34 ++++++++++++++++++- .../components/json_upload_and_parse.tsx | 5 +++ .../file_upload/public/kibana_services.ts | 1 + 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/src/core/public/doc_links/doc_links_service.ts b/src/core/public/doc_links/doc_links_service.ts index ef3172b620b23..2531ae289f412 100644 --- a/src/core/public/doc_links/doc_links_service.ts +++ b/src/core/public/doc_links/doc_links_service.ts @@ -216,6 +216,7 @@ export class DocLinksService { }, maps: { guide: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/maps.html`, + importGeospatialPrivileges: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/import-geospatial-data.html#import-geospatial-privileges`, }, monitoring: { alertsKibana: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kibana-alerts.html`, diff --git a/x-pack/plugins/file_upload/public/components/import_complete_view.tsx b/x-pack/plugins/file_upload/public/components/import_complete_view.tsx index f74be6a87fa53..e1d86c57ddfce 100644 --- a/x-pack/plugins/file_upload/public/components/import_complete_view.tsx +++ b/x-pack/plugins/file_upload/public/components/import_complete_view.tsx @@ -14,12 +14,13 @@ import { EuiCopy, EuiFlexGroup, EuiFlexItem, + EuiLink, EuiSpacer, EuiText, EuiTitle, } from '@elastic/eui'; import { CodeEditor, KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public'; -import { getHttp, getUiSettings } from '../kibana_services'; +import { getDocLinks, getHttp, getUiSettings } from '../kibana_services'; import { ImportResults } from '../importer'; const services = { @@ -27,8 +28,10 @@ const services = { }; interface Props { + failedPermissionCheck: boolean; importResults?: ImportResults; indexPatternResp?: object; + indexName: string; } export class ImportCompleteView extends Component { @@ -90,6 +93,35 @@ export class ImportCompleteView extends Component { } _getStatusMsg() { + if (this.props.failedPermissionCheck) { + return ( + +

+ {i18n.translate('xpack.fileUpload.permissionFailureMsg', { + defaultMessage: + 'You do not have permission to create or import data into index "{indexName}".', + values: { indexName: this.props.indexName }, + })} +

+ + {i18n.translate('xpack.fileUpload.permission.learnMoreLinkText', { + defaultMessage: 'Learn about file import permissions.', + })} + +
+ ); + } + if (!this.props.importResults || !this.props.importResults.success) { const errorMsg = this.props.importResults.error ? i18n.translate('xpack.fileUpload.uploadFailureMsgErrorBlock', { diff --git a/x-pack/plugins/file_upload/public/components/json_upload_and_parse.tsx b/x-pack/plugins/file_upload/public/components/json_upload_and_parse.tsx index 626b935e7ab32..99c1b3cc5c82f 100644 --- a/x-pack/plugins/file_upload/public/components/json_upload_and_parse.tsx +++ b/x-pack/plugins/file_upload/public/components/json_upload_and_parse.tsx @@ -31,6 +31,7 @@ function getWritingToIndexMsg(progress: number) { } interface State { + failedPermissionCheck: boolean; geoFieldType: ES_FIELD_TYPES.GEO_POINT | ES_FIELD_TYPES.GEO_SHAPE; importStatus: string; importResults?: ImportResults; @@ -45,6 +46,7 @@ export class JsonUploadAndParse extends Component ); } diff --git a/x-pack/plugins/file_upload/public/kibana_services.ts b/x-pack/plugins/file_upload/public/kibana_services.ts index a604136ca34e4..dfe2785e7a2bc 100644 --- a/x-pack/plugins/file_upload/public/kibana_services.ts +++ b/x-pack/plugins/file_upload/public/kibana_services.ts @@ -15,6 +15,7 @@ export function setStartServices(core: CoreStart, plugins: FileUploadStartDepend pluginsStart = plugins; } +export const getDocLinks = () => coreStart.docLinks; export const getIndexPatternService = () => pluginsStart.data.indexPatterns; export const getHttp = () => coreStart.http; export const getSavedObjectsClient = () => coreStart.savedObjects.client; From 6befa9d5e4ea81c92dbde8c600ef49ee87e4f21d Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Tue, 30 Mar 2021 16:55:52 -0600 Subject: [PATCH 03/15] call hasImportPermission --- .../public/components/import_complete_view.tsx | 4 ++-- .../components/json_upload_and_parse.tsx | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/file_upload/public/components/import_complete_view.tsx b/x-pack/plugins/file_upload/public/components/import_complete_view.tsx index e1d86c57ddfce..81436569df068 100644 --- a/x-pack/plugins/file_upload/public/components/import_complete_view.tsx +++ b/x-pack/plugins/file_upload/public/components/import_complete_view.tsx @@ -114,8 +114,8 @@ export class ImportCompleteView extends Component { target="_blank" external > - {i18n.translate('xpack.fileUpload.permission.learnMoreLinkText', { - defaultMessage: 'Learn about file import permissions.', + {i18n.translate('xpack.fileUpload.permission.docLink', { + defaultMessage: 'View file import permissions.', })} diff --git a/x-pack/plugins/file_upload/public/components/json_upload_and_parse.tsx b/x-pack/plugins/file_upload/public/components/json_upload_and_parse.tsx index 99c1b3cc5c82f..d73c6e9c5fb3a 100644 --- a/x-pack/plugins/file_upload/public/components/json_upload_and_parse.tsx +++ b/x-pack/plugins/file_upload/public/components/json_upload_and_parse.tsx @@ -16,6 +16,7 @@ import { FileUploadComponentProps } from '../lazy_load_bundle'; import { ImportResults } from '../importer'; import { GeoJsonImporter } from '../importer/geojson_importer'; import { Settings } from '../../common'; +import { hasImportPermission } from '../api'; enum PHASE { CONFIGURE = 'CONFIGURE', @@ -79,7 +80,22 @@ export class JsonUploadAndParse extends Component Date: Tue, 30 Mar 2021 18:02:56 -0600 Subject: [PATCH 04/15] docs tweeks --- docs/maps/import-geospatial-data.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/maps/import-geospatial-data.asciidoc b/docs/maps/import-geospatial-data.asciidoc index 91af77ed3a82f..f7e730756ae0f 100644 --- a/docs/maps/import-geospatial-data.asciidoc +++ b/docs/maps/import-geospatial-data.asciidoc @@ -21,8 +21,8 @@ To upload GeoJson files in {kib} with *Maps*, you must have: privilege for the `Maps` feature * [ ] `all` {kib} privilege for the `Index Pattern Management` feature -* [ ] `create`, `create_index`, and `read` index privileges for destination indices. -Its recommended that users also have `view_index_metadata` index privilege for destination indices. +* [ ] `create` and `create_index`index privileges for destination indices. +To use the index in Maps, you must also have `read` and `view_index_metadata` index privileges. To upload CSV files in {kib} with the *{file-data-viz}*, in addition to upload GeoJson privileges, to you must have: * [ ] `manage_pipeline` cluster privilege From f10c54c7fccaba6b3dd73b1ab25ad3b3d866022d Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Wed, 31 Mar 2021 10:35:02 -0600 Subject: [PATCH 05/15] tslint --- .../public/components/import_complete_view.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/x-pack/plugins/file_upload/public/components/import_complete_view.tsx b/x-pack/plugins/file_upload/public/components/import_complete_view.tsx index 81436569df068..51f94068607dc 100644 --- a/x-pack/plugins/file_upload/public/components/import_complete_view.tsx +++ b/x-pack/plugins/file_upload/public/components/import_complete_view.tsx @@ -123,12 +123,13 @@ export class ImportCompleteView extends Component { } if (!this.props.importResults || !this.props.importResults.success) { - const errorMsg = this.props.importResults.error - ? i18n.translate('xpack.fileUpload.uploadFailureMsgErrorBlock', { - defaultMessage: 'Error: {reason}', - values: { reason: this.props.importResults.error.error.reason }, - }) - : ''; + const errorMsg = + this.props.importResults && this.props.importResults.error + ? i18n.translate('xpack.fileUpload.uploadFailureMsgErrorBlock', { + defaultMessage: 'Error: {reason}', + values: { reason: this.props.importResults.error.error.reason }, + }) + : ''; return ( { ); } - _renderIndexManagementCallout() { + _renderIndexManagementMsg() { return this.props.importResults && this.props.importResults.success ? (

@@ -216,7 +217,7 @@ export class ImportCompleteView extends Component { }), 'indexPatternRespCopyButton' )} - {this._renderIndexManagementCallout()} + {this._renderIndexManagementMsg()} ); } From 4ce8ca20ebbde9cfbc20b89e2e9ef801e4963f75 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Wed, 31 Mar 2021 16:00:55 -0600 Subject: [PATCH 06/15] Update docs/maps/import-geospatial-data.asciidoc Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com> --- docs/maps/import-geospatial-data.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/maps/import-geospatial-data.asciidoc b/docs/maps/import-geospatial-data.asciidoc index f7e730756ae0f..9f27e86d13b0c 100644 --- a/docs/maps/import-geospatial-data.asciidoc +++ b/docs/maps/import-geospatial-data.asciidoc @@ -14,7 +14,7 @@ The {stack-security-features} provide roles and privileges that control which us You can manage your roles, privileges, and spaces in the **{stack-manage-app}** app in {kib}. For more information, see {ref}/security-privileges.html[Security privileges], -<>, and <>. +<>, and <>. To upload GeoJson files in {kib} with *Maps*, you must have: * [ ] `all` {kib} From 4c4af324a7f3d91235dc9794267bf16a19cdff61 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Wed, 31 Mar 2021 16:01:18 -0600 Subject: [PATCH 07/15] Update docs/maps/import-geospatial-data.asciidoc Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com> --- docs/maps/import-geospatial-data.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/maps/import-geospatial-data.asciidoc b/docs/maps/import-geospatial-data.asciidoc index 9f27e86d13b0c..9622d9ec49371 100644 --- a/docs/maps/import-geospatial-data.asciidoc +++ b/docs/maps/import-geospatial-data.asciidoc @@ -12,7 +12,7 @@ Choose an import tool based on the format of your geospatial data. The {stack-security-features} provide roles and privileges that control which users can upload files. You can manage your roles, privileges, and -spaces in the **{stack-manage-app}** app in {kib}. For more information, see +spaces in the **{stack-manage-app}** in {kib}. For more information, see {ref}/security-privileges.html[Security privileges], <>, and <>. From 39fef6d71db7557a735199f4f86622ab7c97743f Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Wed, 31 Mar 2021 16:01:42 -0600 Subject: [PATCH 08/15] Update docs/maps/import-geospatial-data.asciidoc Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com> --- docs/maps/import-geospatial-data.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/maps/import-geospatial-data.asciidoc b/docs/maps/import-geospatial-data.asciidoc index 9622d9ec49371..fb2853dba5f5f 100644 --- a/docs/maps/import-geospatial-data.asciidoc +++ b/docs/maps/import-geospatial-data.asciidoc @@ -16,7 +16,7 @@ spaces in the **{stack-manage-app}** in {kib}. For more information, see {ref}/security-privileges.html[Security privileges], <>, and <>. -To upload GeoJson files in {kib} with *Maps*, you must have: +To upload GeoJSON files in {kib} with *Maps*, you must have: * [ ] `all` {kib} privilege for the `Maps` feature * [ ] `all` {kib} From 9aaec81825ebb878e76a2c3183a45b2ca5a92ec5 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Wed, 31 Mar 2021 16:04:29 -0600 Subject: [PATCH 09/15] Update docs/maps/import-geospatial-data.asciidoc Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com> --- docs/maps/import-geospatial-data.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/maps/import-geospatial-data.asciidoc b/docs/maps/import-geospatial-data.asciidoc index fb2853dba5f5f..e90259a4e620d 100644 --- a/docs/maps/import-geospatial-data.asciidoc +++ b/docs/maps/import-geospatial-data.asciidoc @@ -21,7 +21,7 @@ To upload GeoJSON files in {kib} with *Maps*, you must have: privilege for the `Maps` feature * [ ] `all` {kib} privilege for the `Index Pattern Management` feature -* [ ] `create` and `create_index`index privileges for destination indices. +* [ ] `create` and `create_index` index privileges for destination indices. To use the index in Maps, you must also have `read` and `view_index_metadata` index privileges. To upload CSV files in {kib} with the *{file-data-viz}*, in addition to upload GeoJson privileges, to you must have: From 7cc8b81525f78b510b8d7a1f37272729409bd585 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Wed, 31 Mar 2021 16:13:08 -0600 Subject: [PATCH 10/15] review feedback --- docs/maps/import-geospatial-data.asciidoc | 20 +++++++++---------- .../components/import_complete_view.tsx | 10 +++++----- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/docs/maps/import-geospatial-data.asciidoc b/docs/maps/import-geospatial-data.asciidoc index e90259a4e620d..e4405c21c82f1 100644 --- a/docs/maps/import-geospatial-data.asciidoc +++ b/docs/maps/import-geospatial-data.asciidoc @@ -17,17 +17,15 @@ spaces in the **{stack-manage-app}** in {kib}. For more information, see <>, and <>. To upload GeoJSON files in {kib} with *Maps*, you must have: -* [ ] `all` {kib} -privilege for the `Maps` feature -* [ ] `all` {kib} -privilege for the `Index Pattern Management` feature -* [ ] `create` and `create_index` index privileges for destination indices. -To use the index in Maps, you must also have `read` and `view_index_metadata` index privileges. - -To upload CSV files in {kib} with the *{file-data-viz}*, in addition to upload GeoJson privileges, to you must have: -* [ ] `manage_pipeline` cluster privilege -* [ ] `read` {kib} privilege for the `Machine Learning` feature -* [ ] `machine_learning_admin` or `machine_learning_user` role +* `all` {kib} privilege for `Maps` +* `all` {kib} privilege for `Index Pattern Management` +* `create` and `create_index` index privileges for destination indices. +* To use the index in Maps, you must also have `read` and `view_index_metadata` index privileges for destination indices. + +To upload CSV files in {kib} with the *{file-data-viz}*, you must have privileges to upload GeoJSON files and: +* `manage_pipeline` cluster privilege +* `read` {kib} privilege for `Machine Learning` +* `machine_learning_admin` or `machine_learning_user` role [discrete] diff --git a/x-pack/plugins/file_upload/public/components/import_complete_view.tsx b/x-pack/plugins/file_upload/public/components/import_complete_view.tsx index 51f94068607dc..c5939ecc09426 100644 --- a/x-pack/plugins/file_upload/public/components/import_complete_view.tsx +++ b/x-pack/plugins/file_upload/public/components/import_complete_view.tsx @@ -97,7 +97,7 @@ export class ImportCompleteView extends Component { return ( { external > {i18n.translate('xpack.fileUpload.permission.docLink', { - defaultMessage: 'View file import permissions.', + defaultMessage: 'View file import permissions', })} @@ -133,7 +133,7 @@ export class ImportCompleteView extends Component { return ( {

{ >

From 3a19d6542c8672f967177733999dbf5bc620e5c1 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Thu, 1 Apr 2021 08:53:31 -0600 Subject: [PATCH 11/15] fix bullet list format --- docs/maps/import-geospatial-data.asciidoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/maps/import-geospatial-data.asciidoc b/docs/maps/import-geospatial-data.asciidoc index e4405c21c82f1..efd29799d68ef 100644 --- a/docs/maps/import-geospatial-data.asciidoc +++ b/docs/maps/import-geospatial-data.asciidoc @@ -17,12 +17,14 @@ spaces in the **{stack-manage-app}** in {kib}. For more information, see <>, and <>. To upload GeoJSON files in {kib} with *Maps*, you must have: + * `all` {kib} privilege for `Maps` * `all` {kib} privilege for `Index Pattern Management` * `create` and `create_index` index privileges for destination indices. * To use the index in Maps, you must also have `read` and `view_index_metadata` index privileges for destination indices. To upload CSV files in {kib} with the *{file-data-viz}*, you must have privileges to upload GeoJSON files and: + * `manage_pipeline` cluster privilege * `read` {kib} privilege for `Machine Learning` * `machine_learning_admin` or `machine_learning_user` role From 3968d65a082c745584e3b1541a342c77007fc165 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Thu, 1 Apr 2021 12:24:43 -0600 Subject: [PATCH 12/15] clean-up i18n ids --- .../components/import_complete_view.tsx | 35 ++++++++++--------- .../translations/translations/ja-JP.json | 4 --- .../translations/translations/zh-CN.json | 4 --- 3 files changed, 19 insertions(+), 24 deletions(-) diff --git a/x-pack/plugins/file_upload/public/components/import_complete_view.tsx b/x-pack/plugins/file_upload/public/components/import_complete_view.tsx index c5939ecc09426..447ead8b4ecc0 100644 --- a/x-pack/plugins/file_upload/public/components/import_complete_view.tsx +++ b/x-pack/plugins/file_upload/public/components/import_complete_view.tsx @@ -60,9 +60,12 @@ export class ImportCompleteView extends Component { iconType="copy" color="text" data-test-subj={copyButtonDataTestSubj} - aria-label={i18n.translate('xpack.fileUpload.copyButtonAriaLabel', { - defaultMessage: 'Copy to clipboard', - })} + aria-label={i18n.translate( + 'xpack.fileUpload.importComplete.copyButtonAriaLabel', + { + defaultMessage: 'Copy to clipboard', + } + )} /> )} @@ -96,14 +99,14 @@ export class ImportCompleteView extends Component { if (this.props.failedPermissionCheck) { return (

- {i18n.translate('xpack.fileUpload.permissionFailureMsg', { + {i18n.translate('xpack.fileUpload.importComplete.permissionFailureMsg', { defaultMessage: 'You do not have permission to create or import data into index "{indexName}".', values: { indexName: this.props.indexName }, @@ -114,7 +117,7 @@ export class ImportCompleteView extends Component { target="_blank" external > - {i18n.translate('xpack.fileUpload.permission.docLink', { + {i18n.translate('xpack.fileUpload.importComplete.permission.docLink', { defaultMessage: 'View file import permissions', })} @@ -125,21 +128,21 @@ export class ImportCompleteView extends Component { if (!this.props.importResults || !this.props.importResults.success) { const errorMsg = this.props.importResults && this.props.importResults.error - ? i18n.translate('xpack.fileUpload.uploadFailureMsgErrorBlock', { + ? i18n.translate('xpack.fileUpload.importComplete.uploadFailureMsgErrorBlock', { defaultMessage: 'Error: {reason}', values: { reason: this.props.importResults.error.error.reason }, }) : ''; return (

- {i18n.translate('xpack.fileUpload.uploadFailureMsg', { + {i18n.translate('xpack.fileUpload.importComplete.uploadFailureMsg', { defaultMessage: 'Unable to upload file. {errorMsg}', values: { errorMsg }, })} @@ -148,7 +151,7 @@ export class ImportCompleteView extends Component { ); } - const successMsg = i18n.translate('xpack.fileUpload.uploadSuccessMsg', { + const successMsg = i18n.translate('xpack.fileUpload.importComplete.uploadSuccessMsg', { defaultMessage: 'Indexed {numFeatures} features.', values: { numFeatures: this.props.importResults.docCount, @@ -156,7 +159,7 @@ export class ImportCompleteView extends Component { }); const failedFeaturesMsg = this.props.importResults.failures?.length - ? i18n.translate('xpack.fileUpload.failedFeaturesMsg', { + ? i18n.translate('xpack.fileUpload.importComplete.failedFeaturesMsg', { defaultMessage: 'Unable to index {numFailures} features.', values: { numFailures: this.props.importResults.failures.length, @@ -166,7 +169,7 @@ export class ImportCompleteView extends Component { return ( @@ -180,7 +183,7 @@ export class ImportCompleteView extends Component {

{ href={getHttp().basePath.prepend('/app/management/kibana/indexPatterns')} > @@ -205,14 +208,14 @@ export class ImportCompleteView extends Component { {this._renderCodeEditor( this.props.importResults, - i18n.translate('xpack.fileUpload.jsonImport.indexingResponse', { + i18n.translate('xpack.fileUpload.importComplete.indexingResponse', { defaultMessage: 'Import response', }), 'indexRespCopyButton' )} {this._renderCodeEditor( this.props.indexPatternResp, - i18n.translate('xpack.fileUpload.jsonImport.indexPatternResponse', { + i18n.translate('xpack.fileUpload.importComplete.indexPatternResponse', { defaultMessage: 'Index pattern response', }), 'indexPatternRespCopyButton' diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index d238d3077aadc..6ffe835c7108a 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -8170,10 +8170,6 @@ "xpack.fileUpload.indexSettings.indexNameAlreadyExistsErrorMessage": "インデックス名またはパターンはすでに存在します。", "xpack.fileUpload.indexSettings.indexNameContainsIllegalCharactersErrorMessage": "インデックス名に許可されていない文字が含まれています。", "xpack.fileUpload.indexSettings.indexNameGuidelines": "インデックス名ガイドライン", - "xpack.fileUpload.jsonImport.indexingResponse": "インデックス応答", - "xpack.fileUpload.jsonImport.indexMgmtLink": "インデックス管理", - "xpack.fileUpload.jsonImport.indexModsMsg": "次を使用すると、その他のインデックス修正を行うことができます。\n", - "xpack.fileUpload.jsonImport.indexPatternResponse": "インデックスパターン応答", "xpack.fileUpload.jsonUploadAndParse.dataIndexingError": "データインデックスエラー", "xpack.fileUpload.jsonUploadAndParse.indexPatternError": "インデックスパターンエラー", "xpack.fleet.agentBulkActions.clearSelection": "選択した項目をクリア", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 58119a0739812..0175b798209db 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -8243,10 +8243,6 @@ "xpack.fileUpload.indexSettings.indexNameAlreadyExistsErrorMessage": "索引名称或模式已存在。", "xpack.fileUpload.indexSettings.indexNameContainsIllegalCharactersErrorMessage": "索引名称包含非法字符。", "xpack.fileUpload.indexSettings.indexNameGuidelines": "索引名称指引", - "xpack.fileUpload.jsonImport.indexingResponse": "索引响应", - "xpack.fileUpload.jsonImport.indexMgmtLink": "索引管理", - "xpack.fileUpload.jsonImport.indexModsMsg": "要进一步做索引修改,可以使用\n", - "xpack.fileUpload.jsonImport.indexPatternResponse": "索引模式响应", "xpack.fileUpload.jsonUploadAndParse.dataIndexingError": "数据索引错误", "xpack.fileUpload.jsonUploadAndParse.indexPatternError": "索引模式错误", "xpack.fleet.agentBulkActions.agentsSelected": "已选择 {count, plural, other {# 个代理}}", From 167b78646f8aa7a7950a4157c18374c62574e6cd Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Thu, 1 Apr 2021 13:23:58 -0600 Subject: [PATCH 13/15] Update docs/maps/import-geospatial-data.asciidoc Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com> --- docs/maps/import-geospatial-data.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/maps/import-geospatial-data.asciidoc b/docs/maps/import-geospatial-data.asciidoc index efd29799d68ef..3fc6831cec495 100644 --- a/docs/maps/import-geospatial-data.asciidoc +++ b/docs/maps/import-geospatial-data.asciidoc @@ -12,7 +12,7 @@ Choose an import tool based on the format of your geospatial data. The {stack-security-features} provide roles and privileges that control which users can upload files. You can manage your roles, privileges, and -spaces in the **{stack-manage-app}** in {kib}. For more information, see +spaces in **{stack-manage-app}** in {kib}. For more information, see {ref}/security-privileges.html[Security privileges], <>, and <>. From 4e2c43ebeae07bb29cf78fd80aad806a17dfa8c4 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Thu, 1 Apr 2021 13:27:55 -0600 Subject: [PATCH 14/15] documenation review feedback --- docs/maps/import-geospatial-data.asciidoc | 14 +++++++------- .../public/components/import_complete_view.tsx | 7 +------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/docs/maps/import-geospatial-data.asciidoc b/docs/maps/import-geospatial-data.asciidoc index 3fc6831cec495..2c9ecee95314c 100644 --- a/docs/maps/import-geospatial-data.asciidoc +++ b/docs/maps/import-geospatial-data.asciidoc @@ -18,16 +18,16 @@ spaces in **{stack-manage-app}** in {kib}. For more information, see To upload GeoJSON files in {kib} with *Maps*, you must have: -* `all` {kib} privilege for `Maps` -* `all` {kib} privilege for `Index Pattern Management` -* `create` and `create_index` index privileges for destination indices. -* To use the index in Maps, you must also have `read` and `view_index_metadata` index privileges for destination indices. +* The `all` {kib} privilege for *Maps*. +* The `all` {kib} privilege for *Index Pattern Management*. +* The `create` and `create_index` index privileges for destination indices. +* To use the index in *Maps*, you must also have the `read` and `view_index_metadata` index privileges for destination indices. To upload CSV files in {kib} with the *{file-data-viz}*, you must have privileges to upload GeoJSON files and: -* `manage_pipeline` cluster privilege -* `read` {kib} privilege for `Machine Learning` -* `machine_learning_admin` or `machine_learning_user` role +* The `manage_pipeline` cluster privilege. +* The `read` {kib} privilege for *Machine Learning*. +* The `machine_learning_admin` or `machine_learning_user` role [discrete] diff --git a/x-pack/plugins/file_upload/public/components/import_complete_view.tsx b/x-pack/plugins/file_upload/public/components/import_complete_view.tsx index 447ead8b4ecc0..a3bc2ed082b1a 100644 --- a/x-pack/plugins/file_upload/public/components/import_complete_view.tsx +++ b/x-pack/plugins/file_upload/public/components/import_complete_view.tsx @@ -141,12 +141,7 @@ export class ImportCompleteView extends Component { color="danger" iconType="alert" > -

- {i18n.translate('xpack.fileUpload.importComplete.uploadFailureMsg', { - defaultMessage: 'Unable to upload file. {errorMsg}', - values: { errorMsg }, - })} -

+

{errorMsg}

); } From eb888fa0d801ac7a5d362505d2da0edb1edfefad Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Thu, 1 Apr 2021 13:29:09 -0600 Subject: [PATCH 15/15] add period to last privilege bullet item --- docs/maps/import-geospatial-data.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/maps/import-geospatial-data.asciidoc b/docs/maps/import-geospatial-data.asciidoc index 2c9ecee95314c..0218bac58815a 100644 --- a/docs/maps/import-geospatial-data.asciidoc +++ b/docs/maps/import-geospatial-data.asciidoc @@ -27,7 +27,7 @@ To upload CSV files in {kib} with the *{file-data-viz}*, you must have privilege * The `manage_pipeline` cluster privilege. * The `read` {kib} privilege for *Machine Learning*. -* The `machine_learning_admin` or `machine_learning_user` role +* The `machine_learning_admin` or `machine_learning_user` role. [discrete]