diff --git a/src/App.js b/src/App.js index 62e03f3c12c6161be85583fcba8b2eda75c6324e..e88f1ed07b900d568e58e4c3612b2c5d44b71697 100644 --- a/src/App.js +++ b/src/App.js @@ -28,6 +28,11 @@ import BuildingPastImprovement from './BuildingPastImprovement'; import BuildingFutureImprovement from './BuildingFutureImprovement'; import BuildingElectricityShutoff from './BuildingElectricityShutoff'; import BuildingMedicalDevices from './BuildingMedicalDevices'; +import ChurchCoolingSystemPlan from './ChurchCoolingSystemPlan'; +import ChurchCoolingSystemAge from './ChurchCoolingSystemAge'; +import ChurchBuildingType from './ChurchBuildingType'; +import ChurchHoursPerWeek from './ChurchHoursPerWeek'; +import OperationalSeasons from './OperationalSeasons'; import { questionTree } from './constants'; import { connect } from 'react-redux'; import { submitContact, submitAnswer, submitBuilding, submitQuestionnaire, submitUserAnswer } from './actions'; @@ -54,7 +59,7 @@ class App extends React.Component { reviewQuestions: [], questions: this.resetQuestions(), pages: { - thankYou: , }, multiFamilyAnswerId: 21, + miniSplitCheckBox: false, }; } @@ -122,7 +128,39 @@ class App extends React.Component { value: 0, answerIds: [17, 18, 19, 12], prev: 'heatingSystemAge', - next: 'unitBreakdown', + next: '', + }, + churchBuildingType: { + id: 62, + title: 'Please tell us what kind of building you have.', + answer: '', + value: 0, + answerIds: [124, 125, 126], + prev: 'addressSearch', + next: 'churchHoursPerWeek', + }, + churchHoursPerWeek: { + id: 63, + title: 'How many hours per week is the building occupied?', + answer: '', + value: 0, + answerIds: [127, 128, 129, 130], + prev: 'churchBuildingType', + next: 'operationalSeasons', + }, + operationalSeasons:{ + id: 64, + title: 'Which season(s) is the building operational?', + answer: [], + value: [], + answerIds: [131, 132, 133, 134], + answers: { + 131: 'Spring', + 132: 'Summer', + 133: 'Fall', + 134: 'Winter'}, + prev: 'churchHoursPerWeek', + next: 'buildingNeeds', }, unitBreakdown: { title: 'Tell us about your building.', @@ -285,16 +323,17 @@ class App extends React.Component { title: 'What type of heating system does your building have?', answer: '', value: '', - answerIds: [96, 97, 98, 99, 100, 101, 33, 12], + answerIds: [96, 97, 98, 99, 100, 136, 101, 33, 12], prev: 'buildingOperatingChallenges', next: 'buildingCoolingSystem', + miniSplitCheckBox: false, }, buildingCoolingSystem: { id: 17, title: 'What type of cooling system does your building have?', answer: '', value: '', - answerIds: [102, 103, 104, 105, 106, 107, 108, 113, 33, 12], + answerIds: [102, 103, 104, 105, 106, 107, 108, 113, 136, 33, 12], prev: 'buildingHeatingSystem', next: 'buildingPastImprovement', }, @@ -328,6 +367,24 @@ class App extends React.Component { prev: 'buildingElectricityShutoff', next: 'feedback', }, + churchCoolingSystemAge: { + id: 65, + title: 'How old is the cooling system?', + answer: '', + value: '', + answerIds: [13, 14, 15, 16, 12], + prev: 'buildingCoolingSystem', + next: 'churchCoolingSystemPlan', + }, + churchCoolingSystemPlan: { + id: 66, + title: 'How soon do you plan in replacing your cooling system?', + answer: '', + value: 0, + answerIds: [17, 18, 19, 12], + prev: 'churchCoolingSystemAge', + next: 'buildingPastImprovement', + }, buildingPastImprovement: { title: 'Any Energy or Water Improvements in the past 5 years?', questions: [ @@ -647,11 +704,12 @@ class App extends React.Component { ], prev: 'buildingPastImprovement', next: '', - } + }, + order: [], }; } - componentDidMount() { + componentDidMount() { if(process.env.REACT_APP_ENVIRONMENT==='production'){ ReactGA.initialize('UA-67611405-11'); ReactGA.pageview('/intake'); @@ -675,6 +733,10 @@ class App extends React.Component { questionAnswers[questions[question].id] = value; } + const updatedOrder = questions.order.filter(item => item !== question); + updatedOrder.push(question); + questions.order = updatedOrder; + this.setState({ questions }, () => { if (question === 'addressSearch') { this.props.onSubmitBuilding({ @@ -707,21 +769,81 @@ class App extends React.Component { updateQuestionChain = (question, value) => { let questions = this.state.questions; if (question === 'buildingTypes'){ + // Set the next question for building types. + // If religious institute next page -> Church Building Type + // Else fuel types + questions['buildingTypes'].next = value === 32 ? 'churchBuildingType' : 'fuels'; + // If the building type is multifam or mixed use, we will display unit breakdown, utility bills and comfort issues. if ([21,22].includes(value)){ questions['heatingSystemPlan'].next = 'unitBreakdown'; questions['unitBreakdown'].next = 'utilityBills'; questions['utilityBills'].prev = 'unitBreakdown'; questions['reviewAnswers'].next = 'congrats'; } + // Else the next page from unit breakdown will be financial interest. else{ questions['unitBreakdown'].next = 'financeInterest'; questions['financeInterest'].prev = 'unitBreakdown'; } } + // If the building type is single family the next page of heating system plan will be wait list. if (question === 'buildingTypes' && value === 20){ questions['heatingSystemPlan'].next = 'waitList'; questions['waitList'].prev = 'heatingSystemPlan'; } + // For NYC Church survey, set feedback as the next page of building future improvement. + if (this.props.building.data.surveyId === 1) { + questions['buildingFutureImprovement'].next = 'feedback'; + questions['feedback'].prev = 'buildingFutureImprovement'; + } + // If the cooling system type is 'I don't have' or 'I don't know' we will skip Cooling sys age and replacement plan. + if (this.props.building.data.surveyId === 1 && question === 'buildingCoolingSystem' && (value === 107 || value === 33)){ + questions['buildingCoolingSystem'].next = 'buildingPastImprovement'; + questions['buildingPastImprovement'].prev = 'buildingCoolingSystem'; + } + else { + questions['buildingCoolingSystem'].next = 'churchCoolingSystemAge'; + questions['buildingPastImprovement'].prev = 'churchCoolingSystemPlan' + } + // Heating System for NYC Church PNS. + if (this.props.building.data.surveyId === 1 && questions['buildingTypes']['value'] === 32){ + // If minisplit is also used for cooling system -> We will skip all 3 cooling sys questions. + if(this.state.miniSplitCheckBox === true) { + this.props.onSubmitAnswer({ + questionId: ["17"], + answerId: [106], + surveyId: this.props.building.data.surveyId, + buildingId: this.props.building.data.buildingId, + userId: this.props.building.data.userId, + }); + questions['heatingSystemPlan'].next = 'buildingPastImprovement'; + questions['buildingPastImprovement'].prev = 'heatingSystemPlan'; + } else { + questions['heatingSystemPlan'].next = 'buildingCoolingSystem'; + } + // Set back button pages + questions['buildingNeeds'].prev = 'operationalSeasons' + questions['fuels'].prev = 'buildingHeatingSystem' + questions['heatingSystemAge'].prev = 'fuels' + questions['buildingCoolingSystem'].prev = 'heatingSystemPlan' + } + else{ + questions['fuels'].prev = 'buildingTypes' + } + if (this.props.building.data.surveyId === 1 && question === 'buildingHeatingSystem' && questions['buildingTypes']['value'] === 32){ + // If the heating system type is 'I don't know' or 'I don't have' we will skip next 3 heating sys related questions. + if ([101,33,7].includes(value)) { + questions['buildingHeatingSystem'].next = 'buildingCoolingSystem'; + questions['buildingCoolingSystem'].prev = 'buildingHeatingSystem'; + } + else { + questions['buildingHeatingSystem'].next = 'fuels'; + } + questions['fuels'].next = 'heatingSystemAge'; + questions['heatingSystemAge'].next = 'heatingSystemPlan'; + } + + // If building type is not single fam and fuel type is natural gas or dual fuel -> display congrats page. if (questions['unitBreakdown']['value'] !== 20 && question === 'fuels' && [4,6].includes(value)){ this.setState({ buildingQualified: true}); @@ -796,7 +918,7 @@ class App extends React.Component { singleFamily={true} />; } - + // 1 - Yes & 2 - No for joining the waitlist if(this.state.questions.waitList.value === 1) { this.state.pages.thankYou = ; } - + this.setState({ submitted: true, }, () => { @@ -836,6 +958,12 @@ class App extends React.Component { this.setQuestion(this.state.questions.reviewAnswers.next); } + setMiniSplitforCooling = (miniSplitCheckBox) => { + this.setState({ + miniSplitCheckBox + }); + } + handleInputChange = (event) => { const val = event.target.value; const name = event.target.name; @@ -849,7 +977,6 @@ class App extends React.Component { render() { const building = this.props.building; - let addressSearchMessage = ""; // TODO: Explain why search success is set to true in render function? let addressSearchSuccess = true; @@ -908,6 +1035,31 @@ class App extends React.Component { answer={this.state.questions['heatingSystemPlan'].value} answerIds={this.state.questions['heatingSystemPlan'].answerIds} />, + churchCoolingSystemAge: , + churchBuildingType: , + churchHoursPerWeek: , + operationalSeasons: , unitBreakdown: , buildingCoolingSystem: , + churchCoolingSystemPlan: , buildingPastImprovement: -1) { if (this.state.question === 'addressSearch' && this.props.building.data.surveyId === 1) { content = questions['buildingTypes']; - } + } else if (this.state.question === 'addressSearch' && [2,3].includes(this.props.building.data.surveyId)){ content = questions['buildingTypeSubType']; } else { @@ -1049,7 +1210,7 @@ class App extends React.Component { content = questions[this.state.questions[this.state.question].prev]; } - // TODO: What is this.props.num ? + // TODO: What is this.props.num ? return (
diff --git a/src/BuildingCoolingSystem.js b/src/BuildingCoolingSystem.js index 17c1c43d12ccd20e77b57a66b050e3bca03adcfd..f71bbe72ec5e3a5cc421fc45059474acc3b4a0ca 100644 --- a/src/BuildingCoolingSystem.js +++ b/src/BuildingCoolingSystem.js @@ -14,10 +14,11 @@ export default class BuildingCoolingSystem extends React.Component { 'PTAC units', 'Rooftop air conditioning units', 'Central chiller plant and fan coil units', - 'Mini split heat pump systems', + 'Minisplit heat pump system', 'I don\'t have a cooling system', 'VRF', 'Central Air Conditioning System', + 'I don\'t know but I know it needs to be replaced!', 'Other', 'I\'m not sure', ]; @@ -53,7 +54,6 @@ export default class BuildingCoolingSystem extends React.Component { label: "building-cooling-system" }); } - this.props.setBuildingCoolingSystem(this.state.answer); this.props.nextQuestion( 'buildingCoolingSystem', this.names[this.props.answerIds.indexOf(this.state.answer)], diff --git a/src/BuildingHeatingSystem.js b/src/BuildingHeatingSystem.js index 7699aaf9e129954e5834990443368647949d9f61..ef399925deca8a64a284c07ca6f2ec70008e13b4 100644 --- a/src/BuildingHeatingSystem.js +++ b/src/BuildingHeatingSystem.js @@ -8,13 +8,15 @@ export default class BuildingHeatingSystem extends React.Component { super(props); this.state = { answer: this.props.answer, + miniSplitCheckBox: this.props.miniSplitCheckBox, }; this.names = [ 'Central steam system', 'Central hydronic (hot water) system', 'Central forced-air system', 'Electric baseboard', - 'Individual heat pumps', + 'Minisplit heat pump system', + 'I don\'t know but I know it needs to be replaced!', 'I don\'t have a heating system', 'Other', 'I\'m not sure', @@ -39,7 +41,7 @@ export default class BuildingHeatingSystem extends React.Component { label: "building-heating-system" }); } - this.props.setBuildingHeatingSystem(this.state.answer); + this.props.setMiniSplitforCooling(this.state.miniSplitCheckBox); this.props.nextQuestion( 'buildingHeatingSystem', this.names[this.props.answerIds.indexOf(this.state.answer)], @@ -58,33 +60,58 @@ export default class BuildingHeatingSystem extends React.Component { this.setState({ answer }); } + setMiniSplitforCooling = () => { + this.setState({miniSplitCheckBox : !this.state.miniSplitCheckBox}) + } + render() { + let miniSplitforCooling = '' + miniSplitforCooling = (this.props.surveyId === 1 && this.state.answer === 100)? +
+ +
: + '' const content = (
What type of heating system does your building have?
- { - this.props.answerIds.map((answerId, id) => { - return ( -
- - - - - -
- ); - }) - } + + + { + this.props.answerIds.map((answerId, id) => { + return ( +
+ + + + + +
+ ); + }) + } + + + { miniSplitforCooling } + +
{ + this.props.prevQuestion('churchBuildingType'); + } + + nextQuestion = () => { + if(process.env.REACT_APP_ENVIRONMENT==='production'){ + ReactGA.event({ + category: "Intake Survey NYC", + action: "Clicked continue button", + label: "church-building-type" + }); + } + this.props.nextQuestion('churchBuildingType', this.names[this.props.answerIds.indexOf(this.state.answer)], this.state.answer); + } + + chooseAnswer = (answer) => { + if(process.env.REACT_APP_ENVIRONMENT==='production'){ + ReactGA.event({ + category: "Intake Survey NYC", + action: "Chose church building type", + label: "church-building-type" + }); + } + this.setState({ answer }); + } + + render() { + const content = ( +
+
+ Please tell us what kind of building you have. +
+ + { + this.props.answerIds.map((answerId, id) => { + return ( + +
this.chooseAnswer(answerId)} + > + {this.names[id]} +
+ + ); + }) + } +
+ + + + {'<'} Back + + + + + + +
+ ); + + return ( +
+ {content} +
+ ); + } +} diff --git a/src/ChurchCoolingSystemAge.js b/src/ChurchCoolingSystemAge.js new file mode 100644 index 0000000000000000000000000000000000000000..989525d616dabb3b62a4a9258f6f1b0499686197 --- /dev/null +++ b/src/ChurchCoolingSystemAge.js @@ -0,0 +1,125 @@ +import React from "react"; +import { Row, Col, Button } from 'reactstrap'; +import starIcon from './utils/images/icon-star.svg'; +import './index.css'; +import ReactGA from 'react-ga'; + + +export default class ChurchCoolingSystemAge extends React.Component { + constructor(props) { + super(props); + this.state = { + answer: this.props.answer, + }; + this.names = [ + 'New (0-3 Years)', + 'Pretty new (4-10 Years)', + 'Pretty old (11-20 Years)', + 'Old (21+ Years)', + 'I\'m not sure', + ]; + } + + componentDidMount () { + if(process.env.REACT_APP_ENVIRONMENT==='production'){ + ReactGA.pageview('/church-cooling-system-age'); + } + } + + prevQuestion = () => { + this.props.prevQuestion('churchCoolingSystemAge'); + } + + nextQuestion = () => { + if(process.env.REACT_APP_ENVIRONMENT==='production'){ + ReactGA.event({ + category: "Intake Survey NYC", + action: "Clicked continue button", + label: "church-cooling-system-age" + }); + } + this.props.nextQuestion( + 'churchCoolingSystemAge', + this.names[this.props.answerIds.indexOf(this.state.answer)], + this.state.answer + ); + } + + chooseAnswer = (answer) => { + if(process.env.REACT_APP_ENVIRONMENT==='production'){ + ReactGA.event({ + category: "Intake Survey NYC", + action: "Chose church cooling system age", + label: "church-cooling-system-age" + }); + } + this.setState({ answer }); + } + + render() { + let message = ""; + if ([2, 3].includes(this.props.answerIds.indexOf(this.state.answer))) { + message = ( +
+   {' '} + Looks like it's time for a new system! +
+ ); + } + + const content = ( +
+
+ About how old is your cooling system? +
+ + + + { + this.props.answerIds.map((answerId, id) => { + return ( + +
this.chooseAnswer(answerId)} + > + {this.names[id]} +
+ + ); + }) + } +
+ {message} + +
+ + + + {'<'} Back + + + + + + +
+ ); + + return ( +
+ {content} +
+ ); + } +} diff --git a/src/ChurchCoolingSystemPlan.js b/src/ChurchCoolingSystemPlan.js new file mode 100644 index 0000000000000000000000000000000000000000..33c69ee4f19ac4aa5d5c239b0185e100974a2f44 --- /dev/null +++ b/src/ChurchCoolingSystemPlan.js @@ -0,0 +1,126 @@ +import React from "react"; +import { Row, Col, Button } from 'reactstrap'; +import './index.css'; +import starIcon from './utils/images/icon-star.svg'; +import ReactGA from 'react-ga'; + + +export default class ChurchCoolingSystemPlan extends React.Component { + constructor(props) { + super(props); + this.state = { + answer: this.props.answer, + }; + this.names = [ + 'As soon as possible', + 'In less than a year', + 'In a year or two', + 'I\'m not sure', + ]; + } + + componentDidMount () { + if(process.env.REACT_APP_ENVIRONMENT==='production'){ + ReactGA.pageview('/church-cooling-system-plan'); + } + } + + prevQuestion = () => { + this.props.prevQuestion('churchCoolingSystemPlan'); + } + + nextQuestion = () => { + if(process.env.REACT_APP_ENVIRONMENT==='production'){ + ReactGA.event({ + category: "Intake Survey NYC", + action: "Clicked continue button", + label: "church-cooling-system-plan" + }); + } + this.props.nextQuestion( + 'churchCoolingSystemPlan', + this.names[this.props.answerIds.indexOf(this.state.answer)], + this.state.answer + ); + } + + chooseAnswer = (answer) => { + if(process.env.REACT_APP_ENVIRONMENT==='production'){ + ReactGA.event({ + category: "Intake Survey NYC", + action: "Chose cooling system plan", + label: "church-cooling-system-plan" + }); + } + this.setState({ answer }); + } + + render() { + let message = ""; + if ([0, 1].includes(this.props.answerIds.indexOf(this.state.answer))) { + message = ( +
+   {' '} + We're on it! +
+ ); + } + + const content = ( +
+
+ How soon do you plan to replace your cooling system? +
+ + +
+ + { + this.props.answerIds.map((answerId, id) => { + return ( + +
this.chooseAnswer(answerId)} + > + {this.names[id]} +
+ + ); + }) + } +
+ {message} +
+ +
+ + + + {'<'} Back + + + + + + +
+ ); + + return ( +
+ {content} +
+ ); + } +} diff --git a/src/ChurchHoursPerWeek.js b/src/ChurchHoursPerWeek.js new file mode 100644 index 0000000000000000000000000000000000000000..b654053a1e857b134464aa117e46a30299af29a7 --- /dev/null +++ b/src/ChurchHoursPerWeek.js @@ -0,0 +1,102 @@ +import React from "react"; +import { Row, Col, Button } from 'reactstrap'; +import './index.css'; +import ReactGA from 'react-ga'; + +export default class ChurchHoursPerWeek extends React.Component { + constructor(props) { + super(props); + this.state = { + answer: this.props.answer, + }; + this.names = [ + '0 ~ 20 hrs per week', + '20 ~ 40 hrs per week', + '40 ~ 80 hrs per week', + '24/7, the building is occupied all the time' + ]; + } + + componentDidMount () { + if(process.env.REACT_APP_ENVIRONMENT==='production'){ + ReactGA.pageview('/church-hours-per-week'); + } + } + + prevQuestion = () => { + this.props.prevQuestion('churchHoursPerWeek'); + } + + nextQuestion = () => { + if(process.env.REACT_APP_ENVIRONMENT==='production'){ + ReactGA.event({ + category: "Intake Survey NYC", + action: "Clicked continue button", + label: "church-hours-per-week" + }); + } + this.props.nextQuestion('churchHoursPerWeek', this.names[this.props.answerIds.indexOf(this.state.answer)], this.state.answer); + } + + chooseAnswer = (answer) => { + if(process.env.REACT_APP_ENVIRONMENT==='production'){ + ReactGA.event({ + category: "Intake Survey NYC", + action: "Chose church hours per week", + label: "church-hours-per-week" + }); + } + this.setState({ answer }); + } + + render() { + const content = ( +
+
+ How many hours per week is the building occupied? +
+ + { + this.props.answerIds.map((answerId, id) => { + return ( + +
this.chooseAnswer(answerId)} + > + {this.names[id]} +
+ + ); + }) + } +
+ + + + {'<'} Back + + + + + + +
+ ); + + return ( +
+ {content} +
+ ); + } +} diff --git a/src/CompleteButtons.js b/src/CompleteButtons.js new file mode 100644 index 0000000000000000000000000000000000000000..68dedc9e1b79f642c191f786657f53e0c08e48e1 --- /dev/null +++ b/src/CompleteButtons.js @@ -0,0 +1,38 @@ +import React from "react"; +import { Row, Col, Button } from 'reactstrap'; +import './index.css'; + +export default class CompleteButtons extends React.Component { + addBuilding = () => { + console.log('yes'); + } + + closePage = () => { + window.close(); + } + + render() { + return ( +
+ + + + + + + + +
+ ); + } +} diff --git a/src/OperationalSeasons.js b/src/OperationalSeasons.js new file mode 100644 index 0000000000000000000000000000000000000000..923db71d670d3c28352fc02e0514eeed9b6e51ec --- /dev/null +++ b/src/OperationalSeasons.js @@ -0,0 +1,112 @@ +import React from "react"; +import { Row, Col, Button, Label, Input} from 'reactstrap'; +import './index.css'; +import ReactGA from 'react-ga'; + +export default class OperationalSeasons extends React.Component { + constructor(props) { + super(props); + this.state = { + answerIds: this.props.answer, + }; + this.names = { + Winter: 'Winter', + Spring: 'Spring', + Summer: 'Summer', + Fall: 'Fall' + } + } + + componentDidMount () { + if(process.env.REACT_APP_ENVIRONMENT==='production'){ + ReactGA.pageview('/operational-seasons'); + } + } + + prevQuestion = () => { + this.props.prevQuestion('operationalSeasons'); + } + + nextQuestion = () => { + if(process.env.REACT_APP_ENVIRONMENT==='production'){ + ReactGA.event({ + category: "Intake Survey POW", + action: "Clicked continue button", + label: "operational-seasons" + }); + } + this.props.nextQuestion( + 'operationalSeasons', + this.state.answerIds.map(answerId => this.names[this.props.answers[answerId]]), + this.state.answerIds, + ); + } + + chooseAnswer = (answerId) => { + let answerIds = this.state.answerIds + if (answerIds.includes(answerId)) { + answerIds = answerIds.filter(id => id !== answerId); + } else { + answerIds.push(answerId); + } + this.setState({ answerIds }); + } + + render() { + const content = ( +
+
+ Which season(s) is the building operational? +
+
+ Check all that apply +
+ { + this.props.answerIds.map(answerId => { + const answerName = this.props.answers[answerId]; + return ( +
+ + + + + +
+ ); + }) + } + + + + + {'<'} Back + + + + + + +
+ ); + + return ( +
+ {content} +
+ ); + } +} diff --git a/src/ReviewAnswers.js b/src/ReviewAnswers.js index de2a83791fde5a5e9d2bac9df689bdc5cb774df4..2e19c33f8bd2d0f801d8e1b01eec0d3d5ad7732c 100644 --- a/src/ReviewAnswers.js +++ b/src/ReviewAnswers.js @@ -38,33 +38,6 @@ export default class ReviewAnswers extends React.Component { render() { const questions = this.props.questions; const phoneNumber = this.props.form.PHONE === 0 ? 'N/A' : this.props.form.PHONE; - - const aptBreakdown = questions['unitBreakdown'].answers.filter(c => c === 0).length !== 6? -
- - -
- Apartment Unit Breakdown -
-
- Studio: {this.props.questions['unitBreakdown'].answers[0]}
- One Bedroom: {this.props.questions['unitBreakdown'].answers[1]}
- Two Bedroom: {this.props.questions['unitBreakdown'].answers[2]}
- Three Bedroom: {this.props.questions['unitBreakdown'].answers[3]}
- Four Bedroom: {this.props.questions['unitBreakdown'].answers[4]}
- Other: {this.props.questions['unitBreakdown'].answers[5]} -
- -
- - this.editAnswer('unitBreakdown') } /> - -
-
-
-
- : ''; - const content = (
@@ -72,18 +45,7 @@ export default class ReviewAnswers extends React.Component {
{ - Object.keys(questions) - .filter( - question => questions[question].title !== undefined && - ( - (questions[question].answer !== undefined && questions[question].answer.length !== 0) || - ( - questions[question].questions !== undefined && - questions[question].questions[0].value !== 0 && - questions[question].questions[1].value !== 0 - ) - ) - ) + questions.order .map(question => { if (questions[question].questions !== undefined) { if (questions[question].questions.filter(question => ![0, ""].includes(question.value)).length > 0) { @@ -169,6 +131,55 @@ export default class ReviewAnswers extends React.Component {
); + } else if (question === 'unitBreakdown') { + return ( + questions['unitBreakdown'].answers.filter(c => c === 0).length !== 6? +
+ + +
+ Apartment Unit Breakdown +
+
+ Studio: {this.props.questions['unitBreakdown'].answers[0]}
+ One Bedroom: {this.props.questions['unitBreakdown'].answers[1]}
+ Two Bedroom: {this.props.questions['unitBreakdown'].answers[2]}
+ Three Bedroom: {this.props.questions['unitBreakdown'].answers[3]}
+ Four Bedroom: {this.props.questions['unitBreakdown'].answers[4]}
+ Other: {this.props.questions['unitBreakdown'].answers[5]} +
+ +
+ + this.editAnswer('unitBreakdown') } /> + +
+
+
+
+ : '' + ); + } else if (question === 'feedback') { + return ( +
+ + +
+ How did you first hear about us? +
+
+ {this.props.questions[question].answers[0]}
+
+ +
+ + this.editAnswer('feedback') } /> + +
+
+
+
+ ); } else { return (
@@ -193,27 +204,6 @@ export default class ReviewAnswers extends React.Component { } }) } -
- - -
- How did you first hear about us? -
-
- {this.props.questions['feedback'].answers[0]}
-
- -
- - this.editAnswer('feedback') } /> - -
-
-
-
- - {aptBreakdown} -