Skip to content

Commit

Permalink
Addresses feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl committed Sep 22, 2021
1 parent 3adbc6b commit 9591d18
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<FormattedMessage
id="xpack.ingestPipelines.pipelineEditor.inferenceForm.inferenceConfigurationHelpText"
defaultMessage="Contains the inference type and its options. There are two types: {regression} and {classification}."
values={{
regression: (
<EuiLink external target="_blank" href={esDocsLink1}>
<EuiLink external target="_blank" href={regressionDocsLink}>
{INFERENCE_CONFIG_DOCS.regression.linkLabel}
</EuiLink>
),
classification: (
<EuiLink external target="_blank" href={esDocsLink2}>
<EuiLink external target="_blank" href={classificationDocsLink}>
{INFERENCE_CONFIG_DOCS.classification.linkLabel}
</EuiLink>
),
Expand Down Expand Up @@ -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 (
<>
<UseField config={fieldsConfig.model_id} component={Field} path="fields.model_id" />
Expand Down Expand Up @@ -179,7 +182,7 @@ export const Inference: FunctionComponent = () => {
<UseField
config={{
...fieldsConfig.inference_config,
helpText: getInferenceConfigHelpText(esDocRegression, esDocClassification),
helpText: getInferenceConfigHelpText(regressionDocsLink, classificationDocsLink),
}}
component={XJsonEditor}
componentProps={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ export class DocumentationService {
const docsBase = `${ELASTIC_WEBSITE_URL}guide/en`;

this.esDocBasePath = `${docsBase}/elasticsearch/reference/${DOC_LINK_VERSION}`;
this.ingestNodeUrl = `${links.ingest.pipelines}`;
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}`;
this.ingestNodeUrl = links.ingest.pipelines;
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.geoMatchUrl = links.ingest.geoMatch;
this.dissectKeyModifiersUrl = links.ingest.dissectKeyModifiers;
this.classificationUrl = links.ingest.inferenceClassification;
this.regressionUrl = links.ingest.inferenceRegression;
}

public getEsDocsBasePath() {
Expand Down

0 comments on commit 9591d18

Please sign in to comment.