Skip to content

Commit

Permalink
fix dashboard variable bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
jkafader-esnet committed Oct 31, 2024
1 parent 7b17653 commit e93a9d7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/MapPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,16 @@ export class MapPanel extends Component<MapPanelProps> {
setLocation[dstVar] = null;
setLocation[nodeVar] = null;
}
if (event && event.nodeA && event.nodeZ) {
if (event && event.type === 'edge' && event.selection?.nodeA && event.selection?.nodeZ) {
const srcVariable = 'var-' + self.props.options.layers[event.layer]['dashboardEdgeSrcVar'];
setLocation[srcVariable] = event.nodeA;
setLocation[srcVariable] = event.selection.nodeA;
const dstVariable = 'var-' + self.props.options.layers[event.layer]['dashboardEdgeDstVar'];
setLocation[dstVariable] = event.nodeZ;
setLocation[dstVariable] = event.selection.nodeZ;
}
if (event && event.type === 'node') {
const dashboardVariable = 'var-' + self.props.options.layers[event.layer]['dashboardNodeVar'];
setLocation[dashboardVariable] = event.selection.name;
}

locationService.partial(setLocation, false);
};
}
Expand Down Expand Up @@ -322,6 +321,8 @@ export class MapPanel extends Component<MapPanelProps> {
this.updateTopologyEditor(this.mapCanvas.current['topology']);
});

this.mapCanvas.current.listen(signals.SELECTION_SET, this.setDashboardVariables())

this.updateMap();
// @ts-ignore
this.subscriptionHandle = eventBus.getStream({type: "panel-edit-finished"}).subscribe((e)=>{
Expand Down

0 comments on commit e93a9d7

Please sign in to comment.