* fix(AppRootPage): push the query params properly
* refactor: remove unnecessary changes in AppRootPage
* refactor(AppRootPage): use existing utility function
* support folderuid in FolderPicker
* support folderuid in unified alerting
* support folderuid when returning to view mode after editing a panel
* support folderuid when preselecting the folderpicker in dashboard general settings
* support folderuid when saving dashboard
* support folderuid when pre-selecting folderpicker in dashboard form
* support folderuid in routes when loading a dashboard
* support folderuid when saving dashboard json
* support folderuid when validating new dashboard name
* support folderuid when moving dashboard to another folder
* support folderuid on dashboard action buttons
* support folderuid when creating a new dashboard on an empty folder
* support folderuid when showing library panel modal
* support folderuid when saving library panel
* support folderuid when importing dashboard
* fixed broken tests
* use folderuid when importing dashboards
* remove commented line
* fix typo when comparing uid values
* TeamList: break out rows to its own component
* TeamsState: Add total count
* TeamList: Remove teamsCount prop
* TeamList: Restructure code and use count from backend response
* TeamList: calculate total pages using totalCount
* TeamList: Rename to state to currentPage and the reducer to
setCurrentPage
* TeamList: remove wrapper functions
* TeamList: rewrite as a functional component
* TeamList: export components for test
* TeamList: pass limit, page and query to backend
* TeamList: Rename properties in state and create actions for page and
query change
* TeamList: Add flag to control if EmptyList banner should render
* Component that can cache and extract variable dependencies
* Component that can cache and extract variable dependencies
* Updates
* Refactoring
* Lots of refactoring and iterations of supporting both re-rendering and query re-execution
* Updated SceneCanvasText
* Updated name of file
* Updated
* Refactoring a bit
* Added back getName
* Added comment
* minor fix
* Minor fix
* Merge fixes
* Scene variable interpolation progress
* Merge fixes
* Added all format registeries
* Progress on multi value support
* Progress on multi value support
* Updates
* Progress on scoped vars
* Fixed circular dependency
* Updates
* Some review fixes
* Updated comment
* Added forceRender function
* Add back fail on console log
* Update public/app/features/scenes/variables/interpolation/sceneInterpolator.test.ts
* Moving functions from SceneObjectBase
* fixing tests
* Fixed e2e
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* Move layout to paneleditor, make SplitPaneWrapper more generic
* Read/write the size ratio in local storage
* Add min height to enable scrollbar
* Enable show/hide panel options
* Change back variable name
* initial implementation for quick add
* add new isCreateAction prop on NavModel
* adjust separator margin
* switch to primary button
* undo changes to plugin.json
* remove unused props from interface
* use a consistent dropdown overlay type
* memoize findCreateActions
* add prop description
* use a function so that menus are only rendered when the dropdown is open
* Component that can cache and extract variable dependencies
* Component that can cache and extract variable dependencies
* Updates
* Refactoring
* Lots of refactoring and iterations of supporting both re-rendering and query re-execution
* Updated SceneCanvasText
* Updated name of file
* Updated
* Refactoring a bit
* Added back getName
* Added comment
* minor fix
* Minor fix
* Merge fixes
* Merge fixes
* Some review fixes
* Updated comment
* Added forceRender function
* Add back fail on console log
* WIP: First approach to scene grid layout
* Flex layout
* Grid layout rows
* Allow passing custom props to scene object renderers
* Allow nesting grid layouts
* Re-layout nested grid's enclosing grids
* Update public/app/features/scenes/components/layout/SceneGridLayout.tsx
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
* Review comments
* Got rid of flex & grid child layout objects
* WIP: Recreating rows behaviour (almost working)
* Major progress on rows
* remove nested grid example (not supported)
* Remove removal damn
* Trying to use children directly
* Ts fixes
* chore: Fix TS
* Fix issue when row bboxes when not updated on layout change
* Now the tricky part
* working
* Removing some code
* needs more work
* Getting some thing working
* Getting some thing working
* fix toggle row
* Starting to work
* Fix
* Yay it's working
* Updates
* Updates
* Added some sorting of children
* Updated comment
* Simplify sorting
* removed commented code
* Updated
* Pushed a fix so we can move a panel out from a row and into the parent grid
* simplify move logic
* Minor simplification
* Removed some unnesary code
* fixed comment
* Removed unnessary condition in findGridSceneParent
* remove unnessary if
* Simplify toGridCell
* removed duplicate if
* removed unused code
* Adds grid demo with different data scenarios
* Make it green
* Demo grid with multiple time ranges
* Move child atomically
* Add tests
* Cleanup
* Fix unused import
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
* fix: email and username trimming and invitation validation
* Trim leading and trailing whitespaces from email and username on signup
* Check whether the provided email address is the same as where the invitation sent
* Align tests
Co-authored-by: Mihaly Gyongyosi <mgyongyosi@users.noreply.github.com>
SQL Datasources: fix issue where testing the datasource connection would show success even when there was an error.
Co-authored-by: Victor Marin <victor.marin@grafana.com>
* [Alerting] - replace label inputs with dropdowns (#57019)
* Add AlertLabelDropdown component
It will be used to pick from or create new labels
* Adapt LabelsField component to use AlertLabelDropdown instead of inputs
* Add tests for LabelsField component
Plus a few other tests were adapted to work with the label dropdowns
* Use ref in component
* Fix showing placeholders in the label dropdowns
* Minor syntax change
* Remove unneeded import after rebase
* Display custom labels
When a label key is selected, its corresponding values are shown in the dropdown
* Add tooltip explaining where labels in the dropdowns come from
* Fix import of Stack component
* Avoid duplicated values
* Improvements based on review
* Display labels for currently selected datasource only
* Refactor AlertsField to allow to choose whether to suggest labels or not
* Suggest labels for NotificationStep and tests
* Don't suggest labels in TestContactPointModal
* [LabelsField] - refactor: get dataSourceName as a parameter
* [LabelsField] - extract common code into reusable components
* Display loading spinner while fetching rules
* LabelsField - refactor
Removing the suggest prop and the default dataSource 'grafana'. Instead, the component now relies on the dataSourceName param. If it's set it means we want to show suggestions so we fetch the labels, otherwise, if not set, we show the plain input texts without suggestions.
* Add test for LabelsField without suggestions
* Show custom labels for grafana managed alerts
When the dataSourceName in the NotificationsStep component has a null value, we can assume it's because we're dealing with grafana managed alerts. In that case we set the correct value.
* Fix tests after latest changes
Since we removed the combobox from the TestContactPoints modal, tests had to be adjusted
* Update texts
* initialize all new added inputs with empty data
* Update thema to latest
* Deal with s/Library/*Runtime/
* Commit new, working results of codegen
* We like pointers now
* Always take runtime arg for NewBase()
* Sketchy handwavy pass at entity meta framework
* Little nibbles
* Update pkg/framework/coremodel/entityframework.cue
Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com>
* Move file into new framework location
* Introduce loaders, Go code
* Complete rename to kind
* Flesh out framework, add svg/dashboard examples
* Cruft removal
* Remove generated kind go files from gitignore
* Refine maturity concept, add SlotKind
* Update embed and go deps
* Export PrefixWithGrafanaCUE
* Make the loader actually work, holy crap
* Many small tweaks to type.cue
* Add Apache 2 licensing exceptions for kinds
* Add new kinds dir, start of generator
* Roll back to earlier oapi-codegen
* Introduce new grafana-specific CUE loaders
* Introduce new tidy code generators framework
* Catch up kind framework with tinkering
* Add slices for the generators
* Add write/verify step to main generator
* Many renames
* Split up kind framework cue files
* Use kind.Decl within generated kinds
* Create kind.SomeDecl wrapper type to cache lineages
* Better names again
* Get one generated implemented, hopefully
* Copy dashboard schema into new kind.cue
* Small fixes to make the initial gen work
* Put svg kind in its new home
* Add generated Go dashboard type
* More renames and cleanups
* Add base kind registry and generator
* Stop blacklisting *_gen.go files
This is not the Go best practice, anyway. All we actually want to ignore
for enterprise is generated wire files.
* Change codegen output directories
pkg/kind -> pkg/kinds
pkg/registry/kindreg -> pkg/registry/corekind
* Rename pkg/framework/kind to pkg/kindsys
* Add core structured kind generator
* Add plural and machine names to kind spec
* Copy playlist over to kind system
* Consolidate kindsys files
* Add raw kind generator
* Update CODEOWNERS for kind framework
* Touch up comments a bit
* More docs tweaks
* Remove generated types to reduce noise for review
* Split each generator into its own file
* Rename Slot kind to Composable kind
* Add handwavy types for customkind loading
* Guard against init calls to framework loader
* First pass at doc on extending the kind system
* Improve attribute example in docs
* Fix wire imports
* Add basic TS types generator
* Fix composable kind category def
* No need for a separate file with generate directive
* Catch dashboard schema up
* Rename generator types to something saner and generic
* Make version configurable in ts/go generators
* Add CommonMeta to ease property access
* Add kindsys prop indicating whether lineage is group
* Put all kind categories back in a single file
* Finish with kindsys group props
* Refactor maturity progression per discussion
- Replace "committed" with "merged"
- All kindcats can use all maturity levels, at least for now
* Convert ts veneer index generator to modular system
* Move over to new jennywrites framework
* Strip down old coremodel generator
* Use public version of jennywrites
* Pull latest thema
* Commit generated Go types
* Add header injection postprocessor
* Move sdboyer/jennywrites to grafana/codejen
* Tweak header output
* Remove dashboard and playlist coremodels
* Fix up backend dashboards devenv test
* Fix TS import patterns to new gen filename
* Update internal imports, remove coremodel registry
* Fix compilation errors, wire generation
* Export and replace the prefix dropper
* More Go struct and field name changes
* Last name fixes, hopefully
* Fix lint errors
* Last lint error
Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com>
* Remove URL-based alertmanagers from endpoint config
* WIP
* Add migration and alertmanagers from admin_configuration
* Empty comment removed
* set BasicAuth true when user is present in url
* Remove Alertmanagers from GET /admin_config payload
* Remove URL-based alertmanager configuration from UI
* Fix new uid generation in external alertmanagers migration
* Fix tests for URL-based external alertmanagers
* Fix API tests
* Add more tests, move migration code to separate file, and remove possible am duplicate urls
* Fix edge cases in migration
* Fix imports
* Remove useless fields and fix created_at/updated_at retrieval
Co-authored-by: George Robinson <george.robinson@grafana.com>
Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
* feat(Connections): create sub-pages wrapped by `<Page>`
* feat(Connections): rename the Connections page and update routes
* feat(Connections): use new url for editing datasources
* refactor(Connections): remove unused tab components
* feat(Connections): update routes and nav titles
* tests: fix tests for Connections
* tests: fix typo in backend tests
* WIP: try to support removing series endpoint for supported clients
* add other filter variables to match param for label values query against filter values, in order to resolve bug in which filter value options would display that aren't relevant in the current query editor context, i.e. options would display that upon select would display no data
* clean up console logs
* refactor and comment
* expanding current unit test coverage to cover calls to new API
* fix unit test
* whitespace
* prettier
* WIP: need to merge in other PR
* WIP giving up and trying again
* WIP: most functionality is working, split out shared loki/prom code
* fix bug in which search results wouldn't take other label context into the query
* Fix bug in which the previously selected value would conflict with the async search
* interpolate the label name string instead of the match promql expression
* remove type assertions
* remove type assertion
* clean up generic confusing types, and add back in a type assertion
* remove generic type
* make sure to interpolate label names
* fix bugs with variables not interpolating before query
* remove debug
* assert partial properties on QueryBuilderLabelFilter
* Force update betterer results :(
* update regex so dropdown UX more closely matches current behavior
* add eslint ignore
* add eslint ignore and update betterer
* Added labels
* App page fixes
* Switch to switch
* wip
* Updates
* I am stuck
* Minor tweak
* This props interface could work
* removed change
* use new page extensions in plugin details page
* add link separator, fix action button spacing
* some renaming
* Move PageInfo into it's own folder + add tests
* add support for new props in old page header
* remove PluginDetailsHeader as it's no longer used
* Fix unit tests
* fix some badge alignments
* center align actions
* badge alignment + only show downloads for community/commercial plugins
* better link alignment
* conditionally render description
* move install control warnings to below subtitle + refactor
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
* First baby steps
* First baby steps
* No progress really
* Updates
* no progress
* refactoring
* Progress on sub menu and value selectors
* Some more tweaks
* Lots of progress
* Progress
* Updates
* Progress
* Tweaks
* Updates
* Updates to variable system
* Cleaner tests
* Update
* Some cleanup
* correct test name
* Renames and moves
* prop rename
* Fixed scene template interpolator
* More tests for SceneObjectBase and fixed issue in EventBus
* Updates
* More tweaks
* More refinements
* Fixed test
* Added test to EventBus
* Clone all scene object arrays
* Simplify
* tried to merge issue
* Update
* added more comments to interface
* temp progress
* Trying to simplify things, but struggling a bit
* Updated
* Tweaks
* Progress on fixing the select componenet and typing, and sharing code in a base class
* Updated
* Multi select
* Simpler loading state
* Update
* removed failOnConsole
* Removed old funcs
* Moved logic from update manage to MultiValueVariable
* Added tests for MultiValueVariable logic
* Made value a more abstract concept to support object values
* renamed func to getValueText
* Refactored and moved logic to VariableSet
* Added test for deactivation and query cancelling
* Tweaks
* Fixed lint issues
* feat(loki-monaco-editor): update tests
* chore(loki): use unified datasource mock function in tests
* chore: enable monaco feature flag in tests
* feat(loki-monaco-editor): add test case for disabled feature
* feat(loki-monaco-editor): enable by default
* Revert "feat(loki-monaco-editor): enable by default"
This reverts commit 08904f94a707a4fa32aa1e7f3f0de377575a7636.
* feat(loki-monaco-editor): enable from registry
* feat(loki-monaco-editor): make feature flag frontend only
* add other filter variables to match param for label values query against filter values, in order to resolve bug in which filter value options would display that aren't relevant in the current query editor context, i.e. options would display that upon select would display no data
* expanding current unit test coverage to cover calls to new API
* interpolate the label name string instead of the match promql expression
The existing code uses `instanceof Error` to check for a `message` field on the thrown object. The objects that are thrown are never instances of the error interface. This change introduces a new type that extends Error so that the check works properly and displays a meaningful error message in the UI.
* add line-contains-case-insensitive operation definition
* add loki operation id for line-contains-case-insensitive
* make query case-insensitive when using line filter
* remove console log from operationUtils.ts
* add line-does-not-contain-case-insensitive operation definition
* add loki operation id for line-does-not-contain-case-insensitive
* make query case insensitive when using line-does-not-contain-case-insensitive
* update title and min-width for line-contains-case-insensitive
* add caseInsensitive optional parameter
* toggle case insensitive on operations
* remove console log
* update operation names
* add test coverage
* update to implement suggestions
* add suggestion
* chore: fix go lint issues
* feat(Routing): route standalone plugin pages to the `AppRoutePage`
* feat(plugin.json): introduce a new field called `isCorePage` for `includes`
* chore: add explanatory comments for types
* refactor(AppRootPage): receive the `pluginId` and `pluginSection` through the props
Now we are able to receive these as props as the pluginId is defined on navLinks
that are registered by plugins.
* chore: update teests for AppRootPage
* fix: remove rebase issue
* tests(applinks): add a test for checking isCorePage plugin page setting
* refactor(applinks): update tests to use FindById() and be more resilient to changes
* fix: Go lint issues
* refactor(routes): use cleaner types when working with plugin nav nodes
Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
* chore: fix linting issues
* t: remove `isCorePage` field from includes
Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
- Delete public dashboard button added in public dashboard modal
- Delete public dashboard button refactored in order to be used in audit table and public dashboard modal
- Tests added
- RTK Query api modified, in order to keep cached data because of having to show public dashboard modal once delete modal is closed.
- RTK Query specific cached data invalidated for public dashboard
- Save button text changed: Create public dashboard when it was never created. Save public dashboard when there's a public dashboard already created
- Public Dashboard modal subscribed to DashboardModel metadata changes
* Perf: remove structureRev logic from Graph in Explore
* Avoid reinitializing uPlot when not needed
* move fieldConfigRegistry
* restore usememo for dataWithConfig
* Update credentials form with data-testids and aria-labels
* Update gitignore
* Add example dashboard
* Stub out E2E test for creating ds and importing dashboard
* Add component selectors
* Remove subscription check temporarily
* Appropriately set disabled prop
* Fix lint issues
* Update to use selectors and wait on subscriptions request
* Add test for metrics panel
- Add required selectors for resource picker and metrics query editor
* Add logs and ARG basic query scenarios
- More selector updates
* Add E2E test for template variables
- Tests advanced resource picker
- Adds required selectors
* Remove log and add annotation e2e test
* Update test
* Prettier/betterer updates
- Remove gitignore change
* Lint issues
* Update betterer results
* Lint issue and remove unneeded import
* Don't print certain commands
* Avoiding flakiness
- Ensure code editor has sufficient time to load in ARG test
- Avoid flakiness around correct template variable being selected by typing in resource name
* Remove be.visible requirement
* Update test
* Update selector name
* Reuse datasource
* Fix datasource reuse and combine query tests
* Remove import dashboard step as unneeded
* Review
- Randomise datasource name
- Skip annotations test
- Remove unused example dashboard
* Update to ensure e2e test works in CI
* Update e2e test
- Update environment variables (process is not available in cypress)
- Add wait on resource picker searches to avoid flakiness
- Update subscription and resource group names
* Update CODEOWNERS
* Parse credentials in CI from outputs file
* Update outputs file path
* Fix selector
* Undo selector change
* Update e2e tests
- Set default subscription
- Fix datasource selection in variable editor
- Fix resource picker search flakiness
- Set subscription in ARG query test
- Fix resource group selection
- Update resource group
* Review
* Review 2
This PR splits the create and update paths for public dashboards and includes assorted refactors toward a proper REST API. Additionally, we removed the concept of a "public dashboard config" in favor of "public dashboard"
Co-authored-by: juanicabanas <juan.cabanas@grafana.com>
Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
* Show rules list for the group with the For duration, and add validation for keeping all rules in the same group with a valid For
* Sort rules by For duration
* Add number evaluations column in alert list
* Add Error badge in column #evaluations in case of invalid For
* Add test for getNumberEvaluationsToStartAlerting method
* Move re-usable new InfoIcon component into a separate file in unified components folder
* Add edge case for getNumberEvaluationsToStartAlerting method, and change some namings
* Started search state refactor
* Things are working
* Move more to statemanger
* minor tweaks
* Fixed name of hook
* revert yarn.lock changes
* Harderning StateManagerBase
* More tests and refinements
* Fixed unit test
* More polish
* fixing tests
* fixed test
* Fixed test
* first stab at context away plugin tracking.
* adding a plugin context and a hook to get hold of a tracker that always appends the plugin context information.
* wip
* improved the code a bit.
* wip
* Fixed type errors.
* added datasource_uid to data sources.
* fixed error message when trying to use hook outside of context.
* small refactoring according to feedback.
* using the correct provider for data source context.
* check not needed.
* enforcing the interaction name to start with grafana_plugin_
* exposing guards for the other context type.
* added structure for writing reporter hook tests.
* added some more tests.
* added tests.
* reverted back to inheritance between context types.
* adding mock for getDataSourceSrv
* user essentials mob! 🔱
lastFile:pkg/services/libraryelements/writers.go
* user essentials mob! 🔱
lastFile:pkg/services/libraryelements/writers.go
* user essentials mob! 🔱
lastFile:pkg/services/libraryelements/writers.go
* user essentials mob! 🔱
lastFile:pkg/services/libraryelements/writers.go
* user essentials mob! 🔱
lastFile:pkg/services/libraryelements/database.go
* user essentials mob! 🔱
lastFile:pkg/services/libraryelements/writers.go
* user essentials mob! 🔱
lastFile:pkg/services/libraryelements/writers.go
* user essentials mob! 🔱
* support filterFolderUIDs in the frontend
* move common logic to a variable
* fixed FolderLibraryPanelsPage and improved unit test
* fix backend lint error
* fix formatting error
Co-authored-by: Joao Silva <joao.silva@grafana.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: eledobleefe <laura.fernandez@grafana.com>
Co-authored-by: joshhunt <josh@trtr.co>
- Migrate Postgres query editor to react
- Add support for field aliasing in SELECT clauses to SQL based datasources
Co-authored-by: Kyle Cunningham <kyle@codeincarnate.com>
Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
PublicDashboards: delete button added in public dashboard table in order to delete a public dashboard.
Co-authored-by: Jeff Levin <jeff@levinology.com>
* Move view edit and delete buttons to RulesTable
* Move tests for edit and delete buttons to a new test file for RulesTable
* Action buttons: Only show icon for non large screens, and add a Tooltip
* Remove buttons moved from the RuleDetailsActionButtons component
* Fix horizontal aligment for icons for non large devices
* Add phlare datasource
* Rename
* Add parca
* Add self field to parca
* Make sure phlare works with add to dashboard flow
* Add profiling category and hide behind feature flag
* Update description and logos
* Update phlare icon
* Cleanup logging
* Clean up logging
* Fix for shift+enter
* onRunQuery to set label
* Update type naming
* Fix lint
* Fix test and quality issues
Co-authored-by: Joey Tawadrous <joey.tawadrous@grafana.com>
This PR fixes the naming of routes for public dashboards to be more accurate and descriptive.
Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>