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 --- .../components/dialogs/ControlLoop/ChangeOrderStateModal.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'gui-clamp/ui-react/src/components/dialogs/ControlLoop/ChangeOrderStateModal.js') diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/ChangeOrderStateModal.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/ChangeOrderStateModal.js index 2c6d9aa..d8efd3a 100644 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/ChangeOrderStateModal.js +++ b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/ChangeOrderStateModal.js @@ -48,8 +48,6 @@ const AlertStyled = styled(Alert)` const ChangeOrderStateModal = (props) => { const [show, setShow] = useState(true); - const [windowLocationPathnameGet, setWindowLocationPathnameGet] = useState(''); - const [windowLocationPathNameSave, setWindowLocationPathNameSave] = useState(''); const [controlLoopIdentifierList, setControlLoopIdentifierList] = useState([]); const [orderedState, setOrderedState] = useState(''); const [toscaOrderStateObject, setToscaOrderStateObject] = useState({}); @@ -58,11 +56,10 @@ const ChangeOrderStateModal = (props) => { const [alertMessage, setAlertMessage] = useState(null); useEffect(async () => { - setWindowLocationPathnameGet(window.location.pathname); const instantiationOrderState = await ControlLoopService.getInstanceOrderState( props.location.instantiationName, - props.location.instantiationVersion, windowLocationPathnameGet) + props.location.instantiationVersion) .catch(error => error.message); const orderStateJson = await instantiationOrderState.json(); @@ -91,11 +88,9 @@ const ChangeOrderStateModal = (props) => { const handleSave = async () => { console.log("handleSave called"); - setWindowLocationPathNameSave(window.location.pathname); - const response = await ControlLoopService.changeInstanceOrderState( - toscaOrderStateObject, - windowLocationPathNameSave).catch(error => error.message); + const response = await ControlLoopService.changeInstanceOrderState(toscaOrderStateObject) + .catch(error => error.message); if (response.ok) { successAlert(); -- cgit 1.2.3-korg