mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
(cherry picked from commit b378c064c8
)
Co-authored-by: Dima Arnautov <dmitrii.arnautov@elastic.co>
This commit is contained in:
parent
e9fe4ad5f3
commit
5de1d7117d
1 changed files with 8 additions and 0 deletions
|
@ -78,6 +78,8 @@ interface State {
|
|||
}
|
||||
|
||||
export class AnnotationFlyoutUI extends Component<CommonProps & Props> {
|
||||
private deletionInProgress = false;
|
||||
|
||||
public state: State = {
|
||||
isDeleteModalVisible: false,
|
||||
applyAnnotationToSeries: true,
|
||||
|
@ -121,6 +123,8 @@ export class AnnotationFlyoutUI extends Component<CommonProps & Props> {
|
|||
};
|
||||
|
||||
public deleteHandler = async () => {
|
||||
if (this.deletionInProgress) return;
|
||||
|
||||
const { annotationState } = this.state;
|
||||
const toastNotifications = getToastNotifications();
|
||||
|
||||
|
@ -128,6 +132,8 @@ export class AnnotationFlyoutUI extends Component<CommonProps & Props> {
|
|||
return;
|
||||
}
|
||||
|
||||
this.deletionInProgress = true;
|
||||
|
||||
try {
|
||||
await ml.annotations.deleteAnnotation(annotationState._id);
|
||||
toastNotifications.addSuccess(
|
||||
|
@ -154,6 +160,8 @@ export class AnnotationFlyoutUI extends Component<CommonProps & Props> {
|
|||
|
||||
this.closeDeleteModal();
|
||||
|
||||
this.deletionInProgress = false;
|
||||
|
||||
const { annotationUpdatesService } = this.props;
|
||||
|
||||
annotationUpdatesService.setValue(null);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue