Skip to content

Commit c40e8ac

Browse files
various cleanup/polish items
1 parent 5643419 commit c40e8ac

File tree

15 files changed

+127
-15
lines changed

15 files changed

+127
-15
lines changed
Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
1-
# ingest_pipelines
1+
# Ingest Node Pipelines UI
22

3-
> Ingest node pipelines UI
3+
## Summary
4+
The `ingest_pipelines` plugin provides Kibana support for [Elasticsearch's ingest nodes](https://www.elastic.co/guide/en/elasticsearch/reference/master/ingest.html). Please refer to the Elasticsearch documentation for more details.
5+
6+
This plugin allows Kibana to create, edit, clone and delete ingest node pipelines. It also provides support to simulate a pipeline.
7+
8+
It requires a Basic license and the following cluster privileges: `manage_pipeline` and `cluster:monitor/nodes/info`.
49

510
---
611

712
## Development
813

9-
See the [kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md) for instructions setting up your development environment.
14+
A new app called Ingest Node Pipelines is registered in the Management section and follows a typical CRUD UI pattern. The client-side portion of this app lives in [public/application](public/application) and uses endpoints registered in [server/routes/api](server/routes/api).
15+
16+
See the [kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md) for instructions on setting up your development environment.
17+
18+
### Test coverage
19+
20+
The app has the following test coverage:
21+
22+
- Complete API integration tests
23+
- Smoke-level functional test
24+
- Client-integration tests

x-pack/plugins/ingest_pipelines/public/application/components/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@
55
*/
66

77
export { PipelineForm } from './pipeline_form';
8-
9-
export { PipelineRequestFlyoutProvider as PipelineRequestFlyout } from './pipeline_request_flyout_provider';

x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { EuiButton, EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiSpacer } from
1111
import { useForm, Form, FormConfig } from '../../../shared_imports';
1212
import { Pipeline } from '../../../../common/types';
1313

14-
import { PipelineRequestFlyout } from '../';
14+
import { PipelineRequestFlyout } from './pipeline_request_flyout';
1515
import { PipelineTestFlyout } from './pipeline_test_flyout';
1616
import { PipelineFormFields } from './pipeline_form_fields';
1717
import { PipelineFormError } from './pipeline_form_error';
@@ -85,8 +85,6 @@ export const PipelineForm: React.FunctionComponent<PipelineFormProps> = ({
8585
isInvalid={form.isSubmitted && !form.isValid}
8686
error={form.getErrors()}
8787
>
88-
<EuiSpacer size="l" />
89-
9088
{/* Request error */}
9189
{saveError && <PipelineFormError errorMessage={saveError.message} />}
9290

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
export { PipelineRequestFlyoutProvider as PipelineRequestFlyout } from './pipeline_request_flyout_provider';

x-pack/plugins/ingest_pipelines/public/application/components/pipeline_request_flyout.tsx renamed to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_request_flyout/pipeline_request_flyout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
EuiTitle,
2020
} from '@elastic/eui';
2121

22-
import { Pipeline } from '../../../common/types';
22+
import { Pipeline } from '../../../../../common/types';
2323

2424
interface Props {
2525
pipeline: Pipeline;
@@ -40,7 +40,7 @@ export const PipelineRequestFlyout: React.FunctionComponent<Props> = ({
4040
uuid.current++;
4141

4242
return (
43-
<EuiFlyout maxWidth={480} onClose={closeFlyout}>
43+
<EuiFlyout maxWidth={550} onClose={closeFlyout}>
4444
<EuiFlyoutHeader>
4545
<EuiTitle>
4646
<h2>

x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/pipeline_test_flyout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export const PipelineTestFlyout: React.FunctionComponent<PipelineTestFlyoutProps
128128
}
129129

130130
return (
131-
<EuiFlyout maxWidth={480} onClose={closeFlyout}>
131+
<EuiFlyout maxWidth={550} onClose={closeFlyout}>
132132
<EuiFlyoutHeader>
133133
<EuiTitle>
134134
<h2>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
* or more contributor license agreements. Licensed under the Elastic License;
44
* you may not use this file except in compliance with the Elastic License.
55
*/
6+
import React from 'react';
7+
8+
import { FormattedMessage } from '@kbn/i18n/react';
69
import { i18n } from '@kbn/i18n';
10+
import { EuiCode } from '@elastic/eui';
711

812
import { FormSchema, fieldValidators, ValidationFuncArg } from '../../../../../shared_imports';
913
import { parseJson, stringifyJson } from '../../../../lib';
@@ -18,6 +22,27 @@ export const documentsSchema: FormSchema = {
1822
defaultMessage: 'Documents',
1923
}
2024
),
25+
helpText: (
26+
<FormattedMessage
27+
id="xpack.ingestPipelines.form.onFailureFieldHelpText"
28+
defaultMessage="Use JSON format: {code}"
29+
values={{
30+
code: (
31+
<EuiCode>
32+
{JSON.stringify([
33+
{
34+
_index: 'index',
35+
_id: 'id',
36+
_source: {
37+
foo: 'bar',
38+
},
39+
},
40+
])}
41+
</EuiCode>
42+
),
43+
}}
44+
/>
45+
),
2146
serializer: parseJson,
2247
deserializer: stringifyJson,
2348
validations: [

x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/tabs/tab_documents.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import React from 'react';
88
import { FormattedMessage } from '@kbn/i18n/react';
99
import { i18n } from '@kbn/i18n';
1010

11-
import { EuiSpacer, EuiText, EuiButton, EuiHorizontalRule } from '@elastic/eui';
11+
import { EuiSpacer, EuiText, EuiButton, EuiHorizontalRule, EuiLink } from '@elastic/eui';
1212

1313
import {
1414
getUseField,
@@ -17,6 +17,7 @@ import {
1717
Form,
1818
useForm,
1919
FormConfig,
20+
useKibana,
2021
} from '../../../../../shared_imports';
2122

2223
import { documentsSchema } from './schema';
@@ -35,6 +36,8 @@ export const DocumentsTab: React.FunctionComponent<Props> = ({
3536
handleExecute,
3637
isExecuting,
3738
}) => {
39+
const { services } = useKibana();
40+
3841
const { setCurrentTestConfig, testConfig } = useTestConfigContext();
3942
const { verbose: cachedVerbose, documents: cachedDocuments } = testConfig;
4043

@@ -69,7 +72,19 @@ export const DocumentsTab: React.FunctionComponent<Props> = ({
6972
<p>
7073
<FormattedMessage
7174
id="xpack.ingestPipelines.testPipelineFlyout.documentsTab.tabDescriptionText"
72-
defaultMessage="Provide an array of documents to be ingested by the pipeline."
75+
defaultMessage="Provide an array of documents to be ingested by the pipeline. {learnMoreLink}"
76+
values={{
77+
learnMoreLink: (
78+
<EuiLink href={services.documentation.getSimulatePipelineApiUrl()} target="_blank">
79+
{i18n.translate(
80+
'xpack.ingestPipelines.testPipelineFlyout.documentsTab.simulateDocumentionLink',
81+
{
82+
defaultMessage: 'Learn more.',
83+
}
84+
)}
85+
</EuiLink>
86+
),
87+
}}
7388
/>
7489
</p>
7590
</EuiText>

x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/schema.tsx

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
* or more contributor license agreements. Licensed under the Elastic License;
44
* you may not use this file except in compliance with the Elastic License.
55
*/
6+
import React from 'react';
67

78
import { i18n } from '@kbn/i18n';
9+
import { FormattedMessage } from '@kbn/i18n/react';
10+
import { EuiCode } from '@elastic/eui';
811

912
import { FormSchema, FIELD_TYPES, fieldValidators, fieldFormatters } from '../../../shared_imports';
1013
import { parseJson, stringifyJson } from '../../lib';
@@ -47,6 +50,26 @@ export const pipelineFormSchema: FormSchema = {
4750
label: i18n.translate('xpack.ingestPipelines.form.processorsFieldLabel', {
4851
defaultMessage: 'Processors',
4952
}),
53+
helpText: (
54+
<FormattedMessage
55+
id="xpack.ingestPipelines.form.processorsFieldHelpText"
56+
defaultMessage="Use JSON format: {code}"
57+
values={{
58+
code: (
59+
<EuiCode>
60+
{JSON.stringify([
61+
{
62+
set: {
63+
field: 'foo',
64+
value: 'bar',
65+
},
66+
},
67+
])}
68+
</EuiCode>
69+
),
70+
}}
71+
/>
72+
),
5073
serializer: parseJson,
5174
deserializer: stringifyJson,
5275
validations: [
@@ -70,6 +93,26 @@ export const pipelineFormSchema: FormSchema = {
7093
label: i18n.translate('xpack.ingestPipelines.form.onFailureFieldLabel', {
7194
defaultMessage: 'On-failure processors (optional)',
7295
}),
96+
helpText: (
97+
<FormattedMessage
98+
id="xpack.ingestPipelines.form.onFailureFieldHelpText"
99+
defaultMessage="Use JSON format: {code}"
100+
values={{
101+
code: (
102+
<EuiCode>
103+
{JSON.stringify([
104+
{
105+
set: {
106+
field: '_index',
107+
value: 'failed-{{ _index }}',
108+
},
109+
},
110+
])}
111+
</EuiCode>
112+
),
113+
}}
114+
/>
115+
),
73116
serializer: value => {
74117
const result = parseJson(value);
75118
// If an empty array was passed, strip out this value entirely.

0 commit comments

Comments
 (0)