* 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>
* Add tests for combination of switch
* refactor test
* use alerting option for default datasource in RuleEditor Grafana rules test
* add test for grafana recording rules
* use enum for grafana steps in tests
* dont make each test dependent on previous localstorage
* add test for local storage
* update eslint, tsconfig + esbuild to handle new jsx transform
* remove thing that breaks the new jsx transform
* remove react imports
* adjust grafana-icons build
* is this the correct syntax?
* try this
* well this was much easier than expected...
* change grafana-plugin-configs webpack config
* fixes
* fix lockfile
* fix 2 more violations
* use path.resolve instead of require.resolve
* remove react import
* fix react imports
* more fixes
* remove React import
* remove import React from docs
* remove another react import
* remove advancedDataSourcePicker feature toggle from DataSourcePickerWithPrompt
* remove advancedDataSourcePicker toggle from DataSourcePicker and adjust tests that relied on old picker
* adjust failing tests in QueryVariableEditorForm
* move DataSourceDropdown to DataSourcePicker file
* covert style declaration syntax to object style in DataSourcePicker
* remove advancedDataSourcePicker feature flag from registry
* remove .only from test
* adjust QueryVariableEditor test to avoid console.error
* Add smart type selection when creating a new alert rule
* Auto switch when switch button has not been clicked yet
* remove unnecessay code after the last refacgtor
* Refactor
* Remove unneeded prop
* Move SmartAlertTypeDetector to its own file
* Fix tests
* Refactor: new useSetExpressionAndDataSource hook
* Fix expressions not been propagated when switching from one type to another
* Change texts
* Update tests
* Update text in switch button
* Update texts and tests
* Refactor: move code to getCanSwitch new method
* Move smart alert after queries and remove auto-switch
* Remove expressions and restore them when switching between grafana and cloud type
* Rename previous expression state
* Fix tests
* Add data source name for data source-managed alert selection
* Update reducer when changing cloud data source
* PR review suggestions
* PR review suggestions 2nd part
* PR review suggestions 3th part
* Fix canSwitch
* Update texts on smart alert
---------
Co-authored-by: Virginia Cepeda <virginia.cepeda@grafana.com>
* Add component for rule creation and dropdown
* Make each route type have a different path
* Remove unneeded import
* Fix tests
* Rename CreateRuleButton to MoreActionRuleButtons
* Remove Recording Rule option from new rule form
* Use alerting and recording for path params on new rules
* Fix tests
* Only show new button if permissions are granted
* Fix tests
* Fix action buttons label and placement in several views following standard and being consistent with the rest of the ui
* Update public/app/features/alerting/unified/components/mute-timings/MuteTimingForm.tsx
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
* Fix secondary buttons to not have outline
---------
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
* Keybindings: No global keybindings on chromeless pages
* simplify condition
* Refactoring
* Align name and file
* Move logic into AppChrome
* minor fix
* Update Page.tsx
* Fixing test
* Fixed tests
* More fixes
* Fixed more tests
* Fixing final test
* Fixed search in old nav
* Fix RuleEditor flaky test for existing grafana managed alert
* Fix RuleEditor flaky test for creating a new grafana managed alert
* Fix tests for cloud rules
* Split tests for different rule types
* Move common clickSelectOption method to helpers
* Remove from RuleEditorCloudRules.test.tsx a repeated cloud rule test
* Move existing grafana rule test case to a new file
* Split RuleEditorCloudRules test: move checking only allowed data sources test case to a new test file
* Re-use common ui const
* Re-use renderRuleEditor method
* Create getDiscoverFeaturesMock to reduce code