Commit Graph

206 Commits

Author SHA1 Message Date
Torkel Ödegaard
32fafffed7
PanelQueryRunner: Return previous processed (transform+field config) series for loading state (#67768)
* Return same series for loading state

* Fix shared query issue

* include structureRev

* heatmap should depend on the series, not the wrapper

* fix more panels

* keep config for comparison

* fieldConfig.fieldConfig!

* cleanup

* cmon

---------

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-05-07 15:21:40 +02:00
Ivan Ortega Alba
cdf8555ace
Use URL isFirstPanel to enable panel editor onboarding (#67546) 2023-04-28 19:09:44 +02:00
Gilles De Mey
b94fceddad
Alerting: Make Loki & Prometheus instant vector by default (#66797)
Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
2023-04-27 17:38:22 +03:00
Dominik Prokop
a62cb96089
QueryGroup: Fix infinite loop in edit mode (#67273) 2023-04-26 04:41:31 -07:00
Victor Marin
efd0e9cbea
Datagrid Panel: Edit data within your dashboards (#66353)
* wip

* Datagrid WIP: snapshotting when data edited, better UI for adding column/rows, refactors

* wip

* WIP

* wip

* Add series selector

* Delete selection on key press

* wip

* Multiple row select and delete

* wip

* draggable rows/columns, better column width calculator

* bug fixes

* scrollbars

* add feature flag

* bugfixes

* bugfixes

* bugfixes

* bugfixes

* Add possibility to rename column

* Input fixes

* bugfixes

* bugfixes

* performance optimisations

* WIP component refactoring and optimisations

* comment bit of code to remove error for testing

* fix column move and payload types

* WIP refactors and tests

* e2e tests

* queryGroup subscription refactor

* queryGroup - add component on update, fix failing tests

* refactor querygroup

* querygroup refactor

* tests

* fix codeowners validation

* lint fixes

* revert convertFieldType modification in favor of already merged mod + re-add mistakenly deleted line

* remove //ts-ignores

* Minor style tweaks

* fix

* align colors with theme

* fixes

* refactor

* add test for convertFieldType transformer and write todo

---------

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2023-04-24 17:46:31 +03:00
Torkel Ödegaard
0f9c6be3f0
QueryGroup: Cleanup leftovers from hackathons (#67048) 2023-04-21 15:32:47 +02:00
Ivan Ortega Alba
40c7b3126e
Prompt DS modal when the user adds the first panel to a dashboard (#66911)
* Prompt DS modal when the user adds the first panel to a dashboard

* Rename state prop and use toggle

* Change modal size

* Avoid flickering for dashboard modal when changing number of results

* When editing panel 1, only display when new dashboard
2023-04-20 13:44:19 +02:00
Ivan Ortega Alba
c7af53b79f
[Under FF] New DS Picker with advance mode (#66566)
* Add a wrapper to switch between the previous and new DS picker depending on the feature toggle advancedDataSourcePicker.

* Add a new component to represent the modal DS picker, which we will refer as advanced DS picker
Integrate this into the Edit panel, for now, until we're ready to replace everywhere the grafana-runtime DS picker by the wrapper.

* Replace Drawer component with the dropdown

* Adjust the first version of the styles to fit into this Figma design

* Adjust the design of the FileDropzoneDefaultChildren to match with the new DS modal but everywhere else is used nowadays.

---------

Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
2023-04-19 16:08:09 +03:00
Ryan McKinley
9452c0d718
Annotations: Support filtering the target panels (#66325)
Co-authored-by: Adela Almasan <adela.almasan@grafana.com>
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
2023-04-18 15:39:30 -05:00
Ryan McKinley
39c04a8e36
Chore: Remove deprecated dashboardId from panel query runner (#64786) 2023-04-14 16:50:10 -07:00
Ivan Ortega Alba
7bc31ab04b
Replace the DS drawer toggle with the new DS picker one (#66551) 2023-04-14 13:01:10 +02:00
Gábor Farkas
4ded937c79
Show traceids for failing and successful requests (#64903)
* tracing: show backend trace ids in frontend

* better trace id naming

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>

* better trace id naming

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>

* better trace id naming

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>

* added feature flag

* bind functionality to the feature flag

* use non-generic name for traceid header

* fixed tests

* loki: do not create empty fields

* do not add empty fields

* fixed graphite test mock data

* added unit-tests to queryResponse

* added unit-tests for backend_srv

* more typescript-friendly check

* added unit-tests for runRequest

---------

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
2023-04-05 09:13:24 +02:00
Torkel Ödegaard
b7b608418d
Templating: Introduce macros to simplify and optimize some scopedVars (#65317)
* Templating: Introduce macros to simplify and optimize some scopedVars

* Fixing tests

* fix test

* minor fix

* refactoring so macros work with formatting

* remove breaking change and keep current inconsistency

* Rename valueIndex to rowIndex

* Minor fixes

* Added test dashboard

* Added tags to dashboard

* Update

* Added test to check it returns match

* Update

* Fixed dashboard

* fix
2023-03-28 19:22:34 +02:00
Artur Wierzbicki
4274b9414f
Chore: remove querylibrary feature toggle (#65021)
* chore: remove querylibrary

* chore: remove querylibrary

* chore: remove querylibrary
2023-03-20 20:00:14 +04:00
Alexa V
fef0ee913c
Panel Header: Add CancelQuery option to panel header (#64796)
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
2023-03-16 13:56:58 +01:00
Ashley Harrison
e0e6165f70
Chore: adjust more unit tests to work with react 18 (#64759)
adjust unit tests to work with react 18
2023-03-15 10:12:13 +00:00
Ashley Harrison
85e5326040
Chore: Adjust unit tests so they work with react 18 (#64698)
tweak unit tests so they work with react 18
2023-03-14 17:24:04 +00:00
Polina Boneva
0b1ad0a879
Query Editor: Internal context to actions (#64518)
loadedDataSourceIdentifier is not always loaded, but always queried; comment adds understanding to a specific use case
2023-03-09 16:43:13 +02:00
kay delaney
312117bdfe
DatasourceVariables: Update query editor when switching datasources from picker (#62617) 2023-03-08 11:24:29 +00:00
Torkel Ödegaard
4bf23b7f5f
PanelData: move preProcessPanelData to @grafana/data (#63743) 2023-03-06 10:59:47 +01:00
Andres Martinez Gotor
c84cfd2b3f
Plugin query API: Handle multiple errors (#63553) 2023-03-02 11:25:50 +01:00
Oscar Kilhed
dc1600ff14
DataSourcePicker: Add new style of data source picker. (#63736)
* MVP of a new datasource picker

* Add datasource select history, naming DatasourceSelect -> DataSourceDrawer

* refactor cards

* Cleanup and fixing sort order for recents

* add feature flag

* fix feature flag name and use it

* Highlight selected

* Move new ds picker to core

* Restore original datasource picker

* Remove unused property

* update yarn.lock

* Rename folder, update codeowners

* add test for util functions

* Remove es-lint exception

* Change feature toggle description

* remove unnecessary if

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>

* Make test a bit more clear

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>

* Clean up api, filter once and before maps, minor code cleanup

* Fix prettier issue

---------

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
2023-03-01 11:26:19 +01:00
Ashley Harrison
19d1a46f30
A11y: remove onClick from collapsed text (#62495)
remove onClick from collapsedText
2023-02-24 10:36:04 +00:00
Abdul
5ec8e370f7
Expressions: Add tests for the QueryEditorRows and QueryGroup components (#63394)
* add QueryGroup onAddQueryClick and onExpressionClick tests

* add test's for the query group component

- new query/expression should be expanded
- adds query/expression onclick

* add open data source help modal test

* add disabled expression test

* add query editor rows test

* rm unused attributes, rm renderScenario required override
2023-02-22 17:26:41 +02:00
Ashley Harrison
f8d89eff56
Chore: fix type errors in tests (#63270)
* fix any's in tests

* fix more any's in tests

* more test type fixes

* fixing any's in tests part 3

* more test type fixes

* fixing test any's p5

* some tidy up

* fix template_srv
2023-02-14 16:46:42 +01:00
Michael Mandrus
7391793504
Query Caching: Add per-panel query caching TTL (#61968)
* *Create Caching Config interface and OSS impl
*Create front-end facing DS Cache config
*Populate Caching Config on Datasource DTO
*Update OSS wire deps

* fix unit test

* handle query caching TTL override on the frontend

* Make sure the override works with pubdash

* move caching config to the right place in the ds info

* move caching config logic to enterprise index hook

* move queryCachingTTL to pubdash query payload

* Remove  from metadata (not needed)

* rename struct and add comment

* remove invalid wire dependency

* manual revert of 395c74b

* fix frontend test

* fix backend test

* fix tests for real this time

* truly fix frontend test

* fix back end unit test for real
2023-02-02 23:39:54 -05:00
Ida Štambuk
ec01e6d6b2
Query Panels: Pass on loading state (#62545) 2023-02-02 16:48:13 +01:00
Andreas Christou
3ac97dd396
TemplateVariables: Fix custom variable function support (#62509)
Validate query values
2023-01-30 17:49:16 +00:00
Ida Štambuk
f1a2a76897
Datasources: Use getDefaultQuery in annotations editors (#61870)
+ Add Cloudwatch default annotation
2023-01-30 16:45:03 +01:00
Torkel Ödegaard
bfcf936c38
QueryEditorRows: Remove double callback from onDataSourceChange (#62172)
* QueryEditorRows: Remove double callbacked from onDataSourceChange

* A few more updates

* Updated
2023-01-27 13:30:12 +01:00
Torkel Ödegaard
9f7ddf1f0b
QueryEditorRow: Fixes issue loading query editor when data source variable selected (#61927)
* QueryEditorRow: Fixes issue loading query editor when data source variable selected

* Fix func name

* Removed wait

* restore waiting for with better check

* restore waiting for with better check
2023-01-26 11:07:17 +01:00
Laura Benz
9400ccf478
Glue: Validate target query in correlations page (#57245)
* feat: add draft version of validate button

* feat: add some styling and basics

* temp: intermediate result

* refactor: solve TODOs

* refactor: replace string in state

* refactor: replace error message style

* refactor: set validate state on change in ds

* refactor: add QueryRunner

* refactor: add QueryRunner

* temp: temporary status

* Emit PanelData to check if the query is valid

* refactor: clean up

* refactor: improve a11y of error message and adjust test

* Remove deprecated property call, change equality

* refactor: add changes from code review

* refactor: remove memory leak

* refactor: replace query runner

* refactor: adjust error handling

* refactor: move testing to related unit test

* refactor: clean up test for QueryEditorField

* refactor: clean up test for CorrelationsPage

* refactor: repair test

* refactor: clean up

* refactor: add refId in order avoid errors when running Loki queries

* refactor: replace buildQueryTransaction + set query to invalid if query is empty

* refactor: add empty query value to test cases

* refactor: end handleValidation after setIsValidQuery()

* refactor: refactor test

* refactor: fix last two tests

* refactor: modify validation

* refactor: add happy path

* refactor: clean up

* refactor: clean up tests (not final)

* refactor: further clean up

* refactor: add condition for failing

* refactor: finish clean up

* refactor: changes from code review

* refactor: add response state to condition

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>

* refactor: fix prettier issue

* refactor: remove unused return

* refactor: replace change in queryAnalytics.ts

* refactor: remove correlations from query analytics

* refactor: remove unnecessary test preparation

* refactor: revert changes from commit 4997327

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
Co-authored-by: Kristina Durivage <kristina.durivage@grafana.com>
2023-01-12 11:43:40 +01:00
Ezequiel Victorero
34a865ebf0
PublicDashboards: remove publicDashboardUID from insights event request (#60649) 2023-01-11 18:25:18 -03:00
Marcus Andersson
b633d5395d
Bugfix: Prevent previous query editor to set default values when changing data source (#60218)
* Fixed issue where the query editor of the previous ds sets default values on query passed to the query editor of the next ds.

* Fixed issue with changing data source for query in Alerting.

* Will apply default values from DS if available.

* Fix failing tests.

* fixed spell error.

* reverted getDefaultQuery call so it can be added in a separate PR.
2023-01-11 14:06:33 +01:00
Torkel Ödegaard
bd90a6e1be
Transformations: Add context parameter to transformDataFrame and operators (#60694)
* Transformations: Add context parameter to transformDataFrame and operators

* Remove unused queries prop

* Fixed test

* Fixed test
2023-01-05 17:34:09 +01:00
Will Browne
9aed364898
Plugins: Fix plugin query help markdown (#60485)
* refactor(pluginhelp): rewrite as functional component with useAsync

* mimic old behaviour

* feat(pluginhelp): display message if backend returned an empty string

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2023-01-03 14:20:27 +01:00
sam boyer
f86abf096d
schema: Use generated dashboard model in frontend (#55769)
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: polinaboneva <polina.boneva@grafana.com>
2022-12-20 15:04:14 +01:00
Josh Hunt
af719888d6
Chore: Remove any type assertion in PanelQueryRunner (#60096) 2022-12-14 14:07:22 +00:00
Josh Hunt
9a41277ecd
Dashboards: Show error when data source is missing (#60099)
Return caught exceptions to panel as error state
2022-12-14 12:37:31 +00:00
Ivana Huckova
e2077e9659
Dashboard: Run requests with correct app type (#60010)
Dashboard: Run quries with correct core app
2022-12-08 11:52:28 +01:00
Daniel Lee
74167b4d44
UsageInsights: Record events for Explore queries (#59931)
* usageinsights: record events for Explore queries

* usageinsights: make the source field optional

It is not logical to have it for an event like the dashboard-view

* usageinsights: add comment to Explore test

Explain why we are reversing a previous decision
2022-12-07 21:19:35 +01:00
Erik Sundell
32309a8373
Datasource: Fix - apply default query also to queries in new panels (#59625)
* apply default query also to new panels

* add comment

* add tests
2022-12-05 15:44:04 +01:00
Artur Wierzbicki
009d65b794
Add query library behind dev-mode-only feature flag (#55947)
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
Co-authored-by: Adela Almasan <adela.almasan@grafana.com>
Co-authored-by: drew08t <drew08@gmail.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-11-30 15:33:40 -08:00
renovate[bot]
e84a01e870
Update jest monorepo to v29 (#58261)
* Update jest monorepo to v29

* update snapshots + wrap test in act

* fix linting errors: jest.mocked now defaults to deep mocking

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-11-24 14:00:41 +00:00
matt abrams
d9b8b761e9
Query Editor: Hide overflow for long query names (#58840)
hides overflow for long query names
2022-11-16 18:22:06 +01:00
kay delaney
a8c181bf6a
Chore: Migrate usage of v1 theme to v2 (#58154) 2022-11-03 18:15:55 +00:00
Marcus Andersson
b804b2f073
Plugins: Added hook to make it easier to track interactions in plugins (#56126)
* 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
2022-11-02 16:57:57 +01:00
Kristina
5a99aff7b8
construct the datasource for the example query if not added (#57936) 2022-11-02 09:50:10 -05:00
kay delaney
b49713d323
Chore: Remove unused files (#57515) 2022-10-25 23:34:53 +01:00
lean.dev
654db452cd
Public Dashboards: Fixing annotations validations for public dashboards (#57455) 2022-10-21 12:06:39 -03:00