Piotr Jamróz
b11186f946
Templating: Optionally save interpolated expressions when replacing variables in a string ( #65411 )
...
* Testing a refactor
* update
* Update interface, test interoplations map
* Refactoring
* Add more explicit comment about new behavior
* Update packages/grafana-runtime/src/services/templateSrv.ts
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
---------
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2023-03-28 16:19:27 +02:00
Dominik Prokop
2d7965402e
Templating: Allow percent encoding of variable with custom all ( #65266 )
...
* Templating: Allow percent encoding of variable with custom all
* Test fix
2023-03-27 00:35:41 -07:00
Torkel Ödegaard
cd490ba0be
DataLinks: Fixes interpolation (formatting) of __all_variables and __url_time_range ( #65162 )
...
* DataLinks: Fixes interpolation (formatting) of __all_variables and __url_time_range
* simplify if statement
2023-03-22 18:56:18 +01:00
Ryan McKinley
b39039eadd
DataLinks: Default to percentEncoding ( #64841 )
2023-03-17 06:51:06 -07:00
Kristian Bremberg
27e2b037ae
Chore: Use DOMPurify to sanitize strings rather than js-xss ( #62787 )
...
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-03-16 19:13:34 +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
Dominik Prokop
5dbbaab3f1
Scenes: Use @grafana/scenes ( #60972 )
...
* Use @grafana/scenes WIP
* Use @grafana/scenes package
* Use released @grafana/scenes
* Fix template_srv test
2023-01-10 03:30:53 -08:00
Dominik Prokop
1758ddd457
Scenes: Add query variable support ( #59553 )
...
* WIP first attempt to query variable
* regex issue repro demo
* Refresh variable on time range change if refresh specified
* Instantiate variable runner when updating query variable options
* Simplify runners getTarget interface
* Fix issue with variable ot being updated correctly after other variable changed
* Add templateSrv.replace compatibility with query variable
* QueryVariable: use datasource variable as source
* use proper format
* Make sure variables set is correctly updated when query variable errors
* Do not destruct scopedVars when using sceneGraph.interpolate in templateSrv
* Add support for Legacy variables (metricFindQuery)
* Review
* Fix lint
* Test: Add unit for datasource by variable
* test: Add unit for datasource as var
* query: delegate interpolation to datasourceSrv
* Cleanup
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
2022-12-12 04:01:27 -08: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
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
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
Marcus Andersson
9a12b3ea00
TemplateSrv: exposing a function to detect if a target contains a template ( #45214 )
...
* exposing a function to check if a target contains variables.
* fixed tests.
* renamed function
* updated betterer result.
2022-02-15 08:53:42 +01: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
73b7485630
Variables: Fix so queryparam option works for scoped variables ( #42742 )
...
* Variables: Fix so queryparam option work for scoped variables
* Chore: update after PR comments
2021-12-06 12:44:28 +01:00
Ryan McKinley
7319efe077
Dashboard: replace datasource name with a reference object ( #33817 )
...
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Co-authored-by: Elfo404 <me@giordanoricci.com>
2021-10-29 10:57:24 -07:00
Hugo Häggmark
af5296bee7
Variables: Prevents panel from crashing when using adhoc variable in data links ( #39546 )
...
* Variables: Prevents panel from crashing when using adhoc variable in data links
* Refactor: uses isAdhoc instead
* Chore: updates after PR feedback
2021-09-23 11:56:33 +02:00
Hugo Häggmark
2a3aa95163
Variables: Adds queryparam formatting option ( #30858 )
...
* Variables: Adds queryparam formatting option
* Chore: fixes strict errors
* Chore: changes after PR comments
2021-02-05 07:16:06 +01:00
Hugo Häggmark
8744ad361b
Variables: Fixes so text format will show All instead of custom all ( #30730 )
2021-01-29 09:24:25 +01:00
Dominik Prokop
24bc2b1cf4
TemplateSrv: Do not throw error for an unknown format but use glob as fallback and warn in the console ( #29955 )
2020-12-22 13:26:58 +01:00
Dominik Prokop
683ce69347
Link suppliers: getLinks API update ( #29757 )
...
* ContextMenuPlugin WIP
* Remove Add annotations menu item from graph context menu
* ts ifx
* WIP
* Tests updates
* ts check fix
* Fix rebase
* Use replace function in angular graph data links
2020-12-15 13:29:37 +01:00
Torkel Ödegaard
21ed77d7a5
TemplateSrv: Fix interpolating strings with object variables ( #28171 )
2020-10-12 14:22:26 +02:00
Marcus Andersson
0c8390cea2
Templating: global/system variables should be properly replaced in templated values. ( #27394 )
...
* Fixed so we try to use the variables in the redux store to replace values in template variables.
* First draft of working version.
* Including fieldPath when adding :text format.
* cleaned up code by introducing helper function.
* some minor refactoring.
* Added tests and support for multi variables.
* added test and code to handle the All scenario of a multivariable.
* fixed according to feedback.
* added docs.
* added text format to gdev dashboard.
* updated e2e tests.
* make sure we use the same function for formatting och variable lable.
* increased the number to 22.
* changed label for tests to be All.
* existing format should be respected.
2020-09-14 08:05:51 +02:00
Torkel Ödegaard
00769f19c2
E2E: Adding globals variables and interpolation format gdev test dashboard and e2e test ( #26827 )
2020-08-06 14:54:24 +02:00
Torkel Ödegaard
cfac143244
TemplateSrv: Refactoring out all formats to a formatRegistry ( #26607 )
2020-07-28 07:27:59 +02:00
Torkel Ödegaard
6c49fdb57d
TemplateSrv: Formatting options for ${__from} and ${__to}, unix seconds epoch, ISO 8601/RFC 3339 ( #26466 )
...
* TemplateSrv: WIP date formats
* Templating: formats with arguments
* WIP docs updates
* Docs: Updated docs
* fixed spelling
* Update docs/sources/variables/global-variables.md
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
* Update docs/sources/variables/global-variables.md
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
* Update docs/sources/variables/global-variables.md
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
* Update docs/sources/variables/global-variables.md
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-07-27 20:47:59 +02:00
Torkel Ödegaard
fba329f3ac
BackendSrv: Fix error alert logic ( #26453 )
2020-07-20 11:31:51 +02:00