@@ -45,7 +45,7 @@ import { startShortCircuitAnalysis } from '../../../services/study/short-circuit
45
45
import { fetchNetworkElementInfos } from '../../../services/study/network' ;
46
46
import { useOneBusShortcircuitAnalysisLoader } from '../use-one-bus-shortcircuit-analysis-loader' ;
47
47
import { DynamicSimulationEventDialog } from '../../dialogs/dynamicsimulation/event/dynamic-simulation-event-dialog' ;
48
- import { openDiagram , setComputationStarting , setComputingStatus , setLogsFilter } from '../../../redux/actions' ;
48
+ import { setComputationStarting , setComputingStatus , setLogsFilter } from '../../../redux/actions' ;
49
49
import { AppState } from 'redux/reducer' ;
50
50
import { UUID } from 'crypto' ;
51
51
import { INVALID_LOADFLOW_OPACITY } from '../../../utils/colors' ;
@@ -69,6 +69,7 @@ interface SingleLineDiagramContentProps {
69
69
readonly diagramSizeSetter : ( id : UUID , type : DiagramType , width : number , height : number ) => void ;
70
70
readonly diagramId : UUID ;
71
71
readonly visible : boolean ;
72
+ readonly onNextVoltageLevelClick : ( voltageLevelId : string ) => void ;
72
73
}
73
74
74
75
type EquipmentToModify = {
@@ -116,7 +117,7 @@ function applyInvalidStyles(svgContainer: HTMLElement) {
116
117
}
117
118
118
119
function SingleLineDiagramContent ( props : SingleLineDiagramContentProps ) {
119
- const { diagramSizeSetter, studyUuid, visible } = props ;
120
+ const { diagramSizeSetter, studyUuid, visible, onNextVoltageLevelClick } = props ;
120
121
const theme = useTheme ( ) ;
121
122
const dispatch = useDispatch ( ) ;
122
123
const MenuBranch = withOperatingStatusMenu ( BaseEquipmentMenu ) ;
@@ -219,18 +220,6 @@ function SingleLineDiagramContent(props: SingleLineDiagramContentProps) {
219
220
[ studyUuid , currentNode , modificationInProgress ]
220
221
) ;
221
222
222
- const handleNextVoltageLevelClick = useCallback (
223
- ( id : string ) => {
224
- // This function is called by powsybl-network-viewer when clicking on a navigation arrow in a single line diagram.
225
- // At the moment, there is no plan to open something other than a voltage-level by using these navigation arrows.
226
- if ( ! studyUuid || ! currentNode ) {
227
- return ;
228
- }
229
- dispatch ( openDiagram ( id , DiagramType . VOLTAGE_LEVEL ) ) ;
230
- } ,
231
- [ dispatch , studyUuid , currentNode ]
232
- ) ;
233
-
234
223
const [ equipmentMenu , setEquipmentMenu ] = useState < EquipmentMenuState > ( defaultMenuState ) ;
235
224
236
225
const [ busMenu , setBusMenu ] = useState < BusMenuState > ( defaultBusMenuState ) ;
@@ -543,7 +532,7 @@ function SingleLineDiagramContent(props: SingleLineDiagramContentProps) {
543
532
props . svgType === DiagramType . VOLTAGE_LEVEL ? MAX_HEIGHT_VOLTAGE_LEVEL : MAX_HEIGHT_SUBSTATION ,
544
533
545
534
// callback on the next voltage arrows
546
- isReadyForInteraction ? handleNextVoltageLevelClick : null ,
535
+ isReadyForInteraction ? onNextVoltageLevelClick : null ,
547
536
548
537
// callback on the breakers
549
538
isReadyForInteraction && ! isNodeReadOnly ( currentNode ) ? handleBreakerClick : null ,
@@ -610,7 +599,7 @@ function SingleLineDiagramContent(props: SingleLineDiagramContentProps) {
610
599
props . loadingState ,
611
600
locallySwitchedBreaker ,
612
601
handleBreakerClick ,
613
- handleNextVoltageLevelClick ,
602
+ onNextVoltageLevelClick ,
614
603
diagramSizeSetter ,
615
604
handleTogglePopover ,
616
605
computationStarting ,
0 commit comments