Browse Source

"To be supported" for non-gauge visualizations

merge-requests/6/head
rozetko 2 years ago
parent
commit
05e1cf33e6
  1. 5
      src/components/editors/NotSupportedText.tsx
  2. 12
      src/module.ts

5
src/components/editors/NotSupportedText.tsx

@ -0,0 +1,5 @@
import React from 'react';
export function NotSupportedText() {
return <div>To be supported soon...</div>
}

12
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<PanelOptions>(Panel).setPanelOptions((builder) => {
return builder
@ -18,21 +19,26 @@ export const plugin = new PanelPlugin<PanelOptions>(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',

Loading…
Cancel
Save