feat: allow checks and folders to live in any Grafana folder, using the standard folder picker - #1790
Draft
VikaCep wants to merge 3 commits into
Draft
feat: allow checks and folders to live in any Grafana folder, using the standard folder picker#1790VikaCep wants to merge 3 commits into
VikaCep wants to merge 3 commits into
Conversation
… folder assignment Scaffolding for the folders-location work: a jest mock for @grafana/runtime's FolderPicker (native select backed by the MSW folders API), permission=Edit filtering on the folders list handler, a move endpoint handler, root-level folder fixtures, and folders:read/create on the admin RBAC fixture (the not-provisioned banner test now stubs a 403 instead of relying on the missing permission). Co-authored-by: Cursor <cursoragent@cursor.com>
… locations Replace the custom combobox in FolderSelector (check form and bulk move) with @grafana/runtime's FolderPicker, so users can pick any folder they can edit with Grafana's native nested browsing, search and server-side permission filtering. The create-folder modal also uses the picker for the parent and can create at the root when the user has folder creation rights. useFolders gains parentUid support on create, a move-folder mutation and tree-flattening helpers for indented dropdown labels. Co-authored-by: Cursor <cursoragent@cursor.com>
…allow moving folders Folders that live outside the Grafana Synthetic Monitoring folder (root-level folders and their subfolders) now render as first-class, properly nested entries in the check list, with a neutral Root badge on top-level ones and entries in the folder filter. A new move-folder action lets users relocate an SM folder to the root or any other editable folder via the standard folder picker. Folder classification is unified around a single outsideFolders concept in useCheckFolderAccess and useChecksByFolder. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The folders feature anchors everything under the default
Grafana Synthetic Monitoringfolder: the check form's folder dropdown only offers that subtree, new folders are always created inside it, and folders elsewhere in Grafana are second-class — checks assigned to them via Terraform or the API show up with an orange "Outside default folder" warning badge, can't be selected in the picker, don't appear in the folder filter, and can't be targeted from the UI.This splits a team's resources across two trees (their team folder and the SM subtree), diverges from the platform's folder direction (Team Folders / unified resource folders), and means the UI and the API disagree about where checks are allowed to live.
Solution
Checks and SM folders can now live in any folder the user can edit. The default folder remains the default home for checks — nothing changes for tenants that don't touch the new options — but users can now:
Folder selection everywhere (check form, bulk move, create-folder modal, move-folder modal) now uses Grafana's standard
FolderPickerfrom@grafana/runtimeinstead of our custom dropdown, which gives us search, lazy tree expansion, and server-side permission filtering (only folders the user can edit are offered) — the same experience as the dashboard save dialog.In the check list, folders outside the default subtree render as first-class groups when they contain checks (empty ones are never shown), nest under their parent when it's also visible, carry a neutral "Root" tag when top-level, and appear in the folder filter.
Notes
folderUidthrough, and the effective-permission model (min of SM role and folder permission) already works for any folder.Screenshots
Testing
FolderSelector, check list outside-folder rendering and nesting, folder filter, move-folder and bulk-move flows (the runtimeFolderPickeris mocked in jest against the MSW folders API).yarn buildof this branch. One pass worth doing there: a viewer with a folder-level edit grant, to confirm the picker's server-side permission filtering end to end.