translate logstash (#26169) (#26512)

translate logstash
This commit is contained in:
pavel06081991 2018-12-04 13:43:51 +03:00 committed by GitHub
parent 2b53056651
commit 7a3b22c34b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 636 additions and 181 deletions

View file

@ -22,6 +22,7 @@
"xpack.idxMgmt": "x-pack/plugins/index_management",
"xpack.infra": "x-pack/plugins/infra",
"xpack.licenseMgmt": "x-pack/plugins/license_management",
"xpack.logstash": "x-pack/plugins/logstash",
"xpack.monitoring": "x-pack/plugins/monitoring",
"xpack.reporting": "x-pack/plugins/reporting",
"xpack.rollupJobs": "x-pack/plugins/rollup",

View file

@ -4,35 +4,49 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { i18n } from '@kbn/i18n';
export const TOOLTIPS = {
settings: {
'pipeline.workers': 'The number of workers that will, in parallel, execute the filter and '
'pipeline.workers': i18n.translate('xpack.logstash.workersTooltip', {
defaultMessage: 'The number of workers that will, in parallel, execute the filter and '
+ 'output stages of the pipeline. If you find that events are backing up, '
+ 'or that the CPU is not saturated, consider increasing this number to '
+ 'better utilize machine processing power.\n\n'
+ 'Default value: Number of the hosts CPU cores',
}),
'pipeline.batch.size': 'The maximum number of events an individual worker thread will collect '
'pipeline.batch.size': i18n.translate('xpack.logstash.pipelineBatchSizeTooltip', {
defaultMessage: 'The maximum number of events an individual worker thread will collect '
+ 'from inputs before attempting to execute its filters and outputs. Larger '
+ 'batch sizes are generally more efficient, but come at the cost of increased '
+ 'memory overhead. You may have to increase the JVM heap size by setting the '
+ 'LS_HEAP_SIZE variable to effectively use the option.\n\n'
+ 'Default value: 125',
+ 'Default value: 125'
}),
'pipeline.batch.delay': 'When creating pipeline event batches, how long in milliseconds to wait '
'pipeline.batch.delay': i18n.translate('xpack.logstash.pipelineBatchDelayTooltip', {
defaultMessage: 'When creating pipeline event batches, how long in milliseconds to wait '
+ 'for each event before dispatching an undersized batch to pipeline workers.\n\n'
+ 'Default value: 50ms',
+ 'Default value: 50ms'
}),
'queue.type': 'The internal queuing model to use for event buffering. Specify memory for '
'queue.type': i18n.translate('xpack.logstash.queueTypeTooltip', {
defaultMessage: 'The internal queuing model to use for event buffering. Specify memory for '
+ 'legacy in-memory based queuing, or persisted for disk-based ACKed queueing\n\n'
+ 'Default value: memory',
+ 'Default value: memory'
}),
'queue.max_bytes': 'The total capacity of the queue in number of bytes. Make sure the '
'queue.max_bytes': i18n.translate('xpack.logstash.queueMaxBytesTooltip', {
defaultMessage: 'The total capacity of the queue in number of bytes. Make sure the '
+ 'capacity of your disk drive is greater than the value you specify here.\n\n'
+ 'Default value: 1024mb (1g)',
+ 'Default value: 1024mb (1g)'
}),
'queue.checkpoint.writes': 'The maximum number of written events before forcing a checkpoint when '
'queue.checkpoint.writes': i18n.translate('xpack.logstash.queueCheckpointWritesTooltip', {
defaultMessage: 'The maximum number of written events before forcing a checkpoint when '
+ 'persistent queues are enabled. Specify 0 to set this value to unlimited.\n\n'
+ 'Default value: 1024'
})
}
};

View file

@ -4,12 +4,34 @@ exports[`ConfirmDeletePipelineModal component renders as expected 1`] = `
<EuiOverlayMask>
<EuiConfirmModal
buttonColor="danger"
cancelButtonText="Cancel"
confirmButtonText="Delete pipeline"
cancelButtonText={
<FormattedMessage
defaultMessage="Cancel"
id="xpack.logstash.confirmDeletePipelineModal.cancelButtonText"
values={Object {}}
/>
}
confirmButtonText={
<FormattedMessage
defaultMessage="Delete pipeline"
id="xpack.logstash.confirmDeletePipelineModal.confirmButtonText"
values={Object {}}
/>
}
defaultFocusedButton="cancel"
onCancel={[MockFunction]}
onConfirm={[MockFunction]}
title="Delete pipeline the id"
title={
<FormattedMessage
defaultMessage="Delete pipeline {id}"
id="xpack.logstash.confirmDeletePipelineModal.deletePipelineTitle"
values={
Object {
"id": "the id",
}
}
/>
}
>
<p>
You cannot recover a deleted pipeline.

View file

@ -39,7 +39,13 @@ exports[`PipelineEditor component includes required error message for falsy pipe
describedByIds={Array []}
fullWidth={true}
hasEmptyLabelSpace={false}
label="Pipeline ID"
label={
<FormattedMessage
defaultMessage="Pipeline ID"
id="xpack.logstash.pipelineEditor.pipelineIdFormRowLabel"
values={Object {}}
/>
}
>
<EuiFieldText
compressed={false}
@ -57,7 +63,13 @@ exports[`PipelineEditor component includes required error message for falsy pipe
describedByIds={Array []}
fullWidth={true}
hasEmptyLabelSpace={false}
label="Description"
label={
<FormattedMessage
defaultMessage="Description"
id="xpack.logstash.pipelineEditor.descriptionFormRowLabel"
values={Object {}}
/>
}
>
<EuiFieldText
compressed={false}
@ -73,7 +85,13 @@ exports[`PipelineEditor component includes required error message for falsy pipe
describedByIds={Array []}
fullWidth={true}
hasEmptyLabelSpace={false}
label="Pipeline"
label={
<FormattedMessage
defaultMessage="Pipeline"
id="xpack.logstash.pipelineEditor.pipelineFormRowLabel"
values={Object {}}
/>
}
>
<div
data-test-subj="acePipeline"
@ -295,7 +313,11 @@ Default value: 1024"
onClick={[Function]}
type="button"
>
Create and deploy
<FormattedMessage
defaultMessage="Create and deploy"
id="xpack.logstash.pipelineEditor.createAndDeployButtonLabel"
values={Object {}}
/>
</EuiButton>
</EuiFlexItem>
<EuiFlexItem
@ -310,7 +332,11 @@ Default value: 1024"
onClick={[Function]}
type="button"
>
Cancel
<FormattedMessage
defaultMessage="Cancel"
id="xpack.logstash.pipelineEditor.cancelButtonLabel"
values={Object {}}
/>
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
@ -356,7 +382,13 @@ exports[`PipelineEditor component invalidates form for invalid pipeline id input
describedByIds={Array []}
fullWidth={true}
hasEmptyLabelSpace={false}
label="Pipeline ID"
label={
<FormattedMessage
defaultMessage="Pipeline ID"
id="xpack.logstash.pipelineEditor.pipelineIdFormRowLabel"
values={Object {}}
/>
}
>
<EuiFieldText
compressed={false}
@ -374,7 +406,13 @@ exports[`PipelineEditor component invalidates form for invalid pipeline id input
describedByIds={Array []}
fullWidth={true}
hasEmptyLabelSpace={false}
label="Description"
label={
<FormattedMessage
defaultMessage="Description"
id="xpack.logstash.pipelineEditor.descriptionFormRowLabel"
values={Object {}}
/>
}
>
<EuiFieldText
compressed={false}
@ -390,7 +428,13 @@ exports[`PipelineEditor component invalidates form for invalid pipeline id input
describedByIds={Array []}
fullWidth={true}
hasEmptyLabelSpace={false}
label="Pipeline"
label={
<FormattedMessage
defaultMessage="Pipeline"
id="xpack.logstash.pipelineEditor.pipelineFormRowLabel"
values={Object {}}
/>
}
>
<div
data-test-subj="acePipeline"
@ -612,7 +656,11 @@ Default value: 1024"
onClick={[Function]}
type="button"
>
Create and deploy
<FormattedMessage
defaultMessage="Create and deploy"
id="xpack.logstash.pipelineEditor.createAndDeployButtonLabel"
values={Object {}}
/>
</EuiButton>
</EuiFlexItem>
<EuiFlexItem
@ -627,7 +675,11 @@ Default value: 1024"
onClick={[Function]}
type="button"
>
Cancel
<FormattedMessage
defaultMessage="Cancel"
id="xpack.logstash.pipelineEditor.cancelButtonLabel"
values={Object {}}
/>
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
@ -673,7 +725,13 @@ exports[`PipelineEditor component invalidates form for pipeline id with spaces 1
describedByIds={Array []}
fullWidth={true}
hasEmptyLabelSpace={false}
label="Pipeline ID"
label={
<FormattedMessage
defaultMessage="Pipeline ID"
id="xpack.logstash.pipelineEditor.pipelineIdFormRowLabel"
values={Object {}}
/>
}
>
<EuiFieldText
compressed={false}
@ -691,7 +749,13 @@ exports[`PipelineEditor component invalidates form for pipeline id with spaces 1
describedByIds={Array []}
fullWidth={true}
hasEmptyLabelSpace={false}
label="Description"
label={
<FormattedMessage
defaultMessage="Description"
id="xpack.logstash.pipelineEditor.descriptionFormRowLabel"
values={Object {}}
/>
}
>
<EuiFieldText
compressed={false}
@ -707,7 +771,13 @@ exports[`PipelineEditor component invalidates form for pipeline id with spaces 1
describedByIds={Array []}
fullWidth={true}
hasEmptyLabelSpace={false}
label="Pipeline"
label={
<FormattedMessage
defaultMessage="Pipeline"
id="xpack.logstash.pipelineEditor.pipelineFormRowLabel"
values={Object {}}
/>
}
>
<div
data-test-subj="acePipeline"
@ -929,7 +999,11 @@ Default value: 1024"
onClick={[Function]}
type="button"
>
Create and deploy
<FormattedMessage
defaultMessage="Create and deploy"
id="xpack.logstash.pipelineEditor.createAndDeployButtonLabel"
values={Object {}}
/>
</EuiButton>
</EuiFlexItem>
<EuiFlexItem
@ -944,7 +1018,11 @@ Default value: 1024"
onClick={[Function]}
type="button"
>
Cancel
<FormattedMessage
defaultMessage="Cancel"
id="xpack.logstash.pipelineEditor.cancelButtonLabel"
values={Object {}}
/>
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
@ -986,7 +1064,13 @@ exports[`PipelineEditor component matches snapshot for clone pipeline 1`] = `
describedByIds={Array []}
fullWidth={true}
hasEmptyLabelSpace={false}
label="Description"
label={
<FormattedMessage
defaultMessage="Description"
id="xpack.logstash.pipelineEditor.descriptionFormRowLabel"
values={Object {}}
/>
}
>
<EuiFieldText
compressed={false}
@ -1002,7 +1086,13 @@ exports[`PipelineEditor component matches snapshot for clone pipeline 1`] = `
describedByIds={Array []}
fullWidth={true}
hasEmptyLabelSpace={false}
label="Pipeline"
label={
<FormattedMessage
defaultMessage="Pipeline"
id="xpack.logstash.pipelineEditor.pipelineFormRowLabel"
values={Object {}}
/>
}
>
<div
data-test-subj="acePipeline"
@ -1224,7 +1314,11 @@ Default value: 1024"
onClick={[Function]}
type="button"
>
Create and deploy
<FormattedMessage
defaultMessage="Create and deploy"
id="xpack.logstash.pipelineEditor.createAndDeployButtonLabel"
values={Object {}}
/>
</EuiButton>
</EuiFlexItem>
<EuiFlexItem
@ -1239,7 +1333,11 @@ Default value: 1024"
onClick={[Function]}
type="button"
>
Cancel
<FormattedMessage
defaultMessage="Cancel"
id="xpack.logstash.pipelineEditor.cancelButtonLabel"
values={Object {}}
/>
</EuiButton>
</EuiFlexItem>
<EuiFlexItem
@ -1253,7 +1351,11 @@ Default value: 1024"
onClick={[Function]}
type="button"
>
Delete pipeline
<FormattedMessage
defaultMessage="Delete pipeline"
id="xpack.logstash.pipelineEditor.deletePipelineButtonLabel"
values={Object {}}
/>
</EuiButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>
@ -1295,7 +1397,13 @@ exports[`PipelineEditor component matches snapshot for create pipeline 1`] = `
describedByIds={Array []}
fullWidth={true}
hasEmptyLabelSpace={false}
label="Pipeline ID"
label={
<FormattedMessage
defaultMessage="Pipeline ID"
id="xpack.logstash.pipelineEditor.pipelineIdFormRowLabel"
values={Object {}}
/>
}
>
<EuiFieldText
compressed={false}
@ -1313,7 +1421,13 @@ exports[`PipelineEditor component matches snapshot for create pipeline 1`] = `
describedByIds={Array []}
fullWidth={true}
hasEmptyLabelSpace={false}
label="Description"
label={
<FormattedMessage
defaultMessage="Description"
id="xpack.logstash.pipelineEditor.descriptionFormRowLabel"
values={Object {}}
/>
}
>
<EuiFieldText
compressed={false}
@ -1329,7 +1443,13 @@ exports[`PipelineEditor component matches snapshot for create pipeline 1`] = `
describedByIds={Array []}
fullWidth={true}
hasEmptyLabelSpace={false}
label="Pipeline"
label={
<FormattedMessage
defaultMessage="Pipeline"
id="xpack.logstash.pipelineEditor.pipelineFormRowLabel"
values={Object {}}
/>
}
>
<div
data-test-subj="acePipeline"
@ -1551,7 +1671,11 @@ Default value: 1024"
onClick={[Function]}
type="button"
>
Create and deploy
<FormattedMessage
defaultMessage="Create and deploy"
id="xpack.logstash.pipelineEditor.createAndDeployButtonLabel"
values={Object {}}
/>
</EuiButton>
</EuiFlexItem>
<EuiFlexItem
@ -1566,7 +1690,11 @@ Default value: 1024"
onClick={[Function]}
type="button"
>
Cancel
<FormattedMessage
defaultMessage="Cancel"
id="xpack.logstash.pipelineEditor.cancelButtonLabel"
values={Object {}}
/>
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
@ -1608,7 +1736,13 @@ exports[`PipelineEditor component matches snapshot for edit pipeline 1`] = `
describedByIds={Array []}
fullWidth={true}
hasEmptyLabelSpace={false}
label="Description"
label={
<FormattedMessage
defaultMessage="Description"
id="xpack.logstash.pipelineEditor.descriptionFormRowLabel"
values={Object {}}
/>
}
>
<EuiFieldText
compressed={false}
@ -1624,7 +1758,13 @@ exports[`PipelineEditor component matches snapshot for edit pipeline 1`] = `
describedByIds={Array []}
fullWidth={true}
hasEmptyLabelSpace={false}
label="Pipeline"
label={
<FormattedMessage
defaultMessage="Pipeline"
id="xpack.logstash.pipelineEditor.pipelineFormRowLabel"
values={Object {}}
/>
}
>
<div
data-test-subj="acePipeline"
@ -1846,7 +1986,11 @@ Default value: 1024"
onClick={[Function]}
type="button"
>
Create and deploy
<FormattedMessage
defaultMessage="Create and deploy"
id="xpack.logstash.pipelineEditor.createAndDeployButtonLabel"
values={Object {}}
/>
</EuiButton>
</EuiFlexItem>
<EuiFlexItem
@ -1861,7 +2005,11 @@ Default value: 1024"
onClick={[Function]}
type="button"
>
Cancel
<FormattedMessage
defaultMessage="Cancel"
id="xpack.logstash.pipelineEditor.cancelButtonLabel"
values={Object {}}
/>
</EuiButton>
</EuiFlexItem>
<EuiFlexItem
@ -1875,7 +2023,11 @@ Default value: 1024"
onClick={[Function]}
type="button"
>
Delete pipeline
<FormattedMessage
defaultMessage="Delete pipeline"
id="xpack.logstash.pipelineEditor.deletePipelineButtonLabel"
values={Object {}}
/>
</EuiButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>

View file

@ -7,6 +7,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { EuiConfirmModal, EUI_MODAL_CANCEL_BUTTON, EuiOverlayMask } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { PIPELINE_EDITOR } from './constants';
export function ConfirmDeletePipelineModal({ id, cancelDeleteModal, confirmDeletePipeline }) {
@ -14,12 +15,22 @@ export function ConfirmDeletePipelineModal({ id, cancelDeleteModal, confirmDelet
<EuiOverlayMask>
<EuiConfirmModal
buttonColor="danger"
cancelButtonText="Cancel"
confirmButtonText="Delete pipeline"
cancelButtonText={(<FormattedMessage
id="xpack.logstash.confirmDeletePipelineModal.cancelButtonText"
defaultMessage="Cancel"
/>)}
confirmButtonText={(<FormattedMessage
id="xpack.logstash.confirmDeletePipelineModal.confirmButtonText"
defaultMessage="Delete pipeline"
/>)}
defaultFocusedButton={EUI_MODAL_CANCEL_BUTTON}
onCancel={cancelDeleteModal}
onConfirm={confirmDeletePipeline}
title={`Delete pipeline ${id}`}
title={(<FormattedMessage
id="xpack.logstash.confirmDeletePipelineModal.deletePipelineTitle"
defaultMessage="Delete pipeline {id}"
values={{ id }}
/>)}
>
<p>{PIPELINE_EDITOR.DELETE_PIPELINE_MODAL_MESSAGE}</p>
</EuiConfirmModal>

View file

@ -4,52 +4,75 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { i18n } from '@kbn/i18n';
export const PIPELINE_EDITOR = {
DELETE_PIPELINE_MODAL_MESSAGE: `You cannot recover a deleted pipeline.`,
ID_REQUIRED_ERR_MSG: 'Pipeline ID is required',
ID_FORMAT_ERR_MSG:
'Pipeline ID must begin with a letter or underscore and contain only letters, underscores, dashes, and numbers',
DELETE_PIPELINE_MODAL_MESSAGE: i18n.translate('xpack.logstash.deletePipelineModalMessage', {
defaultMessage: 'You cannot recover a deleted pipeline.',
}),
ID_REQUIRED_ERR_MSG: i18n.translate('xpack.logstash.pipelineIdRequiredMessage', {
defaultMessage: 'Pipeline ID is required',
}),
ID_FORMAT_ERR_MSG: i18n.translate('xpack.logstash.idFormatErrorMessage', {
defaultMessage: 'Pipeline ID must begin with a letter or underscore and contain only letters, underscores, dashes, and numbers',
}),
QUEUE_TYPES: [
{
'data-test-subj': 'selectQueueType-memory',
text: 'memory',
text: i18n.translate('xpack.logstash.queueTypes.memoryLabel', {
defaultMessage: 'memory',
}),
value: 'memory',
},
{
'data-test-subj': 'selectQueueType-persisted',
text: 'persisted',
text: i18n.translate('xpack.logstash.queueTypes.persistedLabel', {
defaultMessage: 'persisted',
}),
value: 'persisted',
},
],
UNITS: [
{
'data-test-subj': 'selectQueueMaxBytesUnits-b',
text: 'bytes',
text: i18n.translate('xpack.logstash.units.bytesLabel', {
defaultMessage: 'bytes',
}),
value: 'b',
},
{
'data-test-subj': 'selectQueueMaxBytesUnits-kb',
text: 'kilobytes',
text: i18n.translate('xpack.logstash.units.kilobytesLabel', {
defaultMessage: 'kilobytes',
}),
value: 'kb',
},
{
'data-test-subj': 'selectQueueMaxBytesUnits-mb',
text: 'megabytes',
text: i18n.translate('xpack.logstash.units.megabytesLabel', {
defaultMessage: 'megabytes',
}),
value: 'mb',
},
{
'data-test-subj': 'selectQueueMaxBytesUnits-gb',
text: 'gigabytes',
text: i18n.translate('xpack.logstash.units.gigabytesLabel', {
defaultMessage: 'gigabytes',
}),
value: 'gb',
},
{
'data-test-subj': 'selectQueueMaxBytesUnits-tb',
text: 'terabytes',
text: i18n.translate('xpack.logstash.units.terabytesLabel', {
defaultMessage: 'terabytes',
}),
value: 'tb',
},
{
'data-test-subj': 'selectQueueMaxBytesUnits-pb',
text: 'petabytes',
text: i18n.translate('xpack.logstash.units.petabytesLabel', {
defaultMessage: 'petabytes',
}),
value: 'pb',
},
],

View file

@ -6,6 +6,7 @@
import React from 'react';
import { PropTypes } from 'prop-types';
import { injectI18n, FormattedMessage } from '@kbn/i18n/react';
import 'brace/mode/plain_text';
import 'brace/theme/github';
@ -33,7 +34,7 @@ import { FlexItemSetting } from './flex_item_setting';
import { FormLabelWithIconTip } from './form_label_with_icon_tip';
import { PIPELINE_EDITOR } from './constants';
export class PipelineEditor extends React.Component {
class PipelineEditorUi extends React.Component {
constructor(props) {
super(props);
@ -125,7 +126,7 @@ export class PipelineEditor extends React.Component {
};
onPipelineSave = () => {
const { pipelineService, toastNotifications } = this.props;
const { pipelineService, toastNotifications, intl } = this.props;
const { id } = this.state.pipeline;
return pipelineService
.savePipeline({
@ -133,7 +134,12 @@ export class PipelineEditor extends React.Component {
upstreamJSON: this.state.pipeline,
})
.then(() => {
toastNotifications.addSuccess(`Saved "${id}"`);
toastNotifications.addSuccess(intl.formatMessage({
id: 'xpack.logstash.pipelineEditor.pipelineSuccessfullySavedMessage',
defaultMessage: 'Saved "{id}"'
}, {
id,
}));
this.onClose();
})
.catch(this.notifyOnError);
@ -194,6 +200,7 @@ export class PipelineEditor extends React.Component {
pipeline: { id },
pipelineService,
toastNotifications,
intl,
} = this.props;
this.hideConfirmDeleteModal();
@ -201,7 +208,12 @@ export class PipelineEditor extends React.Component {
return pipelineService
.deletePipeline(id)
.then(() => {
toastNotifications.addSuccess(`Deleted "${id}"`);
toastNotifications.addSuccess(intl.formatMessage({
id: 'xpack.logstash.pipelineEditor.pipelineSuccessfullyDeletedMessage',
defaultMessage: 'Deleted "{id}"'
}, {
id,
}));
this.onClose();
})
.catch(this.notifyOnError);
@ -215,18 +227,34 @@ export class PipelineEditor extends React.Component {
},
},
isNewPipeline,
intl,
} = this.props;
if (!!clone && id) {
return `Clone Pipeline "${id}"`;
return intl.formatMessage({
id: 'xpack.logstash.pipelineEditor.clonePipelineTitle',
defaultMessage: 'Clone Pipeline "{id}"'
}, {
id,
});
}
if (!isNewPipeline) {
return `Edit Pipeline "${this.state.pipeline.id}"`;
return intl.formatMessage({
id: 'xpack.logstash.pipelineEditor.editPipelineTitle',
defaultMessage: 'Edit Pipeline "{id}"'
}, {
id: this.state.pipeline.id,
});
}
return 'Create Pipeline';
return intl.formatMessage({
id: 'xpack.logstash.pipelineEditor.createPipelineTitle',
defaultMessage: 'Create Pipeline'
});
};
render() {
const { intl } = this.props;
return (
<EuiPage data-test-subj={`pipelineEdit pipelineEdit-${this.state.pipeline.id}`}>
<EuiPageContent
@ -242,7 +270,13 @@ export class PipelineEditor extends React.Component {
<EuiSpacer size="m" />
<EuiForm isInvalid={this.state.showPipelineIdError} error={this.state.pipelineIdErrors}>
{this.props.isNewPipeline && (
<EuiFormRow fullWidth label="Pipeline ID">
<EuiFormRow
fullWidth
label={(<FormattedMessage
id="xpack.logstash.pipelineEditor.pipelineIdFormRowLabel"
defaultMessage="Pipeline ID"
/>)}
>
<EuiFieldText
fullWidth
data-test-subj="inputId"
@ -254,7 +288,13 @@ export class PipelineEditor extends React.Component {
/>
</EuiFormRow>
)}
<EuiFormRow fullWidth label="Description">
<EuiFormRow
fullWidth
label={(<FormattedMessage
id="xpack.logstash.pipelineEditor.descriptionFormRowLabel"
defaultMessage="Description"
/>)}
>
<EuiFieldText
data-test-subj="inputDescription"
fullWidth
@ -263,7 +303,13 @@ export class PipelineEditor extends React.Component {
value={this.state.pipeline.description || ''}
/>
</EuiFormRow>
<EuiFormRow fullWidth label="Pipeline">
<EuiFormRow
fullWidth
label={(<FormattedMessage
id="xpack.logstash.pipelineEditor.pipelineFormRowLabel"
defaultMessage="Pipeline"
/>)}
>
<div data-test-subj="acePipeline">
<EuiCodeEditor
mode="plain_text"
@ -282,7 +328,10 @@ export class PipelineEditor extends React.Component {
<EuiFormRow
label={
<FormLabelWithIconTip
formRowLabelText="Pipeline workers"
formRowLabelText={intl.formatMessage({
id: 'xpack.logstash.pipelineEditor.pipelineWorkersFormRowLabel',
defaultMessage: 'Pipeline workers'
})}
formRowTooltipText={TOOLTIPS.settings['pipeline.workers']}
/>
}
@ -295,7 +344,10 @@ export class PipelineEditor extends React.Component {
</EuiFormRow>
<EuiFlexGroup>
<FlexItemSetting
formRowLabelText="Pipeline batch size"
formRowLabelText={intl.formatMessage({
id: 'xpack.logstash.pipelineEditor.pipelineBatchSizeFormRowLabel',
defaultMessage: 'Pipeline batch size'
})}
formRowTooltipText={TOOLTIPS.settings['pipeline.batch.size']}
>
<EuiFieldNumber
@ -305,7 +357,10 @@ export class PipelineEditor extends React.Component {
/>
</FlexItemSetting>
<FlexItemSetting
formRowLabelText="Pipeline batch delay"
formRowLabelText={intl.formatMessage({
id: 'xpack.logstash.pipelineEditor.pipelineBatchDelayFormRowLabel',
defaultMessage: 'Pipeline batch delay'
})}
formRowTooltipText={TOOLTIPS.settings['pipeline.batch.delay']}
>
<EuiFieldNumber
@ -317,7 +372,10 @@ export class PipelineEditor extends React.Component {
</EuiFlexGroup>
<EuiFlexGroup>
<FlexItemSetting
formRowLabelText="Queue type"
formRowLabelText={intl.formatMessage({
id: 'xpack.logstash.pipelineEditor.queueTypeFormRowLabel',
defaultMessage: 'Queue type'
})}
formRowTooltipText={TOOLTIPS.settings['queue.type']}
>
<EuiSelect
@ -328,7 +386,10 @@ export class PipelineEditor extends React.Component {
/>
</FlexItemSetting>
<FlexItemSetting
formRowLabelText="Queue max bytes"
formRowLabelText={intl.formatMessage({
id: 'xpack.logstash.pipelineEditor.queueMaxBytesFormRowLabel',
defaultMessage: 'Queue max bytes'
})}
formRowTooltipText={TOOLTIPS.settings['queue.max_bytes']}
>
<EuiFieldNumber
@ -346,7 +407,10 @@ export class PipelineEditor extends React.Component {
/>
</FlexItemSetting>
<FlexItemSetting
formRowLabelText="Queue checkpoint writes"
formRowLabelText={intl.formatMessage({
id: 'xpack.logstash.pipelineEditor.queueCheckpointWritesFormRowLabel',
defaultMessage: 'Queue checkpoint writes'
})}
formRowTooltipText={TOOLTIPS.settings['queue.checkpoint.writes']}
>
<EuiFieldNumber
@ -366,12 +430,18 @@ export class PipelineEditor extends React.Component {
isDisabled={this.isSaveDisabled()}
onClick={this.onPipelineSave}
>
Create and deploy
<FormattedMessage
id="xpack.logstash.pipelineEditor.createAndDeployButtonLabel"
defaultMessage="Create and deploy"
/>
</EuiButton>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton data-test-subj="btnCancel" onClick={this.onClose}>
Cancel
<FormattedMessage
id="xpack.logstash.pipelineEditor.cancelButtonLabel"
defaultMessage="Cancel"
/>
</EuiButton>
</EuiFlexItem>
{!this.props.isNewPipeline && (
@ -381,7 +451,10 @@ export class PipelineEditor extends React.Component {
data-test-subj="btnDeletePipeline"
onClick={this.showConfirmDeleteModal}
>
Delete pipeline
<FormattedMessage
id="xpack.logstash.pipelineEditor.deletePipelineButtonLabel"
defaultMessage="Delete pipeline"
/>
</EuiButtonEmpty>
</EuiFlexItem>
)}
@ -399,7 +472,7 @@ export class PipelineEditor extends React.Component {
}
}
PipelineEditor.propTypes = {
PipelineEditorUi.propTypes = {
close: PropTypes.func.isRequired,
isNewPipeline: PropTypes.bool.isRequired,
licenseService: PropTypes.shape({
@ -442,3 +515,5 @@ PipelineEditor.propTypes = {
}).isRequired,
username: PropTypes.string,
};
export const PipelineEditor = injectI18n(PipelineEditorUi);

View file

@ -5,7 +5,7 @@
*/
import React from 'react';
import { shallow } from 'enzyme';
import { shallowWithIntl } from 'test_utils/enzyme_helpers';
import 'brace';
import { PipelineEditor } from './pipeline_editor';
@ -79,7 +79,7 @@ describe('PipelineEditor component', () => {
});
it('matches snapshot for edit pipeline', () => {
expect(shallow(<PipelineEditor {...props} />)).toMatchSnapshot();
expect(shallowWithIntl(<PipelineEditor.WrappedComponent {...props} />)).toMatchSnapshot();
});
it('matches snapshot for clone pipeline', () => {
@ -87,39 +87,39 @@ describe('PipelineEditor component', () => {
clone: true,
id: 'pipelineToClone',
};
expect(shallow(<PipelineEditor {...props} />)).toMatchSnapshot();
expect(shallowWithIntl(<PipelineEditor.WrappedComponent {...props} />)).toMatchSnapshot();
});
it('matches snapshot for create pipeline', () => {
expect(shallow(<PipelineEditor {...props} isNewPipeline={true} />)).toMatchSnapshot();
expect(shallowWithIntl(<PipelineEditor.WrappedComponent {...props} isNewPipeline={true} />)).toMatchSnapshot();
});
it('updates state for pipeline id when creating', () => {
const wrapper = shallow(<PipelineEditor {...props} isNewPipeline={true} />);
const wrapper = shallowWithIntl(<PipelineEditor.WrappedComponent {...props} isNewPipeline={true} />);
wrapper.find(`[data-test-subj="inputId"]`).simulate('change', { target: { value: 'theNewPipelineId' } });
expect(wrapper.instance().state.pipeline.id).toBe('theNewPipelineId');
});
it('updates pipeline description', () => {
const wrapper = shallow(<PipelineEditor {...props} isNewPipeline={true} />);
const wrapper = shallowWithIntl(<PipelineEditor.WrappedComponent {...props} isNewPipeline={true} />);
wrapper.find(`[data-test-subj="inputDescription"]`).simulate('change', { target: { value: 'the new description' } });
expect(wrapper.instance().state.pipeline.description).toBe('the new description');
});
it('updates pipeline workers', () => {
const wrapper = shallow(<PipelineEditor {...props} />);
const wrapper = shallowWithIntl(<PipelineEditor.WrappedComponent {...props} />);
wrapper.find(`[data-test-subj="inputWorkers"]`).simulate('change', { target: { value: '12' } });
expect(wrapper.instance().state.pipeline.settings['pipeline.workers']).toBe(12);
});
it('updates pipeline batch size', () => {
const wrapper = shallow(<PipelineEditor {...props} />);
const wrapper = shallowWithIntl(<PipelineEditor.WrappedComponent {...props} />);
wrapper.find(`[data-test-subj="inputBatchSize"]`).simulate('change', { target: { value: '12' } });
expect(wrapper.instance().state.pipeline.settings['pipeline.batch.size']).toBe(12);
});
it('updates pipeline settings', () => {
const wrapper = shallow(<PipelineEditor {...props} />);
const wrapper = shallowWithIntl(<PipelineEditor.WrappedComponent {...props} />);
wrapper.find(`[data-test-subj="inputWorkers"]`).simulate('change', { target: { value: '10' } });
wrapper.find(`[data-test-subj="inputBatchSize"]`).simulate('change', { target: { value: '11' } });
wrapper.find(`[data-test-subj="inputBatchDelay"]`).simulate('change', { target: { value: '12' } });
@ -132,13 +132,13 @@ describe('PipelineEditor component', () => {
});
it('calls the pipelineService delete function on delete', () => {
const wrapper = shallow(<PipelineEditor {...props} />);
const wrapper = shallowWithIntl(<PipelineEditor.WrappedComponent {...props} />);
wrapper.find(`[data-test-subj="btnDeletePipeline"]`).simulate('click');
expect(wrapper.instance().state.showConfirmDeleteModal).toBe(true);
});
it('only matches pipeline names that fit the acceptable parameters', () => {
const wrapper = shallow(<PipelineEditor {...props} />);
const wrapper = shallowWithIntl(<PipelineEditor.WrappedComponent {...props} />);
const pattern = wrapper.instance().state.pipelineIdPattern;
expect(pattern.test('_startwithunderscore')).toBe(true);
@ -157,19 +157,19 @@ describe('PipelineEditor component', () => {
});
it('invalidates form for invalid pipeline id input', () => {
const wrapper = shallow(<PipelineEditor {...props} isNewPipeline={true} />);
const wrapper = shallowWithIntl(<PipelineEditor.WrappedComponent {...props} isNewPipeline={true} />);
wrapper.find(`[data-test-subj="inputId"]`).simulate('change', { target: { value: '$invalid-pipeline-name' } });
expect(wrapper).toMatchSnapshot();
});
it('invalidates form for pipeline id with spaces', () => {
const wrapper = shallow(<PipelineEditor {...props} isNewPipeline={true} />);
const wrapper = shallowWithIntl(<PipelineEditor.WrappedComponent {...props} isNewPipeline={true} />);
wrapper.find(`[data-test-subj="inputId"]`).simulate('change', { target: { value: 'pipeline id with spaces' } });
expect(wrapper).toMatchSnapshot();
});
it('includes required error message for falsy pipeline id', () => {
const wrapper = shallow(<PipelineEditor {...props} isNewPipeline={true} />);
const wrapper = shallowWithIntl(<PipelineEditor.WrappedComponent {...props} isNewPipeline={true} />);
wrapper.find(`[data-test-subj="inputId"]`).simulate('change', { target: { value: '' } });
expect(wrapper).toMatchSnapshot();
});

View file

@ -3,12 +3,22 @@
exports[`AddRoleAlert component renders expected component 1`] = `
<p>
<strong>
Grant additional privileges.
<FormattedMessage
defaultMessage="Grant additional privileges."
id="xpack.logstash.addRoleAlert.grantAdditionalPrivilegesTitle"
values={Object {}}
/>
</strong>
In Kibana Management, assign the
<EuiCode>
monitoring_user
</EuiCode>
role to your Kibana user.
<FormattedMessage
defaultMessage="In Kibana Management, assign the {role} role to your Kibana user."
id="xpack.logstash.addRoleAlert.grantAdditionalPrivilegesDescription"
values={
Object {
"role": <EuiCode>
monitoring_user
</EuiCode>,
}
}
/>
</p>
`;

View file

@ -8,7 +8,11 @@ exports[`AlertCallOut component renders expected component 1`] = `
title="Only pipelines created in Kibana Management appear here"
>
<p>
How can I see additional pipelines?
<FormattedMessage
defaultMessage="How can I see additional pipelines?"
id="xpack.logstash.alertCallOut.howToSeeAdditionalPipelinesDescription"
values={Object {}}
/>
</p>
<div>
Some text

View file

@ -4,15 +4,45 @@ exports[`ConfirmDeleteModal component confirms delete for multiple pipelines 1`]
<EuiOverlayMask>
<EuiConfirmModal
buttonColor="danger"
cancelButtonText="Cancel"
confirmButtonText="Delete 2 pipelines"
cancelButtonText={
<FormattedMessage
defaultMessage="Cancel"
id="xpack.logstash.confirmDeleteModal.cancelButtonLabel"
values={Object {}}
/>
}
confirmButtonText={
<FormattedMessage
defaultMessage="Delete {numPipelinesSelected} pipelines"
id="xpack.logstash.confirmDeleteModal.deletedPipelinesConfirmButtonLabel"
values={
Object {
"numPipelinesSelected": 2,
}
}
/>
}
defaultFocusedButton="cancel"
onCancel={[MockFunction]}
onConfirm={[MockFunction]}
title="Delete 2 pipelines"
title={
<FormattedMessage
defaultMessage="Delete {numPipelinesSelected} pipelines"
id="xpack.logstash.confirmDeleteModal.deletedPipelinesTitle"
values={
Object {
"numPipelinesSelected": 2,
}
}
/>
}
>
<p>
You cannot recover deleted pipelines.
<FormattedMessage
defaultMessage="You cannot recover deleted pipelines."
id="xpack.logstash.confirmDeleteModal.deletedPipelinesWarningMessage"
values={Object {}}
/>
</p>
</EuiConfirmModal>
</EuiOverlayMask>
@ -22,15 +52,41 @@ exports[`ConfirmDeleteModal component confirms delete for single pipeline 1`] =
<EuiOverlayMask>
<EuiConfirmModal
buttonColor="danger"
cancelButtonText="Cancel"
confirmButtonText="Delete pipeline"
cancelButtonText={
<FormattedMessage
defaultMessage="Cancel"
id="xpack.logstash.confirmDeleteModal.cancelButtonLabel"
values={Object {}}
/>
}
confirmButtonText={
<FormattedMessage
defaultMessage="Delete pipeline"
id="xpack.logstash.confirmDeleteModal.deletedPipelineConfirmButtonLabel"
values={Object {}}
/>
}
defaultFocusedButton="cancel"
onCancel={[MockFunction]}
onConfirm={[MockFunction]}
title="Delete pipeline \\"testId\\""
title={
<FormattedMessage
defaultMessage="Delete pipeline \\"{id}\\""
id="xpack.logstash.confirmDeleteModal.deletedPipelineTitle"
values={
Object {
"id": "testId",
}
}
/>
}
>
<p>
You cannot recover a deleted pipeline
<FormattedMessage
defaultMessage="You cannot recover a deleted pipeline"
id="xpack.logstash.confirmDeleteModal.deletedPipelineWarningMessage"
values={Object {}}
/>
</p>
</EuiConfirmModal>
</EuiOverlayMask>

View file

@ -3,24 +3,31 @@
exports[`EnableMonitoringAlert component renders expected component 1`] = `
<p>
<strong>
Enable monitoring.
<FormattedMessage
defaultMessage="Enable monitoring."
id="xpack.logstash.enableMonitoringAlert.enableMonitoringTitle"
values={Object {}}
/>
</strong>
In the
<EuiCode>
kibana.yml
</EuiCode>
file, set
<EuiCode>
xpack.monitoring.enabled
</EuiCode>
and
<EuiCode>
xpack.monitoring.ui.enabled
</EuiCode>
to
<EuiCode>
true
</EuiCode>
.
<FormattedMessage
defaultMessage="In the {configFileName} file, set {monitoringConfigParam} and {monitoringUiConfigParam} to {trueValue}."
id="xpack.logstash.enableMonitoringAlert.enableMonitoringDescription"
values={
Object {
"configFileName": <EuiCode>
kibana.yml
</EuiCode>,
"monitoringConfigParam": <EuiCode>
xpack.monitoring.enabled
</EuiCode>,
"monitoringUiConfigParam": <EuiCode>
xpack.monitoring.ui.enabled
</EuiCode>,
"trueValue": <EuiCode>
true
</EuiCode>,
}
}
/>
</p>
`;

View file

@ -6,12 +6,24 @@
import React from 'react';
import { EuiCode } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
export function AddRoleAlert() {
return (
<p>
<strong>Grant additional privileges. </strong>
In Kibana Management, assign the <EuiCode>monitoring_user</EuiCode> role to your Kibana user.
<strong>
<FormattedMessage
id="xpack.logstash.addRoleAlert.grantAdditionalPrivilegesTitle"
defaultMessage="Grant additional privileges."
/>
</strong>
<FormattedMessage
id="xpack.logstash.addRoleAlert.grantAdditionalPrivilegesDescription"
defaultMessage="In Kibana Management, assign the {role} role to your Kibana user."
values={{
role: <EuiCode>monitoring_user</EuiCode>,
}}
/>
</p>
);
}

View file

@ -5,12 +5,12 @@
*/
import React from 'react';
import { shallow } from 'enzyme';
import { shallowWithIntl } from 'test_utils/enzyme_helpers';
import { AddRoleAlert } from './add_role_alert';
describe('AddRoleAlert component', () => {
it('renders expected component', () => {
const wrapper = shallow(<AddRoleAlert />);
const wrapper = shallowWithIntl(<AddRoleAlert />);
expect(wrapper).toMatchSnapshot();
});
});

View file

@ -6,12 +6,18 @@
import React from 'react';
import { EuiCallOut } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { PIPELINE_LIST } from './constants';
export function AlertCallOut(props) {
return (
<EuiCallOut title={PIPELINE_LIST.INFO_ALERTS.CALL_OUT_TITLE} color="warning" iconType="help">
<p>How can I see additional pipelines?</p>
<p>
<FormattedMessage
id="xpack.logstash.alertCallOut.howToSeeAdditionalPipelinesDescription"
defaultMessage="How can I see additional pipelines?"
/>
</p>
{props.children}
</EuiCallOut>
);

View file

@ -5,12 +5,12 @@
*/
import React from 'react';
import { shallow } from 'enzyme';
import { shallowWithIntl } from 'test_utils/enzyme_helpers';
import { AlertCallOut } from './alert_call_out';
describe('AlertCallOut component', () => {
it('renders expected component', () => {
const wrapper = shallow(
const wrapper = shallowWithIntl(
<AlertCallOut>
<div>Some text</div>
</AlertCallOut>

View file

@ -6,6 +6,7 @@
import React from 'react';
import { EuiConfirmModal, EUI_MODAL_CANCEL_BUTTON, EuiOverlayMask } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
export function ConfirmDeleteModal({
cancelDeletePipelines,
@ -21,21 +22,59 @@ export function ConfirmDeleteModal({
const confirmText =
numPipelinesSelected === 1
? {
message: 'You cannot recover a deleted pipeline',
button: `Delete pipeline`,
title: `Delete pipeline "${selection[0].id}"`,
message: (
<FormattedMessage
id="xpack.logstash.confirmDeleteModal.deletedPipelineWarningMessage"
defaultMessage="You cannot recover a deleted pipeline"
/>
),
button: (
<FormattedMessage
id="xpack.logstash.confirmDeleteModal.deletedPipelineConfirmButtonLabel"
defaultMessage="Delete pipeline"
/>
),
title: (
<FormattedMessage
id="xpack.logstash.confirmDeleteModal.deletedPipelineTitle"
defaultMessage="Delete pipeline &quot;{id}&quot;"
values={{ id: selection[0].id }}
/>
),
}
: {
message: `You cannot recover deleted pipelines.`,
button: `Delete ${numPipelinesSelected} pipelines`,
title: `Delete ${numPipelinesSelected} pipelines`,
message: (
<FormattedMessage
id="xpack.logstash.confirmDeleteModal.deletedPipelinesWarningMessage"
defaultMessage="You cannot recover deleted pipelines."
/>
),
button: (
<FormattedMessage
id="xpack.logstash.confirmDeleteModal.deletedPipelinesConfirmButtonLabel"
defaultMessage="Delete {numPipelinesSelected} pipelines"
values={{ numPipelinesSelected }}
/>
),
title: (
<FormattedMessage
id="xpack.logstash.confirmDeleteModal.deletedPipelinesTitle"
defaultMessage="Delete {numPipelinesSelected} pipelines"
values={{ numPipelinesSelected }}
/>
),
};
return (
<EuiOverlayMask>
<EuiConfirmModal
buttonColor="danger"
cancelButtonText="Cancel"
cancelButtonText={(
<FormattedMessage
id="xpack.logstash.confirmDeleteModal.cancelButtonLabel"
defaultMessage="Cancel"
/>
)}
confirmButtonText={confirmText.button}
defaultFocusedButton={EUI_MODAL_CANCEL_BUTTON}
onCancel={cancelDeletePipelines}

View file

@ -5,7 +5,7 @@
*/
import React from 'react';
import { mount, shallow } from 'enzyme';
import { shallowWithIntl, mountWithIntl } from 'test_utils/enzyme_helpers';
import { ConfirmDeleteModal } from './confirm_delete_modal';
describe('ConfirmDeleteModal component', () => {
@ -24,18 +24,18 @@ describe('ConfirmDeleteModal component', () => {
});
it('confirms delete for single pipeline', () => {
const wrapper = shallow(<ConfirmDeleteModal {...props} />);
const wrapper = shallowWithIntl(<ConfirmDeleteModal {...props} />);
expect(wrapper).toMatchSnapshot();
});
it('confirms delete for multiple pipelines', () => {
props.selection = [{ id: 'testId' }, { id: 'testId2' }];
const wrapper = shallow(<ConfirmDeleteModal {...props} />);
const wrapper = shallowWithIntl(<ConfirmDeleteModal {...props} />);
expect(wrapper).toMatchSnapshot();
});
it('calls cancel delete', () => {
const wrapper = mount(<ConfirmDeleteModal {...props} />);
const wrapper = mountWithIntl(<ConfirmDeleteModal {...props} />);
wrapper
.find('[data-test-subj="confirmModalCancelButton"]')
.first()
@ -44,7 +44,7 @@ describe('ConfirmDeleteModal component', () => {
});
it('calls deleteSelectedPipelines', () => {
const wrapper = mount(<ConfirmDeleteModal {...props} />);
const wrapper = mountWithIntl(<ConfirmDeleteModal {...props} />);
wrapper
.find('[data-test-subj="confirmModalConfirmButton"]')
.first()
@ -54,7 +54,7 @@ describe('ConfirmDeleteModal component', () => {
it('does not render a component if modal is hidden', () => {
props.showConfirmDeleteModal = false;
const wrapper = mount(<ConfirmDeleteModal {...props} />);
const wrapper = mountWithIntl(<ConfirmDeleteModal {...props} />);
expect(wrapper.instance()).toBeNull();
});
});

View file

@ -4,12 +4,17 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { i18n } from '@kbn/i18n';
export const PIPELINE_LIST = {
INITIAL_PAGE_SIZE: 20,
PAGE_SIZE_OPTIONS: [5, 8, 20, 50],
PIPELINE_NOT_CENTRALLY_MANAGED_TOOLTIP_TEXT:
`This pipeline wasn't created using Centralized Configuration Management. It can't be managed or edited here.`,
PIPELINE_NOT_CENTRALLY_MANAGED_TOOLTIP_TEXT: i18n.translate('xpack.logstash.pipelineNotCentrallyManagedTooltip', {
defaultMessage: `This pipeline wasn't created using Centralized Configuration Management. It can't be managed or edited here.`,
}),
INFO_ALERTS: {
CALL_OUT_TITLE: 'Only pipelines created in Kibana Management appear here',
CALL_OUT_TITLE: i18n.translate('xpack.logstash.kibanaManagementPipelinesTitle', {
defaultMessage: 'Only pipelines created in Kibana Management appear here',
}),
},
};

View file

@ -6,15 +6,27 @@
import React from 'react';
import { EuiCode } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
export function EnableMonitoringAlert() {
return (
<p>
<strong>Enable monitoring. </strong>
In the <EuiCode>kibana.yml</EuiCode> file, set
<EuiCode>xpack.monitoring.enabled</EuiCode> and
<EuiCode>xpack.monitoring.ui.enabled</EuiCode> to
<EuiCode>true</EuiCode>.
<strong>
<FormattedMessage
id="xpack.logstash.enableMonitoringAlert.enableMonitoringTitle"
defaultMessage="Enable monitoring."
/>
</strong>
<FormattedMessage
id="xpack.logstash.enableMonitoringAlert.enableMonitoringDescription"
defaultMessage="In the {configFileName} file, set {monitoringConfigParam} and {monitoringUiConfigParam} to {trueValue}."
values={{
configFileName: <EuiCode>kibana.yml</EuiCode>,
monitoringConfigParam: <EuiCode>xpack.monitoring.enabled</EuiCode>,
monitoringUiConfigParam: <EuiCode>xpack.monitoring.ui.enabled</EuiCode>,
trueValue: <EuiCode>true</EuiCode>,
}}
/>
</p>
);
}

View file

@ -5,12 +5,12 @@
*/
import React from 'react';
import { shallow } from 'enzyme';
import { shallowWithIntl } from 'test_utils/enzyme_helpers';
import { EnableMonitoringAlert } from './enable_monitoring_alert';
describe('EnableMonitoringAlert component', () => {
it('renders expected component', () => {
const wrapper = shallow(<EnableMonitoringAlert />);
const wrapper = shallowWithIntl(<EnableMonitoringAlert />);
expect(wrapper).toMatchSnapshot();
});
});

View file

@ -9,6 +9,7 @@ import { render } from 'react-dom';
import { isEmpty } from 'lodash';
import { uiModules } from 'ui/modules';
import { Notifier, toastNotifications } from 'ui/notify';
import { I18nProvider } from '@kbn/i18n/react';
import { PipelineEditor } from '../../../../components/pipeline_editor';
import 'plugins/logstash/services/license';
import 'plugins/logstash/services/security';
@ -36,19 +37,21 @@ app.directive('pipelineEdit', function ($injector) {
: null;
render(
<PipelineEditor
kbnUrl={kbnUrl}
close={close}
open={open}
isNewPipeline={isEmpty(scope.pipeline.id)}
username={userResource ? userResource.username : null}
pipeline={scope.pipeline}
pipelineService={pipelineService}
routeService={$route}
toastNotifications={toastNotifications}
licenseService={licenseService}
notifier={new Notifier({ location: 'Logstash' })}
/>,
<I18nProvider>
<PipelineEditor
kbnUrl={kbnUrl}
close={close}
open={open}
isNewPipeline={isEmpty(scope.pipeline.id)}
username={userResource ? userResource.username : null}
pipeline={scope.pipeline}
pipelineService={pipelineService}
routeService={$route}
toastNotifications={toastNotifications}
licenseService={licenseService}
notifier={new Notifier({ location: 'Logstash' })}
/>
</I18nProvider>,
el[0]
);
},

View file

@ -8,6 +8,7 @@ import React from 'react';
import { render } from 'react-dom';
import { uiModules } from 'ui/modules';
import { toastNotifications } from 'ui/notify';
import { I18nProvider } from '@kbn/i18n/react';
import { PipelineList } from '../../../../components/pipeline_list';
import 'plugins/logstash/services/pipelines';
import 'plugins/logstash/services/license';
@ -33,19 +34,21 @@ app.directive('pipelineList', function ($injector) {
const clonePipeline = id =>
scope.$evalAsync(kbnUrl.change(`management/logstash/pipelines/pipeline/${id}/edit?clone`));
render(
<PipelineList
clonePipeline={clonePipeline}
clusterService={clusterService}
isReadOnly={licenseService.isReadOnly}
isForbidden={true}
isLoading={false}
licenseService={licenseService}
monitoringService={monitoringService}
openPipeline={openPipeline}
createPipeline={createPipeline}
pipelinesService={pipelinesService}
toastNotifications={toastNotifications}
/>,
<I18nProvider>
<PipelineList
clonePipeline={clonePipeline}
clusterService={clusterService}
isReadOnly={licenseService.isReadOnly}
isForbidden={true}
isLoading={false}
licenseService={licenseService}
monitoringService={monitoringService}
openPipeline={openPipeline}
createPipeline={createPipeline}
pipelinesService={pipelinesService}
toastNotifications={toastNotifications}
/>
</I18nProvider>,
el[0]
);
},