|
|
|
|
@ -2,7 +2,7 @@ import { css } from '@emotion/css'; |
|
|
|
|
import { connect, ConnectedProps } from 'react-redux'; |
|
|
|
|
import useAsyncFn from 'react-use/lib/useAsyncFn'; |
|
|
|
|
|
|
|
|
|
import { locationService } from '@grafana/runtime'; |
|
|
|
|
import { locationService, config, reportInteraction } from '@grafana/runtime'; |
|
|
|
|
import { Modal, ConfirmModal, Button, Text, Space, TextLink } from '@grafana/ui'; |
|
|
|
|
import { DashboardModel } from 'app/features/dashboard/state'; |
|
|
|
|
import { cleanUpDashboardAndVariables } from 'app/features/dashboard/state/actions'; |
|
|
|
|
@ -27,6 +27,13 @@ const DeleteDashboardModalUnconnected = ({ hideModal, cleanUpDashboardAndVariabl |
|
|
|
|
const isProvisioned = dashboard.meta.provisioned; |
|
|
|
|
|
|
|
|
|
const [, onConfirm] = useAsyncFn(async () => { |
|
|
|
|
reportInteraction('grafana_manage_dashboards_delete_clicked', { |
|
|
|
|
item_counts: { |
|
|
|
|
dashboard: 1, |
|
|
|
|
}, |
|
|
|
|
source: 'dashboard_settings', |
|
|
|
|
restore_enabled: config.featureToggles.dashboardRestoreUI, |
|
|
|
|
}); |
|
|
|
|
await deleteDashboard(dashboard.uid, true); |
|
|
|
|
cleanUpDashboardAndVariables(); |
|
|
|
|
hideModal(); |
|
|
|
|
|