mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 20:52:34 +08:00

* add column guid to alert rule table and rule_guid to rule version table + populate the new field with UUID * update storage and domain models * patch GUID * ignore GUID in fingerprint tests * get alert rule versions by GUID * update rule delete to reset uid in history instead of deleting rows * add test * Update delete rule to require UserUID, remove all versions and create "delete" version that holds information about who and when deleted the rule * update usages of the delete method * add list deleted rules to store * list api to support deleted query parameter * add list deleted rules to store ^ Conflicts: ^ pkg/services/ngalert/store/alert_rule_test.go * list api to support deleted query parameter * Restore deleted rules * fix recovering manually recording rules * update role control for the trash route * add alertingRuleRecoverDeleted feature toggle enabled by default * fix access control for trash menu item in the navtree * Add alertingRuleRecoverDeleted feature toggle, add Delete permanently alert rule menu option * hide remove permanently functionality in the UI until we have the api available for it * discard wrong changes after merging * Reverted changes in pkg/apis/dashboard_manifest.go after fixing conflicts * Reverted changes in go.work.sum after fixing conflicts * Reverted changes in pkg/apis/dashboard_manifest.go after fixing conflicts * Reverted changes in pkg/services/ngalert/models/alert_rule.go after fixing conflicts * Reverted changes in pkg/apis/dashboard_manifest.go after fixing conflicts * restore delete permanently and add the queryparam for it * update snapshots * fix translations * protect trash route by the feature toggles * use the new rulerRuleType for checks * revert ability to delete permanently and alert rule from the ui * remove unnecessary update after reverting * fix ff * add tracking * use recently deleted instead of trash * create isRecoverDeletedRulesEnabled for checking ffs * address pr feedback 1 * include alert rule uid in getRowId * use RulerGrafanaRulesConfigDTO for deleted rules response * use isLoading in the AlertingPageWrapper * fix wrong check for recording rules type * add test for restoring manually through the alert rule form * add test for restoring deleted rule * use importAlertingComponent * udpate mock * address pr feedback * update translations * address feedback * address feedback 2 * address feedback 3 * address feedback 4 * move transformation of the response to the endpoint * fix typo * refactor grafanaRuleDtoToFormValues * update translations * use guid for identifying rows * prettier * use ONLY the guid for identifying rows * Add provides/invalidates tags for deleted rules --------- Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com> Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>