diff --git a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md index 860f7c3c74892..01079bdf03d0c 100644 --- a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md +++ b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md @@ -88,6 +88,7 @@ readonly links: { readonly top_hits: string; }; readonly runtimeFields: { + readonly overview: string; readonly mapping: string; }; readonly scriptedFields: { @@ -114,9 +115,10 @@ readonly links: { }; readonly query: { readonly eql: string; + readonly kueryQuerySyntax: string; readonly luceneQuerySyntax: string; + readonly percolate: string; readonly queryDsl: string; - readonly kueryQuerySyntax: string; }; readonly date: { readonly dateMath: string; @@ -127,6 +129,7 @@ readonly links: { readonly transforms: Record; readonly visualize: Record; readonly apis: Readonly<{ + bulkIndexAlias: string; createIndex: string; createSnapshotLifecyclePolicy: string; createRoleMapping: string; @@ -143,6 +146,7 @@ readonly links: { painlessExecuteAPIContexts: string; putComponentTemplateMetadata: string; putSnapshotLifecyclePolicy: string; + putIndexTemplateV1: string; putWatch: string; simulatePipeline: string; updateTransform: string; diff --git a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md index a9cb6729b214e..11814e7ca8b77 100644 --- a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md +++ b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md @@ -17,5 +17,5 @@ export interface DocLinksStart | --- | --- | --- | | [DOC\_LINK\_VERSION](./kibana-plugin-core-public.doclinksstart.doc_link_version.md) | string | | | [ELASTIC\_WEBSITE\_URL](./kibana-plugin-core-public.doclinksstart.elastic_website_url.md) | string | | -| [links](./kibana-plugin-core-public.doclinksstart.links.md) | {
readonly dashboard: {
readonly guide: string;
readonly drilldowns: string;
readonly drilldownsTriggerPicker: string;
readonly urlDrilldownTemplateSyntax: string;
readonly urlDrilldownVariables: string;
};
readonly discover: Record<string, string>;
readonly filebeat: {
readonly base: string;
readonly installation: string;
readonly configuration: string;
readonly elasticsearchOutput: string;
readonly elasticsearchModule: string;
readonly startup: string;
readonly exportedFields: string;
};
readonly auditbeat: {
readonly base: string;
};
readonly metricbeat: {
readonly base: string;
readonly configure: string;
readonly httpEndpoint: string;
readonly install: string;
readonly start: string;
};
readonly enterpriseSearch: {
readonly base: string;
readonly appSearchBase: string;
readonly workplaceSearchBase: string;
};
readonly heartbeat: {
readonly base: string;
};
readonly logstash: {
readonly base: string;
};
readonly functionbeat: {
readonly base: string;
};
readonly winlogbeat: {
readonly base: string;
};
readonly aggs: {
readonly composite: string;
readonly composite_missing_bucket: string;
readonly date_histogram: string;
readonly date_range: string;
readonly date_format_pattern: string;
readonly filter: string;
readonly filters: string;
readonly geohash_grid: string;
readonly histogram: string;
readonly ip_range: string;
readonly range: string;
readonly significant_terms: string;
readonly terms: string;
readonly avg: string;
readonly avg_bucket: string;
readonly max_bucket: string;
readonly min_bucket: string;
readonly sum_bucket: string;
readonly cardinality: string;
readonly count: string;
readonly cumulative_sum: string;
readonly derivative: string;
readonly geo_bounds: string;
readonly geo_centroid: string;
readonly max: string;
readonly median: string;
readonly min: string;
readonly moving_avg: string;
readonly percentile_ranks: string;
readonly serial_diff: string;
readonly std_dev: string;
readonly sum: string;
readonly top_hits: string;
};
readonly runtimeFields: {
readonly mapping: string;
};
readonly scriptedFields: {
readonly scriptFields: string;
readonly scriptAggs: string;
readonly painless: string;
readonly painlessApi: string;
readonly painlessLangSpec: string;
readonly painlessSyntax: string;
readonly painlessWalkthrough: string;
readonly luceneExpressions: string;
};
readonly indexPatterns: {
readonly introduction: string;
readonly fieldFormattersNumber: string;
readonly fieldFormattersString: string;
};
readonly addData: string;
readonly kibana: string;
readonly elasticsearch: Record<string, string>;
readonly siem: {
readonly guide: string;
readonly gettingStarted: string;
};
readonly query: {
readonly eql: string;
readonly luceneQuerySyntax: string;
readonly queryDsl: string;
readonly kueryQuerySyntax: string;
};
readonly date: {
readonly dateMath: string;
readonly dateMathIndexNames: string;
};
readonly management: Record<string, string>;
readonly ml: Record<string, string>;
readonly transforms: Record<string, string>;
readonly visualize: Record<string, string>;
readonly apis: Readonly<{
createIndex: string;
createSnapshotLifecyclePolicy: string;
createRoleMapping: string;
createRoleMappingTemplates: string;
createApiKey: string;
createPipeline: string;
createTransformRequest: string;
cronExpressions: string;
executeWatchActionModes: string;
indexExists: string;
openIndex: string;
putComponentTemplate: string;
painlessExecute: string;
painlessExecuteAPIContexts: string;
putComponentTemplateMetadata: string;
putSnapshotLifecyclePolicy: string;
putWatch: string;
simulatePipeline: string;
updateTransform: string;
}>;
readonly observability: Record<string, string>;
readonly alerting: Record<string, string>;
readonly maps: Record<string, string>;
readonly monitoring: Record<string, string>;
readonly security: Readonly<{
apiKeyServiceSettings: string;
clusterPrivileges: string;
elasticsearchSettings: string;
elasticsearchEnableSecurity: string;
indicesPrivileges: string;
kibanaTLS: string;
kibanaPrivileges: string;
mappingRoles: string;
mappingRolesFieldRules: string;
runAsPrivilege: string;
}>;
readonly watcher: Record<string, string>;
readonly ccs: Record<string, string>;
readonly plugins: Record<string, string>;
readonly snapshotRestore: Record<string, string>;
readonly ingest: Record<string, string>;
} | | +| [links](./kibana-plugin-core-public.doclinksstart.links.md) | {
readonly dashboard: {
readonly guide: string;
readonly drilldowns: string;
readonly drilldownsTriggerPicker: string;
readonly urlDrilldownTemplateSyntax: string;
readonly urlDrilldownVariables: string;
};
readonly discover: Record<string, string>;
readonly filebeat: {
readonly base: string;
readonly installation: string;
readonly configuration: string;
readonly elasticsearchOutput: string;
readonly elasticsearchModule: string;
readonly startup: string;
readonly exportedFields: string;
};
readonly auditbeat: {
readonly base: string;
};
readonly metricbeat: {
readonly base: string;
readonly configure: string;
readonly httpEndpoint: string;
readonly install: string;
readonly start: string;
};
readonly enterpriseSearch: {
readonly base: string;
readonly appSearchBase: string;
readonly workplaceSearchBase: string;
};
readonly heartbeat: {
readonly base: string;
};
readonly logstash: {
readonly base: string;
};
readonly functionbeat: {
readonly base: string;
};
readonly winlogbeat: {
readonly base: string;
};
readonly aggs: {
readonly composite: string;
readonly composite_missing_bucket: string;
readonly date_histogram: string;
readonly date_range: string;
readonly date_format_pattern: string;
readonly filter: string;
readonly filters: string;
readonly geohash_grid: string;
readonly histogram: string;
readonly ip_range: string;
readonly range: string;
readonly significant_terms: string;
readonly terms: string;
readonly avg: string;
readonly avg_bucket: string;
readonly max_bucket: string;
readonly min_bucket: string;
readonly sum_bucket: string;
readonly cardinality: string;
readonly count: string;
readonly cumulative_sum: string;
readonly derivative: string;
readonly geo_bounds: string;
readonly geo_centroid: string;
readonly max: string;
readonly median: string;
readonly min: string;
readonly moving_avg: string;
readonly percentile_ranks: string;
readonly serial_diff: string;
readonly std_dev: string;
readonly sum: string;
readonly top_hits: string;
};
readonly runtimeFields: {
readonly overview: string;
readonly mapping: string;
};
readonly scriptedFields: {
readonly scriptFields: string;
readonly scriptAggs: string;
readonly painless: string;
readonly painlessApi: string;
readonly painlessLangSpec: string;
readonly painlessSyntax: string;
readonly painlessWalkthrough: string;
readonly luceneExpressions: string;
};
readonly indexPatterns: {
readonly introduction: string;
readonly fieldFormattersNumber: string;
readonly fieldFormattersString: string;
};
readonly addData: string;
readonly kibana: string;
readonly elasticsearch: Record<string, string>;
readonly siem: {
readonly guide: string;
readonly gettingStarted: string;
};
readonly query: {
readonly eql: string;
readonly kueryQuerySyntax: string;
readonly luceneQuerySyntax: string;
readonly percolate: string;
readonly queryDsl: string;
};
readonly date: {
readonly dateMath: string;
readonly dateMathIndexNames: string;
};
readonly management: Record<string, string>;
readonly ml: Record<string, string>;
readonly transforms: Record<string, string>;
readonly visualize: Record<string, string>;
readonly apis: Readonly<{
bulkIndexAlias: string;
createIndex: string;
createSnapshotLifecyclePolicy: string;
createRoleMapping: string;
createRoleMappingTemplates: string;
createApiKey: string;
createPipeline: string;
createTransformRequest: string;
cronExpressions: string;
executeWatchActionModes: string;
indexExists: string;
openIndex: string;
putComponentTemplate: string;
painlessExecute: string;
painlessExecuteAPIContexts: string;
putComponentTemplateMetadata: string;
putSnapshotLifecyclePolicy: string;
putIndexTemplateV1: string;
putWatch: string;
simulatePipeline: string;
updateTransform: string;
}>;
readonly observability: Record<string, string>;
readonly alerting: Record<string, string>;
readonly maps: Record<string, string>;
readonly monitoring: Record<string, string>;
readonly security: Readonly<{
apiKeyServiceSettings: string;
clusterPrivileges: string;
elasticsearchSettings: string;
elasticsearchEnableSecurity: string;
indicesPrivileges: string;
kibanaTLS: string;
kibanaPrivileges: string;
mappingRoles: string;
mappingRolesFieldRules: string;
runAsPrivilege: string;
}>;
readonly watcher: Record<string, string>;
readonly ccs: Record<string, string>;
readonly plugins: Record<string, string>;
readonly snapshotRestore: Record<string, string>;
readonly ingest: Record<string, string>;
} | | diff --git a/src/core/public/doc_links/doc_links_service.ts b/src/core/public/doc_links/doc_links_service.ts index 4629b9ffa07d9..ac43cc0a616e9 100644 --- a/src/core/public/doc_links/doc_links_service.ts +++ b/src/core/public/doc_links/doc_links_service.ts @@ -109,6 +109,7 @@ export class DocLinksService { top_hits: `${ELASTICSEARCH_DOCS}search-aggregations-metrics-top-hits-aggregation.html`, }, runtimeFields: { + overview: `${ELASTICSEARCH_DOCS}runtime.html`, mapping: `${ELASTICSEARCH_DOCS}runtime-mapping-fields.html`, }, scriptedFields: { @@ -130,8 +131,50 @@ export class DocLinksService { 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`, elasticsearch: { + docsBase: `${ELASTICSEARCH_DOCS}`, + asyncSearch: `${ELASTICSEARCH_DOCS}async-search-intro.html`, + dataStreams: `${ELASTICSEARCH_DOCS}data-streams.html`, indexModules: `${ELASTICSEARCH_DOCS}index-modules.html`, + indexSettings: `${ELASTICSEARCH_DOCS}index-modules.html#index-modules-settings`, + indexTemplates: `${ELASTICSEARCH_DOCS}indices-templates.html`, mapping: `${ELASTICSEARCH_DOCS}mapping.html`, + mappingAnalyzer: `${ELASTICSEARCH_DOCS}analyzer.html`, + mappingBoost: `${ELASTICSEARCH_DOCS}mapping-boost.html`, + mappingCoerce: `${ELASTICSEARCH_DOCS}coerce.html`, + mappingCopyTo: `${ELASTICSEARCH_DOCS}copy-to.html`, + mappingDocValues: `${ELASTICSEARCH_DOCS}doc-values.html`, + mappingDynamic: `${ELASTICSEARCH_DOCS}dynamic.html`, + mappingDynamicFields: `${ELASTICSEARCH_DOCS}dynamic-field-mapping.html`, + mappingDynamicTemplates: `${ELASTICSEARCH_DOCS}dynamic-templates.html`, + mappingEagerGlobalOrdinals: `${ELASTICSEARCH_DOCS}eager-global-ordinals.html`, + mappingEnabled: `${ELASTICSEARCH_DOCS}enabled.html`, + mappingFieldData: `${ELASTICSEARCH_DOCS}text.html#fielddata-mapping-param`, + mappingFieldDataEnable: `${ELASTICSEARCH_DOCS}text.html#before-enabling-fielddata`, + mappingFieldDataFilter: `${ELASTICSEARCH_DOCS}text.html#field-data-filtering`, + mappingFieldDataTypes: `${ELASTICSEARCH_DOCS}mapping-types.html`, + mappingFormat: `${ELASTICSEARCH_DOCS}mapping-date-format.html`, + mappingIgnoreAbove: `${ELASTICSEARCH_DOCS}ignore-above.html`, + mappingIgnoreMalformed: `${ELASTICSEARCH_DOCS}ignore-malformed.html`, + mappingIndex: `${ELASTICSEARCH_DOCS}mapping-index.html`, + mappingIndexOptions: `${ELASTICSEARCH_DOCS}index-options.html`, + mappingIndexPhrases: `${ELASTICSEARCH_DOCS}index-phrases.html`, + mappingIndexPrefixes: `${ELASTICSEARCH_DOCS}index-prefixes.html`, + mappingJoinFieldsPerformance: `${ELASTICSEARCH_DOCS}parent-join.html#_parent_join_and_performance`, + mappingMeta: `${ELASTICSEARCH_DOCS}mapping-field-meta.html`, + mappingMetaFields: `${ELASTICSEARCH_DOCS}mapping-meta-field.html`, + mappingNormalizer: `${ELASTICSEARCH_DOCS}normalizer.html`, + mappingNorms: `${ELASTICSEARCH_DOCS}norms.html`, + mappingNullValue: `${ELASTICSEARCH_DOCS}null-value.html`, + mappingParameters: `${ELASTICSEARCH_DOCS}mapping-params.html`, + mappingPositionIncrementGap: `${ELASTICSEARCH_DOCS}position-increment-gap.html`, + mappingRankFeatureFields: `${ELASTICSEARCH_DOCS}rank-feature.html`, + mappingRouting: `${ELASTICSEARCH_DOCS}mapping-routing-field.html`, + mappingSimilarity: `${ELASTICSEARCH_DOCS}similarity.html`, + mappingSourceFields: `${ELASTICSEARCH_DOCS}mapping-source-field.html`, + mappingSourceFieldsDisable: `${ELASTICSEARCH_DOCS}mapping-source-field.html#disable-source-field`, + mappingStore: `${ELASTICSEARCH_DOCS}mapping-store.html`, + mappingTermVector: `${ELASTICSEARCH_DOCS}term-vector.html`, + mappingTypesRemoval: `${ELASTICSEARCH_DOCS}removal-of-types.html`, nodeRoles: `${ELASTICSEARCH_DOCS}modules-node.html#node-roles`, remoteClusters: `${ELASTICSEARCH_DOCS}modules-remote-clusters.html`, remoteClustersProxy: `${ELASTICSEARCH_DOCS}modules-remote-clusters.html#proxy-mode`, @@ -146,18 +189,20 @@ export class DocLinksService { }, query: { eql: `${ELASTICSEARCH_DOCS}eql.html`, + kueryQuerySyntax: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kuery-query.html`, luceneQuerySyntax: `${ELASTICSEARCH_DOCS}query-dsl-query-string-query.html#query-string-syntax`, + percolate: `${ELASTICSEARCH_DOCS}query-dsl-percolate-query.html`, queryDsl: `${ELASTICSEARCH_DOCS}query-dsl.html`, - kueryQuerySyntax: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kuery-query.html`, }, date: { dateMath: `${ELASTICSEARCH_DOCS}common-options.html#date-math`, dateMathIndexNames: `${ELASTICSEARCH_DOCS}date-math-index-names.html`, }, management: { + dashboardSettings: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/advanced-options.html#kibana-dashboard-settings`, + indexManagement: `${ELASTICSEARCH_DOCS}index-mgmt.html`, kibanaGeneralSettings: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/advanced-options.html#kibana-general-settings`, kibanaSearchSettings: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/advanced-options.html#kibana-search-settings`, - dashboardSettings: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/advanced-options.html#kibana-dashboard-settings`, visualizationSettings: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/advanced-options.html#kibana-visualization-settings`, }, ml: { @@ -259,6 +304,7 @@ export class DocLinksService { skippingDisconnectedClusters: `${ELASTICSEARCH_DOCS}modules-cross-cluster-search.html#skip-unavailable-clusters`, }, apis: { + bulkIndexAlias: `${ELASTICSEARCH_DOCS}indices-aliases.html`, createIndex: `${ELASTICSEARCH_DOCS}indices-create-index.html`, createSnapshotLifecyclePolicy: `${ELASTICSEARCH_DOCS}slm-api-put-policy.html`, createRoleMapping: `${ELASTICSEARCH_DOCS}security-api-put-role-mapping.html`, @@ -275,6 +321,7 @@ export class DocLinksService { painlessExecuteAPIContexts: `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/painless/${DOC_LINK_VERSION}/painless-execute-api.html#_contexts`, putComponentTemplateMetadata: `${ELASTICSEARCH_DOCS}indices-component-template.html#component-templates-metadata`, putEnrichPolicy: `${ELASTICSEARCH_DOCS}put-enrich-policy-api.html`, + putIndexTemplateV1: `${ELASTICSEARCH_DOCS}indices-templates-v1.html`, putSnapshotLifecyclePolicy: `${ELASTICSEARCH_DOCS}slm-api-put-policy.html`, putWatch: `${ELASTICSEARCH_DOCS}watcher-api-put-watch.html`, simulatePipeline: `${ELASTICSEARCH_DOCS}simulate-pipeline-api.html`, @@ -430,6 +477,7 @@ export interface DocLinksStart { readonly top_hits: string; }; readonly runtimeFields: { + readonly overview: string; readonly mapping: string; }; readonly scriptedFields: { @@ -456,9 +504,10 @@ export interface DocLinksStart { }; readonly query: { readonly eql: string; + readonly kueryQuerySyntax: string; readonly luceneQuerySyntax: string; + readonly percolate: string; readonly queryDsl: string; - readonly kueryQuerySyntax: string; }; readonly date: { readonly dateMath: string; @@ -469,6 +518,7 @@ export interface DocLinksStart { readonly transforms: Record; readonly visualize: Record; readonly apis: Readonly<{ + bulkIndexAlias: string; createIndex: string; createSnapshotLifecyclePolicy: string; createRoleMapping: string; @@ -485,6 +535,7 @@ export interface DocLinksStart { painlessExecuteAPIContexts: string; putComponentTemplateMetadata: string; putSnapshotLifecyclePolicy: string; + putIndexTemplateV1: string; putWatch: string; simulatePipeline: string; updateTransform: string; diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index 8327428991e13..3f4de7fccac72 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -571,6 +571,7 @@ export interface DocLinksStart { readonly top_hits: string; }; readonly runtimeFields: { + readonly overview: string; readonly mapping: string; }; readonly scriptedFields: { @@ -597,9 +598,10 @@ export interface DocLinksStart { }; readonly query: { readonly eql: string; + readonly kueryQuerySyntax: string; readonly luceneQuerySyntax: string; + readonly percolate: string; readonly queryDsl: string; - readonly kueryQuerySyntax: string; }; readonly date: { readonly dateMath: string; @@ -610,6 +612,7 @@ export interface DocLinksStart { readonly transforms: Record; readonly visualize: Record; readonly apis: Readonly<{ + bulkIndexAlias: string; createIndex: string; createSnapshotLifecyclePolicy: string; createRoleMapping: string; @@ -626,6 +629,7 @@ export interface DocLinksStart { painlessExecuteAPIContexts: string; putComponentTemplateMetadata: string; putSnapshotLifecyclePolicy: string; + putIndexTemplateV1: string; putWatch: string; simulatePipeline: string; updateTransform: string; diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/main.test.tsx b/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/main.test.tsx index 6b94eccc4e707..dcc39e9fb385a 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/main.test.tsx +++ b/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/main.test.tsx @@ -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: { + elasticsearch: { asyncSearch: `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', () => { diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/documentation.ts b/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/documentation.ts index 19d37891446cf..38db89e88a6e1 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/documentation.ts +++ b/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/documentation.ts @@ -8,16 +8,15 @@ 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`; + const { links } = docs; // TODO: There should be Kibana documentation link about Search Sessions in Kibana - this.docsBasePath = `${docsBase}/elasticsearch/reference/${DOC_LINK_VERSION}`; + this.docUrl = links.elasticsearch.asyncSearch; } public getElasticsearchDocLink() { - return `${this.docsBasePath}/async-search-intro.html`; + return `${this.docUrl}`; } } diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/lib/documentation.ts b/x-pack/plugins/index_management/public/application/components/component_templates/lib/documentation.ts index 5c839262b62ed..185e521e4a5b8 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/lib/documentation.ts +++ b/x-pack/plugins/index_management/public/application/components/component_templates/lib/documentation.ts @@ -7,14 +7,11 @@ import { DocLinksStart } from 'src/core/public'; -// eslint-disable-next-line @typescript-eslint/naming-convention -export const getDocumentation = ({ ELASTIC_WEBSITE_URL, DOC_LINK_VERSION }: DocLinksStart) => { - const docsBase = `${ELASTIC_WEBSITE_URL}guide/en`; - const esDocsBase = `${docsBase}/elasticsearch/reference/${DOC_LINK_VERSION}`; - +export const getDocumentation = ({ links }: DocLinksStart) => { + const esDocsBase = links.elasticsearch.docsBase; return { esDocsBase, - componentTemplates: `${esDocsBase}/indices-component-template.html`, - componentTemplatesMetadata: `${esDocsBase}/indices-component-template.html#component-templates-metadata`, + componentTemplates: links.apis.putComponentTemplate, + componentTemplatesMetadata: links.apis.putComponentTemplateMetadata, }; }; diff --git a/x-pack/plugins/index_management/public/application/services/documentation.ts b/x-pack/plugins/index_management/public/application/services/documentation.ts index c81c71a32e7e2..1678e88fda8de 100644 --- a/x-pack/plugins/index_management/public/application/services/documentation.ts +++ b/x-pack/plugins/index_management/public/application/services/documentation.ts @@ -10,15 +10,98 @@ import { DataType } from '../components/mappings_editor/types'; import { TYPE_DEFINITION } from '../components/mappings_editor/constants'; class DocumentationService { + private dataStreams: string = ''; private esDocsBase: string = ''; - private kibanaDocsBase: string = ''; - + private indexManagement: string = ''; + private indexSettings: string = ''; + private indexTemplates: string = ''; + private indexV1: string = ''; + private mapping: string = ''; + private mappingAnalyzer: string = ''; + private mappingBoost: string = ''; + private mappingCoerce: string = ''; + private mappingCopyTo: string = ''; + private mappingDocValues: string = ''; + private mappingDynamic: string = ''; + private mappingDynamicFields: string = ''; + private mappingDynamicTemplates: string = ''; + private mappingEagerGlobalOrdinals: string = ''; + private mappingEnabled: string = ''; + private mappingFieldData: string = ''; + private mappingFieldDataFilter: string = ''; + private mappingFieldDataTypes: string = ''; + private mappingFieldDataEnable: string = ''; + private mappingFormat: string = ''; + private mappingIgnoreAbove: string = ''; + private mappingIgnoreMalformed: string = ''; + private mappingIndex: string = ''; + private mappingIndexOptions: string = ''; + private mappingIndexPhrases: string = ''; + private mappingIndexPrefixes: string = ''; + private mappingJoinFieldsPerformance: string = ''; + private mappingMeta: string = ''; + private mappingMetaFields: string = ''; + private mappingNormalizer: string = ''; + private mappingNorms: string = ''; + private mappingNullValue: string = ''; + private mappingPositionIncrementGap: string = ''; + private mappingRankFeatureFields: string = ''; + private mappingRouting: string = ''; + private mappingSimilarity: string = ''; + private mappingSourceFields: string = ''; + private mappingSourceFieldsDisable: string = ''; + private mappingStore: string = ''; + private mappingTermVector: string = ''; + private mappingTypesRemoval: string = ''; + private percolate: string = ''; + private runtimeFields: string = ''; public setup(docLinks: DocLinksStart): void { - const { DOC_LINK_VERSION, ELASTIC_WEBSITE_URL } = docLinks; - const docsBase = `${ELASTIC_WEBSITE_URL}guide/en`; - - this.esDocsBase = `${docsBase}/elasticsearch/reference/${DOC_LINK_VERSION}`; - this.kibanaDocsBase = `${docsBase}/kibana/${DOC_LINK_VERSION}`; + const { links } = docLinks; + this.dataStreams = links.elasticsearch.dataStreams; + this.esDocsBase = links.elasticsearch.docsBase; + this.indexManagement = links.management.indexManagement; + this.indexSettings = links.elasticsearch.indexSettings; + this.indexTemplates = links.elasticsearch.indexTemplates; + this.indexV1 = links.apis.putIndexTemplateV1; + this.mapping = links.elasticsearch.mapping; + this.mappingAnalyzer = links.elasticsearch.mappingAnalyzer; + this.mappingBoost = links.elasticsearch.mappingBoost; + this.mappingCoerce = links.elasticsearch.mappingCoerce; + this.mappingCopyTo = links.elasticsearch.mappingCopyTo; + this.mappingDocValues = links.elasticsearch.mappingDocValues; + this.mappingDynamic = links.elasticsearch.mappingDynamic; + this.mappingDynamicFields = links.elasticsearch.mappingDynamicFields; + this.mappingDynamicTemplates = links.elasticsearch.mappingDynamicTemplates; + this.mappingEagerGlobalOrdinals = links.elasticsearch.mappingEagerGlobalOrdinals; + this.mappingEnabled = links.elasticsearch.mappingEnabled; + this.mappingFieldData = links.elasticsearch.mappingFieldData; + this.mappingFieldDataTypes = links.elasticsearch.mappingFieldDataTypes; + this.mappingFieldDataEnable = links.elasticsearch.mappingFieldDataEnable; + this.mappingFieldDataFilter = links.elasticsearch.mappingFieldDataFilter; + this.mappingFormat = links.elasticsearch.mappingFormat; + this.mappingIgnoreAbove = links.elasticsearch.mappingIgnoreAbove; + this.mappingIgnoreMalformed = links.elasticsearch.mappingIgnoreMalformed; + this.mappingIndex = links.elasticsearch.mappingIndex; + this.mappingIndexOptions = links.elasticsearch.mappingIndexOptions; + this.mappingIndexPhrases = links.elasticsearch.mappingIndexPhrases; + this.mappingIndexPrefixes = links.elasticsearch.mappingIndexPrefixes; + this.mappingJoinFieldsPerformance = links.elasticsearch.mappingJoinFieldsPerformance; + this.mappingMeta = links.elasticsearch.mappingMeta; + this.mappingMetaFields = links.elasticsearch.mappingMetaFields; + this.mappingNormalizer = links.elasticsearch.mappingNormalizer; + this.mappingNorms = links.elasticsearch.mappingNorms; + this.mappingNullValue = links.elasticsearch.mappingNullValue; + this.mappingPositionIncrementGap = links.elasticsearch.mappingPositionIncrementGap; + this.mappingRankFeatureFields = links.elasticsearch.mappingRankFeatureFields; + this.mappingRouting = links.elasticsearch.mappingRouting; + this.mappingSimilarity = links.elasticsearch.mappingSimilarity; + this.mappingSourceFields = links.elasticsearch.mappingSourceFields; + this.mappingSourceFieldsDisable = links.elasticsearch.mappingSourceFieldsDisable; + this.mappingStore = links.elasticsearch.mappingStore; + this.mappingTermVector = links.elasticsearch.mappingTermVector; + this.mappingTypesRemoval = links.elasticsearch.mappingTypesRemoval; + this.percolate = links.query.percolate; + this.runtimeFields = links.runtimeFields.overview; } public getEsDocsBase() { @@ -26,29 +109,27 @@ class DocumentationService { } public getSettingsDocumentationLink() { - return `${this.esDocsBase}/index-modules.html#index-modules-settings`; + return this.indexSettings; } public getMappingDocumentationLink() { - return `${this.esDocsBase}/mapping.html`; + return this.mapping; } public getRoutingLink() { - return `${this.esDocsBase}/mapping-routing-field.html`; + return this.mappingRouting; } public getDataStreamsDocumentationLink() { - return `${this.esDocsBase}/data-streams.html`; + return this.dataStreams; } public getTemplatesDocumentationLink(isLegacy = false) { - return isLegacy - ? `${this.esDocsBase}/indices-templates-v1.html` - : `${this.esDocsBase}/indices-templates.html`; + return isLegacy ? this.indexV1 : this.indexTemplates; } public getIdxMgmtDocumentationLink() { - return `${this.kibanaDocsBase}/managing-indices.html`; + return this.indexManagement; } public getTypeDocLink = (type: DataType, docType = 'main'): string | undefined => { @@ -63,157 +144,154 @@ class DocumentationService { } return `${this.esDocsBase}${typeDefinition.documentation[docType]}`; }; - public getMappingTypesLink() { - return `${this.esDocsBase}/mapping-types.html`; + return this.mappingFieldDataTypes; } - public getDynamicMappingLink() { - return `${this.esDocsBase}/dynamic-field-mapping.html`; + return this.mappingDynamicFields; } - public getPercolatorQueryLink() { - return `${this.esDocsBase}/query-dsl-percolate-query.html`; + return this.percolate; } public getRankFeatureQueryLink() { - return `${this.esDocsBase}/rank-feature.html`; + return this.mappingRankFeatureFields; } public getMetaFieldLink() { - return `${this.esDocsBase}/mapping-meta-field.html`; + return this.mappingMetaFields; } public getDynamicTemplatesLink() { - return `${this.esDocsBase}/dynamic-templates.html`; + return this.mappingDynamicTemplates; } public getMappingSourceFieldLink() { - return `${this.esDocsBase}/mapping-source-field.html`; + return this.mappingSourceFields; } public getDisablingMappingSourceFieldLink() { - return `${this.esDocsBase}/mapping-source-field.html#disable-source-field`; + return this.mappingSourceFieldsDisable; } public getNullValueLink() { - return `${this.esDocsBase}/null-value.html`; + return this.mappingNullValue; } public getTermVectorLink() { - return `${this.esDocsBase}/term-vector.html`; + return this.mappingTermVector; } public getStoreLink() { - return `${this.esDocsBase}/mapping-store.html`; + return this.mappingStore; } public getSimilarityLink() { - return `${this.esDocsBase}/similarity.html`; + return this.mappingSimilarity; } public getNormsLink() { - return `${this.esDocsBase}/norms.html`; + return this.mappingNorms; } public getIndexLink() { - return `${this.esDocsBase}/mapping-index.html`; + return this.mappingIndex; } public getIgnoreMalformedLink() { - return `${this.esDocsBase}/ignore-malformed.html`; + return this.mappingIgnoreMalformed; } public getMetaLink() { - return `${this.esDocsBase}/mapping-field-meta.html`; + return this.mappingMeta; } public getFormatLink() { - return `${this.esDocsBase}/mapping-date-format.html`; + return this.mappingFormat; } public getEagerGlobalOrdinalsLink() { - return `${this.esDocsBase}/eager-global-ordinals.html`; + return this.mappingEagerGlobalOrdinals; } public getDocValuesLink() { - return `${this.esDocsBase}/doc-values.html`; + return this.mappingDocValues; } public getCopyToLink() { - return `${this.esDocsBase}/copy-to.html`; + return this.mappingCopyTo; } public getCoerceLink() { - return `${this.esDocsBase}/coerce.html`; + return this.mappingCoerce; } public getBoostLink() { - return `${this.esDocsBase}/mapping-boost.html`; + return this.mappingBoost; } public getNormalizerLink() { - return `${this.esDocsBase}/normalizer.html`; + return this.mappingNormalizer; } public getIgnoreAboveLink() { - return `${this.esDocsBase}/ignore-above.html`; + return this.mappingIgnoreAbove; } public getFielddataLink() { - return `${this.esDocsBase}/fielddata.html`; + return this.mappingFieldData; } public getFielddataFrequencyLink() { - return `${this.esDocsBase}/fielddata.html#field-data-filtering`; + return this.mappingFieldDataFilter; } public getEnablingFielddataLink() { - return `${this.esDocsBase}/fielddata.html#before-enabling-fielddata`; + return this.mappingFieldDataEnable; } public getIndexPhrasesLink() { - return `${this.esDocsBase}/index-phrases.html`; + return this.mappingIndexPhrases; } public getIndexPrefixesLink() { - return `${this.esDocsBase}/index-prefixes.html`; + return this.mappingIndexPrefixes; } public getPositionIncrementGapLink() { - return `${this.esDocsBase}/position-increment-gap.html`; + return this.mappingPositionIncrementGap; } public getAnalyzerLink() { - return `${this.esDocsBase}/analyzer.html`; + return this.mappingAnalyzer; } public getDateFormatLink() { - return `${this.esDocsBase}/mapping-date-format.html`; + return this.mappingFormat; } public getIndexOptionsLink() { - return `${this.esDocsBase}/index-options.html`; + return this.mappingIndexOptions; } public getAlternativeToMappingTypesLink() { - return `${this.esDocsBase}/removal-of-types.html#_alternatives_to_mapping_types`; + return this.mappingTypesRemoval; } public getJoinMultiLevelsPerformanceLink() { - return `${this.esDocsBase}/parent-join.html#_parent_join_and_performance`; + return this.mappingJoinFieldsPerformance; } public getDynamicLink() { - return `${this.esDocsBase}/dynamic.html`; + return this.mappingDynamic; } public getEnabledLink() { - return `${this.esDocsBase}/enabled.html`; + return this.mappingEnabled; } public getRuntimeFields() { - return `${this.esDocsBase}/runtime.html`; + return this.runtimeFields; } public getWellKnownTextLink() {