mirror of
https://github.com/grafana/grafana.git
synced 2026-09-05 04:40:13 -05:00
Folder API: optionally force deleting Grafana 8 alerts when deleting a folder (or error) (#36427)
* Folder API: Add an optional query parameter for allowing deleting a folder containing rules * Update frontend - Set forceDeleteRules=true when frontend deletes a folder - Improve modal text * Update docs * Apply suggestions from code review Co-authored-by: gotjosh <josue@grafana.com> Co-authored-by: Nathan Rodman <nathanrodman@gmail.com> Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
This commit is contained in:
co-authored by
gotjosh
Nathan Rodman
achatterjee-grafana
parent
ced42e9439
commit
b96dd1877c
@@ -66,10 +66,11 @@ export class FolderSettingsPage extends PureComponent<Props, State> {
|
||||
evt.stopPropagation();
|
||||
evt.preventDefault();
|
||||
|
||||
const confirmationText = `Do you want to delete this folder and all its dashboards and alerts?`;
|
||||
appEvents.publish(
|
||||
new ShowConfirmModalEvent({
|
||||
title: 'Delete',
|
||||
text: `Do you want to delete this folder and all its dashboards?`,
|
||||
text: confirmationText,
|
||||
icon: 'trash-alt',
|
||||
yesText: 'Delete',
|
||||
onConfirm: () => {
|
||||
|
||||
@@ -31,7 +31,7 @@ export function saveFolder(folder: FolderState): ThunkResult<void> {
|
||||
|
||||
export function deleteFolder(uid: string): ThunkResult<void> {
|
||||
return async (dispatch) => {
|
||||
await backendSrv.delete(`/api/folders/${uid}`);
|
||||
await backendSrv.delete(`/api/folders/${uid}?forceDeleteRules=true`);
|
||||
locationService.push('/dashboards');
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user