Skip to content

Commit

Permalink
Fix type and i18n issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jloleysens committed Oct 16, 2020
1 parent 7f48a65 commit e5665d0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Phases } from '../../../../../../../common/types';

import { UseField, ToggleField, NumericField, useFormData } from '../../../../../../shared_imports';

import { schema } from '../../../form_schema';
import { i18nTexts } from '../../../i18n_texts';

import { LearnMoreLink } from '../../';

Expand Down Expand Up @@ -55,7 +55,7 @@ export const Forcemerge: React.FunctionComponent<Props> = ({ phase }) => {
componentProps={{
euiFieldProps: {
'data-test-subj': `${phase}-forceMergeSwitch`,
'aria-label': schema._meta.hot.forceMergeEnabled.label,
'aria-label': i18nTexts.editPolicy.forceMergeEnabledFieldLabel,
'aria-controls': 'forcemergeContent',
},
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const PolicyJsonFlyout: React.FunctionComponent<Props> = ({
iconType="alert"
color="danger"
title={i18n.translate(
'xpack.indexLifecycleMgmt.policyJsonFlyout.validationErrorCallout.body',
'xpack.indexLifecycleMgmt.policyJsonFlyout.validationErrorCallout.title',
{ defaultMessage: 'Invalid policy' }
)}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { defaultSetPriority } from '../../constants';

import { FormInternal } from './types';
import { ifExistsNumberGreaterThanZero, rolloverThresholdsValidator } from './form_validations';
import { i18nTexts } from './i18n_texts';

const { emptyField } = fieldValidators;

Expand All @@ -30,9 +31,7 @@ export const schema: FormSchema<FormInternal> = {
defaultValue: 'd',
},
forceMergeEnabled: {
label: i18n.translate('xpack.indexLifecycleMgmt.forcemerge.enableLabel', {
defaultMessage: 'Force merge data',
}),
label: i18nTexts.editPolicy.forceMergeEnabledFieldLabel,
},
bestCompression: {
label: i18n.translate('xpack.indexLifecycleMgmt.forcemerge.bestCompressionLabel', {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import { i18n } from '@kbn/i18n';

export const i18nTexts = {
editPolicy: {
forceMergeEnabledFieldLabel: i18n.translate('xpack.indexLifecycleMgmt.forcemerge.enableLabel', {
defaultMessage: 'Force merge data',
}),
},
};

0 comments on commit e5665d0

Please sign in to comment.