@grafana/create-plugin 5.2.2-canary.1041.1247c8a.0 → 5.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# v5.2.2 (Fri Aug 09 2024)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- Create Plugin: Update CI workflow for latest GH runners [#1046](https://github.com/grafana/plugin-tools/pull/1046) ([@jackw](https://github.com/jackw))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Jack Westbrook ([@jackw](https://github.com/jackw))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
1
13
|
# v5.2.1 (Wed Aug 07 2024)
|
|
2
14
|
|
|
3
15
|
#### 🐛 Bug Fix
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/create-plugin",
|
|
3
|
-
"version": "5.2.2
|
|
3
|
+
"version": "5.2.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"directory": "packages/create-plugin",
|
|
6
6
|
"url": "https://github.com/grafana/plugin-tools"
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"engines": {
|
|
88
88
|
"node": ">=20"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "083e48deb1b6be862f40d87f6d5ce35071c63a84"
|
|
91
91
|
}
|
|
@@ -30,8 +30,6 @@ export const AppConfig = ({ plugin }: AppConfigProps) => {
|
|
|
30
30
|
isApiKeySet: Boolean(secureJsonFields?.apiKey),
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
const isSubmitDisabled = Boolean(!state.apiUrl || (!state.isApiKeySet && !state.apiKey));
|
|
34
|
-
|
|
35
33
|
const onResetApiKey = () =>
|
|
36
34
|
setState({
|
|
37
35
|
...state,
|
|
@@ -46,30 +44,8 @@ export const AppConfig = ({ plugin }: AppConfigProps) => {
|
|
|
46
44
|
});
|
|
47
45
|
};
|
|
48
46
|
|
|
49
|
-
const onSubmit = () => {
|
|
50
|
-
if (isSubmitDisabled) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
updatePluginAndReload(plugin.meta.id, {
|
|
55
|
-
enabled,
|
|
56
|
-
pinned,
|
|
57
|
-
jsonData: {
|
|
58
|
-
apiUrl: state.apiUrl,
|
|
59
|
-
},
|
|
60
|
-
// This cannot be queried later by the frontend.
|
|
61
|
-
// We don't want to override it in case it was set previously and left untouched now.
|
|
62
|
-
secureJsonData: state.isApiKeySet
|
|
63
|
-
? undefined
|
|
64
|
-
: {
|
|
65
|
-
apiKey: state.apiKey,
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
|
|
70
47
|
return (
|
|
71
48
|
<div data-testid={testIds.appConfig.container}>
|
|
72
|
-
<form onSubmit={onSubmit}>
|
|
73
49
|
<FieldSet label="API Settings">
|
|
74
50
|
<Field label="API Key" description="A secret key for authenticating to our custom API">
|
|
75
51
|
<SecretInput
|
|
@@ -101,13 +77,28 @@ export const AppConfig = ({ plugin }: AppConfigProps) => {
|
|
|
101
77
|
<Button
|
|
102
78
|
type="submit"
|
|
103
79
|
data-testid={testIds.appConfig.submit}
|
|
104
|
-
|
|
80
|
+
onClick={() =>
|
|
81
|
+
updatePluginAndReload(plugin.meta.id, {
|
|
82
|
+
enabled,
|
|
83
|
+
pinned,
|
|
84
|
+
jsonData: {
|
|
85
|
+
apiUrl: state.apiUrl,
|
|
86
|
+
},
|
|
87
|
+
// This cannot be queried later by the frontend.
|
|
88
|
+
// We don't want to override it in case it was set previously and left untouched now.
|
|
89
|
+
secureJsonData: state.isApiKeySet
|
|
90
|
+
? undefined
|
|
91
|
+
: {
|
|
92
|
+
apiKey: state.apiKey,
|
|
93
|
+
},
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
disabled={Boolean(!state.apiUrl || (!state.isApiKeySet && !state.apiKey))}
|
|
105
97
|
>
|
|
106
98
|
Save API settings
|
|
107
99
|
</Button>
|
|
108
100
|
</div>
|
|
109
101
|
</FieldSet>
|
|
110
|
-
</form>
|
|
111
102
|
</div>
|
|
112
103
|
);
|
|
113
104
|
};
|
|
@@ -169,8 +169,8 @@ jobs:
|
|
|
169
169
|
|
|
170
170
|
- name: Start Grafana
|
|
171
171
|
run: |
|
|
172
|
-
docker
|
|
173
|
-
DEVELOPMENT=false GRAFANA_VERSION=$\{{ matrix.GRAFANA_IMAGE.VERSION }} GRAFANA_IMAGE=$\{{ matrix.GRAFANA_IMAGE.NAME }} docker
|
|
172
|
+
docker compose pull
|
|
173
|
+
DEVELOPMENT=false GRAFANA_VERSION=$\{{ matrix.GRAFANA_IMAGE.VERSION }} GRAFANA_IMAGE=$\{{ matrix.GRAFANA_IMAGE.NAME }} docker compose up -d
|
|
174
174
|
|
|
175
175
|
- name: Wait for Grafana to start
|
|
176
176
|
uses: nev7n/wait_for_response@v1
|
|
@@ -193,7 +193,7 @@ jobs:
|
|
|
193
193
|
docker logs {{ pluginId }} >& grafana-server.log
|
|
194
194
|
|
|
195
195
|
- name: Stop grafana docker
|
|
196
|
-
run: docker
|
|
196
|
+
run: docker compose down
|
|
197
197
|
|
|
198
198
|
- name: Upload server log
|
|
199
199
|
uses: actions/upload-artifact@v4
|
|
@@ -33,8 +33,6 @@ export const AppConfig = ({ plugin }: Props) => {
|
|
|
33
33
|
isApiKeySet: Boolean(jsonData?.isApiKeySet),
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
const isSubmitDisabled = Boolean(!state.apiUrl || (!state.isApiKeySet && !state.apiKey));
|
|
37
|
-
|
|
38
36
|
const onResetApiKey = () =>
|
|
39
37
|
setState({
|
|
40
38
|
...state,
|
|
@@ -56,62 +54,106 @@ export const AppConfig = ({ plugin }: Props) => {
|
|
|
56
54
|
});
|
|
57
55
|
};
|
|
58
56
|
|
|
59
|
-
const onSubmit = () => {
|
|
60
|
-
updatePluginAndReload(plugin.meta.id, {
|
|
61
|
-
enabled,
|
|
62
|
-
pinned,
|
|
63
|
-
jsonData: {
|
|
64
|
-
apiUrl: state.apiUrl,
|
|
65
|
-
isApiKeySet: true,
|
|
66
|
-
},
|
|
67
|
-
// This cannot be queried later by the frontend.
|
|
68
|
-
// We don't want to override it in case it was set previously and left untouched now.
|
|
69
|
-
secureJsonData: state.isApiKeySet
|
|
70
|
-
? undefined
|
|
71
|
-
: {
|
|
72
|
-
apiKey: state.apiKey,
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
};
|
|
76
|
-
|
|
77
57
|
return (
|
|
78
58
|
<div data-testid={testIds.appConfig.container}>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
<
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
59
|
+
{/* ENABLE / DISABLE PLUGIN */}
|
|
60
|
+
<FieldSet label="Enable / Disable">
|
|
61
|
+
{!enabled && (
|
|
62
|
+
<>
|
|
63
|
+
<div className={s.colorWeak}>The plugin is currently not enabled.</div>
|
|
64
|
+
<Button
|
|
65
|
+
className={s.marginTop}
|
|
66
|
+
variant="primary"
|
|
67
|
+
onClick={() =>
|
|
68
|
+
updatePluginAndReload(plugin.meta.id, {
|
|
69
|
+
enabled: true,
|
|
70
|
+
pinned: true,
|
|
71
|
+
jsonData,
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
>
|
|
75
|
+
Enable plugin
|
|
76
|
+
</Button>
|
|
77
|
+
</>
|
|
78
|
+
)}
|
|
79
|
+
|
|
80
|
+
{/* Disable the plugin */}
|
|
81
|
+
{enabled && (
|
|
82
|
+
<>
|
|
83
|
+
<div className={s.colorWeak}>The plugin is currently enabled.</div>
|
|
84
|
+
<Button
|
|
85
|
+
className={s.marginTop}
|
|
86
|
+
variant="destructive"
|
|
87
|
+
onClick={() =>
|
|
88
|
+
updatePluginAndReload(plugin.meta.id, {
|
|
89
|
+
enabled: false,
|
|
90
|
+
pinned: false,
|
|
91
|
+
jsonData,
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
>
|
|
95
|
+
Disable plugin
|
|
111
96
|
</Button>
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
</
|
|
97
|
+
</>
|
|
98
|
+
)}
|
|
99
|
+
</FieldSet>
|
|
100
|
+
|
|
101
|
+
{/* CUSTOM SETTINGS */}
|
|
102
|
+
<FieldSet label="API Settings" className={s.marginTopXl}>
|
|
103
|
+
{/* API Key */}
|
|
104
|
+
<Field label="API Key" description="A secret key for authenticating to our custom API">
|
|
105
|
+
<SecretInput
|
|
106
|
+
width={60}
|
|
107
|
+
data-testid={testIds.appConfig.apiKey}
|
|
108
|
+
id="api-key"
|
|
109
|
+
value={state?.apiKey}
|
|
110
|
+
isConfigured={state.isApiKeySet}
|
|
111
|
+
placeholder={'Your secret API key'}
|
|
112
|
+
onChange={onChangeApiKey}
|
|
113
|
+
onReset={onResetApiKey}
|
|
114
|
+
/>
|
|
115
|
+
</Field>
|
|
116
|
+
|
|
117
|
+
{/* API Url */}
|
|
118
|
+
<Field label="API Url" description="" className={s.marginTop}>
|
|
119
|
+
<Input
|
|
120
|
+
width={60}
|
|
121
|
+
id="api-url"
|
|
122
|
+
data-testid={testIds.appConfig.apiUrl}
|
|
123
|
+
label={`API Url`}
|
|
124
|
+
value={state?.apiUrl}
|
|
125
|
+
placeholder={`E.g.: http://mywebsite.com/api/v1`}
|
|
126
|
+
onChange={onChangeApiUrl}
|
|
127
|
+
/>
|
|
128
|
+
</Field>
|
|
129
|
+
|
|
130
|
+
<div className={s.marginTop}>
|
|
131
|
+
<Button
|
|
132
|
+
type="submit"
|
|
133
|
+
data-testid={testIds.appConfig.submit}
|
|
134
|
+
onClick={() =>
|
|
135
|
+
updatePluginAndReload(plugin.meta.id, {
|
|
136
|
+
enabled,
|
|
137
|
+
pinned,
|
|
138
|
+
jsonData: {
|
|
139
|
+
apiUrl: state.apiUrl,
|
|
140
|
+
isApiKeySet: true,
|
|
141
|
+
},
|
|
142
|
+
// This cannot be queried later by the frontend.
|
|
143
|
+
// We don't want to override it in case it was set previously and left untouched now.
|
|
144
|
+
secureJsonData: state.isApiKeySet
|
|
145
|
+
? undefined
|
|
146
|
+
: {
|
|
147
|
+
apiKey: state.apiKey,
|
|
148
|
+
},
|
|
149
|
+
})
|
|
150
|
+
}
|
|
151
|
+
disabled={Boolean(!state.apiUrl || (!state.isApiKeySet && !state.apiKey))}
|
|
152
|
+
>
|
|
153
|
+
Save API settings
|
|
154
|
+
</Button>
|
|
155
|
+
</div>
|
|
156
|
+
</FieldSet>
|
|
115
157
|
</div>
|
|
116
158
|
);
|
|
117
159
|
};
|