From cc5fe51690dc1f780c6b7cd1168e59dedc3b245f Mon Sep 17 00:00:00 2001 From: xuegao Date: Mon, 6 Apr 2020 13:13:52 +0200 Subject: Update suc alert color Update the back groud color for succesful alert messages. Issue-ID: CLAMP-815 Change-Id: I97a621e31f2eb850eae30da3754afd3cd4ddb34a Signed-off-by: xuegao --- ui-react/src/LoopUI.js | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'ui-react/src/LoopUI.js') diff --git a/ui-react/src/LoopUI.js b/ui-react/src/LoopUI.js index bc3f2355e..5e2da79c6 100644 --- a/ui-react/src/LoopUI.js +++ b/ui-react/src/LoopUI.js @@ -109,7 +109,8 @@ export default class LoopUI extends React.Component { userName: null, loopName: OnapConstants.defaultLoopName, loopCache: new LoopCache({}), - showAlert: false + showSucAlert: false, + showFailAlert: false }; constructor() { @@ -119,7 +120,8 @@ export default class LoopUI extends React.Component { this.updateLoopCache = this.updateLoopCache.bind(this); this.loadLoop = this.loadLoop.bind(this); this.closeLoop = this.closeLoop.bind(this); - this.showAlert = this.showAlert.bind(this); + this.showSucAlert = this.showSucAlert.bind(this); + this.showFailAlert = this.showFailAlert.bind(this); this.disableAlert = this.disableAlert.bind(this); } @@ -168,9 +170,14 @@ export default class LoopUI extends React.Component { renderAlertBar() { return ( - +
+ {this.state.showMessage} + + {this.state.showMessage} + +
); } @@ -223,12 +230,16 @@ export default class LoopUI extends React.Component { console.info(this.state.loopName+" loop loaded successfully"); } - showAlert(message) { - this.setState ({ showAlert: true, showMessage:message }); + showSucAlert(message) { + this.setState ({ showSucAlert: true, showMessage:message }); } + showFailAlert(message) { + this.setState ({ showFailAlert: true, showMessage:message }); + } + disableAlert() { - this.setState ({ showAlert: false }); + this.setState ({ showSucAlert: false, showFailAlert: false }); } loadLoop(loopName) { @@ -258,7 +269,7 @@ export default class LoopUI extends React.Component { ()} /> ()} /> ()} /> + render={(routeProps) => ()} /> ()} /> ()} /> ()} /> @@ -268,13 +279,13 @@ export default class LoopUI extends React.Component { ()} /> - ()} /> - ()} /> - ()} /> - ()} /> - ()} /> - ()} /> - ()} /> + ()} /> + ()} /> + ()} /> + ()} /> + ()} /> + ()} /> + ()} /> {this.renderAlertBar()} -- cgit 1.2.3-korg