Skip to content

Commit

Permalink
Add clear error for Reset request
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhail-vl committed Nov 21, 2023
1 parent 888ad63 commit a8bc4e9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions src/components/FormPanel/FormPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,11 @@ export const FormPanel: React.FC<Props> = ({
* Reset Request
*/
const resetRequest = async () => {
/**
* Clear Error
*/
setError('');

if (options.resetAction.mode === ResetActionMode.INITIAL) {
/**
* Use Initial Request
Expand Down
2 changes: 1 addition & 1 deletion src/constants/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
];

0 comments on commit a8bc4e9

Please sign in to comment.