From 426fa90230fc6732bd2a74e4c202e697ecd4c11b Mon Sep 17 00:00:00 2001 From: danielhanrahan Date: Wed, 8 Sep 2021 12:34:22 +0100 Subject: Make gui-clamp work in Docker image Change package.json to generate URLs relative to current pathname Change REST URLs to use window.location.pathname Remove broken React state variables for window.location.pathname Issue-ID: POLICY-3600 Signed-off-by: danielhanrahan Change-Id: I6951a0a6b3f3bef15d262242df13cc2d20a198c8 --- .../dialogs/ControlLoop/InstantiationManagementModal.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationManagementModal.js') diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationManagementModal.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationManagementModal.js index a0a849c..6a435e4 100644 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationManagementModal.js +++ b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstantiationManagementModal.js @@ -46,16 +46,12 @@ const DivWhiteSpaceStyled = styled.div` ` const InstantiationManagementModal = (props) => { const [show, setShow] = useState(true); - const [windowLocationPathName, setWindowLocationPathName] = useState(''); - const [windowLocationPathNameDelete, setWindowLocationPathNameDelete] = useState(''); - const [instantiationList, setInstantiationList] = useState([]); const [alertMessage, setAlertMessage] = useState(null); useEffect(async () => { - setWindowLocationPathName(window.location.pathname); - const response = await ControlLoopService.getControlLoopInstantiation(windowLocationPathName); + const response = await ControlLoopService.getControlLoopInstantiation(); const instantiationListJson = await response.json(); @@ -83,14 +79,11 @@ const InstantiationManagementModal = (props) => { const deleteInstantiationHandler = async (instantiation, index) => { console.log("deleteInstantiationHandler called"); - setWindowLocationPathNameDelete(window.location.pathname); const name = instantiation.name; const version = instantiation.version; - console.log(window.location.pathname); - - const response = await ControlLoopService.deleteInstantiation(name, version, windowLocationPathNameDelete); + const response = await ControlLoopService.deleteInstantiation(name, version); updateList(index); -- cgit 1.2.3-korg