Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update doc links for ingest pipelines app #94742

Merged
merged 2 commits into from
Mar 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -163,5 +163,6 @@ readonly links: {
readonly ccs: Record<string, string>;
readonly plugins: Record<string, string>;
readonly snapshotRestore: Record<string, string>;
readonly ingest: Record<string, string>;
};
```

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@ export class DocLinksService {
registerUrl: `${ELASTICSEARCH_DOCS}snapshots-register-repository.html#snapshots-read-only-repository`,
restoreSnapshot: `${ELASTICSEARCH_DOCS}snapshots-restore-snapshot.html`,
},
ingest: {
pipelines: `${ELASTICSEARCH_DOCS}ingest.html`,
pipelineFailure: `${ELASTICSEARCH_DOCS}ingest.html#handling-pipeline-failures`,
processors: `${ELASTICSEARCH_DOCS}processors.html`,
},
},
});
}
Expand Down Expand Up @@ -440,5 +445,6 @@ export interface DocLinksStart {
readonly ccs: Record<string, string>;
readonly plugins: Record<string, string>;
readonly snapshotRestore: Record<string, string>;
readonly ingest: Record<string, string>;
};
}
1 change: 1 addition & 0 deletions src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ export interface DocLinksStart {
readonly ccs: Record<string, string>;
readonly plugins: Record<string, string>;
readonly snapshotRestore: Record<string, string>;
readonly ingest: Record<string, string>;
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ export const OnFailureProcessorsTitle: FunctionComponent = () => {
values={{
learnMoreLink: (
<EuiLink
href={
services.documentation.getEsDocsBasePath() + '/handling-failure-in-pipelines.html'
}
href={services.documentation.getHandlingFailureUrl()}
target="_blank"
external
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ export const ProcessorsEmptyPrompt: FunctionComponent<Props> = ({ onLoadJson })
defaultMessage="Use processors to transform data before indexing. {learnMoreLink}"
values={{
learnMoreLink: (
<EuiLink
href={services.documentation.getEsDocsBasePath() + '/ingest-processors.html'}
target="_blank"
external
>
<EuiLink href={services.documentation.getProcessorsUrl()} target="_blank" external>
{i18n.translate(
'xpack.ingestPipelines.pipelineEditor.processorsDocumentationLink',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@ export const ProcessorsHeader: FunctionComponent<Props> = ({ onLoadJson, hasProc
defaultMessage="Use processors to transform data before indexing. {learnMoreLink}"
values={{
learnMoreLink: (
<EuiLink
href={services.documentation.getEsDocsBasePath() + '/ingest-processors.html'}
target="_blank"
external
>
<EuiLink href={services.documentation.getProcessorsUrl()} target="_blank" external>
{i18n.translate(
'xpack.ingestPipelines.pipelineEditor.processorsDocumentationLink',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,40 @@ import { DocLinksStart } from 'src/core/public';

export class DocumentationService {
private esDocBasePath: string = '';
private ingestNodeUrl: string = '';
private processorsUrl: string = '';
private handlingFailureUrl: string = '';
private putPipelineApiUrl: string = '';

public setup(docLinks: DocLinksStart): void {
const { DOC_LINK_VERSION, ELASTIC_WEBSITE_URL } = docLinks;
const { DOC_LINK_VERSION, ELASTIC_WEBSITE_URL, links } = docLinks;
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}`;
}

public getEsDocsBasePath() {
return this.esDocBasePath;
}

public getIngestNodeUrl() {
return `${this.esDocBasePath}/ingest.html`;
return this.ingestNodeUrl;
}

public getProcessorsUrl() {
return `${this.esDocBasePath}/ingest-processors.html`;
return this.processorsUrl;
}

public getHandlingFailureUrl() {
return `${this.esDocBasePath}/handling-failure-in-pipelines.html`;
return this.handlingFailureUrl;
}

public getPutPipelineApiUrl() {
return `${this.esDocBasePath}/put-pipeline-api.html`;
return this.putPipelineApiUrl;
}
}

Expand Down