* build(webpack): extract css imports into files including node_modules
* feat(webassets): add cssfiles to entrypoint assets for extracted css files
* feat(views): add entrypoint css link tags to html templates
* feat(webassets): set CDN prefix for CSS files
* test(webassets): trim down sample-assets-manifest, fix failing snapshot tests
* Update pkg/api/webassets/webassets_test.go
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
* build(webpack): remove css module loader
---------
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
* CloudMigrations: create snapshot for Contact Points
* CloudMigrations: add contact point copies and components in frontend
* CloudMigrations: temporarily use bell for all alerts resources
* feat(frontend): introduce project.json for every workspace to improve caching
* refactor(frontend): use nx tags for grafana dependson
* refactor(frontend): clean up nx tags for packages and plugins
* build(nx): make grafana dependent on cacheable generate icons command
* build(nx): clean up project files
* Use advanced options when query params are not transformable
* Update public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx
Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
---------
Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
* Extract shared add to dashboard flow
* Change how we save and add the new panels
* More cleanup
* Began updating tests
* Move and update tests
* set time range
* Fix lint / ts issues
* Fix time history step issue
* fix test
* Update betterer
* remove more tests that are now not needed
* work around cyclic dep
* Update
* Fixes
* fix lint
* remove unused type
* refactor: remove FE feat toggle from BE
* refactor: remove FE toggle and adjust roles
* refactor: replace feat toggle in tracking events
* refactor: remove FE feat toggle
* refactor: remove FE feat toggle
* fix: autogenerated file
* scenes error when options not set
* add all of the options that are updated in onOptionsChange
* add options to all the other places we are building timeseries panels
* Update public/app/features/trails/AutomaticMetricQueries/graph-builders/percentiles.ts
Co-authored-by: Nick Richmond <5732000+NWRichmond@users.noreply.github.com>
* remove activation handlers and unused code
* Update public/app/features/trails/AutomaticMetricQueries/graph-builders/simple.ts
Co-authored-by: Nick Richmond <5732000+NWRichmond@users.noreply.github.com>
* Update public/app/features/trails/AutomaticMetricQueries/graph-builders/percentiles.ts
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
---------
Co-authored-by: Nick Richmond <5732000+NWRichmond@users.noreply.github.com>
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
* Open dashboard list when a scope is selected
* refactor
* test
* remove localstorage key
* add checks on open/close methods
* remove redundant statement
* improve dashboards listing
* wip
* add simple scenes object with logs panel
* return hardcoded log message from runtime ds
* simplify log entry
* use log in links registry
* wired the log together.
* wip
* Connected the extensions log to the runtime datasource to steam logs
* wired the other registies.
* implemented child function.
* set right field type on labels
* set meta type
* using the logger in various places.
* added type of onclick.
* removed time picker.
* removed imports.
* passing log to functions where they are needed.
* moved scene into admin page.
* minor improvement to the message.
* added possibility to update query with values based on the data.
* added filter suppoert.
* wip
* wip
* fixed so extension points are displayed.
* use log level from grafana data
* fixed bugs with the filtering.
* Fixed some logs.
* only register extensions page in development mode.
* fixed filtering.
* added on click debug log.
* PluginExtensions: Add debug log to Grafana (Rewrite to scenes-react) (#93954)
* refactoring.
* simplify it even more.
* Update public/app/features/plugins/extensions/logs/LogViewer.tsx
Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
* used VizGridLayout instead of VizGrid component.
* Fixed feedback and fixed bug in filtering logic.
* fixed another nit.
* empty string instead of title.
* Added tests and fixed error.
* added test file.
* regenerated yarn.lock
* Update public/app/features/plugins/extensions/logs/filterTransformation.test.ts
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* fixed nit.
* more nits.
* added more test cases.
* simplified filtering logic.
* removed unused dep.
* defined broadcast channel in jest setup.
* added tests for datasource.
* fixed failed tests.
* fixed tests.
* fixing go lint issue.
* silent go lint.
* fixed lint issue.
---------
Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* Fix detail view not showing instances nor history tab
* small refactor
* Update public/app/features/alerting/unified/hooks/useCombinedRule.ts
Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
* refactor
---------
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
* add limit for adhoc filters in providers functions
* add comments to describe function
* return early if filtersVariable is not an instance of AdHocFiltersVariable
* update function comments
* add tests to confirm the providers are limited to 10000
* use name in fe
* store parent folder name in local db
* clean up
* tiny test
* trial react
* rename to parent name
* go lint
* generate api and ts
* go tests
* rearrange
* clean
* update with suggestions from josh
* make library elements work
* updates from comments
* global migration types
* parent name for alter table
* Generate options for variables through TemplateSrv
* Add refresh when object changes
* Remove unnecesary static function
* Extract logic
* Add extra test case when variable changes and refresh event is triggered
* bring back old logic, query options should not live in the dashboard json
* add missing change
* Add support to keep variable options in query
* tests
* move refreshEvent to DashboardVariableDependency
---------
Co-authored-by: alexandra vargas <alexa1866@gmail.com>
Co-authored-by: Victor Marin <victor.marin@grafana.com>
* add data provider when switching from non data panel
* handle adding and cleaning up data provider in panel editor on panel switch
* add data provider check sin panel editor tests
* Update dependency @grafana/experimental to v2
* add data-testid to old save button so it works properly in e2e test
* fix azure monitor e2e tests
* use raw selectors
* remove .only
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Plugins: Pass hashes for SRI to frontend
* Add SRI hashes to frontendsettings DTOs
* Add docstring
* TestSriHashes
* Fix typo
* Changed SriHashes to ModuleHash
* update loader_test compareOpts
* update ModuleHash error message
* Add TestModuleHash/no_module.js
* Add omitEmpty to moduleHash
* Add ModuleHash to api/plugins/${pluginId}/settings
* moved ModuleHash field
* feat(plugins): add moduleHash to bootData and plugin types
* feat(plugins): if moduleHash is available apply it to systemjs importmap
* Calculate ModuleHash for CDN provisioned plugins
* Add ModuleHash tests for TestCalculate
* adjust test case name
* removed .envrc
* Fix signature verification failing for internal plugins
* fix tests
* Add pluginsFilesystemSriChecks feature togglemk
* renamed FilesystemSriChecksEnabled
* refactor(plugin_loader): prefer extending type declaration over ts-error
* added a couple more tests
* Removed unused features
* Removed unused argument from signature.DefaultCalculator call
* Removed unused argument from bootstrap.DefaultConstructFunc
* Moved ModuleHash to pluginassets service
* update docstring
* lint
* Removed cdn dependency from manifest.Signature
* add tests
* fix extra parameters in tests
* "fix" tests
* removed outdated test
* removed unused cdn dependency in signature.DefaultCalculator
* reduce diff
* Cache returned values
* Add support for deeply nested plugins (more than 1 hierarchy level)
* simplify cache usage
* refactor TestService_ModuleHash_Cache
* removed unused testdata
* re-generate feature toggles
* use version for module hash cache
* Renamed feature toggle to pluginsSriChecks and use it for both cdn and filesystem
* Removed app/types/system-integrity.d.ts
* re-generate feature toggles
* re-generate feature toggles
* feat(plugins): put systemjs integrity hash behind feature flag
---------
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
* feat: add extensions to the backend plugin model
* feat: update the frontend plugin types
* feat(pluginContext): return a `null` if there is no context found
This will be necessary to understand if a certain hook is running inside a plugin context or not.
* feat: add utility functions for checking extension configs
* tests: fix failing tests due to the type updates
* feat(AddedComponentsRegistry): validate plugin meta-info
* feat(AddedLinksRegistry): validate meta-info
* feat(ExposedComponentsRegistry): validate meta-info
* feat(usePluginComponent): add meta-info validation
* feat(usePluginComponents): add meta-info validation
* feat(usePluginLinks): add meta-info validation
* fix: only validate meta-info in registries if dev mode is enabled
* tests: add unit tests for the restrictions functionality
* tests: fix Go tests
* fix(tests): revert accidental changes
* fix: run goimports
* fix: api tests
* add nested app so that meta data can bested e2e tested
* refactor(types): extract the ExtensionInfo into a separate type
* refactor(extensions/utils): use Array.prototype.some() instead of .find()
* refactor(usePluginLinks): update warning message
* feat(usePluginExtensions()): validate plugin meta-info
* Wip
* fix(e2e): E2E tests for extensions
* fix(extensions): allow multiple "/" slashes in the extension point id
* fix(extensions/validators): stop validating the plugin id pattern
---------
Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
* CloudMigrations: create snapshots of Library Elements
* CloudMigrations: render library element resource in resources table
* CloudMigrations: create newtype with necessary fields for library element creation
* Search by query text, pagination
* Support default filtering by active datasource; filter by datasource name; improve table display
* Cleanup
* Fix update and delete url paths
* Fix test
* Use Stack, remove uneccessary function wrapper
* Notify when something is wrong with a row, add interaction tracking
* i18n
In Dashboard Scene:
* Display a warning in the panel header when rendering an angular panel
* Display a warning in the dashboard when rendering one or more angular panels
* Display a button to migrate in the dashboard banner
* Display a button to migrate in the panel editor
* Display a button to "Edit options" when it is an Angular panel, to open the panel JSON inspector to be able to edit the options
* Add tests
---------
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
* Change the label used for additional app links from apps to more apps so it doesn't conflict with applications, which is application observability, not the other bucket
* update to more apps
* more in german is mehr
* fix case, update translations correctly
* revert changes to de
* fix be tests
---------
Co-authored-by: joshhunt <josh@trtr.co>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Style nits for the simple query mode
* update translations
* update text
* update translations
* update disable word to deactivate
* update preview text when not advanced options
* update text
* update text
* Add showPolicies prop
* Add manage permissions component for easier reuse within alerting
* Add method for checking whether to show access control within alerting
* Remove accidental console.log from main
* Tweak styling for contact point width and add manage permissions drawer
* Improve typing for access control type response
* Add basic test for manage permissions on contact points list
* Only show manage permissions if grafana AM and alertingApiServer is enabled
* Update i18n
* Add test utils for turning features on and back off
* Add access control handlers
* Update tests with new util
* Pass AM in and add tests
* Receiver OSS resource permissions
There is a complication that is not fully addressed: Viewer defaults to read:*
and Editor defaults to read+write+delete:*
This is different to other resource permissions where non-admin are not granted
any global permissions and instead access is handled solely by resource-specific
permissions that are populated on create and removed on delete.
This allows them to easily remove permission to view or edit a single resource
from basic roles.
The reason this is tricky here is that we have multiple APIs that can
create/delete receivers: config api, provisioning api, and k8s receivers api.
Config api in particular is not well-equipped to determine when creates/deletes
are happening and thus ensuring that the proper resource-specific permissions
are created/deleted is finicky.
We would also have to create a migration to populate resource-specific
permissions for all current receivers. This migration would need to be reset so
it can run again if the flag is disabled.
* Add access control permissions
* Pass in contact point ID to receivers form
* Temporarily remove access control check for contact points
* Include access control metadata in k8s receiver List & Get
GET: Always included.
LIST: Included by adding a label selector with value `grafana.com/accessControl`
* Include new permissions for contact points navbar
* Fix receiver creator fixed role to not give global read
* Include in-use metadata in k8s receiver List & Get
GET: Always included.
LIST: Included by adding a label selector with value `grafana.com/inUse`
* Add receiver creator permission to receiver writer
* Add receiver creator permission to navbar
* Always allow listing receivers, don't return 403
* Remove receiver read precondition from receiver create
Otherwise, Creator role will not be able to create their first receiver
* Update routes permissions
* Add further support for RBAC in contact points
* Update routes permissions
* Update contact points header logic
* Back out test feature toggle refactor
Not working atm, not sure why
* Tidy up imports
* Update mock permissions
* Revert more test changes
* Update i18n
* Sync inuse metadata pr
* Add back canAdmin permissions after main merge
* Split out check for policies navtree item
* Tidy up utils and imports and fix rules in use
* Fix contact point tests and act warnings
* Add missing ReceiverPermissionAdmin after merge conflict
* Move contact points permissions
* Only show contact points filter when permissions are correct
* Move to constants
* Fallback to empty array and remove labelSelectors (not needed)
* Allow `toAbility` to take multiple actions
* Show builtin alertmanager if contact points permission
* Add empty state and hide templates if missing permissions
* Translations
* Tidy up mock data
* Fix tests and templates permission
* Update message for unused contact points
* Don't return 403 when user lists receivers and has access to none
* Fix receiver create not adding empty uid permissions
* Move SetDefaultPermissions to ReceiverPermissionService
* Have SetDefaultPermissions use uid from string
Fixes circular dependency
* Add FakeReceiverPermissionsService and fix test wiring
* Implement resource permission handling in provisioning API and renames
Create: Sets to default permissions
Delete: Removes permissions
Update: If receiver name is modified and the new name doesn't exist, it copies
the permissions from the old receiver to the newly created one. If old receiver
is now empty, it removes the old permissions as well.
* Split contact point permissions checks for read/modify
* Generalise getting annotation values from k8s entities
* Proxy RouteDeleteAlertingConfig through MultiOrgAlertmanager
* Cleanup permissions on config api reset and restore
* Cleanup permissions on config api POST
note this is still not available with feature flag enabled
* Gate the permission manager behind FF until initial migration is added
* Sync changes from config api PR
* Switch to named export
* Revert unnecessary changes
* Revert Filter auth change and implement in k8s api only
* Don't allow new scoped permissions to give access without FF
Prevents complications around mixed support for the scoped permissions causing
oddities in the UI.
* Fix integration tests to account for list permission change
* Move to `permissions` file
* Add additional tests for contact points
* Fix redirect for viewer on edit page
* Combine alerting test utils and move to new file location
* Allow new permissions to access provisioning export paths with FF
* Always allow exporting if its grafana flavoured
* Fix logic for showing auto generated policies
* Fix delete logic for contact point only referenced by a rule
* Suppress warning message when renaming a contact point
* Clear team and role perm cache on receiver rename
Prevents temporarily broken UI permissions after rename when a user's source of
elevated permissions comes from a cached team or basic role permission.
* Debug log failed cache clear on CopyPermissions
---------
Co-authored-by: Matt Jacobson <matthew.jacobson@grafana.com>
* Cloud migrations: store resource name in the cloud_migration_resource table
* remove unused function: convertMigrateDataResponseToDTO
* make swagger-clean && make openapi3-gen
* use DB_Text for cloud_migration_resource.name instead of DB_Varchar