diff --git a/public/app/features/explore/RichHistory/RichHistory.tsx b/public/app/features/explore/RichHistory/RichHistory.tsx index 0c9e1a13859..3025c115f09 100644 --- a/public/app/features/explore/RichHistory/RichHistory.tsx +++ b/public/app/features/explore/RichHistory/RichHistory.tsx @@ -88,7 +88,7 @@ class UnThemedRichHistory extends PureComponent { - updateRichHistory(query.ts, 'delete'); - appEvents.emit(AppEvents.alertSuccess, ['Query deleted']); + // For starred queries, we want confirmation. For non-starred, we don't. + if (query.starred) { + appEvents.emit(CoreEvents.showConfirmModal, { + title: 'Delete', + text: 'Are you sure you want to permanently delete your starred query?', + yesText: 'Delete', + icon: 'trash-alt', + onConfirm: () => { + updateRichHistory(query.ts, 'delete'); + appEvents.emit(AppEvents.alertSuccess, ['Query deleted']); + }, + }); + } else { + updateRichHistory(query.ts, 'delete'); + appEvents.emit(AppEvents.alertSuccess, ['Query deleted']); + } }; const onStarrQuery = () => {