From ac42c4b3e7161a76bfa67cae9636ea63d7bd81f8 Mon Sep 17 00:00:00 2001 From: xuegao Date: Wed, 9 Oct 2019 16:12:37 +0200 Subject: Fix policy status issue Change the initial status of policy from SENT_AND_DEPLOYED to NOT_SENT. Issue-ID: CLAMP-533 Change-Id: If4fa22fc2e3fb33500502bab41e49de9000dd7e7 Signed-off-by: xuegao --- ui-react/src/LoopUI.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'ui-react/src') diff --git a/ui-react/src/LoopUI.js b/ui-react/src/LoopUI.js index ad970d811..ff3c4445a 100644 --- a/ui-react/src/LoopUI.js +++ b/ui-react/src/LoopUI.js @@ -33,6 +33,7 @@ import LoopLogs from './components/loop_viewer/logs/LoopLogs'; import LoopStatus from './components/loop_viewer/status/LoopStatus'; import UserService from './api/UserService'; import LoopCache from './api/LoopCache'; +import LoopActionService from './api/LoopActionService'; import { Route } from 'react-router-dom' import OpenLoopModal from './components/dialogs/OpenLoop/OpenLoopModal'; @@ -227,7 +228,14 @@ export default class LoopUI extends React.Component { loadLoop(loopName) { LoopService.getLoop(loopName).then(loop => { console.debug("Updating loopCache"); - this.updateLoopCache(loop); + LoopActionService.refreshStatus(loopName).then(data => { + this.updateLoopCache(data); + this.props.history.push('/'); + }) + .catch(error => { + this.updateLoopCache(loop); + this.props.history.push('/'); + }); }); } -- cgit 1.2.3-korg