Skip to content

Commit

Permalink
Add refresh function using Application Event Bus (#247)
Browse files Browse the repository at this point in the history
* ft - add refresh function to grafana context

* fix update detail to 'Refresh dashboard.' for context.grafana.refresh

* Update CHANGELOG.md

---------

Co-authored-by: Mikhail Volkov <[email protected]>
  • Loading branch information
vitPinchuk and mikhail-vl authored Feb 8, 2024
1 parent 81fac77 commit 8b56db2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change Log

## 5.2.0 (2024-02-05)
## 5.2.0 (2024-02-07)

### Features / Enhancements

Expand All @@ -9,6 +9,7 @@
- Update ESLint configuration and refactoring (#237)
- Update dependencies and Actions (#238)
- Add context parameter to non-visual mode (#245)
- Add refresh function using Application Event Bus (#247)

## 5.1.0 (2023-08-11)

Expand Down
1 change: 1 addition & 0 deletions src/components/EchartsPanel/EchartsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ export const EchartsPanel: React.FC<Props> = ({ options, data, width, height, re
locationService,
notifySuccess,
notifyError,
refresh: () => appEvents.publish({ type: 'variables-changed', payload: { refreshAll: true } }),
},
panel: {
data,
Expand Down
5 changes: 5 additions & 0 deletions src/constants/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ const EDITOR_BASE_CONTEXT_SUGGESTIONS: CodeEditorSuggestionItem[] = [
kind: CodeEditorSuggestionItemKind.Method,
detail: 'Show error notification.',
},
{
label: 'context.grafana.refresh',
kind: CodeEditorSuggestionItemKind.Method,
detail: 'Refresh dashboard.',
},

/**
* Echarts
Expand Down

0 comments on commit 8b56db2

Please sign in to comment.