From 13f852e896bf0e63186df8e7ccb129e625255c6b Mon Sep 17 00:00:00 2001
From: Zoltan Runyo <zoltan.runyo@ess.eu>
Date: Tue, 21 Sep 2021 09:44:26 +0200
Subject: [PATCH] ICSHWI-7906: Give hint for moving IOC use case on UI

---
 src/components/IOC/IOCDeployDialog.js | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/components/IOC/IOCDeployDialog.js b/src/components/IOC/IOCDeployDialog.js
index be52706c..bd31d6b9 100644
--- a/src/components/IOC/IOCDeployDialog.js
+++ b/src/components/IOC/IOCDeployDialog.js
@@ -1,5 +1,5 @@
 import React, { useEffect, useState } from "react";
-import { Button, TextField, Dialog, DialogActions, DialogContent, DialogTitle, makeStyles } from "@material-ui/core";
+import { Button, TextField, Dialog, DialogActions, DialogContent, DialogTitle, Typography, makeStyles } from "@material-ui/core";
 import { Autocomplete } from "@material-ui/lab";
 import { useCSEntrySearch, useTagsAndCommitIds } from "../../api/SwaggerApi";
 import { useTypingTimer } from "../common/SearchBoxFilter/TypingTimer";
@@ -64,7 +64,7 @@ export function IOCDeployDialog({ open, setOpen, submitCallback, hasActiveDeploy
             disabled={(!gitRepo) || (gitRepo.trim() === "")}
             renderInput={(params) => <TextField {...params} label="Git reference" variant="outlined" fullWidth required />}
           />
-          
+
           <Autocomplete
             className={classes.textField}
             autoHighlight
@@ -75,7 +75,15 @@ export function IOCDeployDialog({ open, setOpen, submitCallback, hasActiveDeploy
             renderInput={(params) => <TextField {...params} label="host" variant="outlined" required/>}
             onChange={(event, value, reason) => setHost(value)}
             onInputChange={(event, value, reason) => {event && onHostKeyUp(event.nativeEvent)}}
+            disabled={hasActiveDeployment}
           />
+
+          { hasActiveDeployment ? 
+          <Typography variant="body">
+            Hint: First undeploy IOC if you want to move to another host.
+          </Typography> 
+          : <></>
+          }
         </DialogContent>
         <DialogActions>
           <Button onClick={handleClose} color="primary">Cancel</Button>
-- 
GitLab