224 Commits

Author SHA1 Message Date
eed048fc09 Navigation: Moving Machine-Learning out of IRM and into the top-level of the Navigation (#103822)
* adding ml items to main navigation if plugin is installed

* undoing testing change

* updating based on feedback and fixing role to be specific to access to ml plugin

* cleanup unneeded constants

* cleanup diff

* updateing GetOrgID call

* adding greyscale ml logo and using that for consistency

* use currentColor

---------

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2025-04-25 10:33:03 +01:00
29b3738bc8 Navigation: Remove the "New" badge from the IRM menu item (#104512)
remove the "New" badge from the IRM menu item
2025-04-25 09:49:32 +01:00
fab0bdd634 Navigation: add service center as a standalone nav item (#102897)
add service center as a standalone nav item
2025-04-22 14:20:36 +02:00
a5288db624 Alerting: Remove the POST endpoint for the internal Grafana Alertmanager config (#103819)
* Remove POST config for Grafana Alertmanager

* Delete auth + test for removed path

* Alerting: Remove check for `alertingApiServer` toggle in UI (#103805)

* Remove check for alertingApiServer in UI

* Update tests to no longer care about alertingApiServer

* Add contact points handlers now that we use alertingApiServer all the time

* Fix test broken from removing camelCase for UIDs

---------

Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
2025-04-11 17:38:53 -04:00
07a225649d MetricsDrilldown: Remove legacy Metrics Drilldown code paths (#103845)
* chore: remove feature toggles

* chore: update labels

* chore: remove `public/app/features/trails` code

* fix: typo

* chore: update betterer results

* chore: update i18n
2025-04-11 16:45:14 -04:00
af373569b5 Provisioning: Move nav section under admin (#103911) 2025-04-11 15:43:49 +00:00
6fde69c333 CloudMigrations: Make improvements to the text content (#103770)
* change copy configuration

* comma and this token after token creation

* securely migrate and you'll need token

* add caret and modify steps

* period after check failed resources

* learn about migrating v1

* building snapshot reduce text

* right caret connect to a cloud stack

* building snapshot reduce text v2

* make i18n-extract after merge
2025-04-10 13:50:37 +01:00
757be6365a CI: Bump golangci-lint to 2.0.2 (#103572) 2025-04-10 14:42:23 +02:00
890484ff6a Navigation: Allow apps to show IsNew badge in the navigation menu (#103608) 2025-04-09 15:32:34 +02:00
5e02532073 Provisioning: Update onboarding page (#103436)
* Change feature name

* Update feature list

* Update connect button

* Update enhanced features

* Cleanup
2025-04-04 13:08:58 +03:00
4918d8720c Dashboard Restore: Remove experimental functionality under feature flag dashboardRestore for now - this will be reworked (#103204) 2025-04-03 02:52:54 -05:00
f1e214261c Chore: Allow for an applink to set a subtitle (#103205) 2025-04-02 12:43:21 +02:00
827d86a985 Provisioning: Show in nav tree without feature enabled (#102980) 2025-03-31 15:06:17 +02:00
290e5cbe83 Navtree: Add dashboard type to reduce query (#103057) 2025-03-29 00:22:24 +02:00
ac30bd432a Navtree: Fix flaky test (#103029) 2025-03-28 00:32:00 +02:00
a262da532e Navtree: Switch to search (#103016) 2025-03-27 13:36:56 -05:00
f9471ac10b Alerting: Recover deleted alert rules (#101869)
* 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>
2025-03-27 16:39:26 +02:00
75ce8db0e2 Provisioning: Align frontend more with designs (#102687)
* feat: align frontend more with designs

* feat: remove unnecessary fields

* chore: remove imports

* chore: move imports

* fix: make label not spit out undefined

* feat: update title of nav item

* chore: make update-workspace

* fix: don't wrap text with span unless required

---------

Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
2025-03-25 12:59:42 +01:00
ad5d7e9ad6 Use OpenFeature provider (#102116)
* Migrate pinNavItems to open feature

* Use Boolean method instead of BooleanValue
2025-03-20 08:40:15 +01:00
ff6a97f1a1 Provisioning: Update APIs in main (#102345) 2025-03-18 14:55:22 +02:00
d9cb6e632d Navigation: Add the IsNew badge to the IRM menu item (#101926)
add the `IsNew` badge to the IRM menu item
2025-03-11 14:31:43 +00:00
b4366db1f1 ThemeDrawer: Change theme from anywhere and preview them (#100405)
* ThemeDrawer: Change theme from anywhere and preview them

* Update

* added subtitle

* Use new component

* Fixes

* Fix runtime ony wrong prop

* Fixed saving issue

* update lang file

* Fixed circular dep

* fix import
2025-03-11 12:03:10 +01:00
b5faf5d9a1 Drilldown: Require datasources:explore RBAC action (#101366)
Drilldown: Require `datasources:explore` acton
2025-02-26 17:33:05 +01:00
f3433fd472 RBAC: Remove accessControlOnCall feature toggle (#101222)
* RBAC: Remove accessControlOnCall feature toggle

* Leave the other one in place

* Tests

* frontend

* Readd empty ft to frontend test

* Remove legacy RBAC check

* Fix test

* no need for context

* Remove unused variable

* Remove unecessary param

* remove unecessary param from tests

* More tests :D
2025-02-25 13:44:40 +01:00
e54149e551 Explore: Move drilldown apps from Explore to a new navbar item "Drilldown" (#100409)
* Move drilldown apps from Explore to a new navbar item "Drilldown"

* Commit make i18n-extract

* Update drilldown icon

* Added alert to explore with call out to drilldown apps

* Add isNew field for nav item which shows a "New!" badge on the navbar and expands it by default

* Fix e2e test
2025-02-20 17:56:55 +00:00
92304646e6 Advisor: Add navigation link (#101049) 2025-02-20 14:53:04 +01:00
29fa6dfc8d ExploreMetrics: Add toggle to enable routing to externalized Explore Metrics app plugin (#99481)
* feat: toggle for explore metrics app plugin

* chore: put app navigation settings behind feature toggle

* chore: require restart

* feat: context-driven applinks toggling

* fix: toggle ownership

* docs: note restart requirement

* refactor: prefer global feature toggle check

* chore: undo rm newlines

* fix: minimize changes

* fix: app id, `chromeless`, sidebar ordering
2025-02-03 15:46:54 -05:00
cbb688e910 Zanzana: Remove usage from legacy access control (#98883)
* Zanzana: Remove usage from legacy access control

* remove unused

* remove zanzana client from services where it's not used

* remove unused metrics

* fix linter
2025-01-14 10:26:15 +01:00
3958fb9e0a CloudMigrations: Introduce RBAC role for migration assistant (#98588)
* CloudMigrations: delete unused code

* CloudMigrations: add access control and protect API + navtree with action

* CloudMigrations: register access control roles

* CloudMigrations: gate frontend based with access control

* CloudMigrations: fix api tests

* CloudMigrations: add docs on new actions and roles

* CloudMigrations: dont interpolate vars to make it more greppable

* CloudMigrations: run prettier
2025-01-09 06:03:42 +02:00
67a85fc358 feat: (Navlinks) - Add Adaptive Traces to Cost mgmt navlinks (#97981) 2024-12-18 09:05:18 -06:00
Jo
40d3b02648 Auth: Separate anonymous settings to its own struct (#97791)
separate anonymous settings to its own struct
2024-12-13 10:46:27 +01:00
76f052e8de Requester: Remove duplicated function (#97038)
* Remove duplicated function

* Remove GetDisplayName from interface

* Use GetName
2024-11-26 15:29:31 +01:00
e4a1243948 Alerting: Consume k8s API for notification policies tree (#96147)
* Add basic usage of K8s API for notification policies

* Add permissions checks for navtree for routes

* Add and update permissions for routing tree logic

* Add capability to skip calling contact points hook

* Conditionally show list of mute timings depending on permissions

* Conditionally link to mute timings if user can see at least one

* Add work in progress k8s handlers for routing tree

* Update notification policy hooks

* Wire up policies to permissions better (conditionally calling APIs)

* Add additional checks for whether to show grafana AM

* Add permission checks to access control

* Remove accidental permissions after rebase

* Update types and const for k8s routes

* Improve statefulness and reset routing tree in tests

* Update notif policy tests to check k8s and config API

* Fix type assertion

* Move non-grafana test out of .each

* Make failure case safer

* Override tag invalidation for notification policies API

* Pass in error and add new error alert component

* Add basic mock server conflict check

* Add test to check user can save after a conflict

* Add logic to allow reloading policies if changed by another user

* Fix test

* Update translations in Modals

* Add ViewAlertGroups ability

* Tweak provisioning logic and memoize AM config response

* Update snapshots for useAbilities

* Update result destructure

* Use enums for provenance in routingtrees

* Use consistent memoisation

* Fix _metadata for vanilla AM

* useAsync for error / update state

* move k8s api error handling to separate file

* use cause for error codes

* Use `supported` bools from Alertmanager abilities and clarify default policy

---------

Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2024-11-26 13:46:39 +00:00
5039725da6 Snapshots: Add RBAC roles for creating and deleting (#96126) 2024-11-26 09:13:17 -03:00
517c6fdc9b Navigation: add dbo11y app under Infrastructure (#96763)
* add dbo11y app under Infrastructure

* add i18n for Databases nav item

* add Translation extraction results
2024-11-25 15:34:47 +01:00
3ceaa42d20 Bookmarks: Do not show on navigation or button for unauthed users (#96836) 2024-11-21 15:32:38 +00:00
b8e92aacd2 PublicDashboards: Remove publicDashboards FF (#96578) 2024-11-20 11:36:19 -03:00
b12c731d59 Stars: Add dashboard_uid and org_id to table (#96408) 2024-11-15 09:51:31 -06:00
7a414a04a0 Alerting: Fix permissions for timeintervals UI and improve display of contact points in notification policies (#96129)
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2024-11-14 09:55:15 +00:00
bfecce320a Alerting: Fix some templates RBAC UI action control/checks (#94898) 2024-11-13 17:14:15 +00:00
c7a7f7dce5 PluginExtensions: Made it possible to enable extensions admin page in non-development environments (#95820)
* Added feature flag for toggling extensions admin page.

* fixed typo.

* require restart

---------

Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
2024-11-05 16:55:10 +01:00
4092741f24 RestoreDashboards: Merge both feature toggles to dashboardRestore (#94412)
* 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
2024-10-11 10:29:58 +02:00
bc7386e815 PluginExtension: Added debug log (#94146)
* 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>
2024-10-10 09:27:57 +03:00
19844220db Playlists: Remove from menu for users without permissions (#94403) 2024-10-08 13:04:18 -03:00
f92ef0e126 RestoreDashboards: Add link to dashboards browse view (#94000)
* feat: add button

* refactor: clean up

* feat: add tracking

* refactor: change button copy

* refactor: add payload to tracking

* refactor: add subURL

* refactor: user permissions

* refactor: group conditions

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

---------

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2024-10-03 15:13:29 +02:00
8de1047f65 Change from Apps to "More Apps" (#93454)
* 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>
2024-10-01 11:31:31 +01:00
9144e3b44a Navigation: Fix empty admin menu (#94024) 2024-10-01 11:28:33 +02:00
fc51ec70ba Alerting: Add manage permissions UI logic for Contact Points (#92885)
* 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>
2024-09-27 19:56:32 +01:00
c822feff9e Home: add setup guide tab under home tab (#92947)
* 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
2024-09-25 18:20:04 +01:00
735332570f feat: GroupSync extension UI (#91777)
* 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
2024-09-19 14:58:11 -05:00