* feat(loki-monaco-editor): update tests
* chore(loki): use unified datasource mock function in tests
* chore: enable monaco feature flag in tests
* feat(loki-monaco-editor): add test case for disabled feature
* feat(loki-monaco-editor): enable by default
* Revert "feat(loki-monaco-editor): enable by default"
This reverts commit 08904f94a707a4fa32aa1e7f3f0de377575a7636.
* feat(loki-monaco-editor): enable from registry
* feat(loki-monaco-editor): make feature flag frontend only
* chore: refactor CountDashboardsInFolder to use the more efficient Count() sql function
* feat(nested folders): Add CountAlertRulesInFolder to ngalert store
This commit adds CountAlertRulesInFolder and a new model for the CountAlertRulesQuery. It returns a count of alert rules associated with a given orgID and parent folder UID. (the namespace referenced inside alert rules is the parent folder).
I'm not sure where this belongs in the ngalert service, so that will come in a future commit.
* Folder: Add folder service implementation
* Add Move
* Add tests
* Add new servie method and adjust Update, Delete and Move
* Remove contains
* GetTree return children of depth one
* delete all stale states in one lock
* do not use touched states to detect stale rely only on LastEvaluationTime maintained correctly
* fix tests to use correct eval time
* delete unused method
* chore: fix go lint issues
* feat(Routing): route standalone plugin pages to the `AppRoutePage`
* feat(plugin.json): introduce a new field called `isCorePage` for `includes`
* chore: add explanatory comments for types
* refactor(AppRootPage): receive the `pluginId` and `pluginSection` through the props
Now we are able to receive these as props as the pluginId is defined on navLinks
that are registered by plugins.
* chore: update teests for AppRootPage
* fix: remove rebase issue
* tests(applinks): add a test for checking isCorePage plugin page setting
* refactor(applinks): update tests to use FindById() and be more resilient to changes
* fix: Go lint issues
* refactor(routes): use cleaner types when working with plugin nav nodes
Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
* chore: fix linting issues
* t: remove `isCorePage` field from includes
Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
* Reduce piecemeal state fields
* Read data directly off state instead of rule
* Unify state and context into single struct
* Expose contextual information to layer above setNextState
* Work in terms of ContextualState and call historian in batches
* Call annotations service in batches
* Export format state and reason and remove workaround in unrelated test package
* Add new method to annotation service for batch inserting
* Fix loop variable aliasing bug caught by linter, didn't change behavior
* Incl timerange on annotation tests
* Insert one at a time if tags are present
* Point to rule from ContextualState rather than copy fields
* Build annotations and copy data prior to starting goroutine
* Rename to StateTransition
* Use new bulk-insert utility
* Remove rule from StateTransition and pass in directly to historian
* Simplify annotations logic since we have only one rule
* Fix logs and context, nilcheck, simplify method name
* Regenerate mock
* clean up and document integration test convention
* clarify integration test conventions
* clean up integration tests that don't follow convention
* mark testIntegration* functions as helpers to avoid confusion
* add: IsServiceAccount to SignedInUser and IsRealUser
* fix: linting error
* refactor: add function IsServiceAccountUser()
By adding the function IsServiceAccountUser() we use it to identify for
ServiceAccounts in the HasUniqueID() since caching is built up on having
a uniqueID, see comment: https://github.com/grafana/grafana/pull/58015#discussion_r1011361880
* feat(Navigation): add `pluginId` to NavLink and override sibling navlinks with the same URL
* test replacing page from plugin
* chore: fix go lint issues
* fix(NavLink): change `PluginId` to `PluginID`
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
* fix(NavLink): make the `PluginId` -> `PluginID` change everywhere
* chore(navModel.ts): update explanatory comment for `pluginId`
Co-authored-by: Miklós Tolnai <miklos.tolnai@grafana.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
This PR splits the create and update paths for public dashboards and includes assorted refactors toward a proper REST API. Additionally, we removed the concept of a "public dashboard config" in favor of "public dashboard"
Co-authored-by: juanicabanas <juan.cabanas@grafana.com>
Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
* Chore: Update grafana-plugin-sdk-go to v0.142.0
* Update tests and golden files for 207 status code
* Chore: Move update flag definition at the top in response_parser_test.go
* retrigger
Co-authored-by: Will Browne <will.browne@grafana.com>
* Add configuration options for `renderKey` lifetime
* Rename config key to `render_key_lifetime`
* Update conf/defaults.ini
Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com>
* Add `render_key_lifetime` to sample.ini
Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com>
* add: added a repeat migration w. fixed checks for permissions
* add: migration to migrations
* refactor: fix migration instead of making a new one
* fix: removed the old id
* fix: keep old name but change id
* add: migration for patched previous migration
* add: migration from missing file
* user essentials mob! 🔱
lastFile:pkg/services/libraryelements/writers.go
* user essentials mob! 🔱
lastFile:pkg/services/libraryelements/writers.go
* user essentials mob! 🔱
lastFile:pkg/services/libraryelements/writers.go
* user essentials mob! 🔱
lastFile:pkg/services/libraryelements/writers.go
* user essentials mob! 🔱
lastFile:pkg/services/libraryelements/database.go
* user essentials mob! 🔱
lastFile:pkg/services/libraryelements/writers.go
* user essentials mob! 🔱
lastFile:pkg/services/libraryelements/writers.go
* user essentials mob! 🔱
* support filterFolderUIDs in the frontend
* move common logic to a variable
* fixed FolderLibraryPanelsPage and improved unit test
* fix backend lint error
* fix formatting error
Co-authored-by: Joao Silva <joao.silva@grafana.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: eledobleefe <laura.fernandez@grafana.com>
Co-authored-by: joshhunt <josh@trtr.co>