[Search Sessions] Fix search sessions docs link (#98918) (#99169)

# Conflicts:
#	x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/main.test.tsx
#	x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/documentation.ts
This commit is contained in:
Anton Dosov 2021-05-04 12:55:31 +02:00 committed by GitHub
parent f47a42d1c5
commit a4b87bda72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 12 deletions

View file

@ -98,6 +98,9 @@ readonly links: {
readonly painlessWalkthrough: string;
readonly luceneExpressions: string;
};
readonly search: {
readonly sessions: string;
};
readonly indexPatterns: {
readonly loadingData: string;
readonly introduction: string;

View file

@ -144,6 +144,9 @@ export class DocLinksService {
queryDsl: `${ELASTICSEARCH_DOCS}query-dsl.html`,
kueryQuerySyntax: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kuery-query.html`,
},
search: {
sessions: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/search-sessions.html`,
},
date: {
dateMath: `${ELASTICSEARCH_DOCS}common-options.html#date-math`,
},
@ -356,6 +359,9 @@ export interface DocLinksStart {
readonly painlessWalkthrough: string;
readonly luceneExpressions: string;
};
readonly search: {
readonly sessions: string;
};
readonly indexPatterns: {
readonly loadingData: string;
readonly introduction: string;

View file

@ -568,6 +568,9 @@ export interface DocLinksStart {
readonly painlessWalkthrough: string;
readonly luceneExpressions: string;
};
readonly search: {
readonly sessions: string;
};
readonly indexPatterns: {
readonly loadingData: string;
readonly introduction: string;

View file

@ -57,9 +57,11 @@ describe('Background Search Session Management Main', () => {
describe('renders', () => {
const docLinks: DocLinksStart = {
ELASTIC_WEBSITE_URL: 'boo/',
DOC_LINK_VERSION: '#foo',
links: {} as any,
ELASTIC_WEBSITE_URL: `boo/`,
DOC_LINK_VERSION: `#foo`,
links: {
search: { sessions: `mock-url` } as any,
} as any,
};
let main: ReactWrapper;
@ -93,9 +95,7 @@ describe('Background Search Session Management Main', () => {
test('documentation link', () => {
const docLink = main.find('a[href]').first();
expect(docLink.text()).toBe('Documentation');
expect(docLink.prop('href')).toBe(
'boo/guide/en/elasticsearch/reference/#foo/async-search-intro.html'
);
expect(docLink.prop('href')).toBe('mock-url');
});
test('table is present', () => {

View file

@ -8,16 +8,14 @@
import { DocLinksStart } from 'kibana/public';
export class AsyncSearchIntroDocumentation {
private docsBasePath: string = '';
private docUrl: string = '';
constructor(docs: DocLinksStart) {
const { DOC_LINK_VERSION, ELASTIC_WEBSITE_URL } = docs;
const docsBase = `${ELASTIC_WEBSITE_URL}guide/en`;
// TODO: There should be Kibana documentation link about Search Sessions in Kibana
this.docsBasePath = `${docsBase}/elasticsearch/reference/${DOC_LINK_VERSION}`;
const { links } = docs;
this.docUrl = links.search.sessions;
}
public getElasticsearchDocLink() {
return `${this.docsBasePath}/async-search-intro.html`;
return `${this.docUrl}`;
}
}