Commit Graph

210 Commits

Author SHA1 Message Date
eledobleefe
332639ce43
PanelEdit: Hide multi-/all-select datasource variables in datasource picker (#52142) 2022-07-18 11:02:18 +02:00
Zoltán Bedi
4155dc8eca
SQL: Fix couple of issues in SQLDatasource (#52080)
* Fix: sql plugins feature

(cherry picked from commit 035862bade)

* SQLDS: Use builtin annotation editor

Plus strict rule fixes

(cherry picked from commit fee2eb3716)
2022-07-12 14:11:54 +02:00
Ashley Harrison
2a6b32598d
Chore: some low-hanging type assertion fruit (#51618)
* some low-hanging type assertion fruit

* results
2022-06-30 10:40:00 +01:00
Ashley Harrison
683bbc7373
Templating: Changing between variables with the same name now correctly triggers a dashboard refresh (#51490)
* user essentials mob! 🔱

* user essentials mob! 🔱

lastFile:public/app/features/variables/pickers/OptionsPicker/actions.ts

* user essentials mob! 🔱

lastFile:public/app/features/variables/pickers/OptionsPicker/actions.test.ts

* linting

* update betterer

Co-authored-by: kay delaney <kay@grafana.com>
2022-06-29 09:10:55 +01:00
Todd Treece
342344bb03
Variables: Selectively reload panels on URL update (#51003) 2022-06-24 13:06:36 -04:00
Ashley Harrison
803473f479
Chore: Enable useUnknownInCatchVariables for stricter type checking in catch blocks (#50591)
* wrap a bunch of errors

* wrap more things!

* fix up some unit tests

* wrap more errors

* tiny bit of tidy up
2022-06-15 08:59:29 +01:00
Jack Westbrook
ccd75d72f8
Chore: Remove react-testing-lib from bundles (#50442)
* refactor(selectoptiontest): move helper function out of grafana/ui so testing-lib isn't in bundle

* test(selectoptionintest): update import location of helper function

* test(amroutes): put back missing selectOptionInTest helper

* test(selectoptionintest): clean up remaining file imports / exports

* test(queryeditor): fix failing import

* refactor(grafana-ui): reuse selectOptionInTest in SelectBase test
2022-06-09 11:10:48 +02:00
Ashley Harrison
6fcb2cd307
remove exported test globals from test/lib/common (#50256) 2022-06-06 15:38:37 +01:00
sam boyer
44956aea66
Incremental improvements to dashboard schema (#48977)
* Change default of style to dark

* Separate cursor into standalone def

* Docs on timepicker and templating fields

Also add what appear to be timepicker-related fields

* Separate out AnnotationQuery definition

* Add memberNames for DashboardCursorSync

* Add sketch of VariableModel for templating field

Also changes label field from frontend from null to optional.

* Use constraints to enforce non-empty panel type

Negation (!="")  was breaking openapi exporter

* Add types and fields for links

* Remove panelVersion fields

These weren't right anyway, and they revealed a bug in the CUE openapi
generator

* Remove null label value from test

* Narrow type and set bounds on month field

* Adapt Go dashboard schema to lineage changes
2022-05-17 12:11:09 +01:00
Ashley Harrison
06d3c27bc1
Select: Portal menu by default (#48176)
* Remove menuShouldPortal from all <Select /> components

* fix unit tests

* leave menuShouldPortal as an escape hatch

* Fix import order
2022-05-04 15:12:59 +01:00
Joao Silva
2e5f797666
Variables: Fixes issue with null variables breaking the dropdown (#48644) 2022-05-04 14:27:22 +01:00
kay delaney
bb7e556efc
Templating: Prefix variable picker element IDs (#48405) 2022-05-04 11:04:15 +02:00
Adam Simpson
9db95826a4
Variables: allow Regex tooltip links to be clickable (#48560)
Fixes #48558
2022-05-02 17:44:23 +00:00
Ashley Harrison
277a83215c
Use jest.fakeTimers instead of mocking Date.now (#48121) 2022-04-22 16:00:37 +01:00
Josh Hunt
3c6e0e8ef8
Chore: ESlint import order (#44959)
* Add and configure eslint-plugin-import

* Fix the lint:ts npm command

* Autofix + prettier all the files

* Manually fix remaining files

* Move jquery code in jest-setup to external file to safely reorder imports

* Resolve issue caused by circular dependencies within Prometheus

* Update .betterer.results

* Fix missing // @ts-ignore

* ignore iconBundle.ts

* Fix missing // @ts-ignore
2022-04-22 14:33:13 +01:00
kay delaney
3606527359
Templating: Expose more informative action names for keyed actions (#48076) 2022-04-22 10:57:02 +01:00
Ashley Harrison
11bc5e1a06
Navigation: Prevent chevron overlaying navbar menus (#47988)
* Attach nav item menus to a portal that's a sibling of the chevron to prevent incorrect stacking

* Make sure hover menus size correctly

* refactor into separate component

* Fix focus behaviour

* fix test again...
2022-04-22 10:38:47 +01:00
Ashley Harrison
9595b56f0d
Chore: fix flakey frontend test (#48071)
* remove unnecessary rerender

* removed unused act import
2022-04-21 17:44:06 +01:00
Ashley Harrison
d832bde270
Upgrade @testing-library/user-event to v14 (#47898)
* Update dependency @testing-library/user-event to v14

* everything is async...

* everything is async pt.2

* Fix cascader tests

* hack the yarn.lock file to remove the old version of @testing-library/dom

* some more fixes!

* MOAR FIXES

* more fixes

* remove a bunch of places where we're wrapping in act()

* down to 7 failing tests...

* Fix arrow tests

* Fix rest of NavBarItem tests

* Fix last tests

* Use {Enter} instead of {enter}

* Revert "Use {Enter} instead of {enter}"

This reverts commit e72453bb52.

* remove some unused act imports

* Fix LibraryPanelsSearch tests

* more stable test

* More consistent test...

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-04-21 13:15:21 +01:00
Ashley Harrison
eddefdc274
Variables: Ensure variables in query params are correctly recognised (#47049)
* user essentials mob! 🔱

* user essentials mob! 🔱

* update comment

Co-authored-by: kay delaney <kay@grafana.com>
Co-authored-by: Alexandra Vargas <alexa1866@gmail.com>

Co-authored-by: joshhunt <josh@trtr.co>
Co-authored-by: kay delaney <kay@grafana.com>
Co-authored-by: Alexandra Vargas <alexa1866@gmail.com>
2022-03-31 15:59:14 +01:00
kay delaney
f486b54b84
Navigation: Rough implementation of new navbar design (#46909) 2022-03-30 18:05:52 +01:00
Braden Snell
9a850de5a8
Variables: add graceful circular dependency failure (#46590)
* adds circular dependency check

* adds circular dep test
2022-03-29 11:18:59 +01:00
Yaelle Chaudy
9fc9708ba5
Fixed new variable button keyboard clickable (#46293) 2022-03-09 20:35:53 +01:00
Yaelle Chaudy
ed7701c6b2
Updated span for Button to be accessible (#46296) 2022-03-08 12:42:03 +01:00
Ashley Harrison
d3700c4032
Chore: Remove console output from some jest tests (#45792)
* Chore: Remove console output from some jest tests

* Skip manual performance test
2022-02-24 10:49:48 +00:00
Ashley Harrison
5e3be8b17f
Variables: Fix adding variables to an unsaved dashboard (#45722)
* 🚧: Mob session work 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* 🚧: Mob session work 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
Co-authored-by: Alexandra Vargas <alexa1866@gmail.com>
2022-02-22 13:21:01 +00:00
Hugo Häggmark
dbec2b02fd
Variables: move state tree into a keyed state (#44642)
* Variables: move state tree into a keyed state

* Update public/app/features/variables/state/transactionReducer.ts

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>

* Chore: fix prettier error

* Chore: renamed slices and lastUid

* Chore: rename toUidAction

* Chore: rename dashboardVariableReducer

* Chore: rename state prop back to templating

* Chore renames variable.dashboardUid

* Chore: rename toDashboardVariableIdentifier

* Chore: rename getDashboardVariable

* Chore: rename getDashboardVariablesState

* Chore: rename getDashboardVariables

* Chore: some more renames

* Chore: small clean up

* Chore: small rename

* Chore: removes unused function

* Chore: rename VariableModel.stateKey

* Chore: rename KeyedVariableIdentifier.stateKey

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
Co-authored-by: kay delaney <kay@grafana.com>
Co-authored-by: Alexandra Vargas <alexa1866@gmail.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-02-18 06:06:04 +01:00
Torkel Ödegaard
2b9e46d1f8
Angular: Option to disable angular support and isolate angular dependencies (#45421)
* Angular: Initial setting that disables angular, load angular support in separate chunk

* Load angular panels on demand

* Load alerting in separate chunk only when angularSupportEnabled

* progress, do not export core_module if angular disabled

* Progress

* Update public/app/features/plugins/built_in_plugins.ts

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>

* Removing remaining usage of angular from outside angular app (not counting plugins)

* Update config and docs

* Fix sample.ini

* Update public/app/features/alerting/AlertTab.tsx

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>

* Fixing prettier issue

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2022-02-16 17:14:33 +01:00
Josh Hunt
6baf38e84b
Variables: Fix crash when changing query variable datasource (#44957)
* Variables: refactor variable editor state to dispatch typed & atomic extended props

* Mock variable editor in tests

* Make dataSources mandatory in AdHocVariableEditorState

* nit
2022-02-07 23:52:07 +01:00
Josh Hunt
1c6eca09bb
Variables: Explicitly type variable editor extended state (#44749)
* Narrow Variable editor state using selector functions

 - Explicitly type "extended" editor state in editor/reducter.ts using a union
 - Create selectors to narrow the types, using unique properties from each extended state to discriminate the union
 - Update DataSourceVariableEditor to use new style of redux connector
 - Update variable editor components to use new selectors

* fix tests

* Make adhoc variable infoText optional, because it is!

* Add AdHocVariableEditor tests

* DataSourceVariableEditor tests

* comment

* reset

* Wrote tests for selectors \(that actually caught a bug, whodathunkit)

* fix stray types and lint issues

* Rename selector functions
2022-02-08 09:31:42 +11:00
Josh Hunt
f1b2e2b7ff
Chore: More variable e2e tests (#44803)
* Add Datasource variable e2e tests

* Update other tests

* Fix names/comments in tests

* Add Interval variable tests

* fix typo
2022-02-04 12:37:01 +11:00
Josh Hunt
6211ca4d3d
Chore: Move variable field selectors to data-testid (#44801)
* Chore: Move variable field selectors to data-testid

* Fix data source variable editor selector

* fix test
2022-02-04 11:55:19 +11:00
Josh Hunt
ce4d8646fd
Chore: E2E tests for various variables types (#44747)
* Pass data-testid into VariableTextEditorField

* Add e2e tests for custom variables

* Rename query variable specs to match others

* Add e2e tests for Text Box variables

* manually remove id: null

* Add tests for constant variables
2022-02-03 09:58:56 +11:00
renovate[bot]
d87cd6f26c
Update dependency prettier to v2.5.1 (#43473)
* Update dependency prettier to v2.5.1

* prettier fixes

* chore(toolkit): bump prettier to 2.5.1

* style(eslint): bump grafana config to 2.5.2 in core and toolkit

* style(mssql-datasource): fix no-inferrable-types eslint errors

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2022-02-02 12:02:32 +00:00
Hugo Häggmark
5a5f5cacc8
Variables: Fix for constant variables in self referencing links (#44631)
* Variables: Fix for constant variables in self referencing links

* Chore: adds bettercomment
2022-01-31 13:34:26 +01:00
Timur Olzhabayev
c3f69cc4d9
Adding reload to datasourceSrv (#44217) 2022-01-24 10:45:05 +01:00
Hugo Häggmark
4b4afc7b2c
Chore: reduces circular dependencies for variables/utils.ts (#44087)
* Chore: move constants to own file

* Chore: moves safe* functions to grafana/data

* Chore: moves safe* functions to grafana/data

* Chore: adds VariableQueryEditorProps and deprecates VariableQueryProps

* Chore: remove getDefaultVariableAdapters function

* Chore: moves transaction status to types

* Chore: fix tests that do not initialise TemplateSrv

* Chore: change space when stringifying

* Chore: revert safe* func move

* Chore: remove circular dependency in Explore utils
2022-01-17 12:48:26 +01:00
Hugo Häggmark
7ffefc069f
Variables: Handle variable cancellations better (#43987)
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: joshhunt <josh@trtr.co>
Co-authored-by: kay delaney <kay@grafana.com>
Co-authored-by: Alexandra Vargas <alexa1866@gmail.com>>
2022-01-14 11:19:42 +01:00
Hugo Häggmark
7f8f9eb814
Variables: Fix so data source variables are added to adhoc configuration (#43881) 2022-01-12 12:05:42 +01:00
Hugo Häggmark
9d11c9153f
Variables: Fix for flickering repeat panels (#43447)
* Variables: Fix for flickering repeat panels

* Refactor: updates after PR comments
2022-01-10 06:41:18 +01:00
Connor Lindsey
1a7567d8c7
Tempo: Filter available service graph filter values to most relevant options (#43728)
* Restrict service graph filter tag values to labels from service graph metrics
2022-01-06 07:09:31 -07:00
Hugo Häggmark
aa47cac69f
Variables: Fix for migrating legacy data source properties (#43263) 2021-12-20 06:49:17 +01:00
Hugo Häggmark
bb17193ce5
Variables: Adds user interaction reports (#42802)
* Variables: Adds user interaction reports

* Chore: updates after PR feedback
2021-12-08 10:11:01 +01:00
Hugo Häggmark
7a99b067ef
Variables: Fix repeating panels for on time range changed variables (#42828) 2021-12-08 08:11:52 +01:00
Hugo Häggmark
769c82cf66
Variables: Adds drag and drop in variables list (#42503)
* Variables: adds drag and drop in variables list

* Refactor: fixes after PR comments

* Chore: updates after PR comments

* Refactor: adds styles during dragging

* Docs: update doc

* Chore: pushing Drone
2021-12-06 10:36:58 +01:00
renovate[bot]
035e676cad
Update dependency react-select to v5 (#41604)
* Update dependency react-select to v5

* Remove @types/react-select and update types accordingly

* Fix all unit tests

* Add @ts-expect-error to individual errors, remove prefix as it doesn't seem to exist?

* Another minor typescript fix

* Apply fixes from torkel's PR

* Fix last typescript error

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2021-11-23 12:11:26 +00:00
Hugo Häggmark
44d7d6546f
Variables: Make renamed or missing variable section expandable (#41964)
* Variables: Make renamed or missing variable section expandable

* Chore: feedback after PR comments
2021-11-22 07:38:49 +01:00
Hugo Häggmark
18cc552edb
Variables: Fix so panels in expanded rows have correct variable values (#41721) 2021-11-18 06:22:16 +01:00
Hugo Häggmark
0dcea161fa
Variables: Exclude adhoc variables from the impacted by logic (#41717) 2021-11-16 13:48:07 +01:00
Andrej Ocenas
5cc9ff8b28
Tempo: Add filtering for service graph query (#41162)
* Add filter based on AdHocFilter element

* Add tests

* Cancel layout in case we have have new data or we unmount node graph

* Fix typing

* Fix test
2021-11-11 14:27:59 +01:00