Commit Graph

423 Commits

Author SHA1 Message Date
Ryan McKinley
0a7a5b13fe
Heatmap: Remove legacy angular based implementation (#59249)
remove angular heatmap
2022-11-23 10:46:21 -08:00
Andre Pereira
183b279274
Explore: Sub-tables support for Table component (#58682)
* First commit with working version of sub-tables using subData array

* Update TableContainer and query result to support a dataframe array for the table result

* Fix border issue by moving the subtable to above the cells in the DOM

* Allow header to be configurable using custom options.

* Update TablePanel to support sub-tables

* Fix main row links

* Added tests

* Fix TablePanel correctly splitting frames and sub-frames by using refId
2022-11-23 17:49:32 +00:00
Ashley Harrison
d33b4918cd
Chore: more any/type assertion improvements (#59229)
more any/type assertion improvements
2022-11-23 16:54:57 +00:00
Drew Slobodnjak
ee8f292c6a
Geomap: Improve location editor (#58017)
* add custom component for location editor

* FC cleanup

* Apply filter to add location fields call

* Create custom editor for location mode

* Apply validation logic and render warning

* Improve alert styling

* Add help url button to location alert

* Add success alert for auto

* Remove completed TODOs

* Only use alert on error, not success

* Change location mode to dropdown

* Change alert severity to less severe, info

* Prevent auto field selection during manual

* Update location testing to be for auto mode

* Run geo transformer editor init once

* Fix breaking test

* Clean up some anys

* Update styling for alert

* Remove auto success styling

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
2022-11-22 11:24:56 -08:00
Torkel Ödegaard
156ed4b56c
VizPanel: Support panel migrations and state changes (#58501)
* VizPanel: Make it more real

* Updates

* Progress on query runner and max data points from width

* Updated

* Update

* Tests

* Fixed issue with migration

* Moving VizPanel

* Fixed migration issue due to pluginVersion not being set

* Update public/app/features/scenes/querying/SceneQueryRunner.test.ts

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

* Some minor review fixes

* Added expect

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
2022-11-21 15:31:01 +01:00
Josh Hunt
b1ffe18599
Chore: Fix some as HTMLElement type assertions (#58667) 2022-11-21 13:05:55 +00:00
Leo
27b6b3b3bd
Folder: Replace folderId with folderUid (#58393)
* 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
2022-11-17 09:22:57 +01:00
Torkel Ödegaard
20133ec6fb
Variables: Use new format registry from templateSrv (#58813)
* Variables: Use new format registry from templateSrv

* Updated comment

* Fixed e2e
2022-11-16 14:55:31 +01:00
Torkel Ödegaard
8c585a4ebf
Scene: Variables interpolation formats and multi value handling (#58591)
* 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>
2022-11-16 11:36:30 +01:00
Torkel Ödegaard
84a69135a7
Scene: Variables and support for declaring variable dependencies and getting notified or re-rendered when they change (#58299)
* 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
2022-11-15 12:54:24 +01:00
Dominik Prokop
80e80221b9
Scenes: Grid layout (#56737)
* 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>
2022-11-15 00:49:39 -08:00
Ryan McKinley
d33939da55
DataSourceWithBackend: Add plugin id to the request headers (#58082) 2022-11-14 19:35:50 -05:00
Ashley Harrison
500cf16142
Chore: fix some types (#58662)
chore: fix some types
2022-11-11 16:29:49 +00:00
Nathan Marrs
47055561ec
Canvas: Fix setting icon from field data #58499 2022-11-10 10:56:31 -08:00
Galen Kistler
ee7348afee
Prometheus: Query builder label filters dropdown UI overload fix (#58266)
* 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
2022-11-09 14:54:51 -05:00
Ashley Harrison
159607fe6f
Navigation: Convert PluginDetails page to use new Page extensions (#58509)
* 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>
2022-11-09 14:44:38 +00:00
Torkel Ödegaard
b5651803e0
Scene: ObjectVariable for supporting the built in system variables and object scoped variables (__data for example) (#58291)
* Scene: Adds ObjectVariable to support the built-in/system variables

* fixed lint issue
2022-11-09 10:27:20 +01:00
Levente Balogh
eb3ee35e1c
Frontend Routing: Always render standalone plugin pages using the <AppRootPage> (#57771)
* 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>
2022-11-07 15:19:31 +01:00
Ryan McKinley
bff19747bd
Timeseries: Use standard editor for fillBelowTo field picker (#58283) 2022-11-04 22:00:46 -07:00
Giordano Ricci
4758bbcb61
Explore: don't re-init the Graph on every data change (#57906)
* Perf: remove structureRev logic from Graph in Explore

* Avoid reinitializing uPlot when not needed

* move fieldConfigRegistry

* restore usememo for dataWithConfig
2022-11-04 15:05:06 +00:00
Adela Almasan
9c7b6b1ce8
Canvas: Extend root context menu (#58097) 2022-11-03 17:30:12 +00:00
Giordano Ricci
e6b088fbf5
Explore: Fix shared crosshair for logs, logsvolume and graph panels (#57892)
* Explore: enable shared corsshair for logs, logsvolume & graph panel

* avoid recreating a scoped bus on every render
2022-11-03 09:55:02 +00:00
Ashley Harrison
b8303fd431
Chore: Convert SpanTreeOffset test to RTL (#56195)
* convert SpanTreeOffset tests to RTL (minus mouseenter/mouseleave tests)

* fix remaining tests
2022-11-03 09:31:09 +00:00
Ivana Huckova
a83dee6031
Elasticsearch: Add trace to logs functionality (#58063)
* Elasticsearch: Implement trace to logs

* Fix tests
2022-11-03 09:52:40 +01:00
Torkel Ödegaard
915ebcf832
Search: Refactor state and logic to be less fragmented and spread out (#57973)
* 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
2022-11-03 08:29:39 +01: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
Zoltán Bedi
26659baf8f
PostgreSQL: Migrate to React (#52831)
- 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>
2022-11-02 11:30:35 +07:00
Torkel Ödegaard
f0ab4bea8c
Scene: SceneObject and SceneObjectBase refinements and stricter typing (#57851) 2022-10-31 15:16:16 +01:00
Adela Almasan
a5c492b033
Canvas: Add tabs to inline editor (#57778) 2022-10-28 13:36:19 -04:00
Gilles De Mey
2a36301817
Alerting: Fall back to "range" query type for unified alerting when "both" is specified (#57288) 2022-10-27 17:22:23 +02:00
Ryan McKinley
7346280316
LibraryPanels: Load library panels in the frontend rather than the backend (#50560)
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2022-10-26 15:38:20 -07:00
kay delaney
b49713d323
Chore: Remove unused files (#57515) 2022-10-25 23:34:53 +01:00
Ashley Harrison
d2a70bc42d
Chore: more any/type assertion improvements (#57450)
* more friday any/type assertion improvements

* Apply suggestions from code review

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* Update public/app/angular/promiseToDigest.test.ts

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2022-10-25 11:04:35 +02:00
Nathan Marrs
9d857f4d61
Canvas: Improve resource picker initialization (#57319) 2022-10-24 13:40:28 -07:00
Adela Almasan
73c215ae41
Canvas: Button element (alpha) (#57491) 2022-10-23 20:39:10 -04:00
Brendan O'Handley
60b14a2ec2
Opentsdb: Allow template variables for filter keys (#57226)
* allow template variables for filter keys

* add types to interpolate var function
2022-10-20 15:53:29 -05:00
Gilles De Mey
423643aaa6
Alerting: use virtualized list of namespaces / groups for cloud rules (#56415) 2022-10-18 13:38:59 +02:00
Gábor Farkas
2815343ee5
logs: handle mixed datasources in filters (#56560)
* logs: handle mixed datasources in filters

* removed unnecessary special handling

* added explanation comment

* more consistent type-handling
2022-10-18 09:27:17 +02:00
kay delaney
ed71b7b884
Chore/React18: Remove enzyme slate tests and replace with e2e tests (#57095) 2022-10-17 16:31:59 +01:00
Alexa V
6524a0b437
Chore: Rename grafana core PanelChrome and use grafana-ui - PanelChrome component (#56659) 2022-10-17 16:03:38 +02:00
kay delaney
5d53a983d8
React18: Update useCallback arg types where needed (#57084) 2022-10-17 14:52:12 +01:00
Ashley Harrison
3cca8e3676
any/type assertion fixes (#57009) 2022-10-17 10:10:10 +01:00
kay delaney
e85917f041
Chore/React18: Update component prop types (#56898) 2022-10-14 10:24:32 +01:00
Ashley Harrison
5af36e48ba
convert ThresholdsEditor to RTL (#56791) 2022-10-13 08:56:36 +01:00
Ashley Harrison
7d18460d8f
Chore: convert MetricSelect test to RTL (#56801)
* convert MetricSelect test to RTL

* remove type param
2022-10-12 16:33:12 +01:00
kay delaney
45edce90d3
VariableEditor: Use new form styles (#56326) 2022-10-12 09:43:41 +01:00
Victor Marin
48c27872af
TablePanel: Footer now updates values on column filtering (#56354)
* Table footer now updates values on column filtering

* Backwards compatibility
2022-10-12 07:57:49 +03:00
Piotr Jamróz
ae927eab73
Glue: Enrich query results data frames in Explore with correlations to generate static links from correlations (#56295)
* Attach static generic data link to data frames in Explore

* WIP

* Always load correlations config when the query is run

This will be moved to Wrapper.tsx and called only once Explore is mounted

* remove comment

* Load the config when Explore is loaded

* Clean up

* Check for feature toggle, simplify cod

* Simplify the code

* Remove unused code

* Fix types

* Add a test for attaching links

* Revert package.json changes

* Display title provided in the correlation label

* Add missing mocks

* Fix tests

* Merge branch 'main' into ifrost/integration/attach-generic-data-link

# Conflicts:
#	public/app/features/explore/Wrapper.tsx
#	public/app/features/explore/state/main.ts

* Remove redundant async calls

* Do not block Wrapper before correlations are loaded (only delay the query)

* Test showing results after correlations are loaded

* Post-merge fix

* Use more consistent naming

* Avoid null assertions

Co-authored-by: Elfo404 <me@giordanoricci.com>
2022-10-11 14:40:55 +02:00
Ashley Harrison
ff41b9544b
Chore: more typing improvements to @grafana/ui (#56544)
* improve grafana-ui types

* more type improvements

* better useState type
2022-10-07 15:22:21 +01:00
Joey Tawadrous
74c809f544
Plugins: Introduce new Flame graph panel (#56376)
* Flamegraph

* Updated flame graph width/height values

* Fix top table rendering issue

* Add feature toggle for flamegraph in explore

* Update tests

* Hide flamegraph from dash panel viz list if feature toggle not enabled

* Show table if no flameGraphFrames

* Add flame graph to testdata ds

* Minor improvement
2022-10-07 11:39:14 +01:00