From 6dc192c8b5920acd12f61948222175bdaa708687 Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Wed, 28 Aug 2019 16:40:49 -0400 Subject: [PATCH 1/7] Dropdowns for open data questions --- src/components/Questionnaire/BuildingInfo.js | 48 +++++++++++++++++++ .../Questionnaire/FinancialInitial.js | 42 +++++++++++++++- src/components/Questionnaire/RemoteSurvey.js | 24 ++++++++-- .../ReviewAnswers/BuildingInfo.js | 31 +++++++++++- .../ReviewAnswers/FinancialInitial.js | 29 ++++++++++- .../ReviewAnswers/RemoteSurvey.js | 15 +++++- src/containers/Questionnaire/index.js | 18 +++++++ 7 files changed, 198 insertions(+), 9 deletions(-) diff --git a/src/components/Questionnaire/BuildingInfo.js b/src/components/Questionnaire/BuildingInfo.js index 2dbd4187..89b2da9b 100644 --- a/src/components/Questionnaire/BuildingInfo.js +++ b/src/components/Questionnaire/BuildingInfo.js @@ -13,6 +13,9 @@ class BuildingInfo extends Component { email: props.email, phone: props.phone, address: props.address, + numberOfApartments: props.numberOfApartments, + buildingSqFt: props.buildingSqFt, + numberOfFloors: props.numberOfFloors, unitInfo: { studio: props.numOfStudio, oneBedroom: props.numOfOneBedroom, @@ -153,6 +156,48 @@ class BuildingInfo extends Component { {address} + + + Number of Apartments + + + this.handleInputChange(e)} + /> + + + + + Number of Floors + + + this.handleInputChange(e)} + /> + + + + + Building Square Feet + + + this.handleInputChange(e)} + /> + + Apartment Types Breakdown @@ -272,6 +317,9 @@ BuildingInfo.propTypes = { lastName: PropTypes.string, email: PropTypes.string, phone: PropTypes.string, + numberOfApartments: PropTypes.number, + buildingSqFt: PropTypes.number, + numberOfFloors: PropTypes.number, numOfStudio: PropTypes.number, numOfOneBedroom: PropTypes.number, numOfTwoBedroom: PropTypes.number, diff --git a/src/components/Questionnaire/FinancialInitial.js b/src/components/Questionnaire/FinancialInitial.js index ac588bb4..b37df0d4 100644 --- a/src/components/Questionnaire/FinancialInitial.js +++ b/src/components/Questionnaire/FinancialInitial.js @@ -2,17 +2,18 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Table, Input } from 'reactstrap'; - class FinanacialInitial extends Component { constructor(props) { super(props); this.state = { form: { + legalOwnership: props.legalOwnership, bankruptcyPast: props.bankruptcyPast, currentOnEnergyBills: props.currentOnEnergyBills, currentMortgageBalance: props.currentMortgageBalance, profitable: props.profitable, budgetForDownPayment: props.budgetForDownPayment, + numberOfDobViolations: props.numberOfDobViolations, }, }; } @@ -50,6 +51,43 @@ class FinanacialInitial extends Component {
+ + + + + + - + {/* */} + + + + + + + + + + + + + + + + + +
+ {this.props.legalOwnership.question} + + this.handleInputChange(e)} + > + + + + + + + + {this.props.numberOfDobViolations.question} + + this.handleInputChange(e)} + > + + + + + + + +
{this.props.bankruptcyPast.question} @@ -163,6 +201,8 @@ FinanacialInitial.propTypes = { currentMortgageBalance: PropTypes.string, profitable: PropTypes.string, budgetForDownPayment: PropTypes.string, + legalOwnership: PropTypes.string, + numberOfDobViolations: PropTypes.string, onChangeEvent: PropTypes.func, // answers: PropTypes.objectOf, }; diff --git a/src/components/Questionnaire/RemoteSurvey.js b/src/components/Questionnaire/RemoteSurvey.js index 8cf65b7b..e5bce2c9 100644 --- a/src/components/Questionnaire/RemoteSurvey.js +++ b/src/components/Questionnaire/RemoteSurvey.js @@ -2,7 +2,6 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Table, Input } from 'reactstrap'; - class RemoteSurvey extends Component { constructor(props) { super(props); @@ -23,6 +22,7 @@ class RemoteSurvey extends Component { tenantComplaintsComfort: props.tenantComplaintsComfort, tenantComplaintsWindows: props.tenantComplaintsWindows, meteredForElectricity: props.meteredForElectricity, + numberOfHeatingViolations: props.numberOfHeatingViolations, }, }; } @@ -151,12 +151,26 @@ class RemoteSurvey extends Component { - {' '} + + {this.props.numberOfHeatingViolations.question} - {' '} + this.handleInputChange(e)} + > + + + + + + + {' '} +
@@ -387,8 +401,8 @@ RemoteSurvey.propTypes = { tenantComplaintsComfort: PropTypes.string, meteredForElectricity: PropTypes.string, ageOfHeatGenerateSystem: PropTypes.string, + numberOfHeatingViolations: PropTypes.string, onChangeEvent: PropTypes.func, - // answers: PropTypes.objectOf, }; export default RemoteSurvey; diff --git a/src/components/Questionnaire/ReviewAnswers/BuildingInfo.js b/src/components/Questionnaire/ReviewAnswers/BuildingInfo.js index 84e9e5bb..bd1e4a8e 100644 --- a/src/components/Questionnaire/ReviewAnswers/BuildingInfo.js +++ b/src/components/Questionnaire/ReviewAnswers/BuildingInfo.js @@ -2,7 +2,6 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Table } from 'reactstrap'; - const BuildingInfo = (props) => { const cellStyle = { fontSize: '0.8em', @@ -75,6 +74,36 @@ const BuildingInfo = (props) => {
+
+ Number of Apartments +
+
+ {props.data.numberOfApartments} +
+
+
+ Number of Floors +
+
+ {props.data.numberOfFloors} +
+
+
+ Building Square Feet +
+
+ {props.data.buildingSqFt} +
+
diff --git a/src/components/Questionnaire/ReviewAnswers/FinancialInitial.js b/src/components/Questionnaire/ReviewAnswers/FinancialInitial.js index e8e9d3d3..ac5848b1 100644 --- a/src/components/Questionnaire/ReviewAnswers/FinancialInitial.js +++ b/src/components/Questionnaire/ReviewAnswers/FinancialInitial.js @@ -2,7 +2,6 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Table } from 'reactstrap'; - const FinancialInitial = (props) => { const cellStyle = { fontSize: '0.8em', @@ -18,6 +17,34 @@ const FinancialInitial = (props) => { {props.title}
+
+ Legal Ownership +
+
+ { + props.upperFirstLetter( + props.answers[props.data.legalOwnership.answer_id] + ) + } +
+
+
+ Number of DOB violations? +
+
+ { + props.upperFirstLetter( + props.answers[props.data.numberOfDobViolations.answer_id] + ) + } +
+
diff --git a/src/components/Questionnaire/ReviewAnswers/RemoteSurvey.js b/src/components/Questionnaire/ReviewAnswers/RemoteSurvey.js index 04afeb1d..e767b476 100644 --- a/src/components/Questionnaire/ReviewAnswers/RemoteSurvey.js +++ b/src/components/Questionnaire/ReviewAnswers/RemoteSurvey.js @@ -2,7 +2,6 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Table } from 'reactstrap'; - const RemoteSurvey = (props) => { const cellStyle = { fontSize: '0.8em', @@ -221,6 +220,20 @@ const RemoteSurvey = (props) => {
+
+ Number of Heating Violations in last 5 years? +
+
+ { + props.upperFirstLetter( + props.answers[props.data.numberOfHeatingViolations.answer_id] + ) + } +
+
); diff --git a/src/containers/Questionnaire/index.js b/src/containers/Questionnaire/index.js index 6b2d4d11..018c657d 100644 --- a/src/containers/Questionnaire/index.js +++ b/src/containers/Questionnaire/index.js @@ -27,6 +27,9 @@ class Questionnaire extends Component { lastName: 'Last name', email: 'Email', phone: 'Phone number', + numberOfApartments: 'Number of Apartments', + buildingSqFt: 'Building Square Feet', + numberOfFloors: 'Number of Floors', heatingSystem: 'Heating System', heatingFuelSource: 'Heating Fuel Source', DHWSameBoiler: 'Domestic Hot Water', @@ -47,6 +50,9 @@ class Questionnaire extends Component { currentMortgageBalance: 'Outstanding mortgage balance', profitable: 'Building profit', budgetForDownPayment: 'Down payment budget', + legalOwnership: 'Legal ownership', + numberOfHeatingViolations: 'Number of heating violations', + numberOfDobViolations: 'Number of DOB violations', }; this.state = { buildingInfo: {}, @@ -198,6 +204,8 @@ class Questionnaire extends Component { }; let forms = ''; + console.log(submittedAnswers.data); // eslint-disable-line + console.log(submittedAnswers.data.remoteSurvey.numberOfHeatingViolations); // eslint-disable-line if (submitted === false && calculated === false) { forms = (
@@ -211,6 +219,9 @@ class Questionnaire extends Component { lastName={buildingInfo.data.lastName} email={buildingInfo.data.email} phone={buildingInfo.data.phone} + numberOfApartments={buildingInfo.data.numberOfApartments} + buildingSqFt={buildingInfo.data.buildingSqFt} + numberOfFloors={buildingInfo.data.numberOfFloors} numOfStudio={buildingInfo.data.unitInfo.studio} numOfOneBedroom={buildingInfo.data.unitInfo.oneBedroom} numOfTwoBedroom={buildingInfo.data.unitInfo.twoBedroom} @@ -250,6 +261,9 @@ class Questionnaire extends Component { meteredForElectricity={ submittedAnswers.data.remoteSurvey.meteredForElectricity } + numberOfHeatingViolations={ + submittedAnswers.data.remoteSurvey.numberOfHeatingViolations + } onChangeEvent={this.onChangeEvent} />
@@ -259,6 +273,7 @@ class Questionnaire extends Component { -- GitLab From 9ef80400ed1a36dc3fa0d1bf443a40d6a8b5ee75 Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Thu, 29 Aug 2019 10:46:36 -0400 Subject: [PATCH 2/7] Numbers only for integer data --- src/components/Questionnaire/BuildingInfo.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/Questionnaire/BuildingInfo.js b/src/components/Questionnaire/BuildingInfo.js index 89b2da9b..e4be656a 100644 --- a/src/components/Questionnaire/BuildingInfo.js +++ b/src/components/Questionnaire/BuildingInfo.js @@ -140,6 +140,7 @@ class BuildingInfo extends Component { Date: Thu, 29 Aug 2019 12:10:21 -0400 Subject: [PATCH 3/7] Eliminate # of apartments from the questionnaire --- src/components/Questionnaire/BuildingInfo.js | 18 +----------------- .../ReviewAnswers/BuildingInfo.js | 10 ---------- src/containers/Questionnaire/index.js | 2 -- 3 files changed, 1 insertion(+), 29 deletions(-) diff --git a/src/components/Questionnaire/BuildingInfo.js b/src/components/Questionnaire/BuildingInfo.js index e4be656a..7a99ab17 100644 --- a/src/components/Questionnaire/BuildingInfo.js +++ b/src/components/Questionnaire/BuildingInfo.js @@ -13,7 +13,6 @@ class BuildingInfo extends Component { email: props.email, phone: props.phone, address: props.address, - numberOfApartments: props.numberOfApartments, buildingSqFt: props.buildingSqFt, numberOfFloors: props.numberOfFloors, unitInfo: { @@ -157,21 +156,6 @@ class BuildingInfo extends Component { {address} - - - Number of Apartments - - - this.handleInputChange(e)} - /> - - Number of Floors @@ -321,7 +305,7 @@ BuildingInfo.propTypes = { lastName: PropTypes.string, email: PropTypes.string, phone: PropTypes.string, - numberOfApartments: PropTypes.number, + // numberOfApartments: PropTypes.number, buildingSqFt: PropTypes.number, numberOfFloors: PropTypes.number, numOfStudio: PropTypes.number, diff --git a/src/components/Questionnaire/ReviewAnswers/BuildingInfo.js b/src/components/Questionnaire/ReviewAnswers/BuildingInfo.js index bd1e4a8e..c9a8e1a3 100644 --- a/src/components/Questionnaire/ReviewAnswers/BuildingInfo.js +++ b/src/components/Questionnaire/ReviewAnswers/BuildingInfo.js @@ -74,16 +74,6 @@ const BuildingInfo = (props) => { - - -
- Number of Apartments -
-
- {props.data.numberOfApartments} -
- -
diff --git a/src/containers/Questionnaire/index.js b/src/containers/Questionnaire/index.js index 018c657d..679f69d2 100644 --- a/src/containers/Questionnaire/index.js +++ b/src/containers/Questionnaire/index.js @@ -27,7 +27,6 @@ class Questionnaire extends Component { lastName: 'Last name', email: 'Email', phone: 'Phone number', - numberOfApartments: 'Number of Apartments', buildingSqFt: 'Building Square Feet', numberOfFloors: 'Number of Floors', heatingSystem: 'Heating System', @@ -219,7 +218,6 @@ class Questionnaire extends Component { lastName={buildingInfo.data.lastName} email={buildingInfo.data.email} phone={buildingInfo.data.phone} - numberOfApartments={buildingInfo.data.numberOfApartments} buildingSqFt={buildingInfo.data.buildingSqFt} numberOfFloors={buildingInfo.data.numberOfFloors} numOfStudio={buildingInfo.data.unitInfo.studio} -- GitLab From 3d77c661a43656e00b12fcc566f70fd9324b2337 Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Thu, 29 Aug 2019 12:19:28 -0400 Subject: [PATCH 4/7] Updated dropdowns for Legal Ownership --- src/components/Questionnaire/FinancialInitial.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Questionnaire/FinancialInitial.js b/src/components/Questionnaire/FinancialInitial.js index b37df0d4..9c1df7df 100644 --- a/src/components/Questionnaire/FinancialInitial.js +++ b/src/components/Questionnaire/FinancialInitial.js @@ -63,9 +63,9 @@ class FinanacialInitial extends Component { onChange={e => this.handleInputChange(e)} > - - - + + + -- GitLab From 072f4d77c15f9dc720e70130c3d03ca0d0597205 Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Fri, 30 Aug 2019 10:01:21 -0400 Subject: [PATCH 5/7] Added not sure for que 13. --- src/components/Questionnaire/RemoteSurvey.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Questionnaire/RemoteSurvey.js b/src/components/Questionnaire/RemoteSurvey.js index e5bce2c9..506212b2 100644 --- a/src/components/Questionnaire/RemoteSurvey.js +++ b/src/components/Questionnaire/RemoteSurvey.js @@ -335,6 +335,7 @@ class RemoteSurvey extends Component { + -- GitLab From bd0503187c0bb850123ae0cbd2f7232606f91299 Mon Sep 17 00:00:00 2001 From: Aizizi Yigaimu Date: Fri, 30 Aug 2019 12:16:42 -0400 Subject: [PATCH 6/7] Add Card format --- src/components/Questionnaire/BuildingInfo.js | 414 +++++------ .../Questionnaire/FinancialInitial.js | 305 ++++---- src/components/Questionnaire/RemoteSurvey.js | 663 +++++++++--------- .../ReviewAnswers/BuildingInfo.js | 263 +++---- .../ReviewAnswers/FinancialInitial.js | 217 +++--- .../ReviewAnswers/RemoteSurvey.js | 460 ++++++------ src/containers/Questionnaire/index.js | 22 +- 7 files changed, 1192 insertions(+), 1152 deletions(-) diff --git a/src/components/Questionnaire/BuildingInfo.js b/src/components/Questionnaire/BuildingInfo.js index 7a99ab17..85edcaa0 100644 --- a/src/components/Questionnaire/BuildingInfo.js +++ b/src/components/Questionnaire/BuildingInfo.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { Table, Input } from 'reactstrap'; +import { Table, Input, Card, CardHeader } from 'reactstrap'; import BuildingUnitDropdown from './BuildingUnitDropdown'; class BuildingInfo extends Component { @@ -88,210 +88,217 @@ class BuildingInfo extends Component { }); return (
- - - - - - + +
- Building Intake -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + +
- Full Name - - this.handleInputChange(e)} - /> - - this.handleInputChange(e)} - /> -
- Email - - this.handleInputChange(e)} - /> -
- Phone No. - - this.handleInputChange(e)} - /> -
- Address - - {address} -
- Number of Floors - - this.handleInputChange(e)} - /> -
- Building Square Feet - - this.handleInputChange(e)} - /> -
- Apartment Types Breakdown - -
- Number of Studio -
- -
-
- Number of One Bedroom Apartment -
- -
- {' '} - -
- Number of Two Bedroom Apartment -
- -
-
- Number of Three Bedroom Apartment -
- -
- {' '} - -
- Number of Four Bedroom Apartment -
- -
-
- Other -
-
-
- this.handleOtherInputChange(e)} - /> + + +
+
+ Building Intake +
+
+
+ + + - -
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - -
+ Full Name + + this.handleInputChange(e)} + /> + + this.handleInputChange(e)} + /> +
+ Email + + this.handleInputChange(e)} + /> +
+ Phone No. + + this.handleInputChange(e)} + /> +
+ Address + + {address} +
+ Number of Floors + + this.handleInputChange(e)} + /> +
+ Building Square Feet + + this.handleInputChange(e)} + /> +
+ Apartment Types Breakdown + +
+ Number of Studio
-
- this.handleOtherInputChange(e)} - > - - - - - - - - + +
+
+ Number of One Bedroom Apartment
- -
-
-
+ +
+ {' '} + +
+ Number of Two Bedroom Apartment +
+ +
+
+ Number of Three Bedroom Apartment +
+ +
+ {' '} + +
+ Number of Four Bedroom Apartment +
+ +
+
+ Other +
+
+
+ this.handleOtherInputChange(e)} + /> +
+
+ this.handleOtherInputChange(e)} + > + + + + + + + + +
+
+
+
+
+
); } @@ -305,7 +312,6 @@ BuildingInfo.propTypes = { lastName: PropTypes.string, email: PropTypes.string, phone: PropTypes.string, - // numberOfApartments: PropTypes.number, buildingSqFt: PropTypes.number, numberOfFloors: PropTypes.number, numOfStudio: PropTypes.number, diff --git a/src/components/Questionnaire/FinancialInitial.js b/src/components/Questionnaire/FinancialInitial.js index 9c1df7df..fd4d911a 100644 --- a/src/components/Questionnaire/FinancialInitial.js +++ b/src/components/Questionnaire/FinancialInitial.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { Table, Input } from 'reactstrap'; +import { Table, Input, Card, CardHeader } from 'reactstrap'; class FinanacialInitial extends Component { constructor(props) { @@ -39,156 +39,161 @@ class FinanacialInitial extends Component { render() { return (
- - - - - - - -
- Financial Initial Go/NoGo -
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
- {this.props.legalOwnership.question} - - this.handleInputChange(e)} - > - - - - - - - - {this.props.numberOfDobViolations.question} - - this.handleInputChange(e)} - > - - - - - - - -
- {this.props.bankruptcyPast.question} - - this.handleInputChange(e)} - > - - - - - - - {this.props.currentOnEnergyBills.question} - - this.handleInputChange(e)} - > - - - - - - - - -
- {this.props.currentMortgageBalance.question} - - this.handleInputChange(e)} - > - - - - - - - - - {this.props.profitable.question} - - this.handleInputChange(e)} - > - - - - - -
- {this.props.budgetForDownPayment.question} - - this.handleInputChange(e)} - > - - - - - - {' '} - - {' '} -
+ + +
+
+ Financial Initial Go/NoGo
-
+
+ + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ {this.props.legalOwnership.question} + + this.handleInputChange(e)} + > + + + + + + + + {this.props.numberOfDobViolations.question} + + this.handleInputChange(e)} + > + + + + + + + +
+ {this.props.bankruptcyPast.question} + + this.handleInputChange(e)} + > + + + + + + + {this.props.currentOnEnergyBills.question} + + this.handleInputChange(e)} + > + + + + + + + + +
+ {this.props.currentMortgageBalance.question} + + this.handleInputChange(e)} + > + + + + + + + + + {this.props.profitable.question} + + this.handleInputChange(e)} + > + + + + + +
+ {this.props.budgetForDownPayment.question} + + this.handleInputChange(e)} + > + + + + + + {' '} + + {' '} +
+
+
+
); } diff --git a/src/components/Questionnaire/RemoteSurvey.js b/src/components/Questionnaire/RemoteSurvey.js index 506212b2..5bfc8d4d 100644 --- a/src/components/Questionnaire/RemoteSurvey.js +++ b/src/components/Questionnaire/RemoteSurvey.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { Table, Input } from 'reactstrap'; +import { Table, Input, Card, CardHeader } from 'reactstrap'; class RemoteSurvey extends Component { constructor(props) { @@ -48,337 +48,344 @@ class RemoteSurvey extends Component { render() { return (
- - - - - - + +
- Remote Survey -
-
- - - - - - - - - - - - - - - - - - - {/* */} - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + +
- {this.props.heatingSystem.question} - - this.handleInputChange(e)} - > - - - - - - - - - {this.props.heatingFuelSource.question} - - this.handleInputChange(e)} - > - - - - - - - -
- {this.props.DHWSameBoiler.question} - - this.handleInputChange(e)} - > - - - - - - - {this.props.ageOfHeatGenerateSystem.question} - - this.handleInputChange(e)} - > - - - - - - - -
- {this.props.planToReplaceHS.question} - - this.handleInputChange(e)} - > - - - - - - - - - {this.props.numberOfHeatingViolations.question} - - this.handleInputChange(e)} - > - - - - - - - - {' '} -
- Are the following building areas heated? - -
- Hallways -
-
-
- this.handleInputChange(e)} - > - - - - - + + +
+
+ Remote Survey +
+
+
+ + + - -
+
+ + + + + + + + + + + + + + + + + + + {/* */} + + + + - - - - - - + - - - - - - - - - - - - - - - - - - - - - -
+ {this.props.heatingSystem.question} + + this.handleInputChange(e)} + > + + + + + + + + + {this.props.heatingFuelSource.question} + + this.handleInputChange(e)} + > + + + + + + + +
+ {this.props.DHWSameBoiler.question} + + this.handleInputChange(e)} + > + + + + + + + {this.props.ageOfHeatGenerateSystem.question} + + this.handleInputChange(e)} + > + + + + + + + +
+ {this.props.planToReplaceHS.question} + + this.handleInputChange(e)} + > + + + + + + + + + {this.props.numberOfHeatingViolations.question} + + this.handleInputChange(e)} + > + + + + + + + + {' '} +
+ Are the following building areas heated? + +
+ Hallways
- -
-
- Basement -
-
-
- this.handleInputChange(e)} - > - - - - - +
+
+ this.handleInputChange(e)} + > + + + + + +
-
-
- {' '} -
- {' '} - -
- Stairwells -
-
-
- this.handleInputChange(e)} - > - - - - - +
+
+ Basement
- -
-
- Floors -
-
-
- this.handleInputChange(e)} - > - - - - - +
+
+ this.handleInputChange(e)} + > + + + + + +
-
-
- {' '} -
- {this.props.accessibleByStairwell.question} - - this.handleInputChange(e)} - > - - - - - - - {this.props.backFacadeAttached.question} - - this.handleInputChange(e)} - > - - - - - - -
- {this.props.exteriorWallsAttached.question} - - this.handleInputChange(e)} - > - - - - - - - - {this.props.tenantComplaintsComfort.question} - - this.handleInputChange(e)} - > - - - - - - -
- {this.props.tenantComplaintsWindows.question} - - this.handleInputChange(e)} - > - - - - - - - - {this.props.meteredForElectricity.question} - - this.handleInputChange(e)} - > - - - - - -
-
-
+
+ {' '} +
+ {' '} + +
+ Stairwells +
+
+
+ this.handleInputChange(e)} + > + + + + + +
+
+
+
+ Floors +
+
+
+ this.handleInputChange(e)} + > + + + + + +
+
+
+ {' '} +
+ {this.props.accessibleByStairwell.question} + + this.handleInputChange(e)} + > + + + + + + + {this.props.backFacadeAttached.question} + + this.handleInputChange(e)} + > + + + + + + +
+ {this.props.exteriorWallsAttached.question} + + this.handleInputChange(e)} + > + + + + + + + + {this.props.tenantComplaintsComfort.question} + + this.handleInputChange(e)} + > + + + + + + +
+ {this.props.tenantComplaintsWindows.question} + + this.handleInputChange(e)} + > + + + + + + + + {this.props.meteredForElectricity.question} + + this.handleInputChange(e)} + > + + + + + +
+
+
+
); } diff --git a/src/components/Questionnaire/ReviewAnswers/BuildingInfo.js b/src/components/Questionnaire/ReviewAnswers/BuildingInfo.js index c9a8e1a3..1116565e 100644 --- a/src/components/Questionnaire/ReviewAnswers/BuildingInfo.js +++ b/src/components/Questionnaire/ReviewAnswers/BuildingInfo.js @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Table } from 'reactstrap'; +import { Table, Card, CardHeader } from 'reactstrap'; const BuildingInfo = (props) => { const cellStyle = { @@ -22,133 +22,140 @@ const BuildingInfo = (props) => { return (
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- {props.title} -
-
- First Name -
-
- {props.upperFirstLetter(props.data.firstName)} -
-
-
- Last Name -
-
- {props.upperFirstLetter(props.data.lastName)} -
-
-
- Email -
-
- {props.data.email} -
-
-
- Phone -
-
- {props.data.phone} -
-
-
- Address -
-
- {address} -
-
-
- Number of Floors -
-
- {props.data.numberOfFloors} -
-
-
- Building Square Feet -
-
- {props.data.buildingSqFt} -
-
-
- Number of Studio -
-
- {props.data.unitInfo.studio} -
-
-
- Number of One Bedroom Apartment -
-
- {props.data.unitInfo.oneBedroom} -
-
-
- Number of Two Bedroom Apartment -
-
- {props.data.unitInfo.twoBedroom} -
-
-
- Number of Three Bedroom Apartment -
-
- {props.data.unitInfo.threeBedroom} -
-
-
- Number of Four Bedroom Apartment -
-
- {props.data.unitInfo.fourBedroom} -
-
-
- Other Apartment -
-
- {props.data.unitInfo.other} {props.data.unitInfo.numOfOther} -
-
+ + +
+
+ {props.title} +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ First Name +
+
+ {props.upperFirstLetter(props.data.firstName)} +
+
+
+ Last Name +
+
+ {props.upperFirstLetter(props.data.lastName)} +
+
+
+ Email +
+
+ {props.data.email} +
+
+
+ Phone +
+
+ {props.data.phone} +
+
+
+ Address +
+
+ {address} +
+
+
+ Number of Floors +
+
+ {props.data.numberOfFloors} +
+
+
+ Building Square Feet +
+
+ {props.data.buildingSqFt} +
+
+
+ Number of Studio +
+
+ {props.data.unitInfo.studio} +
+
+
+ Number of One Bedroom Apartment +
+
+ {props.data.unitInfo.oneBedroom} +
+
+
+ Number of Two Bedroom Apartment +
+
+ {props.data.unitInfo.twoBedroom} +
+
+
+ Number of Three Bedroom Apartment +
+
+ {props.data.unitInfo.threeBedroom} +
+
+
+ Number of Four Bedroom Apartment +
+
+ {props.data.unitInfo.fourBedroom} +
+
+
+ Other Apartment +
+
+ {props.data.unitInfo.other} {props.data.unitInfo.numOfOther} +
+
+
); }; diff --git a/src/components/Questionnaire/ReviewAnswers/FinancialInitial.js b/src/components/Questionnaire/ReviewAnswers/FinancialInitial.js index ac5848b1..672c6a80 100644 --- a/src/components/Questionnaire/ReviewAnswers/FinancialInitial.js +++ b/src/components/Questionnaire/ReviewAnswers/FinancialInitial.js @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Table } from 'reactstrap'; +import { Table, Card, CardHeader } from 'reactstrap'; const FinancialInitial = (props) => { const cellStyle = { @@ -11,111 +11,118 @@ const FinancialInitial = (props) => { return (
- - - - - - - - - - - - - - - - - - - - - - - - - -
- {props.title} -
-
- Legal Ownership + + +
+
+ {props.title}
-
- { - props.upperFirstLetter( - props.answers[props.data.legalOwnership.answer_id] - ) - } -
-
-
- Number of DOB violations? -
-
- { - props.upperFirstLetter( - props.answers[props.data.numberOfDobViolations.answer_id] - ) - } -
-
-
- Any bankruptcy in the past three years? -
-
- { - props.upperFirstLetter( - props.answers[props.data.bankruptcyPast.answer_id] - ) - } -
-
-
- Current on energy bills? -
-
- { - props.upperFirstLetter( - props.answers[props.data.currentOnEnergyBills.answer_id] - ) - } -
-
-
- What is the current outstanding balance of the mortgage? -
-
- { - props.upperFirstLetter( - props.answers[props.data.currentMortgageBalance.answer_id] - ) - } -
-
-
- Is your building currently profitable? -
-
- { - props.upperFirstLetter( - props.answers[props.data.profitable.answer_id] - ) - } -
-
-
- What is your current budget for a down payment? -
-
- { - props.upperFirstLetter( - props.answers[props.data.budgetForDownPayment.answer_id] - ) - } -
-
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ Legal Ownership +
+
+ { + props.upperFirstLetter( + props.answers[props.data.legalOwnership.answer_id] + ) + } +
+
+
+ Number of DOB violations? +
+
+ { + props.upperFirstLetter( + props.answers[props.data.numberOfDobViolations.answer_id] + ) + } +
+
+
+ Any bankruptcy in the past three years? +
+
+ { + props.upperFirstLetter( + props.answers[props.data.bankruptcyPast.answer_id] + ) + } +
+
+
+ Current on energy bills? +
+
+ { + props.upperFirstLetter( + props.answers[props.data.currentOnEnergyBills.answer_id] + ) + } +
+
+
+ What is the current outstanding balance of the mortgage? +
+
+ { + props.upperFirstLetter( + props.answers[props.data.currentMortgageBalance.answer_id] + ) + } +
+
+
+ Is your building currently profitable? +
+
+ { + props.upperFirstLetter( + props.answers[props.data.profitable.answer_id] + ) + } +
+
+
+ What is your current budget for a down payment? +
+
+ { + props.upperFirstLetter( + props.answers[props.data.budgetForDownPayment.answer_id] + ) + } +
+
+ ); }; diff --git a/src/components/Questionnaire/ReviewAnswers/RemoteSurvey.js b/src/components/Questionnaire/ReviewAnswers/RemoteSurvey.js index e767b476..df4aec6d 100644 --- a/src/components/Questionnaire/ReviewAnswers/RemoteSurvey.js +++ b/src/components/Questionnaire/ReviewAnswers/RemoteSurvey.js @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Table } from 'reactstrap'; +import { Table, Card, CardHeader } from 'reactstrap'; const RemoteSurvey = (props) => { const cellStyle = { @@ -10,231 +10,239 @@ const RemoteSurvey = (props) => { }; return (
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- {props.title} -
-
- Heating System -
-
- { - props.upperFirstLetter( - props.answers[props.data.heatingSystem.answer_id] - ) - } -
-
-
- Heating Fuel Source -
-
- { - props.upperFirstLetter( - props.answers[props.data.heatingFuelSource.answer_id] - ) - } -
-
-
- Is Domestic Hot Water (DHW) and heat prepared by the same boiler? -
-
- { - props.upperFirstLetter( - props.answers[props.data.DHWSameBoiler.answer_id] - ) - } -
-
-
- Age of heat generating system? -
-
- { - props.upperFirstLetter( - props.answers[props.data.ageOfHeatGenerateSystem.answer_id] - ) - } -
-
-
- When do you plan to replace the heating system? -
-
- { - props.upperFirstLetter( - props.answers[props.data.planToReplaceHS.answer_id] - ) - } -
-
-
- Hallways heated? -
-
- { - props.upperFirstLetter( - props.answers[props.data.hallwaysHeated.answer_id] - ) - } -
-
-
- Basement heated? -
-
- { - props.upperFirstLetter( - props.answers[props.data.basementHeated.answer_id] - ) - } -
-
-
- Stairwells heated? -
-
- { - props.upperFirstLetter( - props.answers[props.data.stairwellsHeated.answer_id] - ) - } -
-
-
- Floors heated? -
-
- { - props.upperFirstLetter( - props.answers[props.data.floorsHeated.answer_id] - ) - } -
-
-
- Is the roof flat and easily accessible by a stairwell? -
-
- { - props.upperFirstLetter( - props.answers[props.data.accessibleByStairwell.answer_id] - ) - } -
-
-
- Is the back facade of your building attached to an adjacent building or structure? -
-
- { - props.upperFirstLetter( - props.answers[props.data.backFacadeAttached.answer_id] - ) - } -
-
-
- Are the exterior walls of your building attached to an adjacent building or structure? -
-
- { - props.upperFirstLetter( - props.answers[props.data.exteriorWallsAttached.answer_id] - ) - } -
-
-
- Any tenant complaints about comfort issues? (Temperature) -
-
- { - props.upperFirstLetter( - props.answers[props.data.tenantComplaintsComfort.answer_id] - ) - } -
-
-
- Any tenant complaints about drafty windows? -
-
- { - props.upperFirstLetter( - props.answers[props.data.tenantComplaintsWindows.answer_id] - ) - } -
-
-
- Is the building directly metered for electricity (tenants pay ConEd bills)? -
-
- { - props.upperFirstLetter( - props.answers[props.data.meteredForElectricity.answer_id] - ) - } -
-
-
- Number of Heating Violations in last 5 years? -
-
- { - props.upperFirstLetter( - props.answers[props.data.numberOfHeatingViolations.answer_id] - ) - } -
-
+ + +
+
+ {props.title} +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ Heating System +
+
+ { + props.upperFirstLetter( + props.answers[props.data.heatingSystem.answer_id] + ) + } +
+
+
+ Heating Fuel Source +
+
+ { + props.upperFirstLetter( + props.answers[props.data.heatingFuelSource.answer_id] + ) + } +
+
+
+ Is Domestic Hot Water (DHW) and heat prepared by the same boiler? +
+
+ { + props.upperFirstLetter( + props.answers[props.data.DHWSameBoiler.answer_id] + ) + } +
+
+
+ Age of heat generating system? +
+
+ { + props.upperFirstLetter( + props.answers[props.data.ageOfHeatGenerateSystem.answer_id] + ) + } +
+
+
+ When do you plan to replace the heating system? +
+
+ { + props.upperFirstLetter( + props.answers[props.data.planToReplaceHS.answer_id] + ) + } +
+
+
+ Hallways heated? +
+
+ { + props.upperFirstLetter( + props.answers[props.data.hallwaysHeated.answer_id] + ) + } +
+
+
+ Basement heated? +
+
+ { + props.upperFirstLetter( + props.answers[props.data.basementHeated.answer_id] + ) + } +
+
+
+ Stairwells heated? +
+
+ { + props.upperFirstLetter( + props.answers[props.data.stairwellsHeated.answer_id] + ) + } +
+
+
+ Floors heated? +
+
+ { + props.upperFirstLetter( + props.answers[props.data.floorsHeated.answer_id] + ) + } +
+
+
+ Is the roof flat and easily accessible by a stairwell? +
+
+ { + props.upperFirstLetter( + props.answers[props.data.accessibleByStairwell.answer_id] + ) + } +
+
+
+ Is the back facade of your building attached to an adjacent building or structure? +
+
+ { + props.upperFirstLetter( + props.answers[props.data.backFacadeAttached.answer_id] + ) + } +
+
+
+ Are the exterior walls of your building attached + to an adjacent building or structure? +
+
+ { + props.upperFirstLetter( + props.answers[props.data.exteriorWallsAttached.answer_id] + ) + } +
+
+
+ Any tenant complaints about comfort issues? (Temperature) +
+
+ { + props.upperFirstLetter( + props.answers[props.data.tenantComplaintsComfort.answer_id] + ) + } +
+
+
+ Any tenant complaints about drafty windows? +
+
+ { + props.upperFirstLetter( + props.answers[props.data.tenantComplaintsWindows.answer_id] + ) + } +
+
+
+ Is the building directly metered for electricity (tenants pay ConEd bills)? +
+
+ { + props.upperFirstLetter( + props.answers[props.data.meteredForElectricity.answer_id] + ) + } +
+
+
+ Number of Heating Violations in last 5 years? +
+
+ { + props.upperFirstLetter( + props.answers[props.data.numberOfHeatingViolations.answer_id] + ) + } +
+
+
); }; diff --git a/src/containers/Questionnaire/index.js b/src/containers/Questionnaire/index.js index 679f69d2..6a121f3c 100644 --- a/src/containers/Questionnaire/index.js +++ b/src/containers/Questionnaire/index.js @@ -32,7 +32,7 @@ class Questionnaire extends Component { heatingSystem: 'Heating System', heatingFuelSource: 'Heating Fuel Source', DHWSameBoiler: 'Domestic Hot Water', - AgeOfHeatGenerateSystem: 'Age of heat generating system', + ageOfHeatGenerateSystem: 'Age of heat generating system', planToReplaceHS: 'Plan to replace the heating system', hallwaysHeated: 'Heated hallways', basementHeated: 'Heated basement', @@ -117,7 +117,9 @@ class Questionnaire extends Component { Object.entries(data).forEach(formData => { if (['buildingInfo', 'remoteSurvey', 'financialInitials'].includes(formData[0])) { Object.entries(formData[1]).forEach(fieldData => { - if (fieldData[0] !== 'other' && fieldData[1].toString().replace(/^\s+|\s+$/g, '') === '') { + if (fieldData[0] !== 'other' && + fieldData[0] !== 'address' && + fieldData[1].toString().replace(/^\s+|\s+$/g, '') === '') { emptyFields.push(this.nameMapping[fieldData[0]]); } if (fieldData[0] === 'phone' && !(validPhone.test(fieldData[1]))) { @@ -128,8 +130,8 @@ class Questionnaire extends Component { } if (typeof fieldData[1] === 'object' && fieldData[1].answer_id !== undefined && - fieldData[1].answer_id === -1 && - fieldData[1].question_id !== 16) { + parseInt(fieldData[1].answer_id, 10) === -1 && + parseInt(fieldData[1].question_id, 10) !== 16) { emptyFields.push(this.nameMapping[fieldData[0]]); } }); @@ -137,12 +139,12 @@ class Questionnaire extends Component { }); if (emptyFields.length > 0) { - errorMessage.push(`Please fill in ${emptyFields.join(', ')} field(s)`); + errorMessage.push(`Please fill in:\n${emptyFields.join('\n')}\nfield(s)`); alert(errorMessage); return false; } if (invalidFields.length > 0) { - errorMessage.push(`\nInvalid input in ${invalidFields.join(', ')} field(s)`); + errorMessage.push(`\nInvalid input in:\n${invalidFields.join('\n')}\nfield(s)`); alert(errorMessage); return false; } @@ -173,11 +175,9 @@ class Questionnaire extends Component { }); const tableHeader = { - paddingBottom: '20px', - borderTop: '1px solid #CCCCCC', - background: '#EEEEEE', fontWeight: 'bold', - paddingTop: '20px', + paddingTop: '5px', + paddingBottom: '5px', }; const labelStyle = { @@ -189,7 +189,7 @@ class Questionnaire extends Component { const successMsgStyle = { padding: '25px 50px 25px 50px', - border: '4px solid #CCCCCC', + border: '1px solid #D8D8D8', marginBottom: '25px', background: '#B8DFC2', fontWeight: 'bold', -- GitLab From c537071aefcf795c857d9a210ab71a1a0b3a9ef9 Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Fri, 30 Aug 2019 13:33:43 -0400 Subject: [PATCH 7/7] removed console logs --- src/components/Questionnaire/BuildingInfo.js | 3 --- src/components/Questionnaire/BuildingUnitDropdown.js | 1 - src/components/Questionnaire/FinancialInitial.js | 1 - src/components/Questionnaire/RemoteSurvey.js | 1 - src/containers/Questionnaire/index.js | 3 --- src/containers/Questionnaire/reducer.js | 2 -- src/containers/Questionnaire/sagas.js | 2 -- 7 files changed, 13 deletions(-) diff --git a/src/components/Questionnaire/BuildingInfo.js b/src/components/Questionnaire/BuildingInfo.js index 85edcaa0..a4eef9e9 100644 --- a/src/components/Questionnaire/BuildingInfo.js +++ b/src/components/Questionnaire/BuildingInfo.js @@ -38,7 +38,6 @@ class BuildingInfo extends Component { }, }, () => { this.props.onChangeEvent('buildingInfo', this.state.form); - console.log('changed!'); // eslint-disable-line }); } @@ -58,7 +57,6 @@ class BuildingInfo extends Component { }, }, () => { this.props.onChangeEvent('buildingInfo', this.state.form); - console.log('changed!'); // eslint-disable-line }); } @@ -74,7 +72,6 @@ class BuildingInfo extends Component { }, }, () => { this.props.onChangeEvent('buildingInfo', this.state.form); - console.log('changed!'); // eslint-disable-line }); } diff --git a/src/components/Questionnaire/BuildingUnitDropdown.js b/src/components/Questionnaire/BuildingUnitDropdown.js index ca2c6df2..3d0d9298 100644 --- a/src/components/Questionnaire/BuildingUnitDropdown.js +++ b/src/components/Questionnaire/BuildingUnitDropdown.js @@ -20,7 +20,6 @@ class BuildingUnitDropdown extends Component { numOfUnit: val, }, () => { this.props.onChange(this.props.inputName, this.state.numOfUnit); - console.log('changed!'); // eslint-disable-line }); } diff --git a/src/components/Questionnaire/FinancialInitial.js b/src/components/Questionnaire/FinancialInitial.js index fd4d911a..3746af4a 100644 --- a/src/components/Questionnaire/FinancialInitial.js +++ b/src/components/Questionnaire/FinancialInitial.js @@ -32,7 +32,6 @@ class FinanacialInitial extends Component { }, }, () => { this.props.onChangeEvent('financialInitials', this.state.form); - console.log('changed!'); // eslint-disable-line }); } diff --git a/src/components/Questionnaire/RemoteSurvey.js b/src/components/Questionnaire/RemoteSurvey.js index 5bfc8d4d..7576b138 100644 --- a/src/components/Questionnaire/RemoteSurvey.js +++ b/src/components/Questionnaire/RemoteSurvey.js @@ -41,7 +41,6 @@ class RemoteSurvey extends Component { }, }, () => { this.props.onChangeEvent('remoteSurvey', this.state.form); - console.log('changed!'); // eslint-disable-line }); } diff --git a/src/containers/Questionnaire/index.js b/src/containers/Questionnaire/index.js index 6a121f3c..6afad907 100644 --- a/src/containers/Questionnaire/index.js +++ b/src/containers/Questionnaire/index.js @@ -169,7 +169,6 @@ class Questionnaire extends Component { if (buildingInfo.data !== undefined && buildingInfo.data !== null && submittedAnswers.data !== undefined && submittedAnswers.data !== null && building !== undefined) { - console.log(questionnaire); // eslint-disable-line const address = building.street_address.map(addressItem => { return `${addressItem}, ${building.borough}`; }); @@ -203,8 +202,6 @@ class Questionnaire extends Component { }; let forms = ''; - console.log(submittedAnswers.data); // eslint-disable-line - console.log(submittedAnswers.data.remoteSurvey.numberOfHeatingViolations); // eslint-disable-line if (submitted === false && calculated === false) { forms = (
diff --git a/src/containers/Questionnaire/reducer.js b/src/containers/Questionnaire/reducer.js index 651cbf2c..e4a981a8 100644 --- a/src/containers/Questionnaire/reducer.js +++ b/src/containers/Questionnaire/reducer.js @@ -96,7 +96,6 @@ export default function (state = questionnaireInitialState, action) { }; case SUBMIT_QUESTIONNAIRE_SUCCEEDED: - console.log(action); // eslint-disable-line return { ...state, buildingInfo: { @@ -179,7 +178,6 @@ export default function (state = questionnaireInitialState, action) { }; case CALCULATE_COST_SUCCEEDED: - console.log(action); // eslint-disable-line return { ...state, submitted: false, diff --git a/src/containers/Questionnaire/sagas.js b/src/containers/Questionnaire/sagas.js index 99cc3eb0..04f32150 100644 --- a/src/containers/Questionnaire/sagas.js +++ b/src/containers/Questionnaire/sagas.js @@ -31,7 +31,6 @@ function* loadQuestionnaire(action) { } function* submitQuestionnaire(action) { - console.log(action); // eslint-disable-line const url = `${process.env.REACT_APP_BLOCLINK_URL}/buildings/${action.buildingId}/pna/questionnaire/`; const res = yield call( request, @@ -51,7 +50,6 @@ function* submitQuestionnaire(action) { } function* editQuestionnaire(action) { - console.log(action); // eslint-disable-line yield put(editQuestionnaireSucceeded(action.payload)); } -- GitLab