diff --git a/CHANGELOG.md b/CHANGELOG.md index 47217016..5dfd6f94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - Update to Grafana 10.2.1 (#292) - Update ESLint configuration (#294) - Add Autosize Code Editor (#295) +- Add Data Source option for Reset button (#296) ### Bugfixes diff --git a/src/components/FormPanel/FormPanel.tsx b/src/components/FormPanel/FormPanel.tsx index 7f1fc60d..8673ee0c 100644 --- a/src/components/FormPanel/FormPanel.tsx +++ b/src/components/FormPanel/FormPanel.tsx @@ -459,6 +459,11 @@ export const FormPanel: React.FC = ({ * Reset Request */ const resetRequest = async () => { + /** + * Clear Error + */ + setError(''); + if (options.resetAction.mode === ResetActionMode.INITIAL) { /** * Use Initial Request diff --git a/src/constants/request.ts b/src/constants/request.ts index cfa9b6e2..4b0c0cc9 100644 --- a/src/constants/request.ts +++ b/src/constants/request.ts @@ -118,6 +118,6 @@ export const enum ResetActionMode { */ export const ResetActionOptions = [ { label: 'Custom Code', value: ResetActionMode.CUSTOM }, - { label: 'Initial request', value: ResetActionMode.INITIAL }, + { label: 'Initial Request', value: ResetActionMode.INITIAL }, { label: 'Data Source', value: ResetActionMode.DATASOURCE }, ];