124 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
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
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
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
290e5cbe83 Navtree: Add dashboard type to reduce query (#103057) 2025-03-29 00:22:24 +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
ad5d7e9ad6 Use OpenFeature provider (#102116)
* Migrate pinNavItems to open feature

* Use Boolean method instead of BooleanValue
2025-03-20 08:40:15 +01: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
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
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
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
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
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
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
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
df3d8915ba Chore: Bump Go to 1.23.0 (#92105)
* chore: Bump Go to 1.23.0

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* update swagger files

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* chore: update .bingo/README.md formatting to satisfy prettier

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* chore(lint): Fix new lint errors found by golangci-lint 1.60.1 and Go 1.23

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* keep golden file

* update openapi

* add name to expected output

* chore(lint): rearrange imports to a sensible order

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

---------

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-08-21 11:40:42 -04:00
42efb14989 Bookmarks: Move building logic to the Frontend (#91849) 2024-08-15 13:35:20 +01:00
bcfb66b416 Identity: remove GetTypedID (#91745) 2024-08-09 18:20:24 +03:00
85d0e17dc4 Bookmarks: Store URLs instead of ids (#91121) 2024-07-31 13:56:39 +01:00
9db3bc926e Identity: Rename "namespace" to "type" in the requester interface (#90567) 2024-07-25 12:52:14 +03:00
Jo
93a979d46d Auth: Fix grafana-auth-app menu not being displayed (#90882)
Auth: Fix grafana-auth-app menu not being displayed if user only has access to cloud access policies
2024-07-24 15:10:19 +02:00
8966083132 Pin Nav Items: Add tracking for pinned items clicks (#90803)
* Pin Nav Items: Add tracking for pinned items clicks

* Update id

* Simplify onClick logic
2024-07-23 14:58:50 +03:00
546f4aa700 Navigation: Show list of pinned items on MegaMenu (#90280)
* Navigation: Show list of pinned ites on the navigation

* Rename section to 'Bookmarks'

* Internationalization

* Rename everything to bookmarks

* Update public/app/core/reducers/navBarTree.ts

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

* Ignore empty message as well

* Dont update navigation if there is an error patching

---------

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2024-07-22 11:43:40 +01:00
d7c844b5b6 Alerting UX: copy changes in Groups view (#90173)
* UI and help copy changes in Alerting Groups view

* Alerting Groups view: change subtitle

* Rename Alerting page title: `Groups` to `Active notifications`

* Update pseudo-local

* update betterer

* Extract translation through `make i18n-extract`
2024-07-11 13:33:41 +02:00
62494248e3 Restore dashboards: Add RBAC (#90270)
* Restore dashboards: Add RBAC

* Add check to navtree

* Prevent non-admins from searching deleted dbs

* Add check to the route

* Cleanup

* Update translations

* Update API permissions

* Correct permissions

* Update warning message

* Update translation

* Return 401 for deleted query without admin role
2024-07-11 13:20:04 +03:00
c76b490c57 Alerting: Central alert history part4 (#90088)
* Implement EventDetails for expanded rows and pagination on the events list

* Add test for getPanelDataForRule function

* prettier

* refactor EventState component

* create interfaces for props

* Add missing translations

* Update some comments

* Add plus button in alertrulename , to add it into the filter

* Add plus button to add filters from the list labels and alert name

* Add clear labels filter button

* run prettier

* fix RBAC checks

* Update AlertLabels onLabelClick functionality

* add limit=0 in useCombinedRule call

* Add filter by state

* remove plus button in labels

* Fix state filter

* Add filter by previous state

* fix some errors after solving conflicts

* Add comments and remove some type assertions

* Update the number of transitions calculation to be for each instance

* Add tests for state filters

* remove type assertion

* Address review comments

* Update returnTo prop in alert list view url

* Update translations

* address review comments

* prettier

* update cursor to pointer

* Address Deyan review comments

* address review pr comments from Deyan

* fix label styles

* Visualize expanded row as a state graph and address some pr review comments

* Add warning when limit of events is reached and rename onClickLabel

* Update texts

* Fix translations

* Update some Labels in the expanded states visualization

* move getPanelDataForRule to a separate file

* Add header to the list of events

* Move HistoryErrorMessage to a separate file

* remove getPanelDataForRule function and test

* add comment

* fitler by instance label results shown inthe state chart

* remove defaults.ini changes

* fix having single event on time state chart

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2024-07-11 12:09:52 +02:00
a3879e02bb RestoreDashboards: Create FE feature toggle (#89655) 2024-06-25 16:43:13 +02:00
34b3dbdbf3 RestoreDashboards: Adjust path (#89233)
* refactor: change path

* fix: page headline

* refactor: remove condition
2024-06-18 17:24:48 +02:00
e75fbe10ca Alerting: Central alert history (part1) (#88593)
* WIP

* Add barchart panel with scenes

* Fix timerange in barchart panel

* Refactor: component names

* Remove not used css styles and rename panel title

* Remove unnecessary HistoryEventsListObject class and update text in labels filter

* add padding top for filter

* Add translations

* update limit labels constant

* Update showing state reason

* Fix scene object

* Address review comments

* Update icons

* use endpoints instead of the autogenerated hook

* Address review comments

* Add tooltip for alert name

* use private polling interval

* fix autogenerated translations

* Address pr rewview comments

* Address review comments

* Update text in placeholder

* Rename variable and remove spaces in Trans children
2024-06-17 14:54:15 +02:00
99d8025829 Chore: Move identity and errutil to apimachinery module (#89116) 2024-06-13 07:11:35 +03:00
822644714a Navigation: Remove ApplyAdminIA logic (#89113)
make admin IA more normal
2024-06-12 16:45:13 +01:00
b761153812 Alerting: Fix permissions for silences list view (#88908) 2024-06-07 19:19:28 +03:00
b6bd9e5352 Laura/refactor/rename trash section (#88617)
* refactor: move and rename page component

* refactor: change codeowners

* refactor: change naming in backend

* refactor: change wording of subtitle
2024-06-04 10:03:33 +03:00
f6a83432a5 RestoreDashboards: Create trash section (#88278)
* feat: add feature toggle to docs

* feat: create page in BE

* feat: create page in FE

* refactor: set feat toggle as a condition

* refactor

* refactor

* refactor

* feat: add permission conditions

* refactor

* feat: add subtitle to translations

* feat: add to codeowners

* refactor: fix docs situation

* refactor

* Merge main branch into feat branch
2024-05-28 10:26:06 +02:00
5e25afe6e9 Alerting: New settings page (#84501) 2024-05-03 17:42:42 +02:00