Skip to content

Commit

Permalink
updating confirm modal text
Browse files Browse the repository at this point in the history
  • Loading branch information
jgowdyelastic committed Jan 9, 2023
1 parent 8aa5eff commit 87e0129
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 165 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React, { Fragment } from 'react';

import { EUI_MODAL_CONFIRM_BUTTON, EuiConfirmModal } from '@elastic/eui';

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

interface Props {
cancelAction: () => void;
Expand All @@ -27,26 +27,26 @@ export const DeleteAnnotationModal: React.FC<Props> = ({
<Fragment>
{isVisible === true && (
<EuiConfirmModal
title={
<FormattedMessage
id="xpack.ml.timeSeriesExplorer.deleteAnnotationModal.deleteAnnotationTitle"
defaultMessage="Delete this annotation?"
/>
}
title={i18n.translate(
'xpack.ml.timeSeriesExplorer.deleteAnnotationModal.deleteAnnotationTitle',
{
defaultMessage: 'Delete this annotation?',
}
)}
onCancel={cancelAction}
onConfirm={deleteAction}
cancelButtonText={
<FormattedMessage
id="xpack.ml.timeSeriesExplorer.deleteAnnotationModal.cancelButtonLabel"
defaultMessage="Cancel"
/>
}
confirmButtonText={
<FormattedMessage
id="xpack.ml.timeSeriesExplorer.deleteAnnotationModal.deleteButtonLabel"
defaultMessage="Delete"
/>
}
cancelButtonText={i18n.translate(
'xpack.ml.timeSeriesExplorer.deleteAnnotationModal.cancelButtonLabel',
{
defaultMessage: 'Cancel',
}
)}
confirmButtonText={i18n.translate(
'xpack.ml.timeSeriesExplorer.deleteAnnotationModal.deleteButtonLabel',
{
defaultMessage: 'Delete',
}
)}
buttonColor="danger"
defaultFocusedButton={EUI_MODAL_CONFIRM_BUTTON}
className="eui-textBreakWord"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { i18n } from '@kbn/i18n';

import { EuiConfirmModal, EuiLink, EUI_MODAL_CONFIRM_BUTTON } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
Expand Down Expand Up @@ -44,27 +45,20 @@ export class DeleteRuleModal extends Component {
if (this.state.isModalVisible) {
modal = (
<EuiConfirmModal
title={
<FormattedMessage
id="xpack.ml.ruleEditor.deleteRuleModal.deleteRuleTitle"
defaultMessage="Delete rule?"
/>
}
title={i18n.translate('xpack.ml.ruleEditor.deleteRuleModal.deleteRuleTitle', {
defaultMessage: 'Delete rule?',
})}
onCancel={this.closeModal}
onConfirm={this.deleteRule}
buttonColor="danger"
cancelButtonText={
<FormattedMessage
id="xpack.ml.ruleEditor.deleteRuleModal.cancelButtonLabel"
defaultMessage="Cancel"
/>
}
confirmButtonText={
<FormattedMessage
id="xpack.ml.ruleEditor.deleteRuleModal.deleteButtonLabel"
defaultMessage="Delete"
/>
}
cancelButtonText={i18n.translate(
'xpack.ml.ruleEditor.deleteRuleModal.cancelButtonLabel',
{ defaultMessage: 'Cancel' }
)}
confirmButtonText={i18n.translate(
'xpack.ml.ruleEditor.deleteRuleModal.deleteButtonLabel',
{ defaultMessage: 'Delete' }
)}
defaultFocusedButton={EUI_MODAL_CONFIRM_BUTTON}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,26 +475,19 @@ export class EditJobFlyoutUI extends Component {
if (this.state.isConfirmationModalVisible) {
confirmationModal = (
<EuiConfirmModal
title={
<FormattedMessage
id="xpack.ml.jobsList.editJobFlyout.unsavedChangesDialogTitle"
defaultMessage="Save changes before leaving?"
/>
}
title={i18n.translate('xpack.ml.jobsList.editJobFlyout.unsavedChangesDialogTitle', {
defaultMessage: 'Save changes before leaving?',
})}
onCancel={() => this.closeFlyout(true)}
onConfirm={() => this.save()}
cancelButtonText={
<FormattedMessage
id="xpack.ml.jobsList.editJobFlyout.leaveAnywayButtonLabel"
defaultMessage="Leave anyway"
/>
}
confirmButtonText={
<FormattedMessage
id="xpack.ml.jobsList.editJobFlyout.saveChangesButtonLabel"
defaultMessage="Save changes"
/>
}
cancelButtonText={i18n.translate(
'xpack.ml.jobsList.editJobFlyout.leaveAnywayButtonLabel',
{ defaultMessage: 'Leave anyway' }
)}
confirmButtonText={i18n.translate(
'xpack.ml.jobsList.editJobFlyout.saveChangesButtonLabel',
{ defaultMessage: 'Save changes' }
)}
defaultFocusedButton="confirm"
>
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { ml } from '../../../services/ml_api_service';
import { mlNodesAvailable } from '../../../ml_nodes_check/check_ml_nodes';
import { deleteCalendars } from './delete_calendars';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { withKibana } from '@kbn/kibana-react-plugin/public';
import { getDocLinks } from '../../../util/dependency_cache';
import { HelpMenu } from '../../../components/help_menu';
Expand Down Expand Up @@ -105,30 +104,27 @@ export class CalendarsListUI extends Component {
destroyModal = (
<EuiConfirmModal
data-test-subj={'mlCalendarDeleteConfirmation'}
title={
<FormattedMessage
id="xpack.ml.calendarsList.deleteCalendarsModal.deleteMultipleCalendarsTitle"
defaultMessage="Delete {calendarsCount, plural, one {{calendarsList}} other {# calendars}}?"
values={{
title={i18n.translate(
'xpack.ml.calendarsList.deleteCalendarsModal.deleteMultipleCalendarsTitle',
{
defaultMessage:
'Delete {calendarsCount, plural, one {{calendarsList}} other {# calendars}}?',
values: {
calendarsCount: selectedForDeletion.length,
calendarsList: selectedForDeletion.map((c) => c.calendar_id).join(', '),
}}
/>
}
},
}
)}
onCancel={this.closeDestroyModal}
onConfirm={this.deleteCalendars}
cancelButtonText={
<FormattedMessage
id="xpack.ml.calendarsList.deleteCalendarsModal.cancelButtonLabel"
defaultMessage="Cancel"
/>
}
confirmButtonText={
<FormattedMessage
id="xpack.ml.calendarsList.deleteCalendarsModal.deleteButtonLabel"
defaultMessage="Delete"
/>
}
cancelButtonText={i18n.translate(
'xpack.ml.calendarsList.deleteCalendarsModal.cancelButtonLabel',
{ defaultMessage: 'Cancel' }
)}
confirmButtonText={i18n.translate(
'xpack.ml.calendarsList.deleteCalendarsModal.deleteButtonLabel',
{ defaultMessage: 'Delete' }
)}
buttonColor="danger"
defaultFocusedButton={EUI_MODAL_CONFIRM_BUTTON}
/>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import { i18n } from '@kbn/i18n';

import { EuiButton, EuiConfirmModal, EUI_MODAL_CONFIRM_BUTTON } from '@elastic/eui';

Expand Down Expand Up @@ -56,34 +57,27 @@ export class DeleteFilterListModal extends Component {
let modal;

if (this.state.isModalVisible) {
const title = (
<FormattedMessage
id="xpack.ml.settings.filterLists.deleteFilterListModal.modalTitle"
defaultMessage="Delete {selectedFilterListsLength, plural, one {{selectedFilterId}} other {# filter lists}}?"
values={{
selectedFilterListsLength: selectedFilterLists.length,
selectedFilterId: !!selectedFilterLists.length && selectedFilterLists[0].filter_id,
}}
/>
);
modal = (
<EuiConfirmModal
title={title}
title={i18n.translate('xpack.ml.settings.filterLists.deleteFilterListModal.modalTitle', {
defaultMessage:
'Delete {selectedFilterListsLength, plural, one {{selectedFilterId}} other {# filter lists}}?',
values: {
selectedFilterListsLength: selectedFilterLists.length,
selectedFilterId: !!selectedFilterLists.length && selectedFilterLists[0].filter_id,
},
})}
className="eui-textBreakWord"
onCancel={this.closeModal}
onConfirm={this.onConfirmDelete}
cancelButtonText={
<FormattedMessage
id="xpack.ml.settings.filterLists.deleteFilterListModal.cancelButtonLabel"
defaultMessage="Cancel"
/>
}
confirmButtonText={
<FormattedMessage
id="xpack.ml.settings.filterLists.deleteFilterListModal.confirmButtonLabel"
defaultMessage="Delete"
/>
}
cancelButtonText={i18n.translate(
'xpack.ml.settings.filterLists.deleteFilterListModal.cancelButtonLabel',
{ defaultMessage: 'Cancel' }
)}
confirmButtonText={i18n.translate(
'xpack.ml.settings.filterLists.deleteFilterListModal.confirmButtonLabel',
{ defaultMessage: 'Delete' }
)}
buttonColor="danger"
defaultFocusedButton={EUI_MODAL_CONFIRM_BUTTON}
data-test-subj={'mlFilterListDeleteConfirmation'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import React, { FC } from 'react';
import { EuiConfirmModal } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { i18n } from '@kbn/i18n';
import type { OverlayStart, ThemeServiceStart } from '@kbn/core/public';
import { toMountPoint, wrapWithTheme } from '@kbn/kibana-react-plugin/public';
import type { ModelItem } from './models_list';
Expand All @@ -25,27 +26,20 @@ export const ForceStopModelConfirmDialog: FC<ForceStopModelConfirmDialogProps> =
}) => {
return (
<EuiConfirmModal
title={
<FormattedMessage
id="xpack.ml.trainedModels.modelsList.forceStopDialog.title"
defaultMessage="Stop model {modelId}?"
values={{ modelId: model.model_id }}
/>
}
title={i18n.translate('xpack.ml.trainedModels.modelsList.forceStopDialog.title', {
defaultMessage: 'Stop model {modelId}?',
values: { modelId: model.model_id },
})}
onCancel={onCancel}
onConfirm={onConfirm}
cancelButtonText={
<FormattedMessage
id="xpack.ml.trainedModels.modelsList.forceStopDialog.cancelText"
defaultMessage="Cancel"
/>
}
confirmButtonText={
<FormattedMessage
id="xpack.ml.trainedModels.modelsList.forceStopDialog.confirmText"
defaultMessage="Stop"
/>
}
cancelButtonText={i18n.translate(
'xpack.ml.trainedModels.modelsList.forceStopDialog.cancelText',
{ defaultMessage: 'Cancel' }
)}
confirmButtonText={i18n.translate(
'xpack.ml.trainedModels.modelsList.forceStopDialog.confirmText',
{ defaultMessage: 'Stop' }
)}
buttonColor="danger"
>
<FormattedMessage
Expand Down

0 comments on commit 87e0129

Please sign in to comment.