chairemobilite / evolution

Online survey platform for travel survey
MIT License
4 stars 9 forks source link

demo_survey: section not marked as completed in the SectionNav #787

Closed tahini closed 1 day ago

tahini commented 2 days ago

When the SectionNav component was moved to typescript, the previous section completion status was modified for this: !!completedStatusBySectionShortname[previousSection]. But when the previous Section is hidden in nav, it does not have a completion status so this becomes false instead of undefined effectively marking the section as disabled forever and ever.

This cause the unit tests to fail.

While investigating this, we observe that hiddenInNav: true is always accompanied by a parentSection property to specify, essentially making it a sub-section of the parent section. Should we force this in the type, making the presence of the parentSection property synonym of hiddenInNav and remove this last property?

samuel-duhaime commented 2 days ago

@tahini Yes, we can do that. I have no objections.

While investigating this, we observe that hiddenInNav: true is always accompanied by a parentSection property to specify, essentially making it a sub-section of the parent section. Should we force this in the type, making the presence of the parentSection property synonym of hiddenInNav and remove this last property?