Fix datalink suggestions (#33411)

This commit is contained in:
Oscar Kilhed 2021-04-28 09:58:53 +02:00 committed by GitHub
parent 18db387387
commit 6c7290164e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -32,7 +32,7 @@ export const OptionsPaneOptions: React.FC<Props> = (props) => {
() => [getPanelFrameCategory(props), getVizualizationOptions(props), getFieldOverrideCategories(props)],
// eslint-disable-next-line react-hooks/exhaustive-deps
[panel.configRev]
[panel.configRev, props.data]
);
const mainBoxElements: React.ReactNode[] = [];

View File

@ -1,7 +1,7 @@
import React from 'react';
import { StandardEditorContext, VariableSuggestionsScope } from '@grafana/data';
import { get as lodashGet, set as lodashSet } from 'lodash';
import { getPanelOptionsVariableSuggestions } from 'app/features/panel/panellinks/link_srv';
import { getDataLinksVariableSuggestions } from 'app/features/panel/panellinks/link_srv';
import { OptionPaneRenderProps } from './types';
import { updateDefaultFieldConfigValue } from './utils';
import { OptionsPaneItemDescriptor } from './OptionsPaneItemDescriptor';
@ -19,7 +19,7 @@ export function getVizualizationOptions(props: OptionPaneRenderProps): OptionsPa
options: currentOptions,
eventBus: dashboard.events,
getSuggestions: (scope?: VariableSuggestionsScope) => {
return getPanelOptionsVariableSuggestions(plugin, data?.series);
return data ? getDataLinksVariableSuggestions(data.series, scope) : [];
},
};