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

[DOCS] Uses doc link service in discover #88835

Merged
merged 13 commits into from
Feb 3, 2021
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ readonly links: {
createPipeline: string;
createTransformRequest: string;
executeWatchActionModes: string;
indexExists: string;
openIndex: string;
putComponentTemplate: string;
painlessExecute: string;
Expand Down
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 @@ -226,6 +226,7 @@ export class DocLinksService {
createPipeline: `${ELASTICSEARCH_DOCS}put-pipeline-api.html`,
createTransformRequest: `${ELASTICSEARCH_DOCS}put-transform.html#put-transform-request-body`,
executeWatchActionModes: `${ELASTICSEARCH_DOCS}watcher-api-execute-watch.html#watcher-api-execute-watch-action-mode`,
indexExists: `${ELASTICSEARCH_DOCS}indices-exists.html`,
openIndex: `${ELASTICSEARCH_DOCS}indices-open-close.html`,
putComponentTemplate: `${ELASTICSEARCH_DOCS}indices-component-template.html`,
painlessExecute: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/painless/${DOC_LINK_VERSION}/painless-execute-api.html`,
Expand Down Expand Up @@ -357,6 +358,7 @@ export interface DocLinksStart {
createPipeline: string;
createTransformRequest: string;
executeWatchActionModes: string;
indexExists: string;
openIndex: string;
putComponentTemplate: string;
painlessExecute: string;
Expand Down
1 change: 1 addition & 0 deletions src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ export interface DocLinksStart {
createPipeline: string;
createTransformRequest: string;
executeWatchActionModes: string;
indexExists: string;
openIndex: string;
putComponentTemplate: string;
painlessExecute: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ jest.mock('../../../kibana_services', () => {
search: mockSearchApi,
},
},
docLinks: {
links: {
apis: {
indexExists: 'mockUrl',
},
},
},
}),
getDocViewsRegistry: () => ({
addDocView(view: any) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface DocProps {

export function Doc(props: DocProps) {
const [reqState, hit, indexPattern] = useEsDocSearch(props);

const indexExistsLink = getServices().docLinks.links.apis.indexExists;
return (
<I18nProvider>
<EuiPage>
Expand Down Expand Up @@ -91,12 +91,7 @@ export function Doc(props: DocProps) {
defaultMessage="{indexName} is missing."
values={{ indexName: props.index }}
/>{' '}
<EuiLink
href={`https://www.elastic.co/guide/en/elasticsearch/reference/${
getServices().metadata.branch
}/indices-exists.html`}
target="_blank"
>
<EuiLink href={indexExistsLink} target="_blank">
<FormattedMessage
id="discover.doc.somethingWentWrongDescriptionAddon"
defaultMessage="Please ensure the index exists."
Expand Down