-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] Fix runtime mapping texts to runtime fields, add transform switc…
…h modal (#97008)
- Loading branch information
Showing
25 changed files
with
280 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...ata_frame_analytics/pages/analytics_creation/components/runtime_mappings/switch_modal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React, { FC } from 'react'; | ||
import { EuiConfirmModal } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
|
||
interface Props { | ||
onCancel: () => void; | ||
onConfirm: () => void; | ||
} | ||
|
||
const modalTitle = i18n.translate( | ||
'xpack.ml.dataframe.analytics.createWizard.runtimeEditorSwitchModalTitle', | ||
{ | ||
defaultMessage: 'Edits will be lost', | ||
} | ||
); | ||
|
||
const cancelButtonText = i18n.translate( | ||
'xpack.ml.dataframe.analytics.createWizard.runtimeEditorSwitchModalCancelButtonText', | ||
{ | ||
defaultMessage: 'Cancel', | ||
} | ||
); | ||
|
||
const applyChangesText = i18n.translate( | ||
'xpack.ml.dataframe.analytics.createWizard.runtimeEditorSwitchModalConfirmButtonText', | ||
{ | ||
defaultMessage: 'Close editor', | ||
} | ||
); | ||
const modalMessage = i18n.translate( | ||
'xpack.ml.dataframe.analytics.createWizard.runtimeEditorSwitchModalBodyText', | ||
{ | ||
defaultMessage: `The changes in the editor haven't been applied yet. By closing the editor you will lose your edits.`, | ||
} | ||
); | ||
|
||
export const SwitchModal: FC<Props> = ({ onCancel, onConfirm }) => ( | ||
<EuiConfirmModal | ||
title={modalTitle} | ||
onCancel={onCancel} | ||
onConfirm={onConfirm} | ||
cancelButtonText={cancelButtonText} | ||
confirmButtonText={applyChangesText} | ||
buttonColor="danger" | ||
defaultFocusedButton="confirm" | ||
> | ||
<p>{modalMessage}</p> | ||
</EuiConfirmModal> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.