From f53e0b9d38b1b026a3f9008e630f9ac415a9ea26 Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 21 Sep 2021 17:46:03 -0700 Subject: [PATCH 1/3] Update more doc links for ingest pipelines --- .../public/doc_links/doc_links_service.ts | 2 ++ .../processor_form/processors/dissect.tsx | 8 ++--- .../processor_form/processors/enrich.tsx | 13 ++++--- .../processor_form/processors/inference.tsx | 21 ++++------- .../tab_documents/tab_documents.tsx | 2 +- .../application/services/documentation.ts | 36 +++++++++++++++++++ 6 files changed, 53 insertions(+), 29 deletions(-) diff --git a/src/core/public/doc_links/doc_links_service.ts b/src/core/public/doc_links/doc_links_service.ts index a9b19a6e84050b..ce9b21dcc705c6 100644 --- a/src/core/public/doc_links/doc_links_service.ts +++ b/src/core/public/doc_links/doc_links_service.ts @@ -282,6 +282,7 @@ export class DocLinksService { }, observability: { guide: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/index.html`, + configureSettings: `{ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/configure-settings.html`, infrastructureThreshold: `{ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/infrastructure-threshold-alert.html`, logsThreshold: `{ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/logs-threshold-alert.html`, metricsThreshold: `{ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/metrics-threshold-alert.html`, @@ -413,6 +414,7 @@ export class DocLinksService { fail: `${ELASTICSEARCH_DOCS}fail-processor.html`, foreach: `${ELASTICSEARCH_DOCS}foreach-processor.html`, geoIp: `${ELASTICSEARCH_DOCS}geoip-processor.html`, + geoMatch: `${ELASTICSEARCH_DOCS}geo-match-enrich-policy-type.html`, grok: `${ELASTICSEARCH_DOCS}grok-processor.html`, gsub: `${ELASTICSEARCH_DOCS}gsub-processor.html`, htmlString: `${ELASTICSEARCH_DOCS}htmlstrip-processor.html`, diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/dissect.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/dissect.tsx index 3864581317e385..be55000bf374a2 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/dissect.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/dissect.tsx @@ -42,11 +42,7 @@ const getFieldsConfig = (esDocUrl: string): Record => { defaultMessage="Pattern used to dissect the specified field. The pattern is defined by the parts of the string to discard. Use a {keyModifier} to alter the dissection behavior." values={{ keyModifier: ( - + {i18n.translate( 'xpack.ingestPipelines.pipelineEditor.dissectForm.patternFieldHelpText.dissectProcessorLink', { @@ -97,7 +93,7 @@ const getFieldsConfig = (esDocUrl: string): Record => { export const Dissect: FunctionComponent = () => { const { services } = useKibana(); - const fieldsConfig = getFieldsConfig(services.documentation.getEsDocsBasePath()); + const fieldsConfig = getFieldsConfig(services.documentation.getDissectKeyModifiersUrl()); return ( <> diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/enrich.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/enrich.tsx index dfbcfc95665076..1c6292795d5878 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/enrich.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/enrich.tsx @@ -139,7 +139,6 @@ const fieldsConfig: FieldsConfig = { export const Enrich: FunctionComponent = () => { const { services } = useKibana(); - const esDocUrl = services.documentation.getEsDocsBasePath(); return ( <> { defaultMessage="Name of the {enrichPolicyLink}." values={{ enrichPolicyLink: ( - + {i18n.translate( 'xpack.ingestPipelines.pipelineEditor.enrichForm.policyNameHelpText.enrichPolicyLink', { defaultMessage: 'enrich policy' } @@ -206,11 +209,7 @@ export const Enrich: FunctionComponent = () => { defaultMessage="Operator used to match the geo-shape of incoming documents to enrich documents. Only used for {geoMatchPolicyLink}." values={{ geoMatchPolicyLink: ( - + {i18n.translate( 'xpack.ingestPipelines.pipelineEditor.enrichForm.shapeRelationFieldHelpText.geoMatchPoliciesLink', { defaultMessage: 'geo-match enrich policies' } diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/inference.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/inference.tsx index 9575e6d690e006..428027b465a736 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/inference.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/inference.tsx @@ -28,14 +28,12 @@ const { emptyField, isJsonField } = fieldValidators; const INFERENCE_CONFIG_DOCS = { regression: { - path: 'inference-processor.html#inference-processor-regression-opt', linkLabel: i18n.translate( 'xpack.ingestPipelines.pipelineEditor.inferenceForm.inferenceConfigField.regressionLinkLabel', { defaultMessage: 'regression' } ), }, classification: { - path: 'inference-processor.html#inference-processor-classification-opt', linkLabel: i18n.translate( 'xpack.ingestPipelines.pipelineEditor.inferenceForm.inferenceConfigField.classificationLinkLabel', { defaultMessage: 'classification' } @@ -43,27 +41,19 @@ const INFERENCE_CONFIG_DOCS = { }, }; -const getInferenceConfigHelpText = (esDocsBasePath: string): React.ReactNode => { +const getInferenceConfigHelpText = (esDocsLink1: string, esDocsLink2: string): React.ReactNode => { return ( + {INFERENCE_CONFIG_DOCS.regression.linkLabel} ), classification: ( - + {INFERENCE_CONFIG_DOCS.classification.linkLabel} ), @@ -158,7 +148,8 @@ const fieldsConfig: FieldsConfig = { export const Inference: FunctionComponent = () => { const { services } = useKibana(); - const esDocUrl = services.documentation.getEsDocsBasePath(); + const esDocRegression = services.documentation.getRegressionUrl(); + const esDocClassification = services.documentation.getClassificationUrl(); return ( <> @@ -188,7 +179,7 @@ export const Inference: FunctionComponent = () => { = ({ values={{ learnMoreLink: ( 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 8aa165cc502a8f..4da04c81b1cf9c 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/services/documentation.ts +++ b/x-pack/plugins/ingest_pipelines/public/application/services/documentation.ts @@ -13,6 +13,12 @@ export class DocumentationService { private processorsUrl: string = ''; private handlingFailureUrl: string = ''; private putPipelineApiUrl: string = ''; + private simulatePipelineApiUrl: string = ''; + private enrichDataUrl: string = ''; + private geoMatchUrl: string = ''; + private dissectKeyModifiersUrl: string = ''; + private classificationUrl: string = ''; + private regressionUrl: string = ''; public setup(docLinks: DocLinksStart): void { const { DOC_LINK_VERSION, ELASTIC_WEBSITE_URL, links } = docLinks; @@ -23,6 +29,12 @@ export class DocumentationService { this.processorsUrl = `${links.ingest.processors}`; this.handlingFailureUrl = `${links.ingest.pipelineFailure}`; this.putPipelineApiUrl = `${links.apis.createPipeline}`; + this.simulatePipelineApiUrl = `${links.apis.simulatePipeline}`; + this.enrichDataUrl = `${links.ingest.enrich}`; + this.enrichDataUrl = `${links.ingest.geoMatch}`; + this.dissectKeyModifiersUrl = `${links.ingest.dissectKeyModifiers}`; + this.classificationUrl = `${links.ingest.inferenceClassification}`; + this.regressionUrl = `${links.ingest.inferenceRegression}`; } public getEsDocsBasePath() { @@ -44,6 +56,30 @@ export class DocumentationService { public getPutPipelineApiUrl() { return this.putPipelineApiUrl; } + + public getSimulatePipelineApiUrl() { + return this.simulatePipelineApiUrl; + } + + public getEnrichDataUrl() { + return this.enrichDataUrl; + } + + public getGeoMatchUrl() { + return this.geoMatchUrl; + } + + public getDissectKeyModifiersUrl() { + return this.dissectKeyModifiersUrl; + } + + public getClassificationUrl() { + return this.classificationUrl; + } + + public getRegressionUrl() { + return this.regressionUrl; + } } export const documentationService = new DocumentationService(); From 3adbc6bcee51ca696ec69421b36df768ceb09352 Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 21 Sep 2021 17:53:32 -0700 Subject: [PATCH 2/3] Removes unnecessary extra link --- src/core/public/doc_links/doc_links_service.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/public/doc_links/doc_links_service.ts b/src/core/public/doc_links/doc_links_service.ts index ce9b21dcc705c6..d7bf80aa3b49aa 100644 --- a/src/core/public/doc_links/doc_links_service.ts +++ b/src/core/public/doc_links/doc_links_service.ts @@ -282,7 +282,6 @@ export class DocLinksService { }, observability: { guide: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/index.html`, - configureSettings: `{ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/configure-settings.html`, infrastructureThreshold: `{ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/infrastructure-threshold-alert.html`, logsThreshold: `{ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/logs-threshold-alert.html`, metricsThreshold: `{ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/metrics-threshold-alert.html`, From 9591d18238c68527f126ccda7a3ac33f1fbb5b89 Mon Sep 17 00:00:00 2001 From: lcawl Date: Wed, 22 Sep 2021 14:35:12 -0700 Subject: [PATCH 3/3] Addresses feedback --- .../processor_form/processors/inference.tsx | 15 ++++++++------ .../application/services/documentation.ts | 20 +++++++++---------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/inference.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/inference.tsx index 428027b465a736..9c3601c3683423 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/inference.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/inference.tsx @@ -41,19 +41,22 @@ const INFERENCE_CONFIG_DOCS = { }, }; -const getInferenceConfigHelpText = (esDocsLink1: string, esDocsLink2: string): React.ReactNode => { +const getInferenceConfigHelpText = ( + regressionDocsLink: string, + classificationDocsLink: string +): React.ReactNode => { return ( + {INFERENCE_CONFIG_DOCS.regression.linkLabel} ), classification: ( - + {INFERENCE_CONFIG_DOCS.classification.linkLabel} ), @@ -148,8 +151,8 @@ const fieldsConfig: FieldsConfig = { export const Inference: FunctionComponent = () => { const { services } = useKibana(); - const esDocRegression = services.documentation.getRegressionUrl(); - const esDocClassification = services.documentation.getClassificationUrl(); + const regressionDocsLink = services.documentation.getRegressionUrl(); + const classificationDocsLink = services.documentation.getClassificationUrl(); return ( <> @@ -179,7 +182,7 @@ export const Inference: FunctionComponent = () => {