Rework action itmes
Rework the submit, stop, restart, delete, undeploy and refresh status
actions.
Issue-ID: CLAMP-441,CLAMP-442,CLAMP-443,CLAMP-444,CLAMP-446,CLAMP-448
Change-Id: I38aed3a06fdcdf0f53fc9b8f8d2d9072f0932d55
Signed-off-by: xuegao <xg353y@intl.att.com>
diff --git a/ui-react/src/LoopUI.js b/ui-react/src/LoopUI.js
index 643b32d..c7080a2 100644
--- a/ui-react/src/LoopUI.js
+++ b/ui-react/src/LoopUI.js
@@ -41,6 +41,8 @@
import LoopProperties from './components/dialogs/LoopProperties';
import UserInfo from './components/dialogs/UserInfo';
import LoopService from './api/LoopService';
+import PerformAction from './components/menu/PerformActions';
+import RefreshStatus from './components/menu/RefreshStatus';
const ProjectNameStyled = styled.a`
vertical-align: middle;
@@ -80,7 +82,7 @@
state = {
userName: null,
loopName: LoopUI.defaultLoopName,
- loopCache: new LoopCache({}),
+ loopCache: new LoopCache({})
};
constructor() {
@@ -102,7 +104,7 @@
renderMenuNavBar() {
return (
- <MenuBar loopCache={this.state.loopCache}/>
+ <MenuBar/>
);
}
@@ -155,6 +157,7 @@
return this.state.loopCache;
}
+
renderLoopViewer() {
return (
<LoopViewDivStyled>
@@ -169,7 +172,7 @@
this.setState({ loopName: this.state.loopCache.getLoopName() });
console.info(this.state.loopName+" loop loaded successfully");
}
-
+
loadLoop(loopName) {
LoopService.getLoop(loopName).then(loop => {
console.debug("Updating loopCache");
@@ -187,6 +190,12 @@
<Route path="/loopProperties" render={(routeProps) => (<LoopProperties {...routeProps} loopCache={this.getLoopCache()} loadLoopFunction={this.loadLoop}/>)} />
<Route path="/userInfo" render={(routeProps) => (<UserInfo {...routeProps} />)} />
<Route path="/closeLoop" render={(routeProps) => (<Redirect to='/'/>)} />
+ <Route path="/submit" render={(routeProps) => (<PerformAction {...routeProps} loopAction="submit" loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache}/>)} />
+ <Route path="/stop" render={(routeProps) => (<PerformAction {...routeProps} loopAction="stop" loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache}/>)} />
+ <Route path="/restart" render={(routeProps) => (<PerformAction {...routeProps} loopAction="restart" loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache}/>)} />
+ <Route path="/delete" render={(routeProps) => (<PerformAction {...routeProps} loopAction="delete" loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache}/>)} />
+ <Route path="/undeploy" render={(routeProps) => (<PerformAction {...routeProps} loopAction="undeploy" loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache}/>)} />
+ <Route path="/refreshStatus" render={(routeProps) => (<RefreshStatus {...routeProps} loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache}/>)} />
<GlobalClampStyle />
{this.renderNavBar()}
{this.renderLoopViewer()}