-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into enable-data-view-edit-from-flyout-1
- Loading branch information
Showing
90 changed files
with
1,490 additions
and
442 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
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
53 changes: 53 additions & 0 deletions
53
src/plugins/unified_search/public/filter_bar/filter_editor/close_confirm_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,53 @@ | ||
/* | ||
* 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 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import React, { memo } from 'react'; | ||
import { EuiConfirmModal } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
|
||
interface CloseFilterEditorConfirmModalProps { | ||
onCancel: () => void; | ||
onConfirm: () => void; | ||
} | ||
|
||
const strings = { | ||
getTitle: () => | ||
i18n.translate('unifiedSearch.filter.closeEditorConfirmModal.title', { | ||
defaultMessage: 'Unsaved changes', | ||
}), | ||
getCancelButton: () => | ||
i18n.translate('unifiedSearch.filter.closeEditorConfirmModal.cancelButton', { | ||
defaultMessage: 'Cancel', | ||
}), | ||
getConfirmButton: () => | ||
i18n.translate('unifiedSearch.filter.closeEditorConfirmModal.confirmButton', { | ||
defaultMessage: 'Discard changes', | ||
}), | ||
getWarningLabel: () => | ||
i18n.translate('unifiedSearch.filter.closeEditorConfirmModal.warningLabel', { | ||
defaultMessage: 'If you leave now, your unsaved filters will be lost.', | ||
}), | ||
}; | ||
|
||
export const CloseFilterEditorConfirmModal = memo(function CloseFilterEditorConfirmModal( | ||
props: CloseFilterEditorConfirmModalProps | ||
) { | ||
return ( | ||
<EuiConfirmModal | ||
data-test-subj="close-filter-editor-confirm-modal" | ||
title={strings.getTitle()} | ||
cancelButtonText={strings.getCancelButton()} | ||
confirmButtonText={strings.getConfirmButton()} | ||
buttonColor="danger" | ||
defaultFocusedButton="confirm" | ||
{...props} | ||
> | ||
<p>{strings.getWarningLabel()}</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
Oops, something went wrong.