From 850ce986b3326e49feb48bc685814ad1e7b974cf Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Sat, 2 May 2020 14:58:53 -0400 Subject: [PATCH 01/29] Add page for church building type --- src/App.js | 17 +++++++ src/ChurchBuildingType.js | 101 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 src/ChurchBuildingType.js diff --git a/src/App.js b/src/App.js index 62e03f3c1..7660ddc82 100644 --- a/src/App.js +++ b/src/App.js @@ -28,6 +28,7 @@ import BuildingPastImprovement from './BuildingPastImprovement'; import BuildingFutureImprovement from './BuildingFutureImprovement'; import BuildingElectricityShutoff from './BuildingElectricityShutoff'; import BuildingMedicalDevices from './BuildingMedicalDevices'; +import ChurchBuildingType from './ChurchBuildingType'; import { questionTree } from './constants'; import { connect } from 'react-redux'; import { submitContact, submitAnswer, submitBuilding, submitQuestionnaire, submitUserAnswer } from './actions'; @@ -124,6 +125,15 @@ class App extends React.Component { prev: 'heatingSystemAge', next: 'unitBreakdown', }, + churchBuildingType: { + id: 62, + title: 'Please tell us what kind of building you have.', + answer: '', + value: 0, + answerIds: [124, 125, 126], + prev: 'addressSearch', + next: '', + }, unitBreakdown: { title: 'Tell us about your building.', questionIds: [52, 53, 54, 55, 56, 57], @@ -707,6 +717,7 @@ class App extends React.Component { updateQuestionChain = (question, value) => { let questions = this.state.questions; if (question === 'buildingTypes'){ + questions['buildingTypes'].next = value === 32 ? 'churchBuildingType' : 'fuels'; if ([21,22].includes(value)){ questions['heatingSystemPlan'].next = 'unitBreakdown'; questions['unitBreakdown'].next = 'utilityBills'; @@ -908,6 +919,12 @@ class App extends React.Component { answer={this.state.questions['heatingSystemPlan'].value} answerIds={this.state.questions['heatingSystemPlan'].answerIds} />, + churchBuildingType: , unitBreakdown: { + 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.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} +
+ ); + } +} -- GitLab From 115f3b5f56947922e49c204568e1d082b193d58f Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Sat, 2 May 2020 15:09:19 -0400 Subject: [PATCH 02/29] Add the page for Church hours per week --- src/App.js | 16 ++++++ src/ChurchHoursPerWeek.js | 102 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 src/ChurchHoursPerWeek.js diff --git a/src/App.js b/src/App.js index 7660ddc82..4c8799d8c 100644 --- a/src/App.js +++ b/src/App.js @@ -29,6 +29,7 @@ import BuildingFutureImprovement from './BuildingFutureImprovement'; import BuildingElectricityShutoff from './BuildingElectricityShutoff'; import BuildingMedicalDevices from './BuildingMedicalDevices'; import ChurchBuildingType from './ChurchBuildingType'; +import ChurchHoursPerWeek from './ChurchHoursPerWeek'; import { questionTree } from './constants'; import { connect } from 'react-redux'; import { submitContact, submitAnswer, submitBuilding, submitQuestionnaire, submitUserAnswer } from './actions'; @@ -132,6 +133,15 @@ class App extends React.Component { 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: '', }, unitBreakdown: { @@ -925,6 +935,12 @@ class App extends React.Component { answer={this.state.questions['churchBuildingType'].value} answerIds={this.state.questions['churchBuildingType'].answerIds} />, + churchHoursPerWeek: , unitBreakdown: { + 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.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} +
+ ); + } +} -- GitLab From 392bea8ac483f32213acf9811a5a0ebe4e1cde68 Mon Sep 17 00:00:00 2001 From: Jinal Soni Date: Sat, 2 May 2020 16:18:59 -0400 Subject: [PATCH 03/29] Church Cooling System Age --- src/App.js | 19 ++++++ src/ChurchCoolingSystemAge.js | 125 ++++++++++++++++++++++++++++++++++ 2 files changed, 144 insertions(+) create mode 100644 src/ChurchCoolingSystemAge.js diff --git a/src/App.js b/src/App.js index 62e03f3c1..8d23e7958 100644 --- a/src/App.js +++ b/src/App.js @@ -28,6 +28,7 @@ import BuildingPastImprovement from './BuildingPastImprovement'; import BuildingFutureImprovement from './BuildingFutureImprovement'; import BuildingElectricityShutoff from './BuildingElectricityShutoff'; import BuildingMedicalDevices from './BuildingMedicalDevices'; +import ChurchCoolingSystemAge from './ChurchCoolingSystemAge'; import { questionTree } from './constants'; import { connect } from 'react-redux'; import { submitContact, submitAnswer, submitBuilding, submitQuestionnaire, submitUserAnswer } from './actions'; @@ -328,6 +329,15 @@ class App extends React.Component { prev: 'buildingElectricityShutoff', next: 'feedback', }, + churchCoolingSystemAge: { + id: 65, + title: 'How old is the cooling system?', + answer: '', + value: '', + answerIds: [12, 13, 14, 15, 16], + prev: 'buildingCoolingSystem', + next: '', + }, buildingPastImprovement: { title: 'Any Energy or Water Improvements in the past 5 years?', questions: [ @@ -722,6 +732,9 @@ class App extends React.Component { questions['heatingSystemPlan'].next = 'waitList'; questions['waitList'].prev = 'heatingSystemPlan'; } + if (this.props.building.data.surveyId === 1 && question === 'buildingCoolingSystem' && (value === 107 || value === 33)){ + question['buildingCoolingSystem'].next = 'buildingPastImprovement'; + } if (questions['unitBreakdown']['value'] !== 20 && question === 'fuels' && [4,6].includes(value)){ this.setState({ buildingQualified: true}); @@ -908,6 +921,12 @@ class App extends React.Component { answer={this.state.questions['heatingSystemPlan'].value} answerIds={this.state.questions['heatingSystemPlan'].answerIds} />, + churchCoolingSystemAge: , unitBreakdown: { + 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} +
+ ); + } +} -- GitLab From 2478c614d82124423210e300d03c0296023a14e1 Mon Sep 17 00:00:00 2001 From: Jinal Soni Date: Sat, 2 May 2020 16:32:16 -0400 Subject: [PATCH 04/29] Church Cooling system plan --- src/App.js | 16 +++++ src/ChurchCoolingSystemPlan.js | 126 +++++++++++++++++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 src/ChurchCoolingSystemPlan.js diff --git a/src/App.js b/src/App.js index 62e03f3c1..3dc9e1bdc 100644 --- a/src/App.js +++ b/src/App.js @@ -28,6 +28,7 @@ import BuildingPastImprovement from './BuildingPastImprovement'; import BuildingFutureImprovement from './BuildingFutureImprovement'; import BuildingElectricityShutoff from './BuildingElectricityShutoff'; import BuildingMedicalDevices from './BuildingMedicalDevices'; +import ChurchCoolingSystemPlan from './ChurchCoolingSystemPlan'; import { questionTree } from './constants'; import { connect } from 'react-redux'; import { submitContact, submitAnswer, submitBuilding, submitQuestionnaire, submitUserAnswer } from './actions'; @@ -328,6 +329,15 @@ class App extends React.Component { prev: 'buildingElectricityShutoff', next: 'feedback', }, + 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: [ @@ -1016,6 +1026,12 @@ class App extends React.Component { answer={this.state.questions['buildingMedicalDevices'].value} answerIds={this.state.questions['buildingMedicalDevices'].answerIds} />, + churchCoolingSystemPlan: , buildingPastImprovement: { + 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} +
+ ); + } +} -- GitLab From 297889a0177a6f576721a26c6e818e680b9a6af5 Mon Sep 17 00:00:00 2001 From: Jose Contreras Date: Sat, 2 May 2020 13:45:13 -0700 Subject: [PATCH 05/29] Add Operational Seasons question and insert it into questionnaire flow. --- src/App.js | 24 +++++++- src/OperationalSeasons.js | 112 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 src/OperationalSeasons.js diff --git a/src/App.js b/src/App.js index 4c8799d8c..633a92dec 100644 --- a/src/App.js +++ b/src/App.js @@ -30,6 +30,7 @@ import BuildingElectricityShutoff from './BuildingElectricityShutoff'; import BuildingMedicalDevices from './BuildingMedicalDevices'; 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'; @@ -142,7 +143,21 @@ class App extends React.Component { value: 0, answerIds: [127, 128, 129, 130], prev: 'churchBuildingType', - next: '', + 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.', @@ -941,6 +956,13 @@ class App extends React.Component { answer={this.state.questions['churchHoursPerWeek'].value} answerIds={this.state.questions['churchHoursPerWeek'].answerIds} />, + operationalSeasons: , unitBreakdown: { + 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} +
+ ); + } +} -- GitLab From 82ce4a82135182f59cc8bd368dae78d43e63b396 Mon Sep 17 00:00:00 2001 From: Jinal Soni Date: Sat, 2 May 2020 16:50:49 -0400 Subject: [PATCH 06/29] } --- src/App.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 9a64f1341..06c67a916 100644 --- a/src/App.js +++ b/src/App.js @@ -358,6 +358,7 @@ class App extends React.Component { answerIds: [17, 18, 19, 12], prev: 'churchCoolingSystemAge', next: 'buildingPastImprovement', + }, churchCoolingSystemAge: { id: 65, title: 'How old is the cooling system?', @@ -686,7 +687,7 @@ class App extends React.Component { ], prev: 'buildingPastImprovement', next: '', - } + }, }; } -- GitLab From e59e9cc82d4ac1bb8b26e458fc638e5d192ac5d6 Mon Sep 17 00:00:00 2001 From: Jinal Soni Date: Sat, 2 May 2020 16:59:37 -0400 Subject: [PATCH 07/29] resolved set function error --- src/App.js | 3 +++ src/BuildingCoolingSystem.js | 1 - src/BuildingHeatingSystem.js | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/App.js b/src/App.js index 4567c7dca..cb7e515df 100644 --- a/src/App.js +++ b/src/App.js @@ -781,6 +781,9 @@ class App extends React.Component { if (this.props.building.data.surveyId === 1 && question === 'buildingCoolingSystem' && (value === 107 || value === 33)){ question['buildingCoolingSystem'].next = 'buildingPastImprovement'; } + else if (this.props.building.data.surveyId === 1 && question === 'buildingCoolingSystem'){ + question['buildingCoolingSystem'].next = 'churchCoolingSystemAge'; + } if (questions['unitBreakdown']['value'] !== 20 && question === 'fuels' && [4,6].includes(value)){ this.setState({ buildingQualified: true}); diff --git a/src/BuildingCoolingSystem.js b/src/BuildingCoolingSystem.js index 17c1c43d1..71b2aacca 100644 --- a/src/BuildingCoolingSystem.js +++ b/src/BuildingCoolingSystem.js @@ -53,7 +53,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 7699aaf9e..c02e9f3bb 100644 --- a/src/BuildingHeatingSystem.js +++ b/src/BuildingHeatingSystem.js @@ -39,7 +39,6 @@ export default class BuildingHeatingSystem extends React.Component { label: "building-heating-system" }); } - this.props.setBuildingHeatingSystem(this.state.answer); this.props.nextQuestion( 'buildingHeatingSystem', this.names[this.props.answerIds.indexOf(this.state.answer)], -- GitLab From 09fa01f96cfe124135ddf018830add6b390deb9b Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Sat, 2 May 2020 17:20:21 -0400 Subject: [PATCH 08/29] Solve the error. Change Question to Questions --- src/App.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index cb7e515df..1420058be 100644 --- a/src/App.js +++ b/src/App.js @@ -760,6 +760,9 @@ class App extends React.Component { } updateQuestionChain = (question, value) => { + console.log(question) + console.log(value) + console.log(this.state.questions) let questions = this.state.questions; if (question === 'buildingTypes'){ questions['buildingTypes'].next = value === 32 ? 'churchBuildingType' : 'fuels'; @@ -781,8 +784,14 @@ class App extends React.Component { if (this.props.building.data.surveyId === 1 && question === 'buildingCoolingSystem' && (value === 107 || value === 33)){ question['buildingCoolingSystem'].next = 'buildingPastImprovement'; } + if (this.props.building.data.surveyId === 1 && question === 'buildingHeatingSystem'){ + questions['buildingHeatingSystem'].next = 'fuels'; + questions['fuels'].next = 'heatingSystemAge'; + questions['heatingSystemAge'].next = 'heatingSystemPlan'; + questions['heatingSystemPlan'].next = 'buildingCoolingSystem'; + } else if (this.props.building.data.surveyId === 1 && question === 'buildingCoolingSystem'){ - question['buildingCoolingSystem'].next = 'churchCoolingSystemAge'; + questions['buildingCoolingSystem'].next = 'churchCoolingSystemAge'; } if (questions['unitBreakdown']['value'] !== 20 && question === 'fuels' && [4,6].includes(value)){ -- GitLab From 91b7eeb6f5432fc4be176e11c15298015abe723c Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Sat, 2 May 2020 17:20:51 -0400 Subject: [PATCH 09/29] Remove console logs --- src/App.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/App.js b/src/App.js index 1420058be..e634486b7 100644 --- a/src/App.js +++ b/src/App.js @@ -760,9 +760,6 @@ class App extends React.Component { } updateQuestionChain = (question, value) => { - console.log(question) - console.log(value) - console.log(this.state.questions) let questions = this.state.questions; if (question === 'buildingTypes'){ questions['buildingTypes'].next = value === 32 ? 'churchBuildingType' : 'fuels'; -- GitLab From 3f66e56adaeb941f86366d04916a4001dc8d7f28 Mon Sep 17 00:00:00 2001 From: Aizizi Yigaimu Date: Sat, 2 May 2020 17:55:57 -0400 Subject: [PATCH 10/29] Add question order to main file and review file --- src/App.js | 19 +++++++---- src/ReviewAnswers.js | 76 +++++++++++++++++++------------------------- 2 files changed, 45 insertions(+), 50 deletions(-) diff --git a/src/App.js b/src/App.js index 62e03f3c1..a23dd341f 100644 --- a/src/App.js +++ b/src/App.js @@ -54,7 +54,7 @@ class App extends React.Component { reviewQuestions: [], questions: this.resetQuestions(), pages: { - thankYou: item !== question); + updatedOrder.push(question); + questions.order = updatedOrder; + this.setState({ questions }, () => { if (question === 'addressSearch') { this.props.onSubmitBuilding({ @@ -796,7 +801,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, }, () => { @@ -1035,7 +1040,7 @@ class App extends React.Component { Object.keys(this.state.questions).indexOf(this.state.question) > -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 +1054,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/ReviewAnswers.js b/src/ReviewAnswers.js index de2a83791..7ebf2577e 100644 --- a/src/ReviewAnswers.js +++ b/src/ReviewAnswers.js @@ -38,33 +38,7 @@ 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') } /> - -
-
-
-
- : ''; - + console.log(questions); const content = (
@@ -72,18 +46,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,7 +132,37 @@ 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 { + console.log(questions[question]); return (
@@ -199,7 +192,7 @@ export default class ReviewAnswers extends React.Component {
How did you first hear about us?
-
+
{this.props.questions['feedback'].answers[0]}
@@ -211,9 +204,6 @@ export default class ReviewAnswers extends React.Component {
- - {aptBreakdown} -
-- GitLab From 3291bb69403dc4c15fe67494d6a7d5c746901557 Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Sat, 2 May 2020 18:35:14 -0400 Subject: [PATCH 11/29] Test logic for minisplit --- src/App.js | 44 ++++++++++++++++++++++++------------ src/BuildingHeatingSystem.js | 8 ++++++- 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/src/App.js b/src/App.js index e634486b7..0b557e4cc 100644 --- a/src/App.js +++ b/src/App.js @@ -365,6 +365,15 @@ 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?', @@ -374,15 +383,6 @@ class App extends React.Component { prev: 'churchCoolingSystemAge', next: 'buildingPastImprovement', }, - churchCoolingSystemAge: { - id: 65, - title: 'How old is the cooling system?', - answer: '', - value: '', - answerIds: [12, 13, 14, 15, 16], - prev: 'buildingCoolingSystem', - next: '', - }, buildingPastImprovement: { title: 'Any Energy or Water Improvements in the past 5 years?', questions: [ @@ -760,6 +760,9 @@ class App extends React.Component { } updateQuestionChain = (question, value) => { + console.log(question) + console.log(value) + console.log(this.state.questions) let questions = this.state.questions; if (question === 'buildingTypes'){ questions['buildingTypes'].next = value === 32 ? 'churchBuildingType' : 'fuels'; @@ -778,18 +781,28 @@ class App extends React.Component { questions['heatingSystemPlan'].next = 'waitList'; questions['waitList'].prev = 'heatingSystemPlan'; } + if (this.props.building.data.surveyId === 1) { + questions['buildingFutureImprovement'].next = 'feedback'; + } if (this.props.building.data.surveyId === 1 && question === 'buildingCoolingSystem' && (value === 107 || value === 33)){ - question['buildingCoolingSystem'].next = 'buildingPastImprovement'; + questions['buildingCoolingSystem'].next = 'buildingPastImprovement'; + } + else { + questions['buildingCoolingSystem'].next = 'churchCoolingSystemAge'; } - if (this.props.building.data.surveyId === 1 && question === 'buildingHeatingSystem'){ - questions['buildingHeatingSystem'].next = 'fuels'; + // Heating System + if (this.props.building.data.surveyId === 1 && question === 'buildingHeatingSystem' && questions['buildingTypes']['value'] === 32){ + if ([101,33,7].includes(value)) { + questions['buildingHeatingSystem'].next = 'buildingCoolingSystem'; + } + else { + questions['buildingHeatingSystem'].next = 'fuels'; + } questions['fuels'].next = 'heatingSystemAge'; questions['heatingSystemAge'].next = 'heatingSystemPlan'; questions['heatingSystemPlan'].next = 'buildingCoolingSystem'; } - else if (this.props.building.data.surveyId === 1 && question === 'buildingCoolingSystem'){ - questions['buildingCoolingSystem'].next = 'churchCoolingSystemAge'; - } + if (questions['unitBreakdown']['value'] !== 20 && question === 'fuels' && [4,6].includes(value)){ this.setState({ buildingQualified: true}); @@ -1086,6 +1099,7 @@ class App extends React.Component { setBuildingHeatingSystem={this.setBuildingHeatingSystem} answer={this.state.questions['buildingHeatingSystem'].value} answerIds={this.state.questions['buildingHeatingSystem'].answerIds} + surveyId={this.props.building.data.surveyId} />, buildingCoolingSystem:
@@ -84,6 +87,9 @@ export default class BuildingHeatingSystem extends React.Component { ); }) } + + { miniSplitforCooling } + Date: Sat, 2 May 2020 18:49:45 -0400 Subject: [PATCH 12/29] Remove console logs --- src/ReviewAnswers.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ReviewAnswers.js b/src/ReviewAnswers.js index 7ebf2577e..0f1d3e1a4 100644 --- a/src/ReviewAnswers.js +++ b/src/ReviewAnswers.js @@ -38,7 +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; - console.log(questions); const content = (
@@ -162,7 +161,6 @@ export default class ReviewAnswers extends React.Component { ); } else { - console.log(questions[question]); return (
-- GitLab From ac4ff7443d516dec55b2953700dc592145c2ac73 Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Sat, 2 May 2020 19:48:08 -0400 Subject: [PATCH 13/29] Set the condition for mini split --- src/App.js | 23 ++++++++++++++++++----- src/BuildingHeatingSystem.js | 20 +++++++++++++++++++- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/src/App.js b/src/App.js index 0b557e4cc..5b8214717 100644 --- a/src/App.js +++ b/src/App.js @@ -70,6 +70,7 @@ class App extends React.Component { />, }, multiFamilyAnswerId: 21, + miniSplitCheckBox: false, }; } @@ -127,7 +128,7 @@ class App extends React.Component { value: 0, answerIds: [17, 18, 19, 12], prev: 'heatingSystemAge', - next: 'unitBreakdown', + next: '', }, churchBuildingType: { id: 62, @@ -325,6 +326,7 @@ class App extends React.Component { answerIds: [96, 97, 98, 99, 100, 101, 33, 12], prev: 'buildingOperatingChallenges', next: 'buildingCoolingSystem', + miniSplitCheckBox: false, }, buildingCoolingSystem: { id: 17, @@ -760,9 +762,6 @@ class App extends React.Component { } updateQuestionChain = (question, value) => { - console.log(question) - console.log(value) - console.log(this.state.questions) let questions = this.state.questions; if (question === 'buildingTypes'){ questions['buildingTypes'].next = value === 32 ? 'churchBuildingType' : 'fuels'; @@ -791,6 +790,13 @@ class App extends React.Component { questions['buildingCoolingSystem'].next = 'churchCoolingSystemAge'; } // Heating System + if (this.props.building.data.surveyId === 1){ + if(this.state.miniSplitCheckBox === true) { + questions['heatingSystemPlan'].next = 'buildingPastImprovement'; + } else { + questions['heatingSystemPlan'].next = 'buildingCoolingSystem'; + } + } if (this.props.building.data.surveyId === 1 && question === 'buildingHeatingSystem' && questions['buildingTypes']['value'] === 32){ if ([101,33,7].includes(value)) { questions['buildingHeatingSystem'].next = 'buildingCoolingSystem'; @@ -800,7 +806,6 @@ class App extends React.Component { } questions['fuels'].next = 'heatingSystemAge'; questions['heatingSystemAge'].next = 'heatingSystemPlan'; - questions['heatingSystemPlan'].next = 'buildingCoolingSystem'; } if (questions['unitBreakdown']['value'] !== 20 && @@ -917,6 +922,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; @@ -1097,9 +1108,11 @@ class App extends React.Component { prevQuestion={this.prevQuestion} nextQuestion={this.nextQuestion} setBuildingHeatingSystem={this.setBuildingHeatingSystem} + setMiniSplitforCooling={this.setMiniSplitforCooling} answer={this.state.questions['buildingHeatingSystem'].value} answerIds={this.state.questions['buildingHeatingSystem'].answerIds} surveyId={this.props.building.data.surveyId} + miniSplitCheckBox={this.state.questions['buildingHeatingSystem'].miniSplitCheckBox} />, buildingCoolingSystem: { + this.setState({miniSplitCheckBox : !this.state.miniSplitCheckBox}) + } + render() { + console.log(this.state.miniSplitCheckBox) let miniSplitforCooling = '' miniSplitforCooling = (this.props.surveyId === 1 && this.state.answer === 100)? - 'Test': '' +
+ +
: + '' const content = (
-- GitLab From 620833305a804c32701333910ca6c352cb37bcb2 Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Sat, 2 May 2020 19:59:25 -0400 Subject: [PATCH 14/29] Add surveyID condition --- src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 5b8214717..7e775cb03 100644 --- a/src/App.js +++ b/src/App.js @@ -790,7 +790,7 @@ class App extends React.Component { questions['buildingCoolingSystem'].next = 'churchCoolingSystemAge'; } // Heating System - if (this.props.building.data.surveyId === 1){ + if (this.props.building.data.surveyId === 1 && questions['buildingTypes']['value'] === 32){ if(this.state.miniSplitCheckBox === true) { questions['heatingSystemPlan'].next = 'buildingPastImprovement'; } else { -- GitLab From 7c9b0fdd2ae9e8500794040e0c63630f4639d02e Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Sat, 2 May 2020 20:16:22 -0400 Subject: [PATCH 15/29] Set back navigation links and small fixes --- src/App.js | 8 ++++++++ src/BuildingHeatingSystem.js | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 7e775cb03..3933e8ab1 100644 --- a/src/App.js +++ b/src/App.js @@ -785,6 +785,7 @@ class App extends React.Component { } 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'; @@ -793,9 +794,16 @@ class App extends React.Component { if (this.props.building.data.surveyId === 1 && questions['buildingTypes']['value'] === 32){ if(this.state.miniSplitCheckBox === true) { questions['heatingSystemPlan'].next = 'buildingPastImprovement'; + questions['buildingPastImprovement'].prev = 'heatingSystemPlan'; } else { questions['heatingSystemPlan'].next = 'buildingCoolingSystem'; } + questions['buildingNeeds'].prev = 'operationalSeasons' + questions['fuels'].prev = 'buildingHeatingSystem' + questions['heatingSystemAge'].prev = 'fuels' + questions['buildingCoolingSystem'].prev = 'heatingSystemPlan' + questions['buildingPastImprovement'].prev = 'churchCoolingSystemPlan' + } if (this.props.building.data.surveyId === 1 && question === 'buildingHeatingSystem' && questions['buildingTypes']['value'] === 32){ if ([101,33,7].includes(value)) { diff --git a/src/BuildingHeatingSystem.js b/src/BuildingHeatingSystem.js index cc95b57ae..aa037dbbe 100644 --- a/src/BuildingHeatingSystem.js +++ b/src/BuildingHeatingSystem.js @@ -64,7 +64,6 @@ export default class BuildingHeatingSystem extends React.Component { } render() { - console.log(this.state.miniSplitCheckBox) let miniSplitforCooling = '' miniSplitforCooling = (this.props.surveyId === 1 && this.state.answer === 100)?
-- GitLab From 1b0d8337b6c937ebb6a775b90309476bfdab5ed8 Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Sat, 2 May 2020 20:32:24 -0400 Subject: [PATCH 16/29] Add option in cooling and heating systems --- src/App.js | 4 ++-- src/BuildingCoolingSystem.js | 1 + src/BuildingHeatingSystem.js | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/App.js b/src/App.js index 3933e8ab1..3cb194cf5 100644 --- a/src/App.js +++ b/src/App.js @@ -323,7 +323,7 @@ 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, @@ -333,7 +333,7 @@ class App extends React.Component { 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', }, diff --git a/src/BuildingCoolingSystem.js b/src/BuildingCoolingSystem.js index 71b2aacca..29f996d33 100644 --- a/src/BuildingCoolingSystem.js +++ b/src/BuildingCoolingSystem.js @@ -18,6 +18,7 @@ export default class BuildingCoolingSystem extends React.Component { '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', ]; diff --git a/src/BuildingHeatingSystem.js b/src/BuildingHeatingSystem.js index aa037dbbe..c00bf7478 100644 --- a/src/BuildingHeatingSystem.js +++ b/src/BuildingHeatingSystem.js @@ -16,6 +16,7 @@ export default class BuildingHeatingSystem extends React.Component { 'Central forced-air system', 'Electric baseboard', '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', -- GitLab From e841eee66cfcecc0fe4f98856961271b1cac2591 Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Sun, 3 May 2020 12:34:39 -0400 Subject: [PATCH 17/29] Add comments --- src/App.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 3cb194cf5..79f887aae 100644 --- a/src/App.js +++ b/src/App.js @@ -764,25 +764,34 @@ 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'].next = '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'; @@ -790,14 +799,16 @@ class App extends React.Component { else { questions['buildingCoolingSystem'].next = 'churchCoolingSystemAge'; } - // Heating System + // 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) { 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' @@ -806,6 +817,7 @@ class App extends React.Component { } 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'; } @@ -816,6 +828,7 @@ class App extends React.Component { 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}); -- GitLab From cba1a49ae7d5a1a3a8681c409abdfe7f2ad6e26d Mon Sep 17 00:00:00 2001 From: Aizizi Yigaimu Date: Sun, 3 May 2020 13:20:58 -0400 Subject: [PATCH 18/29] Fix feedback issue on review page --- src/CompleteButtons.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/CompleteButtons.js diff --git a/src/CompleteButtons.js b/src/CompleteButtons.js new file mode 100644 index 000000000..68dedc9e1 --- /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 ( +
+ + + + + + + + +
+ ); + } +} -- GitLab From 5ed5054972b1a36a36ccdfc3f7ccec1efd6b6f8d Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Sun, 3 May 2020 13:35:36 -0400 Subject: [PATCH 19/29] Update styling for building heating system --- src/BuildingHeatingSystem.js | 50 +++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/src/BuildingHeatingSystem.js b/src/BuildingHeatingSystem.js index c00bf7478..1631d2e63 100644 --- a/src/BuildingHeatingSystem.js +++ b/src/BuildingHeatingSystem.js @@ -67,7 +67,7 @@ export default class BuildingHeatingSystem extends React.Component { render() { let miniSplitforCooling = '' miniSplitforCooling = (this.props.surveyId === 1 && this.state.answer === 100)? -
+
- { - this.props.answerIds.map((answerId, id) => { - return ( -
- - - - - -
- ); - }) - } - { miniSplitforCooling } + + { + this.props.answerIds.map((answerId, id) => { + return ( +
+ + + + + +
+ ); + }) + } + + + { miniSplitforCooling } +
-- GitLab From a0b727085a29d127b7b7663831c1687015adaf9e Mon Sep 17 00:00:00 2001 From: Aizizi Yigaimu Date: Sun, 3 May 2020 13:37:13 -0400 Subject: [PATCH 20/29] Fix feedback issue on review page --- src/ReviewAnswers.js | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/ReviewAnswers.js b/src/ReviewAnswers.js index 0f1d3e1a4..2e19c33f8 100644 --- a/src/ReviewAnswers.js +++ b/src/ReviewAnswers.js @@ -159,7 +159,27 @@ export default class ReviewAnswers extends React.Component {
: '' ); - + } else if (question === 'feedback') { + return ( +
+ + +
+ How did you first hear about us? +
+
+ {this.props.questions[question].answers[0]}
+
+ +
+ + this.editAnswer('feedback') } /> + +
+
+
+
+ ); } else { return (
@@ -184,24 +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') } /> - -
-
-
-
-- GitLab From f922dcdea26670bf381686d660dade437442b6c3 Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Sun, 3 May 2020 13:49:22 -0400 Subject: [PATCH 21/29] Store in the cooling system as well if heating system is minisplit and same system checked --- src/App.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 79f887aae..f7a1029ce 100644 --- a/src/App.js +++ b/src/App.js @@ -789,7 +789,7 @@ class App extends React.Component { // 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'].next = 'buildingFutureImprovement'; + 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)){ @@ -803,6 +803,13 @@ class App extends React.Component { 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 { -- GitLab From f033c133a3e66e08232bd8c2b1dc02a9a36fe51b Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Sun, 3 May 2020 13:54:53 -0400 Subject: [PATCH 22/29] Chenge building type name for churches --- src/BuildingTypes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BuildingTypes.js b/src/BuildingTypes.js index d8ae558d3..709801ec9 100644 --- a/src/BuildingTypes.js +++ b/src/BuildingTypes.js @@ -22,7 +22,7 @@ export default class BuildingTypes extends React.Component { 'Multi Family', 'Co-op', 'Mixed Use (Commercial / Residential)', - 'House of worship / Community Center', + 'House of worship / Religious Institute', 'Other' ]; } -- GitLab From 3127c86cb5be42c30d97539336580b63e4a4b23a Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Sun, 3 May 2020 14:28:10 -0400 Subject: [PATCH 23/29] Change fuel back button issue --- src/App.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index f7a1029ce..3de013e6a 100644 --- a/src/App.js +++ b/src/App.js @@ -821,7 +821,9 @@ class App extends React.Component { questions['heatingSystemAge'].prev = 'fuels' questions['buildingCoolingSystem'].prev = 'heatingSystemPlan' questions['buildingPastImprovement'].prev = 'churchCoolingSystemPlan' - + } + 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. -- GitLab From eaedc480f4771f337c4b244f0f51fd953c9ba536 Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Sun, 3 May 2020 14:33:56 -0400 Subject: [PATCH 24/29] Fix back button links --- src/App.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 3de013e6a..bd0b12f5d 100644 --- a/src/App.js +++ b/src/App.js @@ -798,6 +798,7 @@ class App extends React.Component { } 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){ @@ -820,7 +821,6 @@ class App extends React.Component { questions['fuels'].prev = 'buildingHeatingSystem' questions['heatingSystemAge'].prev = 'fuels' questions['buildingCoolingSystem'].prev = 'heatingSystemPlan' - questions['buildingPastImprovement'].prev = 'churchCoolingSystemPlan' } else{ questions['fuels'].prev = 'buildingTypes' @@ -829,6 +829,7 @@ class App extends React.Component { // 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'; -- GitLab From 0f35f22c2ee7a1122f20e6e043cb0fc4339f8f15 Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Sun, 3 May 2020 14:53:11 -0400 Subject: [PATCH 25/29] Change institue to Institution --- src/BuildingTypes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BuildingTypes.js b/src/BuildingTypes.js index 709801ec9..a55dad9a0 100644 --- a/src/BuildingTypes.js +++ b/src/BuildingTypes.js @@ -22,7 +22,7 @@ export default class BuildingTypes extends React.Component { 'Multi Family', 'Co-op', 'Mixed Use (Commercial / Residential)', - 'House of worship / Religious Institute', + 'House of worship / Religious Institution', 'Other' ]; } -- GitLab From fd6db0dc44ebb29157fc8717d6521921d44cc546 Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Sun, 3 May 2020 17:17:08 -0400 Subject: [PATCH 26/29] Solve missing values in review page for 2 church qns --- src/App.js | 1 - src/ChurchBuildingType.js | 2 +- src/ChurchHoursPerWeek.js | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/App.js b/src/App.js index 90d3d3a9d..84b9d4a7f 100644 --- a/src/App.js +++ b/src/App.js @@ -977,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; diff --git a/src/ChurchBuildingType.js b/src/ChurchBuildingType.js index a1dc0f290..e4fbeb42d 100644 --- a/src/ChurchBuildingType.js +++ b/src/ChurchBuildingType.js @@ -34,7 +34,7 @@ export default class ChurchBuildingType extends React.Component { label: "church-building-type" }); } - this.props.nextQuestion('churchBuildingType', this.names[this.state.answer], this.state.answer); + this.props.nextQuestion('churchBuildingType', this.names[this.props.answerIds.indexOf(this.state.answer)], this.state.answer); } chooseAnswer = (answer) => { diff --git a/src/ChurchHoursPerWeek.js b/src/ChurchHoursPerWeek.js index 35a9db2d4..b654053a1 100644 --- a/src/ChurchHoursPerWeek.js +++ b/src/ChurchHoursPerWeek.js @@ -35,7 +35,7 @@ export default class ChurchHoursPerWeek extends React.Component { label: "church-hours-per-week" }); } - this.props.nextQuestion('churchHoursPerWeek', this.names[this.state.answer], this.state.answer); + this.props.nextQuestion('churchHoursPerWeek', this.names[this.props.answerIds.indexOf(this.state.answer)], this.state.answer); } chooseAnswer = (answer) => { -- GitLab From a635185aa77b8320e37bfef95741754bfdac53b3 Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Sun, 3 May 2020 18:08:26 -0400 Subject: [PATCH 27/29] Convert radio button to checkbox --- src/BuildingHeatingSystem.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BuildingHeatingSystem.js b/src/BuildingHeatingSystem.js index 1631d2e63..ef399925d 100644 --- a/src/BuildingHeatingSystem.js +++ b/src/BuildingHeatingSystem.js @@ -70,7 +70,7 @@ export default class BuildingHeatingSystem extends React.Component {