Skip to content

Commit 4cc49be

Browse files
peteharversonwalterra
authored andcommitted
[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
1 parent 9a158c1 commit 4cc49be

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

src/core_plugins/kibana/public/home/components/__snapshots__/add_data.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ exports[`mlEnabled 1`] = `
832832
type="button"
833833
>
834834
<FormattedMessage
835-
defaultMessage="Import a JSON, CSV, or log file"
835+
defaultMessage="Import a CSV, NDJSON, or log file"
836836
id="kbn.home.addData.uploadFileLink"
837837
values={Object {}}
838838
/>

src/core_plugins/kibana/public/home/components/add_data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => {
229229
>
230230
<FormattedMessage
231231
id="kbn.home.addData.uploadFileLink"
232-
defaultMessage="Import a JSON, CSV, or log file"
232+
defaultMessage="Import a CSV, NDJSON, or log file"
233233
/>
234234
</EuiLink>
235235
</EuiText>

x-pack/plugins/ml/public/file_datavisualizer/components/about_panel/welcome_content.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function WelcomeContent() {
5656
<EuiFlexItem>
5757
<EuiText>
5858
<p>
59-
JSON
59+
Delimited text files, such as CSV and TSV
6060
</p>
6161
</EuiText>
6262
</EuiFlexItem>
@@ -69,7 +69,7 @@ export function WelcomeContent() {
6969
<EuiFlexItem>
7070
<EuiText>
7171
<p>
72-
Delimited text files, such as CSV and TSV
72+
Newline-delimited JSON
7373
</p>
7474
</EuiText>
7575
</EuiFlexItem>

x-pack/plugins/ml/public/file_datavisualizer/components/edit_flyout/__snapshots__/overrides.test.js.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ exports[`Overrides render overrides 1`] = `
1414
Array [
1515
Object {
1616
"inputDisplay": <span>
17-
json
17+
delimited
1818
</span>,
19-
"value": "json",
19+
"value": "delimited",
2020
},
2121
Object {
2222
"inputDisplay": <span>
23-
delimited
23+
ndjson
2424
</span>,
25-
"value": "delimited",
25+
"value": "ndjson",
2626
},
2727
Object {
2828
"inputDisplay": <span>

x-pack/plugins/ml/public/file_datavisualizer/components/edit_flyout/options/option_lists.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77

88
export const FORMAT_OPTIONS = [
9-
'json',
109
'delimited',
10+
'ndjson',
1111
'semi_structured_text',
1212
'xml',
1313
];

x-pack/plugins/ml/public/file_datavisualizer/components/file_datavisualizer_view/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export function createUrlOverrides(overrides, originalSettings) {
6565
}
6666
}
6767

68-
if (formattedOverrides.format === 'json' || originalSettings.format === 'json') {
68+
if (formattedOverrides.format === 'ndjson' || originalSettings.format === 'ndjson') {
6969
formattedOverrides.should_trim_fields = '';
7070
formattedOverrides.has_header_row = '';
7171
formattedOverrides.delimiter = '';

x-pack/plugins/ml/public/file_datavisualizer/components/import_view/importer/importer_factory.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import { CsvImporter } from './csv_importer';
99
import { SstImporter } from './sst_importer';
10-
import { JsonImporter } from './json_importer';
10+
import { NdjsonImporter } from './ndjson_importer';
1111

1212
export function importerFactory(format, results, settings) {
1313

@@ -16,8 +16,8 @@ export function importerFactory(format, results, settings) {
1616
return new CsvImporter(results, settings);
1717
case 'semi_structured_text':
1818
return new SstImporter(results, settings);
19-
case 'json':
20-
return new JsonImporter(results, settings);
19+
case 'ndjson':
20+
return new NdjsonImporter(results, settings);
2121
default:
2222
return;
2323
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import { Importer } from './importer';
99

10-
export class JsonImporter extends Importer {
10+
export class NdjsonImporter extends Importer {
1111
constructor(results, settings) {
1212
super(settings);
1313
}

0 commit comments

Comments
 (0)