mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Canvas: Improve Selection System (#41065)
This commit is contained in:
@@ -44,8 +44,7 @@ export class CanvasPanel extends Component<Props, State> {
|
||||
this.subs.add(
|
||||
this.props.eventBus.subscribe(PanelEditEnteredEvent, (evt) => {
|
||||
// Remove current selection when entering edit mode for any panel in dashboard
|
||||
let event: MouseEvent = new MouseEvent('click');
|
||||
this.scene?.selecto?.clickTarget(event, this.scene?.div);
|
||||
this.scene.clearCurrentSelection();
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ export class LayerElementListEditor extends PureComponent<Props> {
|
||||
try {
|
||||
settings.scene.selecto.clickTarget(item, item?.div);
|
||||
} catch (error) {
|
||||
appEvents.emit(AppEvents.alertError, ['Unable to select element with inline editing disabled']);
|
||||
appEvents.emit(AppEvents.alertError, ['Unable to select element, try selecting element in panel instead']);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -46,8 +46,6 @@ export function getElementEditor(opts: CanvasEditorOptions): NestedPanelOptions<
|
||||
|
||||
// Dynamically fill the selected element
|
||||
build: (builder, context) => {
|
||||
console.log('MAKE element editor', opts.element.UID);
|
||||
|
||||
const { options } = opts.element;
|
||||
const layerTypes = canvasElementRegistry.selectOptions(
|
||||
options?.type // the selected value
|
||||
|
||||
@@ -30,8 +30,6 @@ export function getLayerEditor(opts: InstanceState): NestedPanelOptions<Instance
|
||||
|
||||
// Dynamically fill the selected element
|
||||
build: (builder, context) => {
|
||||
console.log('MAKE layer editor', layer.UID);
|
||||
|
||||
builder.addCustomEditor({
|
||||
id: 'content',
|
||||
path: 'root',
|
||||
|
||||
@@ -28,8 +28,6 @@ export const plugin = new PanelPlugin<PanelOptions>(CanvasPanel)
|
||||
scene: state.scene,
|
||||
})
|
||||
);
|
||||
} else {
|
||||
console.log('NO Single seleciton', selection?.length);
|
||||
}
|
||||
|
||||
builder.addNestedOptions(getLayerEditor(state));
|
||||
|
||||
Reference in New Issue
Block a user