From 05e1cf33e6beef1d0c3fb420beaae0be336e8164 Mon Sep 17 00:00:00 2001 From: rozetko Date: Tue, 10 May 2022 18:02:46 +0400 Subject: [PATCH] "To be supported" for non-gauge visualizations --- src/components/editors/NotSupportedText.tsx | 5 +++++ src/module.ts | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 src/components/editors/NotSupportedText.tsx diff --git a/src/components/editors/NotSupportedText.tsx b/src/components/editors/NotSupportedText.tsx new file mode 100644 index 0000000..22c4432 --- /dev/null +++ b/src/components/editors/NotSupportedText.tsx @@ -0,0 +1,5 @@ +import React from 'react'; + +export function NotSupportedText() { + return
To be supported soon...
+} diff --git a/src/module.ts b/src/module.ts index e366a4a..ce2912e 100644 --- a/src/module.ts +++ b/src/module.ts @@ -5,6 +5,7 @@ import { IconsEditor } from './components/editors/IconsEditor'; import { ThresholdsEditor } from './components/editors/ThresholdsEditor'; import { PanelPlugin } from '@grafana/data'; +import { NotSupportedText } from 'components/editors/NotSupportedText'; export const plugin = new PanelPlugin(Panel).setPanelOptions((builder) => { return builder @@ -18,21 +19,26 @@ export const plugin = new PanelPlugin(Panel).setPanelOptions((buil { label: 'Gauge', value: Pod.GAUGE, - description: 'Enable gauge pod', }, { label: 'Line', value: Pod.LINE, - description: 'Enable line pod', }, { label: 'Bar', value: Pod.BAR, - description: 'Enable bar pod', }, ], }, }) + .addCustomEditor({ + id: 'notSupportedText', + name: 'This visualization is not supported', + category: ['Visualization'], + path: '', + showIf: (config) => config.visualizationType !== Pod.GAUGE, + editor: NotSupportedText as any, + }) .addFieldNamePicker({ name: 'Value',