Commit Graph

450 Commits

Author SHA1 Message Date
Torkel Ödegaard
7634e04231 Fixed template variable value changed handling 2019-02-04 14:45:13 +01:00
Torkel Ödegaard
aafd4a339a Moved dashboard state components to state folder 2019-01-31 08:56:17 +01:00
Torkel Ödegaard
6663b2fab9 Moved time_srv to services folder, this should not belong to dashboard feature but it is too dependant on dashboard to move it out now, needs a bigger refactoring to isolate from dashboard 2019-01-31 08:44:46 +01:00
Torkel Ödegaard
8b68ba5cbb Minor refactoring and adding some typing 2019-01-29 20:49:54 +01:00
Peter Holmberg
78cb3239b8 adding from and to built in variables 2019-01-29 15:05:28 +01:00
Demitri Swan
186e488ace Bug Fix #14961 2019-01-24 14:11:31 +00:00
Benjamin Schweizer
bde4b76c16 based on encodeURIComponent() using strict RFC 3986 sub-delims 2019-01-22 15:09:58 +01:00
Benjamin Schweizer
8a09d84707 Merge branch 'master' of https://github.com/grafana/grafana 2019-01-22 11:20:56 +01:00
Hugo Häggmark
1faa5819a8 Initial commit 2019-01-15 17:15:46 +01:00
Torkel Ödegaard
71837fe137
Merge pull request #12681 from simPod/fix-variable-array-display
Fix array display from url
2018-12-19 14:34:21 +01:00
Torkel Ödegaard
f9110f7902 Merge branch 'master' into develop 2018-12-11 10:00:29 +01:00
AJ West
6c95acc837 Switch to global match for full browser support of escaped custom vars 2018-12-08 18:23:08 -05:00
AJ West
2b3d366f7c Allow backslash escaping in custom variables 2018-12-08 17:31:05 -05:00
Erik Sundell
45fbbe8021 initialize empty variables array in constructor so that datasources can use the array in explore 2018-12-07 11:27:11 +01:00
Daniel Lee
4aeea56342
Merge pull request #14007 from grafana/stackdriver-template-query-editor
Stackdriver template query editor
2018-11-20 13:41:18 +01:00
Erik Sundell
7fc8ed942f stackdriver: make sure object type queries are also checked for vtemplate variables 2018-11-20 12:30:31 +01:00
Erik Sundell
0ec4491a52 stackdriver: reimplementing service variable query type 2018-11-19 16:06:30 +01:00
Erik Sundell
2e0cbe75ee stackdriver: use arrow functions 2018-11-13 11:06:08 +01:00
Erik Sundell
e698202fae stackdriver: use new naming convention for query editor all over 2018-11-13 10:57:10 +01:00
Erik Sundell
1fe70721c9 stackdriver: persist template variable definition 2018-11-09 13:55:14 +01:00
Erik Sundell
588c5c045a stackdriver: pass query definition from react, making it possible to use another definition than the query string only 2018-11-09 13:55:14 +01:00
Erik Sundell
4569527873 stackdriver: set currentdatasource when editview is enabled 2018-11-09 13:55:13 +01:00
Erik Sundell
3883643ea2 stackdriver: reset query value on datasource changed 2018-11-09 13:55:13 +01:00
Erik Sundell
042d156e5f stackdriver: extend label width 2018-11-09 13:55:13 +01:00
Erik Sundell
7ccce76b80 stackdriver: return values for services and metric types 2018-11-09 13:55:08 +01:00
Erik Sundell
f0cba0b0d8 stackdriver: rename default component 2018-11-09 13:55:08 +01:00
Erik Sundell
149c649132 stackdriver: more renaming 2018-11-09 13:55:08 +01:00
Erik Sundell
4f7d3fccb7 stackdriver: make sure default template query editor state is propagted to parent angular scope 2018-11-09 13:53:44 +01:00
Erik Sundell
637b91ab8d stackdriver: conditional template component rendering 2018-11-09 13:53:44 +01:00
Erik Sundell
94ac522109 stackdriver: make it possible to load react plugin components from template query page 2018-11-09 13:53:43 +01:00
Augustin Husson
2abf8a0e8b don't drop the value when it equals to None 2018-11-08 16:23:40 +01:00
Johannes Schill
b880f8d548 Update the regex-matching in templateSrv to work with the new variable-syntax and be more flexible to regex-changes #13804 2018-10-24 13:29:03 +02:00
Johannes Schill
38c155403e Move the variable regex to constants to make sure we use the same reg… (#13801) 2018-10-24 12:06:09 +02:00
Torkel Ödegaard
2107f88fc1
Merge pull request #13770 from ceh-forks/editor-duplicate-placeholder
ux: remove duplicate placeholder attribute
2018-10-23 15:52:33 +02:00
Johannes Schill
22a0f3cf94 fix: Text box variables with empty values should not be considered fa… (#13791)
* fix: text box template variable doesn't work properly without a default value
2018-10-23 14:05:10 +02:00
Emil Hessman
30baaa48fe ux: remove duplicate placeholder attribute 2018-10-20 15:08:38 +02:00
Torkel Ödegaard
b95d64e7a0 fix: fixed variable srv tests 2018-10-19 11:14:02 +02:00
Torkel Ödegaard
11f66bb909 fixed issue with template refresh 2018-10-19 09:43:54 +02:00
Torkel Ödegaard
dddbe62d6c Merge branch 'master' into react-panels-step1 2018-10-19 09:15:37 +02:00
Marcus Efraimsson
4b1a2d3b11
make sure to add all variable nodes to dag before linking variables 2018-10-12 14:15:44 +02:00
Torkel Ödegaard
7d44aacf4a refactoring: slight changes to PR #13247 2018-09-27 14:50:14 +02:00
Torkel Ödegaard
f2307f92de Merge branch 'text_variable-3173' of https://github.com/daldoyle/grafana into daldoyle-text_variable-3173 2018-09-27 14:36:37 +02:00
David Kaltschmidt
1a38c45dde Hotfix for Explore (empty page after running query)
Since #13212 adhoc filters are being gathered, in Explore the template
  service has no variables set and then throws when iterating over them.
2018-09-14 16:09:43 +02:00
David
a5bcd4b8e4 Adhoc-filtering for prometheus dashboards (#13212)
* Basic adhoc-filtering support for prometheus
2018-09-12 18:10:57 +02:00
Dan Doyle
f0e905f3c9 First pass at a text based template var, getting feedback from devs 2018-09-12 13:17:15 +00:00
Patrick O'Carroll
72ab24f300 Changed functions to arrow functions for only-arrow-functions rule. (#13131) 2018-09-05 07:47:30 +02:00
Benjamin Schweizer
4bf8f80657 Merge remote-tracking branch 'upstream/master' 2018-09-04 17:42:15 +02:00
Marcus Efraimsson
7c88436a9b
Merge pull request #13133 from grafana/13132_query_variable
Fix error when new variables created but not yet added/saved
2018-09-04 17:25:08 +02:00
Patrick O'Carroll
0f326f18dc changed functions to arrowfunctions for only-arrow-functions rule (#13127) 2018-09-04 15:55:41 +02:00
Marcus Efraimsson
1e74d7f20a
handle new variables created not yet added 2018-09-04 13:25:44 +02:00
Benjamin Schweizer
f4b29b5782 fixed testcase 2018-09-03 16:08:52 +02:00
Benjamin Schweizer
82554ffd67 Merge remote-tracking branch 'upstream/master' 2018-09-03 15:55:44 +02:00
Patrick O'Carroll
b8d82df97e added no-angle-bracket-type-assertion rule and updatet files to follow rule (#13115) 2018-09-03 11:30:44 +02:00
Patrick O'Carroll
7837ee4466 Updated rules for variable name (#13106)
* updated rules for variable name and fixed files that didn't follow new rules

* fixed test so it uses new rule

* made exceptions to rule in interval_variable
2018-09-03 11:00:46 +02:00
Simon Podlipsky
e67d3df14c
Fix array display from url 2018-09-01 14:13:48 +02:00
Patrick O'Carroll
abbb6f933c added jsdoc-format rule and fixed files that didn't follow new rule (#13107) 2018-08-31 16:40:43 +02:00
Torkel Ödegaard
36bc8b77fb Merge branch 'tsconfig-no-implicit-this' 2018-08-30 11:46:13 +02:00
Patrick O'Carroll
a8547ae36e added this:any to functions and changed functions to arrowfunctions 2018-08-30 10:49:18 +02:00
Patrick O'Carroll
552a61b6ae changed var to let in 50 files (#13075) 2018-08-30 09:03:11 +02:00
Patrick O'Carroll
b494a29e02 changed var to let in last files (#13087) 2018-08-30 08:58:43 +02:00
Patrick O'Carroll
5e0d0c5816 changed var to const (#13061) 2018-08-29 14:26:50 +02:00
Torkel Ödegaard
e1beaaa0f7
tslint: tslint to const fixes part3 (#13036) 2018-08-26 21:52:57 +02:00
Torkel Ödegaard
314b645857
tslint: changing vars -> const (#13034) 2018-08-26 18:43:07 +02:00
Torkel Ödegaard
9b978b7203
tslint: autofix of let -> const (#13033) 2018-08-26 17:14:40 +02:00
Marcus Efraimsson
49f9276df0
Merge pull request #12967 from franciscocpg/custom-all-value-variable-interpolation
Replacing variable interpolation in "All value" value
2018-08-24 15:40:55 +02:00
Marcus Efraimsson
775e95bde4
Merge pull request #12959 from grafana/11890_variables
Fix: Template variables are executing excessive queries
2018-08-21 10:40:47 +02:00
Francisco Guimarães
0223a75de0 Refresh query variable when another variable is used in regex field (#12961) 2018-08-20 11:56:12 +02:00
Francisco Guimarães
d58986872c Replacing variable interpolation in "All value" value 2018-08-17 11:04:32 -03:00
Marcus Efraimsson
d6ad1ced6d
when value in variable changes, identify which variable(s) to update
Given you have variables a, b, c, d where b depends on a, c depends on b, c, d depends on a.
When updating a only an update of b and d should be triggered since c depends on b
and c will be updated eventually when the update of b are finished.
2018-08-17 12:20:21 +02:00
Tobias Skarhed
a65589a5fb Rename test files 2018-08-14 10:52:41 +02:00
Benjamin Schweizer
a653b277f3 switched to lowercase 2018-08-06 22:04:33 +02:00
Benjamin Schweizer
9220f83b3d replaced escape() call, renamed formatter to be more expressive 2018-08-06 21:54:12 +02:00
Tobias Skarhed
9f87f6081a Remove Karma test 2018-08-06 11:23:50 +02:00
Tobias Skarhed
46dd4eba9e All tests passing 2018-08-06 11:23:50 +02:00
Tobias Skarhed
034ca69610 Add mock constructor 2018-08-06 11:23:50 +02:00
Tobias Skarhed
7f4723a9a7 Begin conversion 2018-08-06 11:23:50 +02:00
Benjamin Schweizer
7da9c33ae4 fixed test result 2018-07-30 17:28:50 +02:00
Benjamin Schweizer
a2967565de added urlescape formatting option 2018-07-30 17:19:41 +02:00
Tobias Skarhed
35cc85bfcc All tests passing. Remove Karma test. 2018-07-26 09:36:46 +02:00
Tobias Skarhed
931b944cdd Almost all tests passing 2018-07-25 17:38:45 +02:00
Tobias Skarhed
7d51c15240 Two passing tests 2018-07-25 16:15:03 +02:00
Tobias Skarhed
f350461206 Start conversion 2018-07-25 14:52:03 +02:00
Łukasz Gryglicki
24f395f986 Add support for skipping variable value in URL, fixes #12174 (#12541)
* New rebase

Signed-off-by: Lukasz Gryglicki <lukaszgryglicki@o2.pl>

* Lint

Signed-off-by: Lukasz Gryglicki <lukaszgryglicki@o2.pl>
2018-07-11 10:06:36 -07:00
Mitsuhiro Tanda
aa1b5959da omit extra template refresh (#12454) 2018-07-01 22:56:24 -07:00
Marcus Efraimsson
5280084480
set correct text in drop down when variable is present in url using key/values 2018-06-25 14:59:28 +02:00
Torkel Ödegaard
6c0752473a
Sqlstore refactor (#11908)
* refactor: tracing service refactoring

* refactor: sqlstore to instance service

* refactor: sqlstore & registory priority

* refactor: sqlstore refactor wip

* sqlstore: progress on getting tests to work again

* sqlstore: progress on refactoring and getting tests working

* sqlstore: connection string fix

* fix: not sure why this test is not working and required changing expires

* fix: updated grafana-cli
2018-05-18 11:10:10 +02:00
Seuf
1888708ca5 Templating : return __empty__ value when all value return nothing to prevent elasticsearch syntaxe error (#9701) 2018-05-08 14:04:20 +02:00
Sven Klemm
a806f542c6 test if default variable interpolation is effective when no specific
format is specified
2018-05-03 18:42:58 +02:00
Sven Klemm
764fa15e24 dont shadow format passed in as function parameter 2018-05-02 23:03:37 +02:00
Patrick O'Carroll
a40314022b added pointer to show more, reset values on new query 2018-04-24 17:40:03 +02:00
Patrick O'Carroll
c2cc77fa08 added button to show more preview values for variables, button runs a function that increases options limit, fixes #11508 2018-04-23 13:00:24 +02:00
Torkel Ödegaard
85121e55c9
fix: Row state is now ignored when looking for dashboard changes (#11608)
* fix: Row state is now ignored when looking for dashboawrd changes, had to fix bug in expand logic to make fix work. Also moved the ChangeTracker to it's own file and moved tests to jest, fixes #11208

* removed commented out log calls
2018-04-17 09:41:07 +02:00
Mario Trangoni
e5e6bc56c8 public: fix codespell issues 2018-04-13 20:31:29 +02:00
Alexander Zobnin
d6233714d2 Merge remote-tracking branch 'upstream/master' into fix-11053 2018-04-05 16:30:46 +03:00
Daniel Lee
70eb281840 variables: adds test for variable sorting
ref #11280
2018-04-03 22:34:16 +02:00
Chris Ross
4a93766143 Add case-insensitive sort for variables. 2018-04-03 22:24:21 +02:00
Mitsuhiro Tanda
244cbe8cbd add csv templating format 2018-03-08 00:13:58 +09:00
Dan Cech
abf498fc7f
improve maintainability 2018-02-23 09:51:19 -05:00
Dan Cech
dc6f977304
support [[variable:type]] syntax 2018-02-22 18:45:11 -05:00
Brian Gann
b316dfea98
feature for issue #9911 2018-02-22 18:45:11 -05:00
Daniel Lee
4cfe179f47 variables: lint fix 2018-01-25 14:49:51 +01:00
Daniel Lee
8aa55ee352 variables: fix when datasource returns error 2018-01-25 14:16:06 +01:00
Dan Cech
80a6e0d8d1
support specifying tag_values("<tag>") as graphite template query 2018-01-16 17:02:03 -05:00
Torkel Ödegaard
27835f373e cleanup: removed unused typescript typings import 2018-01-04 10:12:02 +01:00
Alexander Zobnin
e84b6d189a fix move dashboard variables, #10347 (#10375) 2017-12-31 12:24:42 +01:00
Torkel Ödegaard
3a1f52d8a2 prettier: ran on all files again, sorry. now settings are defined in package.json 2017-12-21 08:39:31 +01:00
Torkel Ödegaard
85879a7014 prettier: change to single quoting 2017-12-20 12:33:33 +01:00
Torkel Ödegaard
fadfc665e4 tech: ran pretttier on all typescript files 2017-12-19 16:06:54 +01:00
Torkel Ödegaard
581257416e Merge remote-tracking branch 'origin/develop-icons' into develop 2017-12-14 19:56:19 +01:00
Trent White
764992df2a add links for large cta 2017-12-14 09:31:59 -05:00
Torkel Ödegaard
776c39fd79 templating: made templateSrv globally accessable as ES6 module, DashboardRow can not interpolate row title 2017-12-14 12:31:57 +01:00
Patrick O'Carroll
daf32c579d changed width to input fields (#10184) 2017-12-13 12:42:50 +01:00
Torkel Ödegaard
c4b759fe6d ux: dashboard settings progress 2017-12-11 15:04:48 +01:00
Torkel Ödegaard
05ec7541c8 ux: dashboard settings progress 2017-12-11 13:04:06 +01:00
Torkel Ödegaard
09cc60ffe4 ux: dashboard settings progress 2017-12-11 12:13:45 +01:00
Torkel Ödegaard
511fa7dec1 ux: dashboard settings progress 2017-12-10 12:41:11 +01:00
Torkel Ödegaard
e98af1b3fa updated libs and fixed new typescript errors 2017-11-27 12:14:57 +01:00
Torkel Ödegaard
ac17684f50 ux: table design work 2017-11-26 22:07:34 +01:00
Jason O'Donnell
577478baff Fix typo in template help tab 2017-10-24 10:48:49 -04:00
Alin Sinpalean
d99f4f95c0 Allow for multiple auto interval template variables (#9216)
* Allow for multiple auto interval template variables without them overwriting each other's value.

* Add test for multiple auto interval template variables.

* Correctly handle old links with .
2017-10-24 14:39:10 +02:00
Torkel Ödegaard
adb9d92082 test: added first react snapshot test 2017-10-22 12:48:20 +02:00
Torkel Ödegaard
4aa227dd84 [Tech]: Start migrating to Jest for tests (#9610)
* tech: investigating karma + jest mix

* tech: migrating tests to jest

* tech: moved anoter test file to jest

* test: migrated two more test files to jest

* test: updated readme and made test fail to verify that it causes CI build failure

* tech: added code coverage for jest tests

* tech: testing codecov coverage

* tech: migrated more tests

* tech: migrated template srv to typescript and the tests to jest

* tech: minor build fix

* tech: build fixes

* build: another attempt at fixing go test with coverage
2017-10-22 07:03:26 +02:00
Torkel Ödegaard
0c86241c5b Webpack (#9391)
* webpack poc, this is not going to work for plugins, dam

* tech: webpack and systemjs for plugins starting to work

* tech: webpack and systemjs combo starting to work

* tech: webpack + karma tests progress

* tech: webpack + karma progress

* tech: working on tests

* tech: webpack

* tech: webpack + karma, all tests pass

* tech: webpack + karma, all tests pass

* tech: webpack all tests pass

* webpack: getting closer

* tech: webpack progress

* webpack: further build refinements

* webpack: ng annotate fixes

* webpack: optimized build fix

* tech: minor fix for elasticsearch

* tech: webpack + ace editor

* tech: restored lodash move mixin compatability

* tech: added enzyme react test and upgraded to react v16

* tech: package version fix

* tech: added testdata to built in bundle

* webpack: sass progress

* tech: prod & dev build is working for the sass

* tech: clean up unused grunt stuff and moved to scripts folder

* tech: added vendor and manifest chunks, updated readme and docs

* tech: webpack finishing touches
2017-10-01 20:02:25 +02:00
Torkel Ödegaard
7b42e13c79 typescript: stricter typescript option 2017-09-26 11:24:58 +02:00
Torkel Ödegaard
491fa6cad8 tech: more tslint rules 2017-09-21 17:23:31 +02:00
Torkel Ödegaard
b8d9722b4f tech: removing unused variables from typescript files, and making tslint rules more strict 2017-09-21 16:40:18 +02:00
Alexander Zobnin
fdec9a4daf templating: fix dependent variable updating (#9306) 2017-09-19 20:35:48 +02:00
tamayika
bef4b9b3b0 Fix adhoc filters restoration (#9303) 2017-09-19 14:25:35 +02:00
Torkel Ödegaard
07e192ff47 change: more work on changing default group by time interval to min interval setting 2017-09-01 15:57:02 +02:00
Torkel Ödegaard
d2437d3cf1 fix: ad-hoc filters now works with data source variables, fixes #8052 2017-08-10 12:04:46 +02:00
Daniel Lee
1105bb371f mysqlds: adds support for template variables
Fixes #8855
2017-08-09 19:32:53 +02:00
Daniel Lee
59513ff963 tempvar: bug fix for duplicate template var
and a fix for when selecting the same value twice in
a template variable if it is not multi select. It threw an
exception on the second selection
2017-08-09 14:28:23 +02:00
Torkel Ödegaard
68c4ce34d5 fix: templating issue with data source variables, can now be used right away in other query variables and panels (without page reload), fixes #7510 2017-08-08 17:08:35 +02:00
Torkel Ödegaard
a5d5f3d82f feat: add ad hoc filters directly from table panel cells, kibana 3 style, #8052 2017-08-02 16:15:22 +02:00
Torkel Ödegaard
44fbd3ec9f feat: calls to Graphite api /metrics/find now include panel or dashboard time ranges in some scenarios, closes #8055 2017-07-31 17:21:25 +02:00
Denis Doria
89822acf38 More precise detection for self reference variable on templates (#8814)
This should close the bug #8773
2017-07-12 06:54:32 +02:00
Torkel Ödegaard
878121bb46 fix: templating variable name validation detecting global variable naming wrongly, fixes #8423 2017-05-19 11:14:11 +02:00
Torkel Ödegaard
2479ad262e ux: updated look of info box 2017-05-05 09:16:28 +02:00
Torkel Ödegaard
e75bc5d39a docs: added templating docs link to app 2017-05-05 08:56:19 +02:00
Torkel Ödegaard
d085aaad41 fix: variable srv addVariable function, only used in tests 2017-04-24 17:06:58 +02:00
Torkel Ödegaard
f1276774a0 typescript: updated tslint and fixed new warnings 2017-04-20 11:16:37 +02:00
Torkel Ödegaard
8eb112d119 plugins: refactoring builtIn data source concept, now means data source plugins that you do not need to add via data sources page, that is automatically added as selectable data source, #8095 2017-04-12 08:23:44 +02:00
Torkel Ödegaard
7ec6e84fe8 adhocfilters: minor escape change 2017-04-07 10:08:16 +02:00
tamayika
e6cc5df9d9 Fix restoration of ad-hoc variable value issue (#8057)
* Fix restoration of ad-hoc variable value issue

* Escape delimiters in ad-hoc variable URL

* Remove unnecessary newline
2017-04-07 09:31:36 +02:00
Torkel Ödegaard
48c4e549f5 Revert "support panel repeat for datasource template variable (#7711)"
This reverts commit 554f972a25.
2017-04-04 09:28:33 +02:00
Mitsuhiro Tanda
554f972a25 support panel repeat for datasource template variable (#7711)
* support panel repeat for datasource template variable

* support All option
2017-03-31 07:31:15 +02:00
Daniel Lee
94498d533b template: fix validation for required selects
Since upgrading to Angular 1.6.1, selects with a default empty option
no longer show a popup with an error on submit. This fix adds an
empty option that is then removed with ng-if. Having the default
option set to null or undefined seems to be the cause of the bug.

The list of changes in 1.6 is here but could not find any obvious
cause for this bug:

https://docs.angularjs.org/guide/migration#migrating-from-1-5-to-1-6
2017-03-20 22:51:55 +01:00
Daniel Lee
65910db991 template: tweak to warning message 2017-03-20 17:14:24 +01:00
thuck
555acacd6d Validate query to avoid self-reference of variable #7614 2017-03-07 23:29:16 +01:00
Ross Lodge
70c2586c80 Use other variable dependencies in regex filter for datasource variable (#7547) 2017-03-07 08:39:19 +01:00