mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 16:45:43 -06:00
* Initial pass to move panel state to it's own, and make it by key not panel.id * Progress * Not making much progress, having panel.key be mutable is causing a lot of issues * Think this is starting to work * Began fixing tests * Add selector * Bug fixes and changes to cleanup, and fixing all flicking when switching library panels * Removed console.log * fixes after merge * fixing tests * fixing tests * Added new test for changePlugin thunk
9 lines
414 B
TypeScript
9 lines
414 B
TypeScript
import { StoreState } from 'app/types';
|
|
import { PanelPlugin } from '@grafana/data';
|
|
import { getPanelPluginNotFound } from '../../panel/components/PanelPluginError';
|
|
|
|
export const getPanelPluginWithFallback = (panelType: string) => (state: StoreState): PanelPlugin => {
|
|
const plugin = state.plugins.panels[panelType];
|
|
return plugin || getPanelPluginNotFound(`Panel plugin not found (${panelType})`, true);
|
|
};
|