* Split GetDashboarVersions method
* Add sqlstore dialect and tests
* Fix signature of PAtchPreference
* Add GetDialect to sqlstore and remove GetDashboardVersions
* Add GetDialect to db interface
* Implement List
* add deleted test function
* Remove GetDialect from sqlstore interface
* Remove deleted method from mock
* Refactor test
* API: Migrate CSRF to service and support additional options
* minor
* public Csrf service to use in tests
* WIP
* remove fmt
* comment
* WIP
* remove fmt prints
* todo add prefix slash
* remove fmt prints
* linting fix
* remove trimPrefix
Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
Co-authored-by: IevaVasiljeva <ieva.vasiljeva@grafana.com>
This change adds documentation about how the configuration of Grafana
Alerting affects the performance of the Grafana backend, and how to
control the load that Grafana Alerting generates.
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
* update action names
* correctly retrieve teams for signed in user
* remove test
* undo swagger changes
* undo swagger changes pt2
* add migration from old action names to the new ones
* rename from list to read
* linting
* also update alertign actions
* fix migration
* added regex check of labelKeys
- labelKeys should not contain any special characters
- added encoding of labelKeys in the URL
- don't offer autocomplete if label with special characters is detected
* removed additional regex check for labels
The image file upload code as it is now simply doesn't work - it's
missing several important steps in the file upload process. There is
more information in the fixed issue as to the steps required.
After this change, screenshots will still be attached to slack messages
when external image storage is used with Grafana (an S3 bucket, for
example).
Fixes#50056
* add completeable interface
* add basic labels language
* render monaco editor for label field
* align styling in math expression field
* add unit tests
* fix broken test
* remove unused import
* use theme
* remove comment
* pr feedback
* fix broken imports
* improve test
* make it possible to override code editor styles
* use input styles and align border styles
* Alerting: Remove double quotes from matchers
With #38629 a new Alertmanager configuration object was introduced with `object_matchers`, it was meant to circumvent around the fact that Prometheus label names don't support a set of characters that Grafana needs to support for alerts, silences, matchers, etc. (with a common example being elasticsearch's `.`).
This new object does not include the label of sanitzation or validation that its Prometheus equivalent supports in `matchers` and therefore are semantically not equivalent.
This triggered the problem that when the migration is run, we use `matchers` as the object to populate in configuration for routing policies, but when the UI does its first save this object is transformed to `object_matchers`.
Matchers that were previously running just fine would immediately stop working as soon as the configuration is saved.
This problem surfaced with the introduction of #49952 where we stopped stripping double quotes from matchers (not just regex but _all_ of them).
* Add comment explaining rationale and future removal
Co-authored-by: Alex Weaver <weaver.alex.d@gmail.com>
* backend/sqlstore split: remove unused GetDashboardPermissionsForUser from sqlstore
* remove debugging line
* backend/sqlstore: move dashboard permission related functions to dashboard service
* intro docs refactor
* adds content to the index file; incorporates feedback
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Fix alerting opt out relref
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: Chris Moyer <chris.moyer@grafana.com>
* Convert front matter to YAML and add current aliases
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: Chris Moyer <chris.moyer@grafana.com>
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
* update authz to exclude entire group if user does not have access to rule
* change rule update authz to not return changes because if user does not have access to any rule in group, they do not have access to the rule
* a new query that returns alerts in group by UID of alert that belongs to that group
* collect all affected groups during calculate changes
* update authorize to check access to groups
* update tests for calculateChanges to assert new fields
* add authorization tests
* Fix unified secrets backwards compatibility
* Add compatibility fix to AddDataSource function
* Allow updating password on fail to decrypt secrets
* If unified secret is corrupt try migrating
* changed `onBlur` and `onKeyDown` handling
- `onCommitChange` is only called if `onBlur` or `onKeyDown` are not set
* added `runQueryOnEnter` flag to OperationParamDef
* only run query if `runQueryOnEnter` is configured
* changed `evt.type` check to `keydown`