Skip to content

Commit

Permalink
[ML] Change file data visualizer JSON format label to NDJSON (#24643)
Browse files Browse the repository at this point in the history
* [ML] Change file datavisualizer JSON format label to NDJSON
* [ML] Update edit flyout overrides snapshot
  • Loading branch information
peteharverson authored and walterra committed Oct 29, 2018
1 parent 9a158c1 commit 4cc49be
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ exports[`mlEnabled 1`] = `
type="button"
>
<FormattedMessage
defaultMessage="Import a JSON, CSV, or log file"
defaultMessage="Import a CSV, NDJSON, or log file"
id="kbn.home.addData.uploadFileLink"
values={Object {}}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/core_plugins/kibana/public/home/components/add_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => {
>
<FormattedMessage
id="kbn.home.addData.uploadFileLink"
defaultMessage="Import a JSON, CSV, or log file"
defaultMessage="Import a CSV, NDJSON, or log file"
/>
</EuiLink>
</EuiText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function WelcomeContent() {
<EuiFlexItem>
<EuiText>
<p>
JSON
Delimited text files, such as CSV and TSV
</p>
</EuiText>
</EuiFlexItem>
Expand All @@ -69,7 +69,7 @@ export function WelcomeContent() {
<EuiFlexItem>
<EuiText>
<p>
Delimited text files, such as CSV and TSV
Newline-delimited JSON
</p>
</EuiText>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ exports[`Overrides render overrides 1`] = `
Array [
Object {
"inputDisplay": <span>
json
delimited
</span>,
"value": "json",
"value": "delimited",
},
Object {
"inputDisplay": <span>
delimited
ndjson
</span>,
"value": "delimited",
"value": "ndjson",
},
Object {
"inputDisplay": <span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@


export const FORMAT_OPTIONS = [
'json',
'delimited',
'ndjson',
'semi_structured_text',
'xml',
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand All @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { Importer } from './importer';

export class JsonImporter extends Importer {
export class NdjsonImporter extends Importer {
constructor(results, settings) {
super(settings);
}
Expand Down

0 comments on commit 4cc49be

Please sign in to comment.