You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
segment section: have a single object create setion and widget config
part of #501
Define 2 interfaces: `SectionConfigFactory` and `WidgetConfigFactory`,
the former extending the latter. Config objects that provide more than
one widget can use classes implementing those factories to return all
the required widgets.
The `sectionSegments`, as well as `groupPersonTrips` and `groupSegments`
use this pattern to advertise all their widgets and configs.
The demo_survey platform now gets the sections and widgets from a single
`questionnaire.ts` file, which, for the segment section, now use the
`SegmentsSectionFactory` to get all the builtin section config and
widgets. Builtin widgets do not have to be added to the `segments.tsx`
file anymore.
Copy file name to clipboardExpand all lines: example/demo_survey/src/survey/helper.ts
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,7 @@ import { Mode } from 'evolution-common/lib/services/odSurvey/types';
22
22
// Configuration for the segments section
23
23
// FIXME As sections and their widgets become more builtin, this thould be moved elsewhere. For now, it just needs to be available for both widgets.ts and sections.ts files
// FIXME Workaround to satisfy the completion percentage calculation that expects sections to be defined in their order of display in the object (see https://github.com/chairemobilite/evolution/issues/1024)
Copy file name to clipboardExpand all lines: packages/evolution-common/src/services/questionnaire/sections/common/__tests__/widgetsSwitchPerson.test.ts
0 commit comments