8
8
import { ListItemIcon , ListItemText , Menu , Typography } from '@mui/material' ;
9
9
import BoltIcon from '@mui/icons-material/Bolt' ;
10
10
import { FormattedMessage } from 'react-intl' ;
11
- import { FunctionComponent , useCallback , useEffect , useMemo , useState } from 'react' ;
11
+ import { FunctionComponent , MouseEvent as ReactMouseEvent , useCallback , useEffect , useMemo , useState } from 'react' ;
12
12
import { isNodeBuilt , isNodeReadOnly } from 'components/graph/util/model-functions' ;
13
13
import { useSelector } from 'react-redux' ;
14
14
import { AppState } from 'redux/reducer' ;
@@ -22,13 +22,13 @@ import { useOptionalServiceStatus } from '../../hooks/use-optional-service-statu
22
22
import { OptionalServicesNames , OptionalServicesStatus } from '../utils/optional-services' ;
23
23
import OfflineBoltOutlinedIcon from '@mui/icons-material/OfflineBoltOutlined' ;
24
24
import { tripEquipment } from '../../services/study/network-modifications' ;
25
- import { EquipmentType , useSnackMessage , CustomMenuItem , ComputingType } from '@gridsuite/commons-ui' ;
25
+ import { ComputingType , CustomMenuItem , EquipmentType , useSnackMessage } from '@gridsuite/commons-ui' ;
26
26
import { fetchNetworkElementInfos } from '../../services/study/network' ;
27
27
import { useParameterState } from 'components/dialogs/parameters/use-parameters-state' ;
28
28
29
29
interface BusMenuProps {
30
30
busId : string ;
31
- handleRunShortcircuitAnalysis : ( busId : string ) => void ;
31
+ handleRunShortcircuitAnalysis : ( busId : string , debug : boolean ) => void ;
32
32
onOpenDynamicSimulationEventDialog : (
33
33
equipmentId : string ,
34
34
equipmentType : EquipmentType ,
@@ -105,10 +105,13 @@ export const BusMenu: FunctionComponent<BusMenuProps> = ({
105
105
( state : AppState ) => state . computingStatus [ ComputingType . SHORT_CIRCUIT_ONE_BUS ]
106
106
) ;
107
107
108
- const handleClickRunShortcircuitAnalysis = useCallback ( ( ) => {
109
- onClose ( ) ;
110
- handleRunShortcircuitAnalysis ( busId ) ;
111
- } , [ busId , onClose , handleRunShortcircuitAnalysis ] ) ;
108
+ const handleClickRunShortcircuitAnalysis = useCallback (
109
+ ( event : ReactMouseEvent < HTMLLIElement > ) => {
110
+ onClose ( ) ;
111
+ handleRunShortcircuitAnalysis ( busId , event . ctrlKey ) ;
112
+ } ,
113
+ [ busId , onClose , handleRunShortcircuitAnalysis ]
114
+ ) ;
112
115
113
116
const handleOpenDynamicSimulationEventDialog = useCallback (
114
117
( equipmentId : string , equipmentType : EquipmentType , dialogTitle : string ) => {
0 commit comments