diff --git a/CHANGELOG.md b/CHANGELOG.md index caf73d1..34c6e43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log -## 5.2.0 (2024-02-05) +## 5.2.0 (2024-02-07) ### Features / Enhancements @@ -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) diff --git a/src/components/EchartsPanel/EchartsPanel.tsx b/src/components/EchartsPanel/EchartsPanel.tsx index bba9964..49d23ce 100644 --- a/src/components/EchartsPanel/EchartsPanel.tsx +++ b/src/components/EchartsPanel/EchartsPanel.tsx @@ -209,6 +209,7 @@ export const EchartsPanel: React.FC = ({ options, data, width, height, re locationService, notifySuccess, notifyError, + refresh: () => appEvents.publish({ type: 'variables-changed', payload: { refreshAll: true } }), }, panel: { data, diff --git a/src/constants/editor.ts b/src/constants/editor.ts index db7bf90..1b5a4a4 100644 --- a/src/constants/editor.ts +++ b/src/constants/editor.ts @@ -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