Use documentation link service in index lifecycle management (#118623) (#118896)

This commit is contained in:
Lisa Cawley 2021-11-17 09:32:58 -08:00 committed by GitHub
parent 9783dcc255
commit 9d2a3accaf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View file

@ -9,21 +9,26 @@ import React from 'react';
import { EuiLink } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { DocLinksStart } from 'src/core/public';
import { getNodeAllocationMigrationLink } from '../../../../../../../services/documentation';
export interface Props {
docLinks: DocLinksStart;
}
export const noCustomAttributesTitle = i18n.translate(
'xpack.indexLifecycleMgmt.editPolicy.noCustomAttributesTitle',
{ defaultMessage: 'No custom attributes defined' }
);
export const nodeAllocationMigrationGuidance = (
export const nodeAllocationMigrationGuidance = ({ docLinks }: Props) => (
<FormattedMessage
id="xpack.indexLifecycleMgmt.editPolicy.defaultToDataNodesDescription"
defaultMessage="To allocate data to particular data nodes, {roleBasedGuidance} or configure custom node attributes in elasticsearch.yml."
values={{
roleBasedGuidance: (
<EuiLink href={getNodeAllocationMigrationLink()} target="_blank" external={true}>
<EuiLink href={getNodeAllocationMigrationLink(docLinks)} target="_blank" external={true}>
{i18n.translate(
'xpack.indexLifecycleMgmt.editPolicy.defaultToDataNodesDescription.migrationGuidanceMessage',
{

View file

@ -11,6 +11,8 @@
* in future. The pattern in this file is legacy and should be updated to conform to the plugin lifecycle.
*/
import { DocLinksStart } from 'src/core/public';
export let skippingDisconnectedClustersUrl: string;
export let remoteClustersUrl: string;
export let transportPortUrl: string;
@ -22,5 +24,5 @@ export function init(esDocBasePath: string): void {
}
export const createDocLink = (docPath: string): string => `${_esDocBasePath}${docPath}`;
export const getNodeAllocationMigrationLink = () =>
`${_esDocBasePath}migrate-index-allocation-filters.html`;
export const getNodeAllocationMigrationLink = ({ links }: DocLinksStart) =>
`${links.elasticsearch.migrateIndexAllocationFilters}`;