Skip to content

Commit

Permalink
for conditional survey eval, spread trip props
Browse files Browse the repository at this point in the history
GIven that the configs are JSON and we can only give the "showsIf" conditions as strings, it will be annoying if they get too lengthy.
This will allow us to reference trip properties directly (e.g. "end_loc" instead of "tlEntry.end_loc") which is a bit more concise and readable.
  • Loading branch information
JGreenlee committed Feb 12, 2024
1 parent 11ef42a commit 5c9b307
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion www/js/survey/enketo/conditionalSurveys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function getSurveyForTimelineEntry(
for (let surveyConfig of tripLabelConfig) {
if (!surveyConfig.showsIf) return surveyConfig; // survey shows unconditionally
const scope = {
tlEntry,
...tlEntry,
...conditionalSurveyFunctions,
};
try {
Expand Down

0 comments on commit 5c9b307

Please sign in to comment.