Browse Source

"To be supported" for non-gauge visualizations

merge-requests/6/head
rozetko 3 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 { ThresholdsEditor } from './components/editors/ThresholdsEditor';
import { PanelPlugin } from '@grafana/data'; import { PanelPlugin } from '@grafana/data';
import { NotSupportedText } from 'components/editors/NotSupportedText';
export const plugin = new PanelPlugin<PanelOptions>(Panel).setPanelOptions((builder) => { export const plugin = new PanelPlugin<PanelOptions>(Panel).setPanelOptions((builder) => {
return builder return builder
@ -18,21 +19,26 @@ export const plugin = new PanelPlugin<PanelOptions>(Panel).setPanelOptions((buil
{ {
label: 'Gauge', label: 'Gauge',
value: Pod.GAUGE, value: Pod.GAUGE,
description: 'Enable gauge pod',
}, },
{ {
label: 'Line', label: 'Line',
value: Pod.LINE, value: Pod.LINE,
description: 'Enable line pod',
}, },
{ {
label: 'Bar', label: 'Bar',
value: Pod.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({ .addFieldNamePicker({
name: 'Value', name: 'Value',

Loading…
Cancel
Save