Alerting: Update texts for gm rr in the form (#94844)
* Update texts for gm rr in the form
* fix translations
* Fix test
* address review comments
* address review comments - part2
* translations
* update docs for new term: output
(cherry picked from commit 1860737117)
Co-authored-by: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com>
SSO: Fix client side validations for LDAP (#94561)
* fix client side validations for LDAP
* add translations for new messages
* simplify code in isInvalidField()
(cherry picked from commit 0bd3ad1d5a)
Co-authored-by: Mihai Doarna <mihai.doarna@grafana.com>
* 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
* 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>
* Add mode switch in Query section
* Implement simple query mode : WIP
* fix logic switching mode
* move guard and get methodd to another folder
* Add more requiremts for being transformable from advanced to not advanced mode
* fix usig mode when it's not a grafana managed alert
* Show warning when switching to not advanced and its not possible to convert
* Add feature toggle alertingQueryAndExpressionsStepMode
* fix test
* add translations
* address PR feedback
* Use form context for sharing simplfied mode used, save in local storage and use the new fields in the api
* add check to valid reducer and threshold when switching to simplified mode
* Use only one expression list
* fix test
* move existing rule check outside storeInLocalStorageValues
* add id in InlineSwitch to handle onClick on label
* fix
* Fix default values when editing existing rule
* Update dto fields for the api request
* fix snapshot
* Fix recording rules to not show switch mode
* remove unnecessary Boolean conversion
* fix areQueriesTransformableToSimpleCondition
* update text
* pr review nit
* pr review part2
* feat: add setup guide in home tab
* chore: add feature toggle for setup guide
* chore: add feature toggle for sub menu
* chore: run pretier
* chore: run i18n
* chore: run generated files again
* chore: update description
* chore: update comment to trigger test flow
* chore: trigger test
* chore: fix styling
* Pass one
* Fix linter and add new betterer problem (sorry)
* fix swagger
* Add type to tests and update single correlations sql
* Fix provisioning test and other function that needs a type
* Add errors around query/external typing and add tests
* increment number of correlations tested as we added one for testing v1 type placement
* try merging back the swagger that is in main
* try again?
* Style form a little
* Update public/app/features/logs/components/logParser.ts
Co-authored-by: Matias Chomicki <matyax@gmail.com>
* fix bad commit, simplify logic
* Demonstrating type difficulties
* Fix distributed union changes
* Additional type changes
* Update types in form
* Fix swagger
* Add comment around the assertion and explicit typing
---------
Co-authored-by: Matias Chomicki <matyax@gmail.com>
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
* refactor breakdown scene
* refactor BreakdownScene along with LayoutSwitcher
* rename
* don't pass default layout
* better type handling
* betterer
* add @bsull/augurs
* implement LabelBreakdownScene
* integrate SortByScene in LabelBreakdownScene
* move to new directory
* introduce BreakdownSearchScene
* integrate searchScene
* cleaning
* initialize @bsull/augurs
* add interaction
* use new breakdown scene
* resolve merge conflicts
* ugrade @bsull/augurs
* update import
* update css
* update tooltip text
* refine sorting
* fix unit test
* fix
* implement outlier detector
* support wasm
* jest testing fix
* localization fix
* use unknown instead of any
* update i18n
* update betterer
* fix locales
* update test
* fix tests maybe
* prettier
* chore: update jest config
* chore: create mock for @bsull/augurs (#92156)
chore: create mock for bsull/augurs
@bsull/augurs assumes it will be running as an ESM, not
a CommonJS module, so can't be loaded by Jest (specifically
because it contains a reference to import.meta.url).
This PR provides a mock implementation which gets tests passing
again.
Ideally we'd be able to load the actual @bsull/augurs module
in tests so this is just a stopgap really, until a better
solution appears.
* fix unit tests
* remove unused BreakdownScene.tsx
* set outliers as undefined if an error occurs
* Add labels
* betterer
* reset event implemented
* fix controls positioning
* remove sorting
* fix type guard
* more clean up
* remove wasm support from webpack
* betterer
---------
Co-authored-by: Matias Chomicki <matyax@gmail.com>
Co-authored-by: Ben Sully <ben.sully@grafana.com>
* feat: supporting code for groupsync extension UI
* Add result of running i18n extraction
* Place the UI behind a feature toggle as well as the license feature
* Also add access checks to route loading of groupsync route with feature toggle
* Add access check on permissions to show External group sync in nav
* fix: New version of multiOrgRoleOptions hook
* Remove OSS route definition
* Apply feedback on nav title
* add OTel filter in metric select scene
* add resource query to get matching OTEL job&instance
* filter metrics by OTEL resources
* only add otel select if DS has OTEL matching job and instance
* add folder for otel resources
* upate metric select for new otel folder
* move otel api call
* get otel resources for labels for single series job/instance target_info
* add otel resources to adhoc variable dropdown
* update otel api to check for standardization and return labels
* label types for api
* check standardization, show otel variable, select depenv, update other variables
* remove otel target list from metric select scene
* load resources if dep_env label has already been selected
* exclude previously used filters
* do not check standardization if there are already otel filters
* drop filters when switching data sources
* add experience var for switching to otel experience
* remove otel from variables and place near settings
* add error for non-standard prom with otel resources
* fix typescript errors, remove ts-ignores
* add custom variable for deployment environment like app-olly
* fix name of otel variable
* add function for getting otel resources from variables
* add otel join query const
* update standard check to be simpler
* allow for unstandard otel data sources but give warning
* add otelJoinQuery to the base query and clean up variables when state changes
* refactor otel functions to return filters for targets, use targets to filter metrics
* update metric names on otel target filter change
* when no otel targets for otel resource filter, show no metrics
* move switch to settings, default to use experience, refactor otel checks
* clean code
* fix refactor to add hasOtelResources for showing the switch in settings
* sort otel resources by blessed list
* reset otel when data source is changed
* move otel experience toggle back outside settings
* move showPreviews into settings
* do not re-add otel resources from blessed list to filters when already selected
* add otel join query variable to histogram base query
* only show settings for appropriate scenes
* show info tooltip the same but show error on hover for disabling otel exp for unstandard DS
* refactor tagKeys and tagValues for otel resources variable, fix promoted list ordering, fix dep env state bug
* default dep env value
* apply var filters only where they are using VAR_FILTER_EXPR in queryies
* change copy for labels to attributes
* do not group_left job label when already joining by job
* update copy for label variable when using otel
* remove isStandard check for now because of data staleness in Prometheus
* default to showing heatmap for histograms
* add trail history for selecting dep env and otel resources
* add otel resource attributes tests for DataTrail
* move otel functions to utils
* write tests for otel api calls
* write tests for otel utils functions
* fix history
* standard otel has target_info metric and deployment_environment resource attributes
* fix tests
* refactor otel functions for updating state and variables
* clean code
* fix tests
* fix tests
* mock checkDataSourceForOtelResources
* fix tests
* update query tests with otelJoinQuery and default to heatmap for _bucket metrics
* fix tests for otel api
* fix trail history test
* fix trail store tests for missing otel variables
* make i18n-extract
* handle target_info with inconsistent job and instance labels
* fix otel copy and <Trans> component
* fix custom variable deployment environment bug when switchiing data sources from non otel to otel
* fix linting error for trans component
* format i18nKey correctly
* clean up old comments
* add frontend hardening for OTel job and instance metric list filtering
* fix test for deployment environment custom variable to use changeValueTo
* fix i18n
* remove comments for fixed bug
* edit skipped tests
* Fix parse of
* Add i18n files
* Add default value
* Replace input field with multiselect
* rename delete form function
* Use Controller for MultiSelect
* Add GroupMApping component
* Add remove/add buttons
* Implement role fields
* Change value as number for org ids
* Add i18n extracts
* Use conditional for GrafanaAdmin switch