diff --git a/src/components/NavBar/index.js b/src/components/NavBar/index.js index 85c00958fdaf83d9094bd9defcddfcfa271b992c..9688bf9255efed39972a7849a74ff4d2a500f16b 100644 --- a/src/components/NavBar/index.js +++ b/src/components/NavBar/index.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import { Link } from 'react-router'; import ReactGA from 'react-ga'; -import { Collapse, Navbar, NavbarToggler, Nav, NavItem, NavLink } from 'reactstrap'; +import { Collapse, Navbar, NavbarToggler, Nav, NavItem } from 'reactstrap'; import PropTypes from 'prop-types'; import './styles.css'; import blocpowerLogo from './blocpower-logo'; @@ -58,23 +58,25 @@ export default class NavBar extends Component { { this.props.backText ? ( - {this.props.backText} - + ) : null } { this.props.displayAudit && viewAudit ? ( - Audit Data - + ) : null } diff --git a/src/components/ProjectOverview/index.js b/src/components/ProjectOverview/index.js index 74371b72d2b8bd6c0ca34fe435f2076095fa9332..7fb91d6186a86783c85d34851d6e42df3f345be1 100644 --- a/src/components/ProjectOverview/index.js +++ b/src/components/ProjectOverview/index.js @@ -190,10 +190,10 @@ class ProjectOverview extends Component { accessToken={this.props.documents.boxAccessToken} accessTokenLoading={this.props.documents.boxAccessTokenLoading} accessTokenError={this.props.documents.boxAccessTokenError} - folderId={this.props.documents.buildingFolder ? this.props.documents.buildingFolder.box_id.toString() : ''} - folderLoading={this.props.documents.buildingFolderLoading} - folderError={this.props.documents.buildingFolderError} - folderExists={this.props.documents.buildingFolderExists} + folderId={this.props.documents.projectFolder ? this.props.documents.projectFolder.box_id.toString() : ''} + folderLoading={this.props.documents.projectFolderLoading} + folderError={this.props.documents.projectFolderError} + folderExists={this.props.documents.projectFolderExists} /> ) : ( diff --git a/src/components/SensorInstall/Gateway.js b/src/components/SensorInstall/Gateway.js index 50a6140c5fa86ad5d779735dfba4c80f8b9438e4..d4715b06ad927e7d49f5750afb3106de471ba6b0 100644 --- a/src/components/SensorInstall/Gateway.js +++ b/src/components/SensorInstall/Gateway.js @@ -607,6 +607,7 @@ class Gateway extends Component { } const sensewareNodes = this.state.sensewareNodes.map(val => ( )); let backgroundColor = ''; @@ -824,6 +832,7 @@ class Gateway extends Component { } Gateway.propTypes = { + offline: PropTypes.bool, form: PropTypes.shape({ date_of_install: PropTypes.string, sensor_type: PropTypes.number, @@ -856,6 +865,13 @@ Gateway.propTypes = { pathname: PropTypes.string, }), user: userPropType, + createApartment: PropTypes.func, + createCommonArea: PropTypes.func, + createServiceArea: PropTypes.func, + createSpace: PropTypes.func, + updateApartment: PropTypes.func, + updateSpace: PropTypes.func, + buildingArea: PropTypes.object, // eslint-disable-line }; Gateway.defaultProps = { diff --git a/src/components/SensorInstall/SensorInstall.js b/src/components/SensorInstall/GatewayList.js similarity index 95% rename from src/components/SensorInstall/SensorInstall.js rename to src/components/SensorInstall/GatewayList.js index c4fe6766b0e1e9a6a7ea6478ed59097cc7b43b56..496108c9ac3c70a9dd7c3c1badd9237621701eef 100644 --- a/src/components/SensorInstall/SensorInstall.js +++ b/src/components/SensorInstall/GatewayList.js @@ -14,7 +14,7 @@ import Loading from '../../components/Loading'; import userPropType from '../../containers/User/propTypes'; /* eslint-disable react/sort-comp */ -class SensorInstall extends Component { +class GatewayList extends Component { mounted = false; constructor(props) { super(props); @@ -551,6 +551,7 @@ class SensorInstall extends Component { {this.state.gatewayLines.map(val => ( ))} @@ -594,7 +602,7 @@ class SensorInstall extends Component { } } -SensorInstall.propTypes = { +GatewayList.propTypes = { building: completeOverviewPropTypes, buildingId: PropTypes.string, uploadDocument: PropTypes.func, @@ -603,6 +611,13 @@ SensorInstall.propTypes = { pathname: PropTypes.string, }), user: userPropType, + createApartment: PropTypes.func, + createCommonArea: PropTypes.func, + createServiceArea: PropTypes.func, + createSpace: PropTypes.func, + updateApartment: PropTypes.func, + updateSpace: PropTypes.func, + buildingArea: PropTypes.object, // eslint-disable-line }; -export default SensorInstall; +export default GatewayList; diff --git a/src/components/SensorInstall/Nodes/SensewareNode.js b/src/components/SensorInstall/Nodes/SensewareNode.js index 5cf3f5edcd886b4a5734ee7e20e88ddf36377327..8645c9f73c8a293be64febf09f28e4f4f4f68987 100644 --- a/src/components/SensorInstall/Nodes/SensewareNode.js +++ b/src/components/SensorInstall/Nodes/SensewareNode.js @@ -8,6 +8,7 @@ import SensorImageUpload from '../SensorImageUpload'; import { ENTITY_TYPES } from '../constants'; import documentsPropType from '../../../containers/Documents/propTypes'; import Node from './Node'; +import SpacePicker from '../../../components/SpacePicker/SpacePicker'; import userPropType from '../../../containers/User/propTypes'; class SensewareNode extends Node { @@ -48,6 +49,7 @@ class SensewareNode extends Node { ...this.state, form: { node_id: this.props.form.node_id, + space_id: this.props.form.space_id, repeater: this.props.form.repeater ? 'true' : 'false', temperature_probe_1: this.props.form.temperature_probe_1, temperature_probe_2: this.props.form.temperature_probe_2, @@ -79,6 +81,13 @@ class SensewareNode extends Node { } } + updateSpaceId = (spaceId) => { + this.saveInputChange( + { ...this.state.form, space_id: spaceId }, + this.state.display_name, + ); + } + generateDisplayName = (repeater, boiler) => { let displayName = 'temperature--node'; if (repeater === 'true') { @@ -180,7 +189,7 @@ class SensewareNode extends Node { } else if (value === 'boiler') { // Handle boiler node this.setState({ nodeType: 'boiler' }); - const displayName = this.generateDisplayName('true', true); + const displayName = this.generateDisplayName('false', true); this.saveInputChange( { ...this.state.form, @@ -221,7 +230,6 @@ class SensewareNode extends Node { value={this.state.form[`temperature_probe_${val}`] ? this.state.form[`temperature_probe_${val}`] : ''} onChange={this.handleInputChange} > -