Skip to content

Commit

Permalink
Revert "Update survey conditional render rules"
Browse files Browse the repository at this point in the history
This reverts commit 43836a0.
  • Loading branch information
Andrewy-gh committed Dec 6, 2024
1 parent 4d8d68b commit 283bc5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ const ConditionalQuestion = ({
});

useEffect(() => {
if (rule && !rule.answers.includes(watchedValue)) {
if (rule && watchedValue !== rule.answer) {
setValue(id.toString(), formDefault[id]);
}
}, [watchedValue, rule, id, setValue, formDefault]);

if (rule && !rule.answers.includes(watchedValue)) {
if (rule && watchedValue !== rule.answer) {
return null;
}

Expand Down
60 changes: 1 addition & 59 deletions frontend/front/src/util/surveyUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,62 +83,4 @@ export const surveyAnswersToArray = (answers) => {
}, {});
};

export const surveyRenderRules = {
1: null,
2: null,
3: null,
4: null,
5: {
question: 4,
answers: [
"No - heard of them but have not considered them for either",
"No answer - Not Available",
],
},
6: {
question: 4,
answers: [
"Yes, for heating, not for cooling",
"Yes for cooling, not for heating",
"Yes, for both",
],
},
7: {
question: 6,
answers: [
"Basic research & Looked at a website",
"Decided on a plan",
"Contacted installers & Got quotes",
"Other",
],
},
8: null,
9: { question: 8, answers: ["Yes"] },
10: {
question: 9,
answers: [
"Talked on the phone",
"Scheduled a Mass Save visit",
"Had a Mass Save visit",
"Other",
],
},
11: { question: 8, answers: ["No"] },
12: {
question: 11,
answers: ["ABCD", "RISE", "Homeworks Energy", "CET", "ClearResult"],
},
13: null,
14: { question: 13, answers: ["No"] },
15: null,
16: null,
17: null,
18: null,
19: null,
20: null,
21: null,
22: null,
23: null,
24: null,
25: null,
};
export const surveyRenderRules = {};

0 comments on commit 283bc5a

Please sign in to comment.