diff --git a/.env b/.env deleted file mode 100644 index 8593f5822dd9dc7f3bda4ba40a2d1f08cfd122ae..0000000000000000000000000000000000000000 --- a/.env +++ /dev/null @@ -1,7 +0,0 @@ -REACT_APP_MAPBOX_TOKEN=pk.eyJ1IjoiYmxvY3Bvd2VyIiwiYSI6ImNqNDdhZ2o2czAwdDcycXJ1YzZ6MHZlNHoifQ.fRQhMFfCCyDk78RI5QD4ow -# Environment -ENVIRONMENT=local - -# Services -REACT_APP_BLOCLINK_URL=http://0.0.0.0:5410 -SKIP_PREFLIGHT_CHECK=true diff --git a/.gitignore b/.gitignore index 3797cabdbe367899399cac0a0db1a3c530bba3c8..7b4b0f71462fd6bc8966c1c55969c2890f88c0b7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # Node Modules node_modules/* -.env +.env* # Elastic Beanstalk Files # .elasticbeanstalk/* # !.elasticbeanstalk/*.cfg.yml diff --git a/src/BuildingCoolingSystem.js b/src/BuildingCoolingSystem.js index b1c801acccefb16f078de041fb220b52ac90a268..350b0485cda5054200a9b26e2f4000415217bd11 100644 --- a/src/BuildingCoolingSystem.js +++ b/src/BuildingCoolingSystem.js @@ -47,7 +47,7 @@ export default class BuildingCoolingSystem extends React.Component { { this.props.answerIds.map((answerId, id) => { return ( -
+
-
+
diff --git a/src/BuildingFutureWaterImprovement.js b/src/BuildingFutureWaterImprovement.js deleted file mode 100644 index 135fa35c22b6cc535c410067fb257f379d48f7f7..0000000000000000000000000000000000000000 --- a/src/BuildingFutureWaterImprovement.js +++ /dev/null @@ -1,345 +0,0 @@ -import React from "react"; -import { Row, Col, Button, Input } from 'reactstrap'; -import './index.css'; -import { yieldExpression } from "@babel/types"; - - -export default class BuildingWaterImprovement extends React.Component { - constructor(props) { - super(props); - this.state = { - form: { - newHeatingSystem: { - questionId: 35, - checked: !(this.props.questions[0].answer === 2 || this.props.questions[0].answer === "No"), - answer: this.props.questions[0].value, - }, - newCoolingSystem: { - questionId: 36, - checked: !(this.props.questions[1].answer === 2 || this.props.questions[1].answer === "No"), - answer: this.props.questions[1].value, - }, - newControl: { questionId: 37, checked: this.props.questions[2].answer === "Yes"}, - convertHeatingFuel: { questionId: 38, checked: this.props.questions[3].answer === "Yes" }, - convertHeatingSystem: { questionId: 39, checked: this.props.questions[4].answer === "Yes" }, - newDomesticHotwaterSystem: { questionId: 40, checked: this.props.questions[5].answer === "Yes" }, - addInsulation: { questionId: 41, checked: this.props.questions[6].answer === "Yes" }, - airSealBuildingEnvelope: { questionId: 42, checked: this.props.questions[7].answer === "Yes" }, - newWindows: { questionId: 43, checked: this.props.questions[8].answer === "Yes" }, - newRoof: { questionId: 44, checked: this.props.questions[9].answer === "Yes" }, - solarPanels: { questionId: 45, checked: this.props.questions[10].answer === "Yes" }, - toilets: { questionId: 46, checked: this.props.questions[11].answer === "Yes" }, - lowFlowShowerheadsFaucets: { questionId: 47, checked: this.props.questions[12].answer === "Yes" }, - ledLighting: { questionId: 48, checked: this.props.questions[13].answer === "Yes" }, - other: { questionId: 49, checked: this.props.questions[14].answer === "Yes" }, - none: { questionId: 50, checked: this.props.questions[15].answer === "Yes" }, - notSure: { questionId: 51, checked: this.props.questions[16].answer === "Yes" } - } - }; - - this.heatingSystemNames = [ - 'Central steam system', - 'Central hydronic (hot water) system', - 'Central forced-air system', - 'Electric baseboard', - 'Individual heat pumps', - 'I don\'t have a heating system', - 'I\'m not sure', - 'Other', - ]; - this.coolingSystemNames = [ - 'Window A/C units', - 'PTAC units', - 'Rooftop air conditioning units', - 'Central chiller plant and fan coil units', - 'Mini split heat pump systems', - 'I don\'t have a cooling system', - 'VRF', - 'Other', - 'I\'m not sure', - ]; - - this.nameMapping = { - 1 : 'Yes', - 2: 'No', - 96: 'Central steam system', - 97: 'Central hydronic (hot water) system', - 98: 'Central forced-air system', - 99: 'Electric baseboard', - 100: 'Individual heat pumps', - 101: 'I don\'t have a heating system', - 33: 'I\'m not sure', - 12: 'Other', - 102: 'Window A/C units', - 103: 'PTAC units', - 104: 'Rooftop air conditioning units', - 105: 'Central chiller plant and fan coil units', - 106: 'Mini split heat pump systems', - 107: 'I don\'t have a cooling system', - 108: 'VRF', - }; - } - - prevQuestion = () => { - this.props.prevQuestion('buildingFutureWaterImprovement'); - } - - nextQuestion = () => { - const answerIds = this.getAnswerIds(); - this.props.nextQuestion( - 'buildingFutureWaterImprovement', - answerIds.map(answerId => this.nameMapping[answerId]), - answerIds, - ); - } - - getAnswerIds = () => { - const answerIds = []; - Object.values(this.state.form).forEach(question => { - if (question.answer === undefined) { - answerIds.push(question.checked ? 1 : 2); - } else { - answerIds.push(question.answer === "" ? 2 : parseInt(question.answer, 10)); - } - }); - return answerIds; - } - - checkAnswer = (answerName) => { - let form = this.state.form; - form[answerName]['checked'] = !this.state.form[answerName].checked; - form[answerName]['answer'] = this.state.form[answerName].checked ? 1 : 2 - this.setState({ form }); - } - - handleInput = (answerName, event) => { - let form = this.state.form; - form[answerName]['answer'] = event.target.value; - this.setState({ form }); - } - - render() { - let disabled = Object.values(this.state.form).filter(val => val.checked === true).length === 0; - - if(this.state.form.newHeatingSystem.checked && [0, 1].includes(this.state.form.newHeatingSystem.answer)) { - disabled = true; - } - if(this.state.form.newCoolingSystem.checked && [0, 1].includes(this.state.form.newCoolingSystem.answer)) { - disabled = true; - } - - const generalDisabled = Object.keys(this.state.form).filter(key => this.state.form['none'].checked || this.state.form['notSure'].checked).length > 0 ? true : false; - const noneDisabled = Object.keys(this.state.form).filter(key => key !== 'none' && this.state.form[key].checked).length > 0 ? true : false; - const notSureDisabled = Object.keys(this.state.form).filter(key => key !== 'notSure' && this.state.form[key].checked).length > 0 ? true : false; - - return ( -
-
- Any Energy or Water Improvements within coming year or so? -
-
- Check all that apply -
-
- - -
- this.checkAnswer('newHeatingSystem')} /> Install a new heating system - { - this.state.form.newHeatingSystem.checked && - this.handleInput('newHeatingSystem', e)} - disabled={generalDisabled} - > - - { - this.props.questions[17].answerIds.map((answerId, id) => { - return ( - - ); - }) - } - - } -
-
- this.checkAnswer('newCoolingSystem')} /> Install a new cooling system - { - this.state.form.newCoolingSystem.checked && - this.handleInput('newCoolingSystem', e)} - disabled={generalDisabled} - > - - { - this.props.questions[18].answerIds.map((answerId, id) => { - return ( - - ); - }) - } - - } -
-
- this.checkAnswer('newControl')} - disabled={generalDisabled} - /> Install new controls -
-
- this.checkAnswer('convertHeatingFuel')} - disabled={generalDisabled} - /> Convert Heating Fuel -
-
- this.checkAnswer('convertHeatingSystem')} - disabled={generalDisabled} - /> Convert Heating System -
-
- this.checkAnswer('newDomesticHotwaterSystem')} - disabled={generalDisabled} - /> Install new domestic hotwater system -
-
- this.checkAnswer('addInsulation')} - disabled={generalDisabled} - /> Add Insulation -
-
- this.checkAnswer('airSealBuildingEnvelope')} - disabled={generalDisabled} - /> Air seal the building envelope -
-
- this.checkAnswer('newWindows')} - disabled={generalDisabled} - /> Install New Windows -
- - -
- this.checkAnswer('newRoof')} - disabled={generalDisabled} - /> Install New roof -
-
- this.checkAnswer('solarPanels')} - disabled={generalDisabled} - /> Install Solar Panels -
-
- this.checkAnswer('toilets')} - disabled={generalDisabled} - /> Install Toilets -
-
- this.checkAnswer('lowFlowShowerheadsFaucets')} - disabled={generalDisabled} - /> Low flow showerheads and faucets -
-
- this.checkAnswer('ledLighting')} - disabled={generalDisabled} - /> Install LED lighting -
-
- this.checkAnswer('other')} - disabled={generalDisabled} - /> Other -
-
- this.checkAnswer('none')} - disabled={noneDisabled} - /> None -
-
- this.checkAnswer('notSure')} - disabled={notSureDisabled} - /> I'm not sure -
- -
-
- - - - {'<'} Back - - - - - - -
- ); - } -} diff --git a/src/BuildingHeatingSystem.js b/src/BuildingHeatingSystem.js index c1d9aeb642573b3b7d1a351526c6885163d25c14..dc1f7d1e58a1c350711cad8a147fc7d87eb73f95 100644 --- a/src/BuildingHeatingSystem.js +++ b/src/BuildingHeatingSystem.js @@ -46,7 +46,7 @@ export default class BuildingHeatingSystem extends React.Component { { this.props.answerIds.map((answerId, id) => { return ( -
+