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/InstancePropertiesModal.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstancePropertiesModal.js') diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstancePropertiesModal.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstancePropertiesModal.js index 8343237..8ad855e 100644 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstancePropertiesModal.js +++ b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/InstancePropertiesModal.js @@ -60,7 +60,6 @@ function Fragment(props) { Fragment.propTypes = { children: PropTypes.node }; const InstancePropertiesModal = (props) => { const [show, setShow] = useState(true); - const [windowLocationPathname, setWindowLocationPathname] = useState(''); const [toscaFullTemplate, setToscaFullTemplate] = useState({}); const [jsonEditor, setJsonEditor] = useState(null); const [alertMessage, setAlertMessage] = useState(null); @@ -71,9 +70,11 @@ const InstancePropertiesModal = (props) => { const [isLoading, setIsLoading] = useState(true); useEffect(async () => { - const toscaInstanceProperties = await ControlLoopService.getCommonOrInstanceProperties(templateName, templateVersion, windowLocationPathname, false).catch(error => error.message); + const toscaInstanceProperties = await ControlLoopService.getCommonOrInstanceProperties(templateName, templateVersion, false) + .catch(error => error.message); - const toscaTemplateResponse = await ControlLoopService.getToscaTemplate(templateName, templateVersion, windowLocationPathname).catch(error => error.message); + const toscaTemplateResponse = await ControlLoopService.getToscaTemplate(templateName, templateVersion) + .catch(error => error.message); if (!toscaInstanceProperties.ok) { const errorResponse = await toscaInstanceProperties.json() @@ -238,11 +239,10 @@ const InstancePropertiesModal = (props) => { console.log("instanceName to be saved is: " + instanceName) - setWindowLocationPathname(window.location.pathname); - updateTemplate(jsonEditor.getValue()); - const response = await ControlLoopService.createInstanceProperties(instanceName, toscaFullTemplate, windowLocationPathname).catch(error => error.message); + const response = await ControlLoopService.createInstanceProperties(instanceName, toscaFullTemplate) + .catch(error => error.message); if (response.ok) { successAlert(); -- cgit 1.2.3-korg