diff --git a/LCU/Maintenance/MDB_WebView/maintenancedb_view/src/App.js b/LCU/Maintenance/MDB_WebView/maintenancedb_view/src/App.js index 9d19c0c0910340e462ee3fcca1f74377984a9d20..96d66c71a264657270ca9bff7fb6812ca5e83fe6 100644 --- a/LCU/Maintenance/MDB_WebView/maintenancedb_view/src/App.js +++ b/LCU/Maintenance/MDB_WebView/maintenancedb_view/src/App.js @@ -3,7 +3,6 @@ import LandingPage from './pages/LandingPage.js' import StationOverviewPage from './pages/StationOverviewPage.js' import TilesPage from './pages/TilesPage.js' import DetailsPage from './pages/DetailsPage.js' -import Header from './components/header.js' import { connect } from "react-redux"; import { fetchErrorTypes } from "./redux/actions/appInitData.js"; @@ -12,24 +11,19 @@ import { fetchErrorTypes } from "./redux/actions/appInitData.js"; import './App.css'; import { BrowserRouter as Router, - Route, - Link + Route } from 'react-router-dom'; class AppC extends Component { - constructor(props){ - super(props); - } - componentDidMount( ) { + // Load initial application data this.props.dispatch(fetchErrorTypes()); } render(){ - console.log(this.props.location); return ( <Router> <div> diff --git a/LCU/Maintenance/MDB_WebView/maintenancedb_view/src/components/StationTestSummary.js b/LCU/Maintenance/MDB_WebView/maintenancedb_view/src/components/StationTestSummary.js index ccb8efd0962f64e0c70e5f7253a9656636ae58c9..638adb6aefc34e6e4e71c127fc86a4a580580345 100644 --- a/LCU/Maintenance/MDB_WebView/maintenancedb_view/src/components/StationTestSummary.js +++ b/LCU/Maintenance/MDB_WebView/maintenancedb_view/src/components/StationTestSummary.js @@ -1,10 +1,9 @@ import React, { Component } from 'react'; import { connect } from "react-redux"; -import { Table, Popover, PopoverHeader, PopoverBody, Button, ButtonGroup } from 'reactstrap'; -import { unique_id, capitalize } from '../utils/utils.js' +import { Table, Button } from 'reactstrap'; +import { unique_id } from '../utils/utils.js' import { componentErrorTypes } from '../utils/constants.js' import AutoLoadWrapper from '../utils/autoLoader.js' -import axios from 'axios'; //import stdata from '../testdata/station_test_summary.js' @@ -72,8 +71,6 @@ class ToolBar extends Component { */ class StationTestSummaryC extends Component { - static errorTypesURL = '/api/view/ctrl_list_component_error_types'; - activeErrorTypes = []; // Result of filtering state.errorTypes state = { @@ -129,7 +126,7 @@ class StationTestSummaryC extends Component { prevDate = null; this.props.data.forEach( (stationData) => { - let date = (stationData.date != prevDate ? stationData.date : ""); + let date = (stationData.date !== prevDate ? stationData.date : ""); let components = Object.keys(stationData.component_error_summary).sort(); let station = stationData.station_name; let time = (stationData.start_datetime.match(/T(.*):..Z/))[1]; @@ -156,7 +153,6 @@ class StationTestSummaryC extends Component { } render() { - console.log("render stationTestSummary"); this.setActiveErrorTypes(); @@ -188,6 +184,7 @@ class StationTestSummaryC extends Component { } +// Map the appInitData from store for the error types const mapStateToProps = state => { return { ...state.appInitData }; }; diff --git a/LCU/Maintenance/MDB_WebView/maintenancedb_view/src/index.js b/LCU/Maintenance/MDB_WebView/maintenancedb_view/src/index.js index 239f1053f0da50f5c50bd7f20d47928d4dc3db94..560ea3fe281efbaf14c7adbcda9fc71079658c85 100644 --- a/LCU/Maintenance/MDB_WebView/maintenancedb_view/src/index.js +++ b/LCU/Maintenance/MDB_WebView/maintenancedb_view/src/index.js @@ -4,7 +4,6 @@ import './index.css'; import App from './App'; import 'bootstrap/dist/css/bootstrap.min.css'; import registerServiceWorker from './registerServiceWorker'; -import { BrowserRouter } from 'react-router-dom' // Redux import { Provider } from "react-redux"; diff --git a/LCU/Maintenance/MDB_WebView/maintenancedb_view/src/utils/autoLoader.js b/LCU/Maintenance/MDB_WebView/maintenancedb_view/src/utils/autoLoader.js index c6fd9b85eb8dfbf6cd490902bf71c792d51d9cb2..953aff966014dfd194cd03bf0af26b3b426e40ee 100644 --- a/LCU/Maintenance/MDB_WebView/maintenancedb_view/src/utils/autoLoader.js +++ b/LCU/Maintenance/MDB_WebView/maintenancedb_view/src/utils/autoLoader.js @@ -26,7 +26,6 @@ function AutoLoadWrapper(WrappedComponent) { static getDerivedStateFromProps(props, state) { // Store prevUrl in state so we can compare when props change. if (props.url !== state.prevUrl) { - console.log('getDerived; '); return { isLoading: true, prevUrl: props.url @@ -78,14 +77,12 @@ function AutoLoadWrapper(WrappedComponent) { } componentDidMount() { - console.log('did mount'); this.fetchData(); this._intervalId = setInterval(() => this.fetchData(), this.props.reloadInterval); } componentDidUpdate(prevProps, prevState) { if (prevProps.url !== this.props.url) { - console.log('props changed: ' + prevProps.url+ ' '+this.props.url); this.fetchData(); } } @@ -95,7 +92,6 @@ function AutoLoadWrapper(WrappedComponent) { } render() { - console.log('render', this); let loadingHtml = ""; if (this.state.isLoading) { loadingHtml = <div className="alLoading"></div>;