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

[ML] Use doc links service for transforms #86919

Merged
merged 3 commits into from
Jan 4, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ export class DocLinksService {
createRoleMapping: `${ELASTICSEARCH_DOCS}security-api-put-role-mapping.html`,
createApiKey: `${ELASTICSEARCH_DOCS}security-api-create-api-key.html`,
createPipeline: `${ELASTICSEARCH_DOCS}put-pipeline-api.html`,
createTransformRequest: `${ELASTICSEARCH_DOCS}put-transform.html#put-transform-request-body`,
openIndex: `${ELASTICSEARCH_DOCS}indices-open-close.html`,
updateTransform: `${ELASTICSEARCH_DOCS}update-transform.html`,
},
},
});
Expand Down
6 changes: 0 additions & 6 deletions x-pack/plugins/transform/public/app/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ export enum SECTION_SLUG {
CREATE_TRANSFORM = 'create_transform',
}

export enum TRANSFORM_DOC_PATHS {
default = 'docs.html',
plugins = 'plugins.html',
transforms = 'transforms.html',
}

// UI Metric constants
export const UIM_APP_NAME = 'transform';
export const UIM_TRANSFORM_LIST_LOAD = 'transform_list_load';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,15 @@

import { useAppDependencies } from '../app_dependencies';

import { TRANSFORM_DOC_PATHS } from '../constants';

export const useDocumentationLinks = () => {
const deps = useAppDependencies();
const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = deps.docLinks;
return {
esDocBasePath: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/`,
esIndicesCreateIndex: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/indices-create-index.html#indices-create-index`,
esIndicesCreateIndex: deps.docLinks.links.apis.createIndex,
esPluginDocBasePath: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/plugins/${DOC_LINK_VERSION}/`,
esQueryDsl: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/query-dsl.html`,
esStackOverviewDocBasePath: `${ELASTIC_WEBSITE_URL}guide/en/elastic-stack-overview/${DOC_LINK_VERSION}/`,
esTransform: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/${TRANSFORM_DOC_PATHS.transforms}`,
esTransformPivot: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/put-transform.html#put-transform-request-body`,
esTransformUpdate: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/update-transform.html`,
mlDocBasePath: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/`,
esQueryDsl: deps.docLinks.links.query.queryDsl,
esTransform: deps.docLinks.links.transforms.guide,
esTransformPivot: deps.docLinks.links.apis.createTransformRequest,
esTransformUpdate: deps.docLinks.links.apis.updateTransform,
};
};