From 01e5fde3fa45638f3ad884ca76ad861d8781868a Mon Sep 17 00:00:00 2001 From: Ted Humphrey Date: Mon, 27 Jan 2020 18:57:39 -0500 Subject: Changes for populating ReactJS component library Modification of Maven pom.xml to segregate creation of component library away from the basic CLAMP UI. New directory ui-react-lib is introduced and populated with just a few files to support the library creation. Introduction of OnapConstants.js provides single focus for defining constants shared across multiple components, resolving circular dependency between LoopUI.js and MenuBar.js around defaultLoopName. Modified LoopSvg.js to import withRoute from react-router-dom instead of react-router, which was causing problems in usage of completed component library. Issue-ID: CLAMP-586 Change-Id: I3054d5388b8aa7417fe7566c34279390d24fb80a Signed-off-by: Ted Humphrey --- ui-react/src/LoopUI.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'ui-react/src/LoopUI.js') diff --git a/ui-react/src/LoopUI.js b/ui-react/src/LoopUI.js index eb4ff6a50..9eea0be95 100644 --- a/ui-react/src/LoopUI.js +++ b/ui-react/src/LoopUI.js @@ -27,6 +27,7 @@ import MenuBar from './components/menu/MenuBar'; import Navbar from 'react-bootstrap/Navbar'; import logo from './logo.png'; import { GlobalClampStyle } from './theme/globalStyle.js'; +import OnapConstants from './utils/OnapConstants'; import LoopSvg from './components/loop_viewer/svg/LoopSvg'; import LoopLogs from './components/loop_viewer/logs/LoopLogs'; @@ -99,11 +100,9 @@ const LoopViewBodyDivStyled = styled.div` export default class LoopUI extends React.Component { - static defaultLoopName="Empty (NO loop loaded yet)"; - state = { userName: null, - loopName: LoopUI.defaultLoopName, + loopName: OnapConstants.defaultLoopName, loopCache: new LoopCache({}), showAlert: false }; @@ -242,7 +241,7 @@ export default class LoopUI extends React.Component { } closeLoop() { - this.setState({ loopCache: new LoopCache({}), loopName: LoopUI.defaultLoopName }); + this.setState({ loopCache: new LoopCache({}), loopName: OnapConstants.defaultLoopName }); this.props.history.push('/'); } -- cgit 1.2.3-korg