Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use documentation link service in index lifecycle management #118623

Merged
merged 1 commit into from
Nov 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}`;