Skip to content

Commit

Permalink
[Transform] Show destination index mapping warning for the latest tra…
Browse files Browse the repository at this point in the history
…nsform (#87858) (#87999)

* [Transform] show callout for the latest transform

* [Transform] fix flex styles

* [Transform] change to vertical layout, update warning message

* [Transform] fix messages
  • Loading branch information
darnautov authored Jan 12, 2021
1 parent e2bf7f2 commit 0a441fc
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ export const StepDefineSummary: FC<Props> = ({
}
)}
dataTestSubj="transformPivotPreview"
title={i18n.translate('xpack.transform.pivotPreview.PivotPreviewTitle', {
defaultMessage: 'Transform pivot preview',
title={i18n.translate('xpack.transform.pivotPreview.transformPreviewTitle', {
defaultMessage: 'Transform preview',
})}
toastNotifications={toastNotifications}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import React, { Fragment, FC, useEffect, useState } from 'react';

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

import {
EuiAccordion,
Expand All @@ -17,6 +18,7 @@ import {
EuiFormRow,
EuiSelect,
EuiSpacer,
EuiCallOut,
} from '@elastic/eui';

import { KBN_FIELD_TYPES } from '../../../../../../../../../src/plugins/data/common';
Expand Down Expand Up @@ -50,6 +52,7 @@ import {
transformSettingsMaxPageSearchSizeValidator,
} from '../../../../common/validators';
import { StepDefineExposedState } from '../step_define/common';
import { TRANSFORM_FUNCTION } from '../../../../../../common/constants';

export interface StepDetailsExposedState {
continuousModeDateField: string;
Expand Down Expand Up @@ -397,6 +400,7 @@ export const StepDetailsForm: FC<Props> = React.memo(
data-test-subj="transformDescriptionInput"
/>
</EuiFormRow>

<EuiFormRow
label={i18n.translate('xpack.transform.stepDetailsForm.destinationIndexLabel', {
defaultMessage: 'Destination index',
Expand Down Expand Up @@ -443,6 +447,30 @@ export const StepDetailsForm: FC<Props> = React.memo(
/>
</EuiFormRow>

{stepDefineState.transformFunction === TRANSFORM_FUNCTION.LATEST ? (
<>
<EuiSpacer size={'m'} />
<EuiCallOut color="warning" iconType="alert" size="m">
<p>
<FormattedMessage
id="xpack.transform.stepDetailsForm.destinationIndexWarning"
defaultMessage="Before you start the transform, use index templates or the {docsLink} to ensure the mappings for your destination index match the source index. Otherwise, the destination index is created with dynamic mappings. If the transform fails, check the messages tab on the Stack Management page for errors."
values={{
docsLink: (
<EuiLink href={esIndicesCreateIndex} target="_blank">
{i18n.translate('xpack.transform.stepDetailsForm.createIndexAPI', {
defaultMessage: 'Create index API',
})}
</EuiLink>
),
}}
/>
</p>
</EuiCallOut>
<EuiSpacer size={'m'} />
</>
) : null}

<EuiFormRow
isInvalid={createIndexPattern && indexPatternTitleExists}
error={
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -21342,7 +21342,6 @@
"xpack.transform.pivotPreview.copyClipboardTooltip": "ピボットプレビューの開発コンソールステートメントをクリップボードにコピーします。",
"xpack.transform.pivotPreview.PivotPreviewIncompleteConfigCalloutBody": "group-by フィールドと集約を 1 つ以上選んでください。",
"xpack.transform.pivotPreview.PivotPreviewNoDataCalloutBody": "プレビューリクエストはデータを返しませんでした。オプションのクエリがデータを返し、グループ分け基準により使用されるフィールドと集約フィールドに値が存在することを確認してください。",
"xpack.transform.pivotPreview.PivotPreviewTitle": "ピボットプレビューを変換",
"xpack.transform.progress": "進捗",
"xpack.transform.statsBar.batchTransformsLabel": "一斉",
"xpack.transform.statsBar.continuousTransformsLabel": "連続",
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -21391,7 +21391,6 @@
"xpack.transform.pivotPreview.copyClipboardTooltip": "将透视预览的开发控制台语句复制到剪贴板。",
"xpack.transform.pivotPreview.PivotPreviewIncompleteConfigCalloutBody": "请至少选择一个分组依据字段和聚合。",
"xpack.transform.pivotPreview.PivotPreviewNoDataCalloutBody": "预览请求未返回任何数据。请确保可选查询返回数据且存在分组依据和聚合字段使用的字段的值。",
"xpack.transform.pivotPreview.PivotPreviewTitle": "转换数据透视表预览",
"xpack.transform.progress": "进度",
"xpack.transform.statsBar.batchTransformsLabel": "批量",
"xpack.transform.statsBar.continuousTransformsLabel": "连续",
Expand Down

0 comments on commit 0a441fc

Please sign in to comment.