From 6de65e54391e4cc0f9008dfbee584381c7cec320 Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Mon, 2 Mar 2020 12:06:25 -0500 Subject: [PATCH 1/2] Change the tree for mixed use building type --- src/App.js | 10 +++++----- src/constants.js | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/App.js b/src/App.js index 44db54049..b95408a53 100644 --- a/src/App.js +++ b/src/App.js @@ -141,8 +141,8 @@ class App extends React.Component { title: 'Which kind of building do you have?', answer: '', value: '', - answerIds: [20, 21, 22, 23, 32, 33], - answers: { 20: 'singleFamily', 21: 'multiFamily', 22: 'mixedUse', 23: 'coop', 32: 'church', 33: 'other' }, + answerIds: [20, 21, 23, 22, 32, 33], + answers: { 20: 'singleFamily', 21: 'multiFamily', 23: 'coop', 22: 'mixedUse', 32: 'church', 33: 'other' }, prev: 'unitBreakdown', next: '', }, @@ -840,7 +840,7 @@ class App extends React.Component { if (this.state.factors.fuel === 4 || this.state.factors.fuel === 6) { this.setState({ buildingQualified: true}); - if (this.state.factors.buildingTypes === 21) { + if (this.state.factors.buildingTypes === 21 || this.state.factors.buildingTypes === 22) { questions.reviewAnswers.next = 'congrats'; } this.state.pages.congrats = ; } - if (this.state.factors.buildingTypes === 21 && this.state.factors.heatDistribution !== 10) { + if ((this.state.factors.buildingTypes === 21 || this.state.factors.buildingTypes === 22) && this.state.factors.heatDistribution !== 10) { questions.financeInterest.prev = 'comfortIssues'; this.setState({ buildingQualified: true}); } else { @@ -869,7 +869,7 @@ class App extends React.Component { if (found === false) { const questions = this.state.questions; - if (this.state.factors.buildingTypes === 21) { + if (this.state.factors.buildingTypes === 21 || this.state.factors.buildingTypes === 22) { questions.buildingTypes.next = 'utilityBills'; questions.financeInterest.prev = 'comfortIssues'; } else { diff --git a/src/constants.js b/src/constants.js index fac0d9e98..501ccdcea 100644 --- a/src/constants.js +++ b/src/constants.js @@ -5,7 +5,7 @@ const questionTree = [ heatDistribution: [8, 9, 10, 11, 12], heatingSystemAge: [15, 16], heatingSystemPlan: [17, 18], - buildingTypes: [22, 23], + buildingTypes: [23], }, output: { nextQuestion: 'financeInterest', @@ -19,7 +19,7 @@ const questionTree = [ heatDistribution: [8, 9, 10, 11, 12], heatingSystemAge: [15, 16], heatingSystemPlan: [17, 18], - buildingTypes: [21], + buildingTypes: [21, 22], }, output: { nextQuestion: 'utilityBills', @@ -61,7 +61,7 @@ const questionTree = [ heatDistribution: [8, 9, 10, 11, 12], heatingSystemAge: [13, 14, 15, 16, 12], heatingSystemPlan: [17, 18, 19, 12], - buildingTypes: [22, 23], + buildingTypes: [23], }, output: { nextQuestion: 'financeInterest', @@ -75,7 +75,7 @@ const questionTree = [ heatDistribution: [8, 9, 10, 11, 12], heatingSystemAge: [13, 14, 15, 16, 12], heatingSystemPlan: [17, 18, 19, 12], - buildingTypes: [21], + buildingTypes: [21, 22], }, output: { nextQuestion: 'utilityBills', @@ -89,7 +89,7 @@ const questionTree = [ heatDistribution: [10], heatingSystemAge: [13, 14, 15, 16, 12], heatingSystemPlan: [17, 18, 19, 12], - buildingTypes: [23, 22, 32, 33], + buildingTypes: [23, 32, 33], }, output: { nextQuestion: 'financeInterest', -- GitLab From f058b3e4a948e8352a1905603761a4432f35db30 Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Mon, 2 Mar 2020 12:19:39 -0500 Subject: [PATCH 2/2] Remove few compile warnings --- src/AddressSearch.js | 2 +- src/App.js | 6 +----- src/BuildingFutureImprovement.js | 2 -- src/BuildingNeeds.js | 2 +- src/BuildingOperatingChallenges.js | 2 +- src/BuildingTypes.js | 12 ++++++------ src/Congrats.js | 2 +- src/Fuels.js | 13 ++++++------- src/HeatDistribution.js | 12 +++++------- src/HeatingSystemAge.js | 2 +- src/HeatingSystemPlan.js | 2 +- src/ReviewAnswers.js | 12 ++++++------ src/SideBar.js | 9 +-------- src/ThankYou.js | 2 +- src/UnitBreakdown.js | 2 -- 15 files changed, 32 insertions(+), 50 deletions(-) diff --git a/src/AddressSearch.js b/src/AddressSearch.js index 608cc7d35..b28b0c2e6 100644 --- a/src/AddressSearch.js +++ b/src/AddressSearch.js @@ -288,7 +288,7 @@ export default class AddressSearch extends React.Component { - + {addressData} diff --git a/src/App.js b/src/App.js index b95408a53..baaef2117 100644 --- a/src/App.js +++ b/src/App.js @@ -1,5 +1,5 @@ import React from "react"; -import { Row, Col, Button, Input } from 'reactstrap'; +import { Row, Col} from 'reactstrap'; import 'bootstrap/dist/css/bootstrap.css'; import SideBar from './SideBar'; import AddressSearch from './AddressSearch'; @@ -945,10 +945,6 @@ class App extends React.Component { render() { const building = this.props.building; - // TODO: Why did we comment out the section below? - // const questions = this.props.questions; - const contact = this.props.contact; - const complete = this.props.complete; let addressSearchMessage = ""; // TODO: Explain why search success is set to true in render function? diff --git a/src/BuildingFutureImprovement.js b/src/BuildingFutureImprovement.js index 7fdc00e80..d234b7a38 100644 --- a/src/BuildingFutureImprovement.js +++ b/src/BuildingFutureImprovement.js @@ -1,8 +1,6 @@ import React from "react"; import { Row, Col, Button, Input } from 'reactstrap'; import './index.css'; -import { yieldExpression } from "@babel/types"; - export default class BuildingFutureImprovement extends React.Component { constructor(props) { diff --git a/src/BuildingNeeds.js b/src/BuildingNeeds.js index 3a95e1c2b..e8cf220e7 100644 --- a/src/BuildingNeeds.js +++ b/src/BuildingNeeds.js @@ -85,7 +85,7 @@ export default class BuildingNeeds extends React.Component { className="button" onClick={this.nextQuestion} disabled={ - this.state.answerIds == 0 + this.state.answerIds === 0 } > Continue > diff --git a/src/BuildingOperatingChallenges.js b/src/BuildingOperatingChallenges.js index 4ef926a33..b174e6aa7 100644 --- a/src/BuildingOperatingChallenges.js +++ b/src/BuildingOperatingChallenges.js @@ -88,7 +88,7 @@ export default class BuildingOperatingChallenges extends React.Component { className="button" onClick={this.nextQuestion} disabled={ - this.state.answerIds == 0 + this.state.answerIds === 0 } > Continue > diff --git a/src/BuildingTypes.js b/src/BuildingTypes.js index b7fd9dff9..c17a22e08 100644 --- a/src/BuildingTypes.js +++ b/src/BuildingTypes.js @@ -65,12 +65,12 @@ export default class BuildingTypes extends React.Component { render() { const images = [ - , - , - , - , - , - , + , + , + , + , + , + , ]; const content = (
diff --git a/src/Congrats.js b/src/Congrats.js index 9356510dc..7884170fa 100644 --- a/src/Congrats.js +++ b/src/Congrats.js @@ -19,7 +19,7 @@ const Congrats = (props) => { items.map(item => { return (
  • {item}
  • ) }); const content = (
    - +
    Congratulations!
    diff --git a/src/Fuels.js b/src/Fuels.js index 0453b0ef8..6b5715194 100644 --- a/src/Fuels.js +++ b/src/Fuels.js @@ -67,17 +67,17 @@ export default class Fuels extends React.Component { if (this.state.answer === 3 || this.state.answer === 5) { message = (
    -   {' '} +   {' '} That's one of the most expensive ways to heat your home. We can likely help you save money!
    ); } const images = [ - , - , - , - , - , + , + , + , + , + , ]; const content = ( @@ -91,7 +91,6 @@ export default class Fuels extends React.Component { { this.props.answerIds.map((answerId, id) => { - const answerName = this.props.answers[answerId]; return (
    , - , - , - , - , + , + , + , + , + , ]; const content = (
    @@ -80,8 +80,6 @@ export default class HeatDistribution extends React.Component { { this.props.answerIds.map((answerId, id) => { - // TODO: This value is not used it seems - const answerName = this.props.answers[answerId]; return (
    -   {' '} +   {' '} Looks like it's time for a new system!
    ); diff --git a/src/HeatingSystemPlan.js b/src/HeatingSystemPlan.js index aed08c45a..fff1d2278 100644 --- a/src/HeatingSystemPlan.js +++ b/src/HeatingSystemPlan.js @@ -61,7 +61,7 @@ export default class HeatingSystemPlan extends React.Component { if ([0, 1].includes(this.props.answerIds.indexOf(this.state.answer))) { message = (
    -   {' '} +   {' '} We're on it!
    ); diff --git a/src/ReviewAnswers.js b/src/ReviewAnswers.js index bedd7608b..309d83b4f 100644 --- a/src/ReviewAnswers.js +++ b/src/ReviewAnswers.js @@ -90,7 +90,7 @@ export default class ReviewAnswers extends React.Component {
    - this.editAnswer(question) } /> + this.editAnswer(question) } />
    @@ -118,7 +118,7 @@ export default class ReviewAnswers extends React.Component {
    - this.editAnswer(question) } /> + this.editAnswer(question) } />

    @@ -157,7 +157,7 @@ export default class ReviewAnswers extends React.Component {
    - this.editAnswer(question) } /> + this.editAnswer(question) } />
    @@ -179,7 +179,7 @@ export default class ReviewAnswers extends React.Component {
    - this.editAnswer('feedback') } /> + this.editAnswer('feedback') } />
    @@ -203,7 +203,7 @@ export default class ReviewAnswers extends React.Component {
    - this.editAnswer('unitBreakdown') } /> + this.editAnswer('unitBreakdown') } />
    @@ -225,7 +225,7 @@ export default class ReviewAnswers extends React.Component {
    - this.editAnswer('contact') } /> + this.editAnswer('contact') } />
    diff --git a/src/SideBar.js b/src/SideBar.js index 80bad808a..2d558de12 100644 --- a/src/SideBar.js +++ b/src/SideBar.js @@ -2,17 +2,10 @@ import React from "react"; import logo from './utils/images/bp-logo-color.svg'; // with import import './App.css'; - const SideBar = (props) => { - const navTitles = [ - 'Your Building', - 'Heating Your Building', - 'Your Tenants', - ]; - return (
    - +
    ); } diff --git a/src/ThankYou.js b/src/ThankYou.js index af8e78057..6da414970 100644 --- a/src/ThankYou.js +++ b/src/ThankYou.js @@ -39,7 +39,7 @@ const ThankYou = (props) => { const content = (
    - +
    Thank You!
    diff --git a/src/UnitBreakdown.js b/src/UnitBreakdown.js index 75f8e8d5f..0ba7871c6 100644 --- a/src/UnitBreakdown.js +++ b/src/UnitBreakdown.js @@ -1,7 +1,6 @@ import React from "react"; import { Row, Col, Button } from 'reactstrap'; import './index.css'; -import ReactGA from 'react-ga'; export default class UnitBreakDown extends React.Component { constructor(props) { @@ -92,7 +91,6 @@ export default class UnitBreakDown extends React.Component { { this.props.questions.map((questionId, index) => { - const answer = this.props.answers[index]; return (
    -- GitLab