Skip to content

Commit

Permalink
Use documentation link service in index lifecycle management (#118623)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl authored and dmlemeshko committed Nov 29, 2021
1 parent abc2614 commit d357744
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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}`;

0 comments on commit d357744

Please sign in to comment.