@@ -21,6 +21,8 @@ import { NodeTable } from "../graph/node-modal/NodeDetailsContent/NodeTable";
21
21
import { ToggleProcessActionModalData } from "./DeployProcessDialog" ;
22
22
import LoaderSpinner from "../spinner/Spinner" ;
23
23
import { useErrorBoundary } from "react-error-boundary" ;
24
+ import { RootState } from "../../reducers" ;
25
+ import { getProcessState } from "../../reducers/selectors/scenarioState" ;
24
26
25
27
function initialNodesData ( params : ActionNodeParameters [ ] ) : NodesDeploymentData {
26
28
return params . reduce (
@@ -44,11 +46,16 @@ export function DeployWithParametersDialog(props: WindowContentProps<WindowKind,
44
46
const [ parametersDefinition , setParametersDefinition ] = useState < ActionNodeParameters [ ] > ( [ ] ) ;
45
47
const [ parametersValues , setParametersValues ] = useState < NodesDeploymentData > ( { } ) ;
46
48
49
+ const scenarioState = useSelector ( ( state : RootState ) => getProcessState ( state ) ) ;
50
+ const scenarioStatusesToActiveDeploy = [ "RUNNING" , "SCHEDULED" ] ;
51
+ const isDeploymentActive = scenarioStatusesToActiveDeploy . includes ( scenarioState . status . name ) ;
52
+
47
53
const getActionParameters = useCallback ( async ( ) => {
48
54
setIsLoading ( true ) ;
49
55
await HttpService . getActionParameters ( processName )
50
56
. then ( ( response ) => {
51
- const definition = response . data . actionNameToParameters [ "DEPLOY" ] || ( [ ] as ActionNodeParameters [ ] ) ;
57
+ const actionName = response . data . actionNameToParameters [ "REDEPLOY" ] && isDeploymentActive ? "REDEPLOY" : "DEPLOY" ;
58
+ const definition = response . data . actionNameToParameters [ actionName ] || ( [ ] as ActionNodeParameters [ ] ) ;
52
59
const initialValues = initialNodesData ( definition ) ;
53
60
setParametersDefinition ( definition ) ;
54
61
setParametersValues ( initialValues ) ;
@@ -59,7 +66,7 @@ export function DeployWithParametersDialog(props: WindowContentProps<WindowKind,
59
66
. finally ( ( ) => {
60
67
setIsLoading ( false ) ;
61
68
} ) ;
62
- } , [ processName , showBoundary ] ) ;
69
+ } , [ processName , showBoundary , isDeploymentActive ] ) ;
63
70
64
71
useEffect ( ( ) => {
65
72
getActionParameters ( ) ;
0 commit comments