Skip to content

Commit 4d94768

Browse files
committed
Add default values
1 parent 2d1133c commit 4d94768

File tree

5 files changed

+10
-20
lines changed

5 files changed

+10
-20
lines changed

dist/module.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/module.js.LICENSE.txt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,3 @@ object-assign
5252
* Copyright (c) 2014-2015, Jon Schlinkert.
5353
* Licensed under the MIT License.
5454
*/
55-
56-
/*! *****************************************************************************
57-
Copyright (c) Microsoft Corporation. All rights reserved.
58-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
59-
this file except in compliance with the License. You may obtain a copy of the
60-
License at http://www.apache.org/licenses/LICENSE-2.0
61-
62-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
63-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
64-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
65-
MERCHANTABLITY OR NON-INFRINGEMENT.
66-
67-
See the Apache Version 2.0 License for specific language governing permissions
68-
and limitations under the License.
69-
***************************************************************************** */

dist/module.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
{"name": "Panel", "path": "img/panel.png"}
2222
],
2323
"version": "0.3.0",
24-
"updated": "2020-10-09"
24+
"updated": "2020-10-13"
2525
},
2626

2727
"dependencies": {

src/module.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { PanelPlugin } from '@grafana/data';
2-
import { SimpleOptions } from './types';
2+
import { SimpleOptions, defaults } from './types';
33
import { SimplePanel } from './SimplePanel';
44
import {PanelOptionCode} from './PanelOptionCode';
55

@@ -15,6 +15,7 @@ export const plugin = new PanelPlugin<SimpleOptions>(SimplePanel).setPanelOption
1515
settings: {
1616
language: 'json',
1717
},
18+
defaultValue: defaults.data,
1819
})
1920
.addCustomEditor({
2021
id: 'layout',
@@ -26,6 +27,7 @@ export const plugin = new PanelPlugin<SimpleOptions>(SimplePanel).setPanelOption
2627
settings: {
2728
language: 'json',
2829
},
30+
defaultValue: defaults.layout,
2931
})
3032
.addCustomEditor({
3133
id: 'config',
@@ -37,14 +39,15 @@ export const plugin = new PanelPlugin<SimpleOptions>(SimplePanel).setPanelOption
3739
settings: {
3840
language: 'json',
3941
},
42+
defaultValue: defaults.config,
4043
})
4144
.addCustomEditor({
4245
id: 'script',
4346
path: 'script',
4447
name: 'Script',
4548
description: `
4649
Script executed whenever new data is available.
47-
50+
4851
Must return an object with one or more of the following properties : data, layout, config
4952
f(data, variables){...your code...}
5053
`,
@@ -53,6 +56,7 @@ export const plugin = new PanelPlugin<SimpleOptions>(SimplePanel).setPanelOption
5356
settings: {
5457
language: 'javascript',
5558
},
59+
defaultValue: defaults.script,
5660
})
5761
.addCustomEditor({
5862
id: 'onclick',
@@ -66,5 +70,6 @@ export const plugin = new PanelPlugin<SimpleOptions>(SimplePanel).setPanelOption
6670
settings: {
6771
language: 'javascript',
6872
},
73+
defaultValue: defaults.onclick,
6974
})
7075
});

0 commit comments

Comments
 (0)