From aa486be66b1c29ad2e953cb44d105ca1bde40b1c Mon Sep 17 00:00:00 2001 From: sebdet Date: Tue, 18 Feb 2020 02:00:11 -0800 Subject: Modify the Ui Modify the Ui to have a modify option in the menu so that the user can tune the loop instance Issue-ID: CLAMP-648 Change-Id: I57523bc1c3afaf5ca5a2acf5c59823df06fd4cd9 Signed-off-by: sebdet --- ui-react/src/components/dialogs/Loop/OpenLoopModal.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ui-react/src/components/dialogs/Loop/OpenLoopModal.js') diff --git a/ui-react/src/components/dialogs/Loop/OpenLoopModal.js b/ui-react/src/components/dialogs/Loop/OpenLoopModal.js index fbfc727e..4e8d9782 100644 --- a/ui-react/src/components/dialogs/Loop/OpenLoopModal.js +++ b/ui-react/src/components/dialogs/Loop/OpenLoopModal.js @@ -68,15 +68,16 @@ export default class OpenLoopModal extends React.Component { getLoopNames() { LoopService.getLoopNames().then(loopNames => { - const loopOptions = loopNames.map((loopName) => { return { label: loopName, value: loopName } }); - this.setState({ loopNames: loopOptions }) + if (Object.entries(loopNames).length !== 0) { + const loopOptions = loopNames.filter(loopName => loopName!=='undefined').map((loopName) => { return { label: loopName, value: loopName } }); + this.setState({ loopNames: loopOptions }) + } }); } handleOpen() { console.info("Loop " + this.state.chosenLoopName + " is chosen"); - this.setState({ show: false }); - this.props.history.push('/'); + this.handleClose(); this.props.loadLoopFunction(this.state.chosenLoopName); } -- cgit 1.2.3-korg