mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Sandbox: Fix panel custom editors not working inside the sandbox (#74589)
* Sandbox: Fix panel custom editors not working inside the sandbox * Use the plugin-id in the specific rendering category
This commit is contained in:
@@ -19,6 +19,7 @@ export interface OptionsPaneCategoryProps {
|
|||||||
className?: string;
|
className?: string;
|
||||||
isNested?: boolean;
|
isNested?: boolean;
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
|
sandboxId?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CATEGORY_PARAM_NAME = 'showCategory';
|
const CATEGORY_PARAM_NAME = 'showCategory';
|
||||||
@@ -34,6 +35,7 @@ export const OptionsPaneCategory = React.memo(
|
|||||||
className,
|
className,
|
||||||
itemsCount,
|
itemsCount,
|
||||||
isNested = false,
|
isNested = false,
|
||||||
|
sandboxId,
|
||||||
}: OptionsPaneCategoryProps) => {
|
}: OptionsPaneCategoryProps) => {
|
||||||
const initialIsExpanded = isOpenDefault !== false;
|
const initialIsExpanded = isOpenDefault !== false;
|
||||||
const [savedState, setSavedState] = useLocalStorage(getOptionGroupStorageKey(id), {
|
const [savedState, setSavedState] = useLocalStorage(getOptionGroupStorageKey(id), {
|
||||||
@@ -112,6 +114,7 @@ export const OptionsPaneCategory = React.memo(
|
|||||||
<div
|
<div
|
||||||
className={boxStyles}
|
className={boxStyles}
|
||||||
data-testid="options-category"
|
data-testid="options-category"
|
||||||
|
data-plugin-sandbox={sandboxId}
|
||||||
aria-label={selectors.components.OptionsGroup.group(id)}
|
aria-label={selectors.components.OptionsGroup.group(id)}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export interface OptionsPaneCategoryDescriptorProps {
|
|||||||
isNested?: boolean;
|
isNested?: boolean;
|
||||||
itemsCount?: number;
|
itemsCount?: number;
|
||||||
customRender?: () => React.ReactNode;
|
customRender?: () => React.ReactNode;
|
||||||
|
sandboxId?: string;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This is not a real React component but an intermediary to enable deep option search without traversing a React node tree.
|
* This is not a real React component but an intermediary to enable deep option search without traversing a React node tree.
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ export function getVisualizationOptions(props: OptionPaneRenderProps): OptionsPa
|
|||||||
return (categoryIndex[categoryName] = new OptionsPaneCategoryDescriptor({
|
return (categoryIndex[categoryName] = new OptionsPaneCategoryDescriptor({
|
||||||
title: categoryName,
|
title: categoryName,
|
||||||
id: categoryName,
|
id: categoryName,
|
||||||
|
sandboxId: plugin.meta.id,
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user