From 2abf58df4be5bf61fa6bd107b2dea8c8cd6b5e57 Mon Sep 17 00:00:00 2001 From: Pete Harverson Date: Mon, 29 Oct 2018 09:07:46 +0000 Subject: [PATCH] [ML] Change file data visualizer JSON format label to NDJSON (#24643) * [ML] Change file datavisualizer JSON format label to NDJSON * [ML] Update edit flyout overrides snapshot --- .../home/components/__snapshots__/add_data.test.js.snap | 2 +- .../kibana/public/home/components/add_data.js | 2 +- .../components/about_panel/welcome_content.js | 4 ++-- .../edit_flyout/__snapshots__/overrides.test.js.snap | 8 ++++---- .../components/edit_flyout/options/option_lists.js | 2 +- .../components/file_datavisualizer_view/utils.js | 2 +- .../components/import_view/importer/importer_factory.js | 6 +++--- .../importer/{json_importer.js => ndjson_importer.js} | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) rename x-pack/plugins/ml/public/file_datavisualizer/components/import_view/importer/{json_importer.js => ndjson_importer.js} (94%) diff --git a/src/core_plugins/kibana/public/home/components/__snapshots__/add_data.test.js.snap b/src/core_plugins/kibana/public/home/components/__snapshots__/add_data.test.js.snap index d2002077b15d5..220d5e472c99b 100644 --- a/src/core_plugins/kibana/public/home/components/__snapshots__/add_data.test.js.snap +++ b/src/core_plugins/kibana/public/home/components/__snapshots__/add_data.test.js.snap @@ -832,7 +832,7 @@ exports[`mlEnabled 1`] = ` type="button" > diff --git a/src/core_plugins/kibana/public/home/components/add_data.js b/src/core_plugins/kibana/public/home/components/add_data.js index 8e598e4f26c3a..a45eda343cfca 100644 --- a/src/core_plugins/kibana/public/home/components/add_data.js +++ b/src/core_plugins/kibana/public/home/components/add_data.js @@ -229,7 +229,7 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => { > diff --git a/x-pack/plugins/ml/public/file_datavisualizer/components/about_panel/welcome_content.js b/x-pack/plugins/ml/public/file_datavisualizer/components/about_panel/welcome_content.js index 323db3b35fbcc..c33b684c52f96 100644 --- a/x-pack/plugins/ml/public/file_datavisualizer/components/about_panel/welcome_content.js +++ b/x-pack/plugins/ml/public/file_datavisualizer/components/about_panel/welcome_content.js @@ -53,7 +53,7 @@ export function WelcomeContent() {

- JSON + Delimited text files, such as CSV and TSV

@@ -66,7 +66,7 @@ export function WelcomeContent() {

- Delimited text files, such as CSV and TSV + Newline-delimited JSON

diff --git a/x-pack/plugins/ml/public/file_datavisualizer/components/edit_flyout/__snapshots__/overrides.test.js.snap b/x-pack/plugins/ml/public/file_datavisualizer/components/edit_flyout/__snapshots__/overrides.test.js.snap index e1697b865ce11..c11317ccad9eb 100644 --- a/x-pack/plugins/ml/public/file_datavisualizer/components/edit_flyout/__snapshots__/overrides.test.js.snap +++ b/x-pack/plugins/ml/public/file_datavisualizer/components/edit_flyout/__snapshots__/overrides.test.js.snap @@ -14,15 +14,15 @@ exports[`Overrides render overrides 1`] = ` Array [ Object { "inputDisplay": - json + delimited , - "value": "json", + "value": "delimited", }, Object { "inputDisplay": - delimited + ndjson , - "value": "delimited", + "value": "ndjson", }, Object { "inputDisplay": diff --git a/x-pack/plugins/ml/public/file_datavisualizer/components/edit_flyout/options/option_lists.js b/x-pack/plugins/ml/public/file_datavisualizer/components/edit_flyout/options/option_lists.js index 8918850c3f974..7534790de0a84 100644 --- a/x-pack/plugins/ml/public/file_datavisualizer/components/edit_flyout/options/option_lists.js +++ b/x-pack/plugins/ml/public/file_datavisualizer/components/edit_flyout/options/option_lists.js @@ -6,8 +6,8 @@ export const FORMAT_OPTIONS = [ - 'json', 'delimited', + 'ndjson', 'semi_structured_text', 'xml', ]; diff --git a/x-pack/plugins/ml/public/file_datavisualizer/components/file_datavisualizer_view/utils.js b/x-pack/plugins/ml/public/file_datavisualizer/components/file_datavisualizer_view/utils.js index cb82f6f4b1910..e97c16b629b8f 100644 --- a/x-pack/plugins/ml/public/file_datavisualizer/components/file_datavisualizer_view/utils.js +++ b/x-pack/plugins/ml/public/file_datavisualizer/components/file_datavisualizer_view/utils.js @@ -65,7 +65,7 @@ export function createUrlOverrides(overrides, originalSettings) { } } - if (formattedOverrides.format === 'json' || originalSettings.format === 'json') { + if (formattedOverrides.format === 'ndjson' || originalSettings.format === 'ndjson') { formattedOverrides.should_trim_fields = ''; formattedOverrides.has_header_row = ''; formattedOverrides.delimiter = ''; diff --git a/x-pack/plugins/ml/public/file_datavisualizer/components/import_view/importer/importer_factory.js b/x-pack/plugins/ml/public/file_datavisualizer/components/import_view/importer/importer_factory.js index e2bf8f5707bec..c82d94696ac5e 100644 --- a/x-pack/plugins/ml/public/file_datavisualizer/components/import_view/importer/importer_factory.js +++ b/x-pack/plugins/ml/public/file_datavisualizer/components/import_view/importer/importer_factory.js @@ -7,7 +7,7 @@ import { CsvImporter } from './csv_importer'; import { SstImporter } from './sst_importer'; -import { JsonImporter } from './json_importer'; +import { NdjsonImporter } from './ndjson_importer'; export function importerFactory(format, results, settings) { @@ -16,8 +16,8 @@ export function importerFactory(format, results, settings) { return new CsvImporter(results, settings); case 'semi_structured_text': return new SstImporter(results, settings); - case 'json': - return new JsonImporter(results, settings); + case 'ndjson': + return new NdjsonImporter(results, settings); default: return; } diff --git a/x-pack/plugins/ml/public/file_datavisualizer/components/import_view/importer/json_importer.js b/x-pack/plugins/ml/public/file_datavisualizer/components/import_view/importer/ndjson_importer.js similarity index 94% rename from x-pack/plugins/ml/public/file_datavisualizer/components/import_view/importer/json_importer.js rename to x-pack/plugins/ml/public/file_datavisualizer/components/import_view/importer/ndjson_importer.js index 4fdfbf8d8f002..5f1c834b03af7 100644 --- a/x-pack/plugins/ml/public/file_datavisualizer/components/import_view/importer/json_importer.js +++ b/x-pack/plugins/ml/public/file_datavisualizer/components/import_view/importer/ndjson_importer.js @@ -7,7 +7,7 @@ import { Importer } from './importer'; -export class JsonImporter extends Importer { +export class NdjsonImporter extends Importer { constructor(results, settings) { super(settings); }