From b26bd6175d11d52c577e62ebfc3186dea9d7ec58 Mon Sep 17 00:00:00 2001 From: Sonja Krause-Harder Date: Wed, 5 Aug 2020 13:48:11 +0200 Subject: [PATCH 1/5] [Ingest Manager] Adjust dataset aggs to use datastream fields instead (#74342) * [Ingest Manager] Adjust dataset aggs to use datastream fields instead Elastic Agent and Elasticsearch are switching over from using dataset.* to datastream.*. This adjust the aggregation on the dataset page to get the datastreams. For this to work properly, the most recent version of Elasticsearch 7.9 must be used and is pending updates on all the packages to ship also the datastream fields, see https://github.com/elastic/integrations/pull/213 * Update datastream to data_stream * Update data stream name generation * Fix typo * Temporarily use datastream instead of data_stream * updating to use `data_stream` instead of `datastream` Co-authored-by: ruflin Co-authored-by: Jen Huang --- .../server/routes/data_streams/handlers.ts | 10 +++++----- .../services/epm/elasticsearch/template/template.ts | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/x-pack/plugins/ingest_manager/server/routes/data_streams/handlers.ts b/x-pack/plugins/ingest_manager/server/routes/data_streams/handlers.ts index df37aeb27c75c..43ae2b72f6077 100644 --- a/x-pack/plugins/ingest_manager/server/routes/data_streams/handlers.ts +++ b/x-pack/plugins/ingest_manager/server/routes/data_streams/handlers.ts @@ -31,12 +31,12 @@ export const getListHandler: RequestHandler = async (context, request, response) must: [ { exists: { - field: 'dataset.namespace', + field: 'data_stream.namespace', }, }, { exists: { - field: 'dataset.name', + field: 'data_stream.dataset', }, }, ], @@ -54,19 +54,19 @@ export const getListHandler: RequestHandler = async (context, request, response) aggs: { dataset: { terms: { - field: 'dataset.name', + field: 'data_stream.dataset', size: 1, }, }, namespace: { terms: { - field: 'dataset.namespace', + field: 'data_stream.namespace', size: 1, }, }, type: { terms: { - field: 'dataset.type', + field: 'data_stream.type', size: 1, }, }, diff --git a/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.ts b/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.ts index a739806d5868b..71e49acf1766f 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.ts @@ -393,14 +393,14 @@ const updateExistingIndex = async ({ // are added in https://github.com/elastic/kibana/issues/66551. namespace value we will continue // to skip updating and assume the value in the index mapping is correct delete mappings.properties.stream; - delete mappings.properties.dataset; + delete mappings.properties.data_stream; - // get the dataset values from the index template to compose data stream name + // get the data_stream values from the index template to compose data stream name const indexMappings = await getIndexMappings(indexName, callCluster); - const dataset = indexMappings[indexName].mappings.properties.dataset.properties; - if (!dataset.type.value || !dataset.name.value || !dataset.namespace.value) - throw new Error(`dataset values are missing from the index template ${indexName}`); - const dataStreamName = `${dataset.type.value}-${dataset.name.value}-${dataset.namespace.value}`; + const dataStream = indexMappings[indexName].mappings.properties.data_stream.properties; + if (!dataStream.type.value || !dataStream.dataset.value || !dataStream.namespace.value) + throw new Error(`data_stream values are missing from the index template ${indexName}`); + const dataStreamName = `${dataStream.type.value}-${dataStream.dataset.value}-${dataStream.namespace.value}`; // try to update the mappings first try { From 7a1b09dcf1189ef9b5c950678d36ac0844572140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Marcondes?= <55978943+cauemarcondes@users.noreply.github.com> Date: Wed, 5 Aug 2020 13:28:13 +0100 Subject: [PATCH 2/5] [APM] Average for transaction error rate includes null values (#74345) --- .../shared/charts/ErroneousTransactionsRateChart/index.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x-pack/plugins/apm/public/components/shared/charts/ErroneousTransactionsRateChart/index.tsx b/x-pack/plugins/apm/public/components/shared/charts/ErroneousTransactionsRateChart/index.tsx index a433b0b507239..8214c081e6ce1 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/ErroneousTransactionsRateChart/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/ErroneousTransactionsRateChart/index.tsx @@ -6,7 +6,6 @@ import { EuiTitle } from '@elastic/eui'; import theme from '@elastic/eui/dist/eui_theme_light.json'; import { i18n } from '@kbn/i18n'; -import { mean } from 'lodash'; import React, { useCallback } from 'react'; import { EuiPanel } from '@elastic/eui'; import { useChartsSync } from '../../../../hooks/useChartsSync'; @@ -79,7 +78,7 @@ export function ErroneousTransactionsRateChart() { { color: theme.euiColorVis7, data: [], - legendValue: tickFormatY(mean(errorRates.map((rate) => rate.y))), + legendValue: tickFormatY(data?.average), legendClickDisabled: true, title: i18n.translate('xpack.apm.errorRateChart.avgLabel', { defaultMessage: 'Avg.', From f9fc83fb1d0b2e44c4a080ef7e96f7123072fd96 Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Wed, 5 Aug 2020 14:28:56 +0200 Subject: [PATCH 3/5] Add README files for Kibana app plugins (#74277) * Add README files for Kibana app plugins * Update src/plugins/timelion/README.md Co-authored-by: Matthias Wilhelm * Update src/plugins/vis_type_vislib/README.md Co-authored-by: Matthias Wilhelm Co-authored-by: Matthias Wilhelm --- .github/CODEOWNERS | 1 - src/plugins/dashboard/README.md | 1 + src/plugins/discover/README.md | 1 + src/plugins/input_control_vis/README.md | 1 + src/plugins/timelion/README.md | 2 ++ src/plugins/vis_type_markdown/README.md | 1 + src/plugins/vis_type_metric/README.md | 1 + src/plugins/vis_type_table/README.md | 1 + src/plugins/vis_type_tagcloud/README.md | 1 + src/plugins/vis_type_timelion/README.md | 2 ++ src/plugins/vis_type_timeseries/README.md | 1 + src/plugins/vis_type_vega/README.md | 1 + src/plugins/vis_type_vislib/README.md | 2 ++ src/plugins/vis_type_xy/README.md | 2 ++ src/plugins/visualizations/README.md | 2 ++ src/plugins/visualize/README.md | 2 ++ x-pack/plugins/dashboard_enhanced/README.md | 2 +- x-pack/plugins/dashboard_mode/README.md | 1 + x-pack/plugins/discover_enhanced/README.md | 1 + 19 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 src/plugins/dashboard/README.md create mode 100644 src/plugins/discover/README.md create mode 100644 src/plugins/input_control_vis/README.md create mode 100644 src/plugins/timelion/README.md create mode 100644 src/plugins/vis_type_markdown/README.md create mode 100644 src/plugins/vis_type_metric/README.md create mode 100644 src/plugins/vis_type_table/README.md create mode 100644 src/plugins/vis_type_tagcloud/README.md create mode 100644 src/plugins/vis_type_timeseries/README.md create mode 100644 src/plugins/vis_type_vega/README.md create mode 100644 src/plugins/vis_type_vislib/README.md create mode 100644 src/plugins/vis_type_xy/README.md create mode 100644 src/plugins/visualizations/README.md create mode 100644 src/plugins/visualize/README.md create mode 100644 x-pack/plugins/dashboard_mode/README.md create mode 100644 x-pack/plugins/discover_enhanced/README.md diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f1a374445657f..73fb10532fd8d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -7,7 +7,6 @@ /x-pack/plugins/discover_enhanced/ @elastic/kibana-app /x-pack/plugins/lens/ @elastic/kibana-app /x-pack/plugins/graph/ @elastic/kibana-app -/src/legacy/core_plugins/kibana/public/local_application_service/ @elastic/kibana-app /src/plugins/dashboard/ @elastic/kibana-app /src/plugins/discover/ @elastic/kibana-app /src/plugins/input_control_vis/ @elastic/kibana-app diff --git a/src/plugins/dashboard/README.md b/src/plugins/dashboard/README.md new file mode 100644 index 0000000000000..f44bd943eaca9 --- /dev/null +++ b/src/plugins/dashboard/README.md @@ -0,0 +1 @@ +Contains the dashboard application. \ No newline at end of file diff --git a/src/plugins/discover/README.md b/src/plugins/discover/README.md new file mode 100644 index 0000000000000..a914d651eef35 --- /dev/null +++ b/src/plugins/discover/README.md @@ -0,0 +1 @@ +Contains the Discover application and the saved search embeddable. \ No newline at end of file diff --git a/src/plugins/input_control_vis/README.md b/src/plugins/input_control_vis/README.md new file mode 100644 index 0000000000000..67266079dede5 --- /dev/null +++ b/src/plugins/input_control_vis/README.md @@ -0,0 +1 @@ +Contains the input control visualization allowing to place custom filter controls on a dashboard. \ No newline at end of file diff --git a/src/plugins/timelion/README.md b/src/plugins/timelion/README.md new file mode 100644 index 0000000000000..d29a33028e967 --- /dev/null +++ b/src/plugins/timelion/README.md @@ -0,0 +1,2 @@ +Contains the deprecated timelion application. For the timelion visualization, +which also contains the timelion APIs and backend, look at the vis_type_timelion plugin. diff --git a/src/plugins/vis_type_markdown/README.md b/src/plugins/vis_type_markdown/README.md new file mode 100644 index 0000000000000..ae79a4822d4ac --- /dev/null +++ b/src/plugins/vis_type_markdown/README.md @@ -0,0 +1 @@ +The markdown visualization that can be used to place text panels on dashboards. \ No newline at end of file diff --git a/src/plugins/vis_type_metric/README.md b/src/plugins/vis_type_metric/README.md new file mode 100644 index 0000000000000..78df92832bdbf --- /dev/null +++ b/src/plugins/vis_type_metric/README.md @@ -0,0 +1 @@ +Contains the metric visualization. \ No newline at end of file diff --git a/src/plugins/vis_type_table/README.md b/src/plugins/vis_type_table/README.md new file mode 100644 index 0000000000000..cf37e133ed1cf --- /dev/null +++ b/src/plugins/vis_type_table/README.md @@ -0,0 +1 @@ +Contains the data table visualization, that allows presenting data in a simple table format. \ No newline at end of file diff --git a/src/plugins/vis_type_tagcloud/README.md b/src/plugins/vis_type_tagcloud/README.md new file mode 100644 index 0000000000000..7e8f2a6e5b72a --- /dev/null +++ b/src/plugins/vis_type_tagcloud/README.md @@ -0,0 +1 @@ +Contains the tagcloud visualization. \ No newline at end of file diff --git a/src/plugins/vis_type_timelion/README.md b/src/plugins/vis_type_timelion/README.md index c306e03abf2c6..89d34527c51d6 100644 --- a/src/plugins/vis_type_timelion/README.md +++ b/src/plugins/vis_type_timelion/README.md @@ -1,5 +1,7 @@ # Vis type Timelion +Contains the timelion visualization and the timelion backend. + # Generate a parser If your grammar was changed in `public/chain.peg` you need to re-generate the static parser. You could use a grunt task: diff --git a/src/plugins/vis_type_timeseries/README.md b/src/plugins/vis_type_timeseries/README.md new file mode 100644 index 0000000000000..4b4184b6eadd9 --- /dev/null +++ b/src/plugins/vis_type_timeseries/README.md @@ -0,0 +1 @@ +Contains everything around TSVB (the editor, visualizatin implementations and backends). \ No newline at end of file diff --git a/src/plugins/vis_type_vega/README.md b/src/plugins/vis_type_vega/README.md new file mode 100644 index 0000000000000..3d9bfd387e2c5 --- /dev/null +++ b/src/plugins/vis_type_vega/README.md @@ -0,0 +1 @@ +Contains the Vega visualization. \ No newline at end of file diff --git a/src/plugins/vis_type_vislib/README.md b/src/plugins/vis_type_vislib/README.md new file mode 100644 index 0000000000000..7641ea2acd1ec --- /dev/null +++ b/src/plugins/vis_type_vislib/README.md @@ -0,0 +1,2 @@ +Contains the vislib visualizations. These are the classical area/line/bar, pie, gauge/goal and +heatmap charts. diff --git a/src/plugins/vis_type_xy/README.md b/src/plugins/vis_type_xy/README.md new file mode 100644 index 0000000000000..70ddb21c1e9db --- /dev/null +++ b/src/plugins/vis_type_xy/README.md @@ -0,0 +1,2 @@ +Contains the new xy-axis chart using the elastic-charts library, which will eventually +replace the vislib xy-axis (bar, area, line) charts. \ No newline at end of file diff --git a/src/plugins/visualizations/README.md b/src/plugins/visualizations/README.md new file mode 100644 index 0000000000000..c61beb670a503 --- /dev/null +++ b/src/plugins/visualizations/README.md @@ -0,0 +1,2 @@ +Contains most of the visualization infrastructure, e.g. the visualization type registry or the +visualization embeddable. \ No newline at end of file diff --git a/src/plugins/visualize/README.md b/src/plugins/visualize/README.md new file mode 100644 index 0000000000000..be3e555a1407b --- /dev/null +++ b/src/plugins/visualize/README.md @@ -0,0 +1,2 @@ +Contains the visualize application which includes the listing page and the app frame, +which will load the visualization's editor. \ No newline at end of file diff --git a/x-pack/plugins/dashboard_enhanced/README.md b/x-pack/plugins/dashboard_enhanced/README.md index d9296ae158621..0aeb156a99f1f 100644 --- a/x-pack/plugins/dashboard_enhanced/README.md +++ b/x-pack/plugins/dashboard_enhanced/README.md @@ -1 +1 @@ -# X-Pack part of Dashboard app +Contains the enhancements to the OSS dashboard app. \ No newline at end of file diff --git a/x-pack/plugins/dashboard_mode/README.md b/x-pack/plugins/dashboard_mode/README.md new file mode 100644 index 0000000000000..4e244afb97fdf --- /dev/null +++ b/x-pack/plugins/dashboard_mode/README.md @@ -0,0 +1 @@ +The deprecated dashboard only mode. \ No newline at end of file diff --git a/x-pack/plugins/discover_enhanced/README.md b/x-pack/plugins/discover_enhanced/README.md new file mode 100644 index 0000000000000..08d0dbb9cdbef --- /dev/null +++ b/x-pack/plugins/discover_enhanced/README.md @@ -0,0 +1 @@ +Contains the enhancements to the OSS discover app. \ No newline at end of file From bf22fe54e1f1579821e2b55f211d432f12555bd5 Mon Sep 17 00:00:00 2001 From: Alison Goryachev Date: Wed, 5 Aug 2020 09:21:57 -0400 Subject: [PATCH 4/5] [Ingest Node Pipelines] Refactor pipeline simulator code (#72328) --- .../components/pipeline_form/index.ts | 2 +- .../pipeline_form/pipeline_form.tsx | 22 -- .../pipeline_form/pipeline_form_fields.tsx | 18 +- .../pipeline_form/pipeline_form_provider.tsx | 20 -- .../pipeline_test_flyout.tsx | 203 ------------------ .../pipeline_test_flyout_provider.tsx | 47 ---- .../pipeline_form/processors_header.tsx | 28 +-- .../pipeline_processors_editor.helpers.tsx | 6 +- .../pipeline_processors_editor.test.tsx | 5 + .../components/index.ts | 2 + .../components/pipeline_processors_editor.tsx | 1 + .../components/test_pipeline/button.tsx | 30 +++ .../test_pipeline/flyout_provider.tsx | 171 +++++++++++++++ .../test_pipeline/flyout_tabs}/index.ts | 0 .../flyout_tabs}/pipeline_test_tabs.tsx | 0 .../test_pipeline/flyout_tabs}/schema.tsx | 4 +- .../flyout_tabs}/tab_documents.tsx | 23 +- .../test_pipeline/flyout_tabs}/tab_output.tsx | 3 +- .../components/test_pipeline}/index.ts | 2 +- .../context/context.tsx | 42 ++++ .../context/index.ts | 15 ++ .../processors_context.tsx} | 25 ++- .../context}/test_config_context.tsx | 0 .../pipeline_processors_editor/index.ts | 4 +- .../pipeline_processors_editor/types.ts | 4 + .../public/application/services/api.ts | 2 +- .../application/services/documentation.ts | 4 - .../translations/translations/ja-JP.json | 3 - .../translations/translations/zh-CN.json | 3 - 29 files changed, 323 insertions(+), 366 deletions(-) delete mode 100644 x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_provider.tsx delete mode 100644 x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/pipeline_test_flyout.tsx delete mode 100644 x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/pipeline_test_flyout_provider.tsx create mode 100644 x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/button.tsx create mode 100644 x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/flyout_provider.tsx rename x-pack/plugins/ingest_pipelines/public/application/components/{pipeline_form/pipeline_test_flyout/tabs => pipeline_processors_editor/components/test_pipeline/flyout_tabs}/index.ts (100%) rename x-pack/plugins/ingest_pipelines/public/application/components/{pipeline_form/pipeline_test_flyout/tabs => pipeline_processors_editor/components/test_pipeline/flyout_tabs}/pipeline_test_tabs.tsx (100%) rename x-pack/plugins/ingest_pipelines/public/application/components/{pipeline_form/pipeline_test_flyout/tabs => pipeline_processors_editor/components/test_pipeline/flyout_tabs}/schema.tsx (96%) rename x-pack/plugins/ingest_pipelines/public/application/components/{pipeline_form/pipeline_test_flyout/tabs => pipeline_processors_editor/components/test_pipeline/flyout_tabs}/tab_documents.tsx (85%) rename x-pack/plugins/ingest_pipelines/public/application/components/{pipeline_form/pipeline_test_flyout/tabs => pipeline_processors_editor/components/test_pipeline/flyout_tabs}/tab_output.tsx (97%) rename x-pack/plugins/ingest_pipelines/public/application/components/{pipeline_form/pipeline_test_flyout => pipeline_processors_editor/components/test_pipeline}/index.ts (70%) create mode 100644 x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/context/context.tsx create mode 100644 x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/context/index.ts rename x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/{context.tsx => context/processors_context.tsx} (91%) rename x-pack/plugins/ingest_pipelines/public/application/components/{pipeline_form => pipeline_processors_editor/context}/test_config_context.tsx (100%) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/index.ts b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/index.ts index 2b007a25667a1..21a2ee30a84e1 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/index.ts +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/index.ts @@ -4,4 +4,4 @@ * you may not use this file except in compliance with the Elastic License. */ -export { PipelineFormProvider as PipelineForm } from './pipeline_form_provider'; +export { PipelineForm } from './pipeline_form'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form.tsx index 341e15132d353..5279bd718c16e 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form.tsx @@ -16,7 +16,6 @@ import './pipeline_form.scss'; import { OnUpdateHandlerArg, OnUpdateHandler } from '../pipeline_processors_editor'; import { PipelineRequestFlyout } from './pipeline_request_flyout'; -import { PipelineTestFlyout } from './pipeline_test_flyout'; import { PipelineFormFields } from './pipeline_form_fields'; import { PipelineFormError } from './pipeline_form_error'; import { pipelineFormSchema } from './schema'; @@ -48,8 +47,6 @@ export const PipelineForm: React.FunctionComponent = ({ }) => { const [isRequestVisible, setIsRequestVisible] = useState(false); - const [isTestingPipeline, setIsTestingPipeline] = useState(false); - const { processors: initialProcessors, on_failure: initialOnFailureProcessors, @@ -79,10 +76,6 @@ export const PipelineForm: React.FunctionComponent = ({ } }; - const handleTestPipelineClick = () => { - setIsTestingPipeline(true); - }; - const { form } = useForm({ schema: pipelineFormSchema, defaultValue: defaultFormValues, @@ -90,7 +83,6 @@ export const PipelineForm: React.FunctionComponent = ({ }); const onEditorFlyoutOpen = useCallback(() => { - setIsTestingPipeline(false); setIsRequestVisible(false); }, [setIsRequestVisible]); @@ -137,8 +129,6 @@ export const PipelineForm: React.FunctionComponent = ({ onFailure={processorsState.onFailure} onProcessorsUpdate={onProcessorsChangeHandler} hasVersion={Boolean(defaultValue.version)} - isTestButtonDisabled={isTestingPipeline || form.isValid === false} - onTestPipelineClick={handleTestPipelineClick} isEditing={isEditing} /> @@ -198,18 +188,6 @@ export const PipelineForm: React.FunctionComponent = ({ closeFlyout={() => setIsRequestVisible((prevIsRequestVisible) => !prevIsRequestVisible)} /> ) : null} - - {/* Test pipeline flyout */} - {isTestingPipeline ? ( - - processorStateRef.current?.getData() || { processors: [], on_failure: [] } - } - closeFlyout={() => { - setIsTestingPipeline((prevIsTestingPipeline) => !prevIsTestingPipeline); - }} - /> - ) : null} diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_fields.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_fields.tsx index 0e7a45e8d07b9..32beb61039a90 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_fields.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_fields.tsx @@ -13,7 +13,7 @@ import { Processor } from '../../../../common/types'; import { getUseField, getFormRow, Field, useKibana } from '../../../shared_imports'; import { - PipelineProcessorsContextProvider, + ProcessorsEditorContextProvider, GlobalOnFailureProcessorsEditor, ProcessorsEditor, OnUpdateHandler, @@ -29,8 +29,6 @@ interface Props { onLoadJson: OnDoneLoadJsonHandler; onProcessorsUpdate: OnUpdateHandler; hasVersion: boolean; - isTestButtonDisabled: boolean; - onTestPipelineClick: () => void; onEditorFlyoutOpen: () => void; isEditing?: boolean; } @@ -45,8 +43,6 @@ export const PipelineFormFields: React.FunctionComponent = ({ onProcessorsUpdate, isEditing, hasVersion, - isTestButtonDisabled, - onTestPipelineClick, onEditorFlyoutOpen, }) => { const { services } = useKibana(); @@ -125,20 +121,18 @@ export const PipelineFormFields: React.FunctionComponent = ({ {/* Pipeline Processors Editor */} -
- + @@ -154,7 +148,7 @@ export const PipelineFormFields: React.FunctionComponent = ({
-
+ ); }; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_provider.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_provider.tsx deleted file mode 100644 index e6482a9fc12c2..0000000000000 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_provider.tsx +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import React from 'react'; - -import { PipelineForm as PipelineFormUI, PipelineFormProps } from './pipeline_form'; -import { TestConfigContextProvider } from './test_config_context'; - -export const PipelineFormProvider: React.FunctionComponent = ( - passThroughProps -) => { - return ( - - - - ); -}; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/pipeline_test_flyout.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/pipeline_test_flyout.tsx deleted file mode 100644 index da5e6cf77364c..0000000000000 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/pipeline_test_flyout.tsx +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import React, { useState, useEffect, useCallback } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { i18n } from '@kbn/i18n'; - -import { - EuiFlyout, - EuiFlyoutBody, - EuiFlyoutHeader, - EuiSpacer, - EuiTitle, - EuiCallOut, -} from '@elastic/eui'; - -import { useKibana } from '../../../../shared_imports'; -import { Pipeline } from '../../../../../common/types'; -import { Tabs, Tab, OutputTab, DocumentsTab } from './tabs'; -import { useTestConfigContext } from '../test_config_context'; - -export interface PipelineTestFlyoutProps { - closeFlyout: () => void; - pipeline: Pipeline; - isPipelineValid: boolean; -} - -export const PipelineTestFlyout: React.FunctionComponent = ({ - closeFlyout, - pipeline, - isPipelineValid, -}) => { - const { services } = useKibana(); - - const { testConfig } = useTestConfigContext(); - const { documents: cachedDocuments, verbose: cachedVerbose } = testConfig; - - const initialSelectedTab = cachedDocuments ? 'output' : 'documents'; - const [selectedTab, setSelectedTab] = useState(initialSelectedTab); - - const [shouldExecuteImmediately, setShouldExecuteImmediately] = useState(false); - const [isExecuting, setIsExecuting] = useState(false); - const [executeError, setExecuteError] = useState(null); - const [executeOutput, setExecuteOutput] = useState(undefined); - - const handleExecute = useCallback( - async (documents: object[], verbose?: boolean) => { - const { name: pipelineName, ...pipelineDefinition } = pipeline; - - setIsExecuting(true); - setExecuteError(null); - - const { error, data: output } = await services.api.simulatePipeline({ - documents, - verbose, - pipeline: pipelineDefinition, - }); - - setIsExecuting(false); - - if (error) { - setExecuteError(error); - return; - } - - setExecuteOutput(output); - - services.notifications.toasts.addSuccess( - i18n.translate('xpack.ingestPipelines.testPipelineFlyout.successNotificationText', { - defaultMessage: 'Pipeline executed', - }), - { - toastLifeTimeMs: 1000, - } - ); - - setSelectedTab('output'); - }, - [pipeline, services.api, services.notifications.toasts] - ); - - useEffect(() => { - if (cachedDocuments) { - setShouldExecuteImmediately(true); - } - // We only want to know on initial mount if there are cached documents - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - - useEffect(() => { - // If the user has already tested the pipeline once, - // use the cached test config and automatically execute the pipeline - if (shouldExecuteImmediately && Object.entries(pipeline).length > 0) { - setShouldExecuteImmediately(false); - handleExecute(cachedDocuments!, cachedVerbose); - } - }, [ - pipeline, - handleExecute, - cachedDocuments, - cachedVerbose, - isExecuting, - shouldExecuteImmediately, - ]); - - let tabContent; - - if (selectedTab === 'output') { - tabContent = ( - - ); - } else { - // default to "documents" tab - tabContent = ( - - ); - } - - return ( - - - -

- {pipeline.name ? ( - - ) : ( - - )} -

-
-
- - - !executeOutput && tabId === 'output'} - /> - - - - {/* Execute error */} - {executeError ? ( - <> - - } - color="danger" - iconType="alert" - > -

{executeError.message}

-
- - - ) : null} - - {/* Invalid pipeline error */} - {!isPipelineValid ? ( - <> - - } - color="danger" - iconType="alert" - /> - - - ) : null} - - {/* Documents or output tab content */} - {tabContent} -
-
- ); -}; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/pipeline_test_flyout_provider.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/pipeline_test_flyout_provider.tsx deleted file mode 100644 index 7f91672d64df4..0000000000000 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/pipeline_test_flyout_provider.tsx +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import React, { useState, useEffect } from 'react'; - -import { Pipeline } from '../../../../../common/types'; -import { useFormContext } from '../../../../shared_imports'; - -import { ReadProcessorsFunction } from '../types'; - -import { PipelineTestFlyout, PipelineTestFlyoutProps } from './pipeline_test_flyout'; - -interface Props extends Omit { - readProcessors: ReadProcessorsFunction; -} - -export const PipelineTestFlyoutProvider: React.FunctionComponent = ({ - closeFlyout, - readProcessors, -}) => { - const form = useFormContext(); - const [formData, setFormData] = useState({} as Pipeline); - const [isFormDataValid, setIsFormDataValid] = useState(false); - - useEffect(() => { - const subscription = form.subscribe(async ({ isValid, validate, data }) => { - const isFormValid = isValid ?? (await validate()); - if (isFormValid) { - setFormData(data.format() as Pipeline); - } - setIsFormDataValid(isFormValid); - }); - - return subscription.unsubscribe; - }, [form]); - - return ( - - ); -}; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/processors_header.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/processors_header.tsx index 5e5cddbd36b92..3e8cd999a484a 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/processors_header.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/processors_header.tsx @@ -5,25 +5,23 @@ */ import React, { FunctionComponent } from 'react'; -import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiLink, EuiText, EuiTitle } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiLink, EuiText, EuiTitle } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { usePipelineProcessorsContext } from '../pipeline_processors_editor/context'; -import { LoadFromJsonButton, OnDoneLoadJsonHandler } from '../pipeline_processors_editor'; +import { + LoadFromJsonButton, + OnDoneLoadJsonHandler, + TestPipelineButton, +} from '../pipeline_processors_editor'; export interface Props { - onTestPipelineClick: () => void; - isTestButtonDisabled: boolean; onLoadJson: OnDoneLoadJsonHandler; } -export const ProcessorsHeader: FunctionComponent = ({ - onTestPipelineClick, - isTestButtonDisabled, - onLoadJson, -}) => { +export const ProcessorsHeader: FunctionComponent = ({ onLoadJson }) => { const { links } = usePipelineProcessorsContext(); return ( = ({ - - - + ); diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/__jest__/pipeline_processors_editor.helpers.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/__jest__/pipeline_processors_editor.helpers.tsx index e7258a74f4732..227513dcdaacc 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/__jest__/pipeline_processors_editor.helpers.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/__jest__/pipeline_processors_editor.helpers.tsx @@ -7,7 +7,7 @@ import { act } from 'react-dom/test-utils'; import React from 'react'; import { registerTestBed, TestBed } from '../../../../../../../test_utils'; import { - PipelineProcessorsContextProvider, + ProcessorsEditorContextProvider, Props, ProcessorsEditor, GlobalOnFailureProcessorsEditor, @@ -62,9 +62,9 @@ jest.mock('react-virtualized', () => { const testBedSetup = registerTestBed( (props: Props) => ( - + - + ), { doMountAsync: false, diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/__jest__/pipeline_processors_editor.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/__jest__/pipeline_processors_editor.test.tsx index df4832f9a45e0..a45a677846b2e 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/__jest__/pipeline_processors_editor.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/__jest__/pipeline_processors_editor.test.tsx @@ -3,8 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ +import { notificationServiceMock } from 'src/core/public/mocks'; + import { setup, SetupResult } from './pipeline_processors_editor.helpers'; import { Pipeline } from '../../../../../common/types'; +import { apiService } from '../../../services'; const testProcessors: Pick = { processors: [ @@ -46,6 +49,8 @@ describe('Pipeline Editor', () => { links: { esDocsBasePath: 'test', }, + toasts: notificationServiceMock.createSetupContract().toasts, + api: apiService, }); }); diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/index.ts b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/index.ts index b532b2d953e65..bf724be950fdf 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/index.ts +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/index.ts @@ -20,4 +20,6 @@ export { ProcessorRemoveModal } from './processor_remove_modal'; export { OnDoneLoadJsonHandler, LoadFromJsonButton } from './load_from_json'; +export { TestPipelineButton } from './test_pipeline'; + export { PipelineProcessorsItemTooltip, Position } from './pipeline_processors_editor_item_tooltip'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/pipeline_processors_editor.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/pipeline_processors_editor.tsx index c89ff1d3d99ac..ef8bf790a18aa 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/pipeline_processors_editor.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/pipeline_processors_editor.tsx @@ -21,6 +21,7 @@ export const PipelineProcessorsEditor: FunctionComponent = memo( state: { editor, processors }, } = usePipelineProcessorsContext(); const baseSelector = useMemo(() => [stateSlice], [stateSlice]); + return ( { + return ( + + {(openFlyout) => { + return ( + + {i18nTexts.buttonLabel} + + ); + }} + + ); +}; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/flyout_provider.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/flyout_provider.tsx new file mode 100644 index 0000000000000..ad88259e3bcc4 --- /dev/null +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/flyout_provider.tsx @@ -0,0 +1,171 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import React, { useState, useEffect, useCallback } from 'react'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { i18n } from '@kbn/i18n'; + +import { + EuiFlyout, + EuiFlyoutBody, + EuiFlyoutHeader, + EuiSpacer, + EuiTitle, + EuiCallOut, +} from '@elastic/eui'; + +import { usePipelineProcessorsContext, useTestConfigContext } from '../../context'; +import { serialize } from '../../serialize'; + +import { Tabs, Tab, OutputTab, DocumentsTab } from './flyout_tabs'; + +export interface Props { + children: (openFlyout: () => void) => React.ReactNode; +} + +export const FlyoutProvider: React.FunctionComponent = ({ children }) => { + const { + state: { processors }, + api, + toasts, + } = usePipelineProcessorsContext(); + + const serializedProcessors = serialize(processors.state); + + const { testConfig } = useTestConfigContext(); + const { documents: cachedDocuments, verbose: cachedVerbose } = testConfig; + + const [isFlyoutVisible, setIsFlyoutVisible] = useState(false); + + const initialSelectedTab = cachedDocuments ? 'output' : 'documents'; + const [selectedTab, setSelectedTab] = useState(initialSelectedTab); + + const [shouldExecuteImmediately, setShouldExecuteImmediately] = useState(false); + const [isExecuting, setIsExecuting] = useState(false); + const [executeError, setExecuteError] = useState(null); + const [executeOutput, setExecuteOutput] = useState(undefined); + + const handleExecute = useCallback( + async (documents: object[], verbose?: boolean) => { + setIsExecuting(true); + setExecuteError(null); + + const { error, data: output } = await api.simulatePipeline({ + documents, + verbose, + pipeline: { ...serializedProcessors }, + }); + + setIsExecuting(false); + + if (error) { + setExecuteError(error); + return; + } + + setExecuteOutput(output); + + toasts.addSuccess( + i18n.translate('xpack.ingestPipelines.testPipelineFlyout.successNotificationText', { + defaultMessage: 'Pipeline executed', + }), + { + toastLifeTimeMs: 1000, + } + ); + + setSelectedTab('output'); + }, + [serializedProcessors, api, toasts] + ); + + useEffect(() => { + if (isFlyoutVisible === false && cachedDocuments) { + setShouldExecuteImmediately(true); + } + }, [isFlyoutVisible, cachedDocuments]); + + useEffect(() => { + // If the user has already tested the pipeline once, + // use the cached test config and automatically execute the pipeline + if (isFlyoutVisible && shouldExecuteImmediately && cachedDocuments) { + setShouldExecuteImmediately(false); + handleExecute(cachedDocuments!, cachedVerbose); + } + }, [handleExecute, cachedDocuments, cachedVerbose, isFlyoutVisible, shouldExecuteImmediately]); + + let tabContent; + + if (selectedTab === 'output') { + tabContent = ( + + ); + } else { + // default to "Documents" tab + tabContent = ; + } + + return ( + <> + {children(() => setIsFlyoutVisible(true))} + + {isFlyoutVisible && ( + setIsFlyoutVisible(false)} + data-test-subj="testPipelineFlyout" + > + + +

+ +

+
+
+ + + !executeOutput && tabId === 'output'} + /> + + + + {/* Execute error */} + {executeError ? ( + <> + + } + color="danger" + iconType="alert" + > +

{executeError.message}

+
+ + + ) : null} + + {/* Documents or output tab content */} + {tabContent} +
+
+ )} + + ); +}; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/tabs/index.ts b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/flyout_tabs/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/tabs/index.ts rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/flyout_tabs/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/tabs/pipeline_test_tabs.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/flyout_tabs/pipeline_test_tabs.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/tabs/pipeline_test_tabs.tsx rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/flyout_tabs/pipeline_test_tabs.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/tabs/schema.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/flyout_tabs/schema.tsx similarity index 96% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/tabs/schema.tsx rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/flyout_tabs/schema.tsx index de9910344bd4b..e8ac223d56ed9 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/tabs/schema.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/flyout_tabs/schema.tsx @@ -9,8 +9,8 @@ import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; import { EuiCode } from '@elastic/eui'; -import { FormSchema, fieldValidators, ValidationFuncArg } from '../../../../../shared_imports'; -import { parseJson, stringifyJson } from '../../../../lib'; +import { FormSchema, fieldValidators, ValidationFuncArg } from '../../../../../../shared_imports'; +import { parseJson, stringifyJson } from '../../../../../lib'; const { emptyField, isJsonField } = fieldValidators; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/tabs/tab_documents.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/flyout_tabs/tab_documents.tsx similarity index 85% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/tabs/tab_documents.tsx rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/flyout_tabs/tab_documents.tsx index be9ebc57c69ee..593347f8b2343 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/tabs/tab_documents.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/test_pipeline/flyout_tabs/tab_documents.tsx @@ -17,32 +17,27 @@ import { Form, useForm, FormConfig, - useKibana, -} from '../../../../../shared_imports'; +} from '../../../../../../shared_imports'; + +import { usePipelineProcessorsContext, useTestConfigContext, TestConfig } from '../../../context'; import { documentsSchema } from './schema'; -import { useTestConfigContext, TestConfig } from '../../test_config_context'; const UseField = getUseField({ component: Field }); interface Props { handleExecute: (documents: object[], verbose: boolean) => void; - isPipelineValid: boolean; isExecuting: boolean; } -export const DocumentsTab: React.FunctionComponent = ({ - isPipelineValid, - handleExecute, - isExecuting, -}) => { - const { services } = useKibana(); +export const DocumentsTab: React.FunctionComponent = ({ handleExecute, isExecuting }) => { + const { links } = usePipelineProcessorsContext(); const { setCurrentTestConfig, testConfig } = useTestConfigContext(); const { verbose: cachedVerbose, documents: cachedDocuments } = testConfig; const executePipeline: FormConfig['onSubmit'] = async (formData, isValid) => { - if (!isValid || !isPipelineValid) { + if (!isValid) { return; } @@ -76,7 +71,7 @@ export const DocumentsTab: React.FunctionComponent = ({ values={{ learnMoreLink: ( @@ -98,7 +93,7 @@ export const DocumentsTab: React.FunctionComponent = ({
{/* Documents editor */} @@ -125,7 +120,7 @@ export const DocumentsTab: React.FunctionComponent = ({ onClick={form.submit} size="s" isLoading={isExecuting} - disabled={(form.isSubmitted && !form.isValid) || !isPipelineValid} + disabled={form.isSubmitted && !form.isValid} > {isExecuting ? ( = ({ + children, + links, + api, + toasts, + onUpdate, + value, + onFlyoutOpen, +}: Props) => { + return ( + + + {children} + + + ); +}; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/context/index.ts b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/context/index.ts new file mode 100644 index 0000000000000..1664b3410c1c0 --- /dev/null +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/context/index.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +export { ProcessorsEditorContextProvider } from './context'; + +export { TestConfigContextProvider, useTestConfigContext, TestConfig } from './test_config_context'; + +export { + PipelineProcessorsContextProvider, + usePipelineProcessorsContext, + Props, +} from './processors_context'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/context.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/context/processors_context.tsx similarity index 91% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/context.tsx rename to x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/context/processors_context.tsx index 098473b0d2572..db4629823ef52 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/context.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/context/processors_context.tsx @@ -15,7 +15,10 @@ import React, { useRef, } from 'react'; -import { Processor } from '../../../../common/types'; +import { NotificationsSetup } from 'src/core/public'; + +import { Processor } from '../../../../../common/types'; +import { ApiService } from '../../../services'; import { EditorMode, @@ -26,29 +29,31 @@ import { ContextValueState, Links, ProcessorInternal, -} from './types'; +} from '../types'; -import { useProcessorsState, isOnFailureSelector } from './processors_reducer'; +import { useProcessorsState, isOnFailureSelector } from '../processors_reducer'; -import { deserialize } from './deserialize'; +import { deserialize } from '../deserialize'; -import { serialize } from './serialize'; +import { serialize } from '../serialize'; -import { OnActionHandler } from './components/processors_tree'; +import { OnActionHandler } from '../components/processors_tree'; import { ProcessorRemoveModal, PipelineProcessorsItemTooltip, ProcessorSettingsForm, OnSubmitHandler, -} from './components'; +} from '../components'; -import { getValue } from './utils'; +import { getValue } from '../utils'; const PipelineProcessorsContext = createContext({} as any); export interface Props { links: Links; + api: ApiService; + toasts: NotificationsSetup['toasts']; value: { processors: Processor[]; onFailure?: Processor[]; @@ -62,6 +67,8 @@ export interface Props { export const PipelineProcessorsContextProvider: FunctionComponent = ({ links, + api, + toasts, value: { processors: originalProcessors, onFailure: originalOnFailureProcessors }, onUpdate, onFlyoutOpen, @@ -205,6 +212,8 @@ export const PipelineProcessorsContextProvider: FunctionComponent = ({ ; + pipeline: Pick; }) { const result = await this.sendRequest({ path: `${API_BASE_PATH}/simulate`, diff --git a/x-pack/plugins/ingest_pipelines/public/application/services/documentation.ts b/x-pack/plugins/ingest_pipelines/public/application/services/documentation.ts index 7f6a87a46fea3..daed338eb6ab4 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/services/documentation.ts +++ b/x-pack/plugins/ingest_pipelines/public/application/services/documentation.ts @@ -34,10 +34,6 @@ export class DocumentationService { public getPutPipelineApiUrl() { return `${this.esDocBasePath}/put-pipeline-api.html`; } - - public getSimulatePipelineApiUrl() { - return `${this.esDocBasePath}/simulate-pipeline-api.html`; - } } export const documentationService = new DocumentationService(); diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index aa12e2a34075e..7e1ce610a1948 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -9799,7 +9799,6 @@ "xpack.ingestPipelines.pipelineEditor.setForm.valueFieldLabel": "値", "xpack.ingestPipelines.pipelineEditor.setForm.valueRequiredError": "設定する値が必要です。", "xpack.ingestPipelines.pipelineEditor.settingsForm.learnMoreLabelLink.processor": "{processorLabel}ドキュメント", - "xpack.ingestPipelines.pipelineEditor.testPipelineButtonLabel": "パイプラインをテスト", "xpack.ingestPipelines.pipelineEditor.typeField.fieldRequiredError": "タイプが必要です。", "xpack.ingestPipelines.pipelineEditor.typeField.typeFieldLabel": "プロセッサー", "xpack.ingestPipelines.processors.label.append": "末尾に追加", @@ -9857,13 +9856,11 @@ "xpack.ingestPipelines.testPipelineFlyout.documentsTab.simulateDocumentionLink": "詳細", "xpack.ingestPipelines.testPipelineFlyout.documentsTab.tabDescriptionText": "投入するパイプラインのドキュメントの配列を指定します。{learnMoreLink}", "xpack.ingestPipelines.testPipelineFlyout.executePipelineError": "パイプラインを実行できません", - "xpack.ingestPipelines.testPipelineFlyout.invalidPipelineErrorMessage": "実行するパイプラインが無効です。", "xpack.ingestPipelines.testPipelineFlyout.outputTab.descriptionLinkLabel": "出力を更新", "xpack.ingestPipelines.testPipelineFlyout.outputTab.descriptionText": "出力データを表示するか、パイプライン経由で渡されるときに各プロセッサーがドキュメントにどのように影響するのかを確認します。", "xpack.ingestPipelines.testPipelineFlyout.outputTab.verboseSwitchLabel": "冗長出力を表示", "xpack.ingestPipelines.testPipelineFlyout.successNotificationText": "パイプラインが実行されました", "xpack.ingestPipelines.testPipelineFlyout.title": "パイプラインをテスト", - "xpack.ingestPipelines.testPipelineFlyout.withPipelineNameTitle": "パイプライン'{pipelineName}'をテスト", "xpack.lens.app.docLoadingError": "保存されたドキュメントの保存中にエラーが発生", "xpack.lens.app.docSavingError": "ドキュメントの保存中にエラーが発生", "xpack.lens.app.indexPatternLoadingError": "インデックスパターンの読み込み中にエラーが発生", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index befce4de3d247..e82ba7cc1d60f 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -9801,7 +9801,6 @@ "xpack.ingestPipelines.pipelineEditor.setForm.valueFieldLabel": "值", "xpack.ingestPipelines.pipelineEditor.setForm.valueRequiredError": "需要设置值。", "xpack.ingestPipelines.pipelineEditor.settingsForm.learnMoreLabelLink.processor": "{processorLabel}文档", - "xpack.ingestPipelines.pipelineEditor.testPipelineButtonLabel": "测试管道", "xpack.ingestPipelines.pipelineEditor.typeField.fieldRequiredError": "类型必填。", "xpack.ingestPipelines.pipelineEditor.typeField.typeFieldLabel": "处理器", "xpack.ingestPipelines.processors.label.append": "追加", @@ -9859,13 +9858,11 @@ "xpack.ingestPipelines.testPipelineFlyout.documentsTab.simulateDocumentionLink": "了解详情", "xpack.ingestPipelines.testPipelineFlyout.documentsTab.tabDescriptionText": "为管道提供要采集的一系列文档。{learnMoreLink}", "xpack.ingestPipelines.testPipelineFlyout.executePipelineError": "无法执行管道", - "xpack.ingestPipelines.testPipelineFlyout.invalidPipelineErrorMessage": "要执行的管道无效。", "xpack.ingestPipelines.testPipelineFlyout.outputTab.descriptionLinkLabel": "刷新输出", "xpack.ingestPipelines.testPipelineFlyout.outputTab.descriptionText": "查看输出数据或了解文档通过管道时每个处理器对文档的影响。", "xpack.ingestPipelines.testPipelineFlyout.outputTab.verboseSwitchLabel": "查看详细输出", "xpack.ingestPipelines.testPipelineFlyout.successNotificationText": "管道已执行", "xpack.ingestPipelines.testPipelineFlyout.title": "测试管道", - "xpack.ingestPipelines.testPipelineFlyout.withPipelineNameTitle": "测试管道“{pipelineName}”", "xpack.lens.app.docLoadingError": "加载已保存文档时出错", "xpack.lens.app.docSavingError": "保存文档时出错", "xpack.lens.app.indexPatternLoadingError": "加载索引模式时出错", From 87596465766158ccd758bb7eafa10d4d6d6acb99 Mon Sep 17 00:00:00 2001 From: Mikhail Shustov Date: Wed, 5 Aug 2020 16:28:03 +0300 Subject: [PATCH 5/5] update docs (#74364) --- .../architecture/code-exploration.asciidoc | 74 ++++++++++--------- 1 file changed, 41 insertions(+), 33 deletions(-) diff --git a/docs/developer/architecture/code-exploration.asciidoc b/docs/developer/architecture/code-exploration.asciidoc index 4481dea44795c..bb7222020180c 100644 --- a/docs/developer/architecture/code-exploration.asciidoc +++ b/docs/developer/architecture/code-exploration.asciidoc @@ -58,9 +58,9 @@ The Charts plugin is a way to create easier integration of shared colors, themes WARNING: Missing README. -- {kib-repo}blob/{branch}/src/plugins/dashboard[dashboard] +- {kib-repo}blob/{branch}/src/plugins/dashboard/README.md[dashboard] -WARNING: Missing README. +Contains the dashboard application. - {kib-repo}blob/{branch}/src/plugins/data/README.md[data] @@ -76,9 +76,9 @@ Routing will be handled by the id of the dev tool - your dev tool will be mounte This API doesn't support angular, for registering angular dev tools, bootstrap a local module on mount into the given HTML element. -- {kib-repo}blob/{branch}/src/plugins/discover[discover] +- {kib-repo}blob/{branch}/src/plugins/discover/README.md[discover] -WARNING: Missing README. +Contains the Discover application and the saved search embeddable. - {kib-repo}blob/{branch}/src/plugins/embeddable/README.md[embeddable] @@ -109,9 +109,9 @@ Moves the legacy ui/registry/feature_catalogue module for registering "features" WARNING: Missing README. -- {kib-repo}blob/{branch}/src/plugins/input_control_vis[inputControlVis] +- {kib-repo}blob/{branch}/src/plugins/input_control_vis/README.md[inputControlVis] -WARNING: Missing README. +Contains the input control visualization allowing to place custom filter controls on a dashboard. - {kib-repo}blob/{branch}/src/plugins/inspector/README.md[inspector] @@ -206,9 +206,10 @@ This plugin adds the Advanced Settings section for the Usage Data collection (ak WARNING: Missing README. -- {kib-repo}blob/{branch}/src/plugins/timelion[timelion] +- {kib-repo}blob/{branch}/src/plugins/timelion/README.md[timelion] -WARNING: Missing README. +Contains the deprecated timelion application. For the timelion visualization, +which also contains the timelion APIs and backend, look at the vis_type_timelion plugin. - {kib-repo}blob/{branch}/src/plugins/ui_actions/README.md[uiActions] @@ -222,59 +223,63 @@ Usage Collection allows collecting usage data for other services to consume (tel To integrate with the telemetry services for usage collection of your feature, there are 2 steps: -- {kib-repo}blob/{branch}/src/plugins/vis_type_markdown[visTypeMarkdown] +- {kib-repo}blob/{branch}/src/plugins/vis_type_markdown/README.md[visTypeMarkdown] -WARNING: Missing README. +The markdown visualization that can be used to place text panels on dashboards. -- {kib-repo}blob/{branch}/src/plugins/vis_type_metric[visTypeMetric] +- {kib-repo}blob/{branch}/src/plugins/vis_type_metric/README.md[visTypeMetric] -WARNING: Missing README. +Contains the metric visualization. -- {kib-repo}blob/{branch}/src/plugins/vis_type_table[visTypeTable] +- {kib-repo}blob/{branch}/src/plugins/vis_type_table/README.md[visTypeTable] -WARNING: Missing README. +Contains the data table visualization, that allows presenting data in a simple table format. -- {kib-repo}blob/{branch}/src/plugins/vis_type_tagcloud[visTypeTagcloud] +- {kib-repo}blob/{branch}/src/plugins/vis_type_tagcloud/README.md[visTypeTagcloud] -WARNING: Missing README. +Contains the tagcloud visualization. - {kib-repo}blob/{branch}/src/plugins/vis_type_timelion/README.md[visTypeTimelion] -If your grammar was changed in public/chain.peg you need to re-generate the static parser. You could use a grunt task: +Contains the timelion visualization and the timelion backend. -- {kib-repo}blob/{branch}/src/plugins/vis_type_timeseries[visTypeTimeseries] +- {kib-repo}blob/{branch}/src/plugins/vis_type_timeseries/README.md[visTypeTimeseries] -WARNING: Missing README. +Contains everything around TSVB (the editor, visualizatin implementations and backends). -- {kib-repo}blob/{branch}/src/plugins/vis_type_vega[visTypeVega] +- {kib-repo}blob/{branch}/src/plugins/vis_type_vega/README.md[visTypeVega] -WARNING: Missing README. +Contains the Vega visualization. -- {kib-repo}blob/{branch}/src/plugins/vis_type_vislib[visTypeVislib] +- {kib-repo}blob/{branch}/src/plugins/vis_type_vislib/README.md[visTypeVislib] -WARNING: Missing README. +Contains the vislib visualizations. These are the classical area/line/bar, pie, gauge/goal and +heatmap charts. -- {kib-repo}blob/{branch}/src/plugins/vis_type_xy[visTypeXy] +- {kib-repo}blob/{branch}/src/plugins/vis_type_xy/README.md[visTypeXy] -WARNING: Missing README. +Contains the new xy-axis chart using the elastic-charts library, which will eventually +replace the vislib xy-axis (bar, area, line) charts. -- {kib-repo}blob/{branch}/src/plugins/visualizations[visualizations] +- {kib-repo}blob/{branch}/src/plugins/visualizations/README.md[visualizations] -WARNING: Missing README. +Contains most of the visualization infrastructure, e.g. the visualization type registry or the +visualization embeddable. -- {kib-repo}blob/{branch}/src/plugins/visualize[visualize] +- {kib-repo}blob/{branch}/src/plugins/visualize/README.md[visualize] -WARNING: Missing README. +Contains the visualize application which includes the listing page and the app frame, +which will load the visualization's editor. [discrete] @@ -345,9 +350,12 @@ You can run a local cluster and simulate a remote cluster within a single Kibana - {kib-repo}blob/{branch}/x-pack/plugins/dashboard_enhanced/README.md[dashboardEnhanced] -- {kib-repo}blob/{branch}/x-pack/plugins/dashboard_mode[dashboardMode] +Contains the enhancements to the OSS dashboard app. -WARNING: Missing README. + +- {kib-repo}blob/{branch}/x-pack/plugins/dashboard_mode/README.md[dashboardMode] + +The deprecated dashboard only mode. - {kib-repo}blob/{branch}/x-pack/plugins/data_enhanced[dataEnhanced] @@ -355,9 +363,9 @@ WARNING: Missing README. WARNING: Missing README. -- {kib-repo}blob/{branch}/x-pack/plugins/discover_enhanced[discoverEnhanced] +- {kib-repo}blob/{branch}/x-pack/plugins/discover_enhanced/README.md[discoverEnhanced] -WARNING: Missing README. +Contains the enhancements to the OSS discover app. - {kib-repo}blob/{branch}/x-pack/plugins/embeddable_enhanced[embeddableEnhanced]