mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
This commit is contained in:
parent
112e174c31
commit
7b977771d9
8 changed files with 31 additions and 22 deletions
|
@ -23,14 +23,24 @@ core.application.register({
|
|||
title: 'Translated title',
|
||||
keywords: ['translated keyword1', 'translated keyword2'],
|
||||
deepLinks: [
|
||||
{ id: 'sub1', title: 'Sub1', path: '/sub1', keywords: ['subpath1'] },
|
||||
{
|
||||
id: 'sub2',
|
||||
title: 'Sub2',
|
||||
deepLinks: [
|
||||
{ id: 'subsub', title: 'SubSub', path: '/sub2/sub', keywords: ['subpath2'] }
|
||||
]
|
||||
}
|
||||
{
|
||||
id: 'sub1',
|
||||
title: 'Sub1',
|
||||
path: '/sub1',
|
||||
keywords: ['subpath1'],
|
||||
},
|
||||
{
|
||||
id: 'sub2',
|
||||
title: 'Sub2',
|
||||
deepLinks: [
|
||||
{
|
||||
id: 'subsub',
|
||||
title: 'SubSub',
|
||||
path: '/sub2/sub',
|
||||
keywords: ['subpath2'],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
mount: () => { ... }
|
||||
})
|
||||
|
|
|
@ -111,6 +111,7 @@ readonly links: {
|
|||
readonly introduction: string;
|
||||
readonly fieldFormattersNumber: string;
|
||||
readonly fieldFormattersString: string;
|
||||
readonly runtimeFields: string;
|
||||
};
|
||||
readonly addData: string;
|
||||
readonly kibana: string;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -131,6 +131,7 @@ export class DocLinksService {
|
|||
introduction: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/index-patterns.html`,
|
||||
fieldFormattersNumber: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/numeral.html`,
|
||||
fieldFormattersString: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/field-formatters-string.html`,
|
||||
runtimeFields: `${KIBANA_DOCS}managing-index-patterns.html#runtime-fields`,
|
||||
},
|
||||
addData: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/connect-to-elasticsearch.html`,
|
||||
kibana: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/index.html`,
|
||||
|
@ -514,6 +515,7 @@ export interface DocLinksStart {
|
|||
readonly introduction: string;
|
||||
readonly fieldFormattersNumber: string;
|
||||
readonly fieldFormattersString: string;
|
||||
readonly runtimeFields: string;
|
||||
};
|
||||
readonly addData: string;
|
||||
readonly kibana: string;
|
||||
|
|
|
@ -584,6 +584,7 @@ export interface DocLinksStart {
|
|||
readonly introduction: string;
|
||||
readonly fieldFormattersNumber: string;
|
||||
readonly fieldFormattersString: string;
|
||||
readonly runtimeFields: string;
|
||||
};
|
||||
readonly addData: string;
|
||||
readonly kibana: string;
|
||||
|
|
|
@ -14,12 +14,11 @@ import { registerTestBed, TestBed, getCommonActions } from '../../test_utils';
|
|||
import { RuntimeFieldPainlessError } from '../../lib';
|
||||
import { Field } from '../../types';
|
||||
import { FieldEditor, Props, FieldEditorFormState } from './field_editor';
|
||||
import { docLinksServiceMock } from '../../../../../core/public/mocks';
|
||||
|
||||
const defaultProps: Props = {
|
||||
onChange: jest.fn(),
|
||||
links: {
|
||||
runtimePainless: 'https://elastic.co',
|
||||
},
|
||||
links: docLinksServiceMock.createStartContract() as any,
|
||||
ctx: {
|
||||
existingConcreteFields: [],
|
||||
namesNotAllowed: [],
|
||||
|
|
|
@ -8,15 +8,16 @@
|
|||
import { act } from 'react-dom/test-utils';
|
||||
|
||||
import '../test_utils/setup_environment';
|
||||
import { registerTestBed, TestBed, noop, docLinks, getCommonActions } from '../test_utils';
|
||||
import { registerTestBed, TestBed, noop, getCommonActions } from '../test_utils';
|
||||
|
||||
import { FieldEditor } from './field_editor';
|
||||
import { FieldEditorFlyoutContent, Props } from './field_editor_flyout_content';
|
||||
import { docLinksServiceMock } from '../../../../core/public/mocks';
|
||||
|
||||
const defaultProps: Props = {
|
||||
onSave: noop,
|
||||
onCancel: noop,
|
||||
docLinks,
|
||||
docLinks: docLinksServiceMock.createStartContract() as any,
|
||||
FieldEditor,
|
||||
indexPattern: { fields: [] } as any,
|
||||
uiSettings: {} as any,
|
||||
|
|
|
@ -8,14 +8,9 @@
|
|||
|
||||
import { DocLinksStart } from 'src/core/public';
|
||||
|
||||
export const getLinks = (docLinks: DocLinksStart) => {
|
||||
const { DOC_LINK_VERSION, ELASTIC_WEBSITE_URL } = docLinks;
|
||||
const docsBase = `${ELASTIC_WEBSITE_URL}guide/en`;
|
||||
const painlessDocsBase = `${docsBase}/elasticsearch/painless/${DOC_LINK_VERSION}`;
|
||||
const kibanaDocsBase = `${docsBase}/kibana/${DOC_LINK_VERSION}`;
|
||||
|
||||
export const getLinks = ({ links }: DocLinksStart) => {
|
||||
return {
|
||||
runtimePainless: `${kibanaDocsBase}/managing-index-patterns.html#runtime-fields`,
|
||||
painlessSyntax: `${painlessDocsBase}/painless-lang-spec.html`,
|
||||
runtimePainless: links.indexPatterns.runtimeFields,
|
||||
painlessSyntax: links.scriptedFields.painlessLangSpec,
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue