File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 49
49
- run :
50
50
name : Build and test frontend
51
51
command : ./node_modules/.bin/grafana-toolkit plugin:ci-build
52
+ - run :
53
+ name : Run test with coverage
54
+ command : ./node_modules/.bin/grafana-toolkit plugin:test --coverage
55
+ - run :
56
+ name : Setup Code Climate test-reporter
57
+ command : |
58
+ curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
59
+ chmod +x ./cc-test-reporter
60
+ ./cc-test-reporter before-build
61
+ when : always
62
+ - run :
63
+ name : Send coverage report to Code Climate
64
+ command :
65
+ ./cc-test-reporter after-build -t lcov
66
+ when : always
52
67
- run :
53
68
name : Move results to ci folder
54
69
command : ./node_modules/.bin/grafana-toolkit plugin:ci-build --finish
63
78
- ci/packages
64
79
- ci/dist
65
80
- ci/grafana-test-env
81
+ - coverage/lcov.info
66
82
- store_artifacts :
67
83
path : ci
84
+ path : coverage/lcov.info
Original file line number Diff line number Diff line change 1
1
# Grafana Button Control Panel
2
2
3
+ [ ![ CircleCI] ( https://circleci.com/gh/speakyourcode/grafana-button-panel.svg?style=shield )] ( https://circleci.com/gh/speakyourcode/grafana-button-panel )
4
+ [ ![ David Dependency Status] ( https://david-dm.org/speakyourcode/grafana-button-panel.svg )] ( https://david-dm.org/speakyourcode/grafana-button-panel )
5
+ [ ![ David Dev Dependency Status] ( https://david-dm.org/speakyourcode/grafana-button-panel/dev-status.svg )] ( https://david-dm.org/speakyourcode/grafana-button-panel/?type=dev )
6
+ [ ![ Known Vulnerabilities] ( https://snyk.io/test/github/speakyourcode/grafana-button-panel/badge.svg )] ( https://snyk.io/test/github/speakyourcode/grafana-button-panel )
7
+ [ ![ Maintainability] ( https://api.codeclimate.com/v1/badges/3d8db85bc1cc2b95d314/maintainability )] ( https://codeclimate.com/github/speakyourcode/grafana-button-panel/maintainability )
8
+ [ ![ Test Coverage] ( https://api.codeclimate.com/v1/badges/3d8db85bc1cc2b95d314/test_coverage )] ( https://codeclimate.com/github/speakyourcode/grafana-button-panel/test_coverage )
9
+
3
10
This panel allows you to create buttons and define actions for them. It can be
4
11
used to add controlling functionality to your dashboards. Actions are defined as
5
12
queries to Datasources.
Original file line number Diff line number Diff line change @@ -18,16 +18,17 @@ export interface EditorProps {
18
18
}
19
19
20
20
export const Editor : React . FC < EditorProps > = ( { buttons, onChange } ) => {
21
- const [ elems , setElems ] = React . useState < SelectableValue < string > [ ] > ( ) ;
21
+ const [ elems , setElems ] = React . useState < Array < SelectableValue < string > > > ( ) ;
22
22
const [ isOpen , setOpen ] = React . useState < boolean [ ] > ( buttons . map ( e => false ) ) ;
23
23
React . useEffect ( ( ) => {
24
24
let cancel = false ;
25
25
const fetchData = async ( ) => {
26
26
const ds = await getBackendSrv ( ) . get ( '/api/datasources' ) ;
27
- if ( ! cancel )
27
+ if ( ! cancel ) {
28
28
setElems (
29
29
ds . map ( ( i : any ) => ( { label : i . name , value : i . name , name : i . name } ) )
30
30
) ;
31
+ }
31
32
} ;
32
33
fetchData ( ) ;
33
34
return ( ) : void => {
You can’t perform that action at this time.
0 commit comments