+ }
color="warning"
iconType="help"
>
- {importFailures.length} out of {docCount} documents could not be imported.
- This could be due to lines not matching the Grok pattern.
+
+
@@ -72,7 +91,12 @@ function Failures({ failedDocs }) {
return (
+ }
paddingSize="m"
>
@@ -100,32 +124,57 @@ function createDisplayItems(
) {
const items = [
{
- title: 'Index',
+ title: (
+
+ ),
description: index,
},
{
- title: 'Documents ingested',
+ title: (
+
+ ),
description: docCount - ((importFailures && importFailures.length) || 0),
}
];
if (createPipeline) {
items.splice(1, 0, {
- title: 'Ingest pipeline',
+ title: (
+
+ ),
description: ingestPipelineId,
});
}
if (createIndexPattern) {
items.splice(1, 0, {
- title: 'Index pattern',
+ title: (
+
+ ),
description: indexPattern,
});
}
if (importFailures && importFailures.length > 0) {
items.push({
- title: 'Failed documents',
+ title: (
+
+ ),
description: importFailures.length,
});
}
diff --git a/x-pack/plugins/ml/public/file_datavisualizer/components/import_view/import_view.js b/x-pack/plugins/ml/public/file_datavisualizer/components/import_view/import_view.js
index a722b11b9945c..651924542cfe7 100644
--- a/x-pack/plugins/ml/public/file_datavisualizer/components/import_view/import_view.js
+++ b/x-pack/plugins/ml/public/file_datavisualizer/components/import_view/import_view.js
@@ -5,6 +5,7 @@
*/
+import { FormattedMessage } from '@kbn/i18n/react';
import React, {
Component,
} from 'react';
@@ -363,9 +364,18 @@ export class ImportView extends Component {
- Import data
+
+
+ }
/>
@@ -399,7 +409,10 @@ export class ImportView extends Component {
iconSide="right"
fill
>
- Import
+
}
@@ -409,7 +422,10 @@ export class ImportView extends Component {
- Reset
+
}
@@ -519,7 +535,12 @@ function getDefaultState(state, results) {
function isIndexNameValid(name, indexNames) {
if (indexNames.find(i => i === name)) {
- return 'Index name already exists';
+ return (
+
+ );
}
const reg = new RegExp('[\\\\/\*\?\"\<\>\|\\s\,\#]+');
@@ -529,7 +550,12 @@ function isIndexNameValid(name, indexNames) {
name.match(/^[-_+]/) !== null || // name can't start with these chars
name.match(reg) !== null // name can't contain these chars
) {
- return 'Index name contains illegal characters';
+ return (
+
+ );
}
return '';
}
@@ -541,7 +567,12 @@ function isIndexPatternNameValid(name, indexPatternNames, index) {
}
if (indexPatternNames.find(i => i === name)) {
- return 'Index pattern name already exists';
+ return (
+
+ );
}
// escape . and + to stop the regex matching more than it should.
@@ -551,7 +582,12 @@ function isIndexPatternNameValid(name, indexPatternNames, index) {
newName = newName.replace('*', '.*');
const reg = new RegExp(`^${newName}$`);
if (index.match(reg) === null) { // name should match index
- return 'Index pattern does not match index name';
+ return (
+
+ );
}
return '';
diff --git a/x-pack/plugins/ml/public/file_datavisualizer/components/results_links/results_links.js b/x-pack/plugins/ml/public/file_datavisualizer/components/results_links/results_links.js
index b88c87c21758e..5c38548825cd7 100644
--- a/x-pack/plugins/ml/public/file_datavisualizer/components/results_links/results_links.js
+++ b/x-pack/plugins/ml/public/file_datavisualizer/components/results_links/results_links.js
@@ -5,6 +5,7 @@
*/
+import { FormattedMessage } from '@kbn/i18n/react';
import React, {
Component,
} from 'react';
@@ -90,7 +91,12 @@ export class ResultsLinks extends Component {
}
- title="View index in Discover"
+ title={
+
+ }
description=""
href={`${uiChrome.getBasePath()}/app/kibana#/discover?&_a=(index:'${indexPatternId}')${_g}`}
/>
@@ -100,7 +106,12 @@ export class ResultsLinks extends Component {
}
- title="Create new ML job"
+ title={
+
+ }
description=""
href={`${uiChrome.getBasePath()}/app/ml#/jobs/new_job/step/job_type?index=${indexPatternId}${_g}`}
/>
@@ -110,7 +121,12 @@ export class ResultsLinks extends Component {
}
- title="Open in Data Visualizer"
+ title={
+
+ }
description=""
href={`${uiChrome.getBasePath()}/app/ml#/jobs/new_job/datavisualizer?index=${indexPatternId}${_g}`}
/>
@@ -119,7 +135,12 @@ export class ResultsLinks extends Component {
}
- title="Index Management"
+ title={
+
+ }
description=""
href={`${uiChrome.getBasePath()}/app/kibana#/management/elasticsearch/index_management/home`}
/>
@@ -128,7 +149,12 @@ export class ResultsLinks extends Component {
}
- title="Index Pattern Management"
+ title={
+
+ }
description=""
href={`${uiChrome.getBasePath()}/app/kibana#/management/kibana/indices/${indexPatternId}`}
/>
diff --git a/x-pack/plugins/ml/public/file_datavisualizer/components/results_view/results_view.js b/x-pack/plugins/ml/public/file_datavisualizer/components/results_view/results_view.js
index 1c966cbefede2..9a632edefed0b 100644
--- a/x-pack/plugins/ml/public/file_datavisualizer/components/results_view/results_view.js
+++ b/x-pack/plugins/ml/public/file_datavisualizer/components/results_view/results_view.js
@@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-
+import { injectI18n, FormattedMessage } from '@kbn/i18n/react';
import React from 'react';
import {
@@ -18,14 +18,17 @@ import { FileContents } from '../file_contents';
import { AnalysisSummary } from '../analysis_summary';
import { FieldsStats } from '../fields_stats';
-export function ResultsView({ data, results, showEditFlyout }) {
+export const ResultsView = injectI18n(function ({ data, results, showEditFlyout, intl }) {
console.log(results);
const tabs = [
{
id: 'file-stats',
- name: 'File stats',
+ name: intl.formatMessage({
+ id: 'xpack.ml.fileDatavisualizer.resultsView.fileStatsTabName',
+ defaultMessage: 'File stats'
+ }),
content: ,
}
];
@@ -50,7 +53,10 @@ export function ResultsView({ data, results, showEditFlyout }) {
showEditFlyout()}>
- Override settings
+
@@ -66,4 +72,4 @@ export function ResultsView({ data, results, showEditFlyout }) {
);
-}
+});
diff --git a/x-pack/plugins/ml/public/file_datavisualizer/file_datavisualizer.js b/x-pack/plugins/ml/public/file_datavisualizer/file_datavisualizer.js
index f59788329da34..8b18e00aef534 100644
--- a/x-pack/plugins/ml/public/file_datavisualizer/file_datavisualizer.js
+++ b/x-pack/plugins/ml/public/file_datavisualizer/file_datavisualizer.js
@@ -4,7 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/
-
import { FileDataVisualizerView } from './components/file_datavisualizer_view';
import React from 'react';
diff --git a/x-pack/plugins/ml/public/file_datavisualizer/file_datavisualizer_directive.js b/x-pack/plugins/ml/public/file_datavisualizer/file_datavisualizer_directive.js
index 85666785c92fc..6e150126338b4 100644
--- a/x-pack/plugins/ml/public/file_datavisualizer/file_datavisualizer_directive.js
+++ b/x-pack/plugins/ml/public/file_datavisualizer/file_datavisualizer_directive.js
@@ -6,6 +6,7 @@
import 'ngreact';
+import { injectI18nProvider } from '@kbn/i18n/react';
import { uiModules } from 'ui/modules';
const module = uiModules.get('apps/ml', ['react']);
@@ -17,6 +18,7 @@ import { getMlNodeCount } from 'plugins/ml/ml_nodes_check/check_ml_nodes';
import { loadNewJobDefaults } from 'plugins/ml/jobs/new_job/utils/new_job_defaults';
import { loadIndexPatterns } from '../util/index_utils';
import { initPromise } from 'plugins/ml/util/promise';
+import { FileDataVisualizerPage } from './file_datavisualizer';
import uiRoutes from 'ui/routes';
@@ -36,14 +38,10 @@ uiRoutes
}
});
-
-
-import { FileDataVisualizerPage } from './file_datavisualizer';
-
module.directive('fileDatavisualizerPage', function ($injector) {
const reactDirective = $injector.get('reactDirective');
const indexPatterns = $injector.get('indexPatterns');
const kibanaConfig = $injector.get('config');
- return reactDirective(FileDataVisualizerPage, undefined, { restrict: 'E' }, { indexPatterns, kibanaConfig });
+ return reactDirective(injectI18nProvider(FileDataVisualizerPage), undefined, { restrict: 'E' }, { indexPatterns, kibanaConfig });
});