From 5e329d3c6011852141e08bc287af743880c4edbc Mon Sep 17 00:00:00 2001 From: Vitali Pinchuk Date: Wed, 7 Feb 2024 10:31:21 +0300 Subject: [PATCH] ft - add refresh function to grafana context --- src/components/EchartsPanel/EchartsPanel.tsx | 1 + src/constants/editor.ts | 5 +++++ 2 files changed, 6 insertions(+) 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..7d30c0f 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: 'Interpolate all variables.', + }, /** * Echarts