@@ -28,6 +28,7 @@ import InputLabel from "@mui/material/InputLabel";
2828import MenuItem from "@mui/material/MenuItem" ;
2929import Dialog from "@mui/material/Dialog" ;
3030import Select from "@mui/material/Select" ;
31+ import Stack from "@mui/material/Stack" ;
3132import TextField from "@mui/material/TextField" ;
3233import Typography from "@mui/material/Typography" ;
3334import { Close , DeleteOutline , Add , EditOutlined } from "@mui/icons-material" ;
@@ -107,7 +108,7 @@ const emptyScenario: ScenarioDict = {
107108 properties : [ ] ,
108109} ;
109110
110- const ActionContentSx = { mr : 2 , ml : 2 } ;
111+ const ActionContentSx = { mr : 2 , ml : 2 , width : "100%" } ;
111112
112113const DialogContentSx = {
113114 maxHeight : "calc(100vh - 256px)" ,
@@ -126,10 +127,6 @@ const SquareButtonSx = {
126127 aspectRatio : "1" ,
127128} ;
128129
129- const CancelBtnSx = {
130- mr : 2 ,
131- } ;
132-
133130const IconButtonSx = {
134131 p : 0 ,
135132} ;
@@ -370,36 +367,28 @@ const ScenarioEditDialog = ({ scenario, submit, open, actionEdit, configs, close
370367 </ DialogContent >
371368
372369 < DialogActions >
373- < Grid container justifyContent = "space-between" sx = { ActionContentSx } >
370+ < Stack direction = "row" justifyContent = "space-between" sx = { ActionContentSx } >
374371 { actionEdit && (
375- < Grid size = { 6 } >
376- < Button
377- variant = "outlined"
378- color = "error"
379- onClick = { onConfirmDialogOpen }
380- disabled = { ! scenario || ! scenario [ ScFProps . deletable ] }
381- >
382- Delete
383- </ Button >
384- </ Grid >
372+ < Button
373+ variant = "outlined"
374+ color = "error"
375+ onClick = { onConfirmDialogOpen }
376+ disabled = { ! scenario || ! scenario [ ScFProps . deletable ] }
377+ >
378+ Delete
379+ </ Button >
385380 ) }
386- < Grid container size = { actionEdit ? 6 : 12 } justifyContent = "flex-end" >
387- < Grid sx = { CancelBtnSx } >
388- < Button variant = "outlined" color = "inherit" onClick = { close } >
389- Cancel
390- </ Button >
391- </ Grid >
392- < Grid >
393- < Button
394- variant = "contained"
395- type = "submit"
396- disabled = { ! form . values . config || ! form . values . name }
397- >
398- { actionEdit ? "Apply" : "Create" }
399- </ Button >
400- </ Grid >
401- </ Grid >
402- </ Grid >
381+ < Button variant = "outlined" color = "inherit" onClick = { close } >
382+ Cancel
383+ </ Button >
384+ < Button
385+ variant = "contained"
386+ type = "submit"
387+ disabled = { ! form . values . config || ! form . values . name }
388+ >
389+ { actionEdit ? "Apply" : "Create" }
390+ </ Button >
391+ </ Stack >
403392 </ DialogActions >
404393 </ form >
405394 </ Dialog >
@@ -489,26 +478,26 @@ const ScenarioSelector = (props: ScenarioSelectorProps) => {
489478 const openEditDialog = useCallback (
490479 ( e : React . MouseEvent < HTMLElement > ) => {
491480 e . stopPropagation ( ) ;
492- const { id : scenId } = e . currentTarget ?. dataset || { } ;
481+ const { id : scId } = e . currentTarget ?. dataset || { } ;
493482 const varName = getUpdateVar ( updateScVars , "sc_id" ) ;
494- scenId &&
483+ scId &&
495484 props . onScenarioSelect &&
496- dispatch ( createSendActionNameAction ( props . id , module , props . onScenarioSelect , varName , scenId ) ) ;
485+ dispatch ( createSendActionNameAction ( props . id , module , props . onScenarioSelect , varName , scId ) ) ;
497486 setOpen ( true ) ;
498487 setActionEdit ( true ) ;
499488 } ,
500489 [ props . onScenarioSelect , props . id , dispatch , module , updateScVars ]
501490 ) ;
502491
503- const EditScenario = useCallback (
492+ const editScenario = useCallback (
504493 ( props : EditProps ) => (
505494 < Tooltip title = { props . active ? "Edit Scenario" : "Can't edit Scenario" } >
506495 < span >
507496 < IconButton
508497 data-id = { props . id }
509498 onClick = { openEditDialog }
510499 sx = { tinyEditIconButtonSx }
511- disabled = { props . active }
500+ disabled = { ! props . active }
512501 >
513502 < EditOutlined />
514503 </ IconButton >
@@ -526,7 +515,7 @@ const ScenarioSelector = (props: ScenarioSelectorProps) => {
526515 entities = { props . innerScenarios }
527516 leafType = { NodeType . SCENARIO }
528517 lovPropertyName = "innerScenarios"
529- editComponent = { EditScenario }
518+ editComponent = { editScenario }
530519 showPins = { showPins }
531520 multiple = { multiple }
532521 updateCoreVars = { updateScVars }
0 commit comments