@inseefr/lunatic 3.6.5 → 3.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/components/CheckboxGroup/CustomCheckboxGroup.d.ts +1 -1
  2. package/components/CheckboxGroup/CustomCheckboxGroup.js.map +1 -1
  3. package/components/Roundabout/CustomRoundabout.js +2 -2
  4. package/components/Roundabout/CustomRoundabout.js.map +1 -1
  5. package/components/Roundabout/roundabout.spec.js +22 -0
  6. package/components/Roundabout/roundabout.spec.js.map +1 -1
  7. package/components/shared/Checkbox/CheckboxOption.d.ts +4 -2
  8. package/components/shared/Checkbox/CheckboxOption.js.map +1 -1
  9. package/components/shared/Radio/RadioGroup.d.ts +1 -1
  10. package/components/shared/Radio/RadioGroup.js.map +1 -1
  11. package/esm/components/CheckboxGroup/CustomCheckboxGroup.d.ts +1 -1
  12. package/esm/components/CheckboxGroup/CustomCheckboxGroup.js.map +1 -1
  13. package/esm/components/Roundabout/CustomRoundabout.js +2 -2
  14. package/esm/components/Roundabout/CustomRoundabout.js.map +1 -1
  15. package/esm/components/Roundabout/roundabout.spec.js +22 -0
  16. package/esm/components/Roundabout/roundabout.spec.js.map +1 -1
  17. package/esm/components/shared/Checkbox/CheckboxOption.d.ts +4 -2
  18. package/esm/components/shared/Checkbox/CheckboxOption.js.map +1 -1
  19. package/esm/components/shared/Radio/RadioGroup.d.ts +1 -1
  20. package/esm/components/shared/Radio/RadioGroup.js.map +1 -1
  21. package/esm/use-lunatic/commons/compile-controls.js +25 -7
  22. package/esm/use-lunatic/commons/compile-controls.js.map +1 -1
  23. package/package.json +2 -1
  24. package/src/components/CheckboxGroup/CustomCheckboxGroup.tsx +1 -0
  25. package/src/components/Roundabout/CustomRoundabout.tsx +11 -1
  26. package/src/components/Roundabout/roundabout.spec.tsx +38 -0
  27. package/src/components/shared/Checkbox/CheckboxOption.tsx +3 -2
  28. package/src/components/shared/Radio/RadioGroup.tsx +1 -0
  29. package/src/stories/roundabout/roundabout.stories.tsx +13 -0
  30. package/src/stories/roundabout/sourceWithControl.json +599 -0
  31. package/src/use-lunatic/commons/compile-controls.ts +47 -11
  32. package/tsconfig.build.tsbuildinfo +1 -1
  33. package/use-lunatic/commons/compile-controls.js +24 -7
  34. package/use-lunatic/commons/compile-controls.js.map +1 -1
@@ -0,0 +1,599 @@
1
+ {
2
+ "$schema": "../../../lunatic-schema.json",
3
+ "maxPage": "6",
4
+ "cleaning": {
5
+ "PRENOM": {
6
+ "AGE": [
7
+ {
8
+ "shapeFrom": "PRENOM",
9
+ "expression": "not(not(PRENOM = \"Paul\"))",
10
+ "isAggregatorUsed": false
11
+ }
12
+ ],
13
+ "QUESTIONAV": [
14
+ {
15
+ "shapeFrom": "PRENOM",
16
+ "expression": "not(not(PRENOM = \"Paul\"))",
17
+ "isAggregatorUsed": false
18
+ }
19
+ ]
20
+ }
21
+ },
22
+ "resizing": {
23
+ "NBHAB": {
24
+ "size": "nvl(NBHAB,1)",
25
+ "variables": ["PRENOM"]
26
+ },
27
+ "PRENOM": {
28
+ "size": "count(PRENOM)",
29
+ "variables": ["AGE", "QUESTIONAV"]
30
+ }
31
+ },
32
+ "variables": [
33
+ {
34
+ "name": "SUM_AGE",
35
+ "dimension": 0,
36
+ "expression": {
37
+ "type": "VTL",
38
+ "value": "sum(AGE_N)"
39
+ },
40
+ "variableType": "CALCULATED",
41
+ "bindingDependencies": ["AGE_N", "AGE"]
42
+ },
43
+ {
44
+ "name": "AGE_N",
45
+ "dimension": 1,
46
+ "shapeFrom": ["PRENOM"],
47
+ "expression": {
48
+ "type": "VTL",
49
+ "value": "nvl(AGE,0)"
50
+ },
51
+ "variableType": "CALCULATED",
52
+ "iterationReference": "lyoigdda",
53
+ "bindingDependencies": ["AGE"]
54
+ },
55
+ {
56
+ "name": "ADR",
57
+ "variableType": "EXTERNAL"
58
+ },
59
+ {
60
+ "name": "NBHAB",
61
+ "values": {
62
+ "COLLECTED": null
63
+ },
64
+ "dimension": 0,
65
+ "variableType": "COLLECTED"
66
+ },
67
+ {
68
+ "name": "PRENOM",
69
+ "values": {
70
+ "COLLECTED": []
71
+ },
72
+ "dimension": 1,
73
+ "variableType": "COLLECTED",
74
+ "iterationReference": "lyoigdda"
75
+ },
76
+ {
77
+ "name": "AGE",
78
+ "values": {
79
+ "COLLECTED": []
80
+ },
81
+ "dimension": 1,
82
+ "variableType": "COLLECTED",
83
+ "iterationReference": "lyoigdda"
84
+ },
85
+ {
86
+ "name": "QUESTIONAV",
87
+ "values": {
88
+ "COLLECTED": []
89
+ },
90
+ "dimension": 1,
91
+ "variableType": "COLLECTED",
92
+ "iterationReference": "lyoigdda"
93
+ },
94
+ {
95
+ "name": "TESTCONTRO",
96
+ "values": {
97
+ "COLLECTED": null
98
+ },
99
+ "dimension": 0,
100
+ "variableType": "COLLECTED"
101
+ },
102
+ {
103
+ "name": "FILTER_RESULT_NBHAB",
104
+ "dimension": 0,
105
+ "expression": {
106
+ "type": "VTL",
107
+ "value": "true"
108
+ },
109
+ "variableType": "CALCULATED",
110
+ "isIgnoredByLunatic": true
111
+ },
112
+ {
113
+ "name": "FILTER_RESULT_PRENOM",
114
+ "dimension": 1,
115
+ "shapeFrom": ["PRENOM"],
116
+ "expression": {
117
+ "type": "VTL",
118
+ "value": "true"
119
+ },
120
+ "variableType": "CALCULATED",
121
+ "isIgnoredByLunatic": true,
122
+ "iterationReference": "lyoigdda"
123
+ },
124
+ {
125
+ "name": "FILTER_RESULT_AGE",
126
+ "dimension": 1,
127
+ "shapeFrom": ["PRENOM"],
128
+ "expression": {
129
+ "type": "VTL",
130
+ "value": "true"
131
+ },
132
+ "variableType": "CALCULATED",
133
+ "isIgnoredByLunatic": true,
134
+ "iterationReference": "lyoigdda"
135
+ },
136
+ {
137
+ "name": "FILTER_RESULT_QUESTIONAV",
138
+ "dimension": 1,
139
+ "shapeFrom": ["PRENOM"],
140
+ "expression": {
141
+ "type": "VTL",
142
+ "value": "true"
143
+ },
144
+ "variableType": "CALCULATED",
145
+ "isIgnoredByLunatic": true,
146
+ "iterationReference": "lyoigdda"
147
+ },
148
+ {
149
+ "name": "FILTER_RESULT_TESTCONTRO",
150
+ "dimension": 0,
151
+ "expression": {
152
+ "type": "VTL",
153
+ "value": "true"
154
+ },
155
+ "variableType": "CALCULATED",
156
+ "isIgnoredByLunatic": true
157
+ },
158
+ {
159
+ "name": "BOUCLE1_PROGRESS",
160
+ "values": {
161
+ "COLLECTED": []
162
+ },
163
+ "dimension": 1,
164
+ "variableType": "COLLECTED",
165
+ "iterationReference": "lyoigdda"
166
+ }
167
+ ],
168
+ "components": [
169
+ {
170
+ "id": "lst6jn38",
171
+ "page": "1",
172
+ "label": {
173
+ "type": "VTL",
174
+ "value": "\"I - \" || \"S1\""
175
+ },
176
+ "componentType": "Sequence",
177
+ "conditionFilter": {
178
+ "type": "VTL",
179
+ "value": "true"
180
+ }
181
+ },
182
+ {
183
+ "id": "question-lst71avf",
184
+ "page": "2",
185
+ "label": {
186
+ "type": "VTL|MD",
187
+ "value": "\"Combien de personnes ?\""
188
+ },
189
+ "components": [
190
+ {
191
+ "id": "lst71avf",
192
+ "max": 10,
193
+ "min": 1,
194
+ "page": "2",
195
+ "controls": [
196
+ {
197
+ "id": "lst71avf-format-borne-inf-sup",
198
+ "type": "SIMPLE",
199
+ "control": {
200
+ "type": "VTL",
201
+ "value": "not(not(isnull(NBHAB)) and (1>NBHAB or 10<NBHAB))"
202
+ },
203
+ "criticality": "ERROR",
204
+ "errorMessage": {
205
+ "type": "VTL|MD",
206
+ "value": "\" La valeur doit être comprise entre 1 et 10\""
207
+ },
208
+ "typeOfControl": "FORMAT"
209
+ },
210
+ {
211
+ "id": "lst71avf-format-decimal",
212
+ "type": "SIMPLE",
213
+ "control": {
214
+ "type": "VTL",
215
+ "value": "not(not(isnull(NBHAB)) and round(NBHAB,0)<>NBHAB)"
216
+ },
217
+ "criticality": "ERROR",
218
+ "errorMessage": {
219
+ "type": "VTL|MD",
220
+ "value": "\"Le nombre doit comporter au maximum 0 chiffre(s) après la virgule\""
221
+ },
222
+ "typeOfControl": "FORMAT"
223
+ },
224
+ {
225
+ "id": "lst71avf-CI-0",
226
+ "type": "ROW",
227
+ "control": {
228
+ "type": "VTL",
229
+ "value": "not(nvl($TAB13$,0) > 0 and nvl($TAB12$,0) > 0 and nvl($TAB13$,0) > nvl($TAB12$,0))"
230
+ },
231
+ "criticality": "WARN",
232
+ "errorMessage": {
233
+ "type": "VTL|MD",
234
+ "value": "\"Le CA export doit être inférieur au CA\""
235
+ },
236
+ "typeOfControl": "CONSISTENCY"
237
+ }
238
+ ],
239
+ "decimals": 0,
240
+ "response": {
241
+ "name": "NBHAB"
242
+ },
243
+ "description": {
244
+ "type": "TXT",
245
+ "value": "Format attendu : un nombre entre 1 et 10"
246
+ },
247
+ "isMandatory": false,
248
+ "componentType": "InputNumber"
249
+ }
250
+ ],
251
+ "componentType": "Question",
252
+ "conditionFilter": {
253
+ "type": "VTL",
254
+ "value": "true"
255
+ }
256
+ },
257
+ {
258
+ "id": "lyoigdda",
259
+ "page": "3",
260
+ "depth": 1,
261
+ "lines": {
262
+ "max": {
263
+ "type": "VTL",
264
+ "value": "nvl(NBHAB,1)"
265
+ },
266
+ "min": {
267
+ "type": "VTL",
268
+ "value": "nvl(NBHAB,1)"
269
+ }
270
+ },
271
+ "components": [
272
+ {
273
+ "id": "lt72wmbk",
274
+ "page": "3",
275
+ "label": {
276
+ "type": "VTL|MD",
277
+ "value": "\"Lister les prénoms\""
278
+ },
279
+ "description": {
280
+ "type": "VTL|MD",
281
+ "value": "\"On n'interrogera pas les prénoms AA\""
282
+ },
283
+ "componentType": "Subsequence",
284
+ "conditionFilter": {
285
+ "type": "VTL",
286
+ "value": "true"
287
+ }
288
+ },
289
+ {
290
+ "id": "question-lt72y80j",
291
+ "page": "3",
292
+ "label": {
293
+ "type": "VTL|MD",
294
+ "value": "\"Prénom de l'individu \" || cast(GLOBAL_ITERATION_INDEX,string) || \" qui habite à \" || ADR "
295
+ },
296
+ "components": [
297
+ {
298
+ "id": "lt72y80j",
299
+ "page": "3",
300
+ "response": {
301
+ "name": "PRENOM"
302
+ },
303
+ "maxLength": 249,
304
+ "isMandatory": false,
305
+ "componentType": "Input"
306
+ }
307
+ ],
308
+ "componentType": "Question",
309
+ "conditionFilter": {
310
+ "type": "VTL",
311
+ "value": "true"
312
+ }
313
+ }
314
+ ],
315
+ "iterations": {
316
+ "type": "VTL",
317
+ "value": "count(PRENOM)"
318
+ },
319
+ "componentType": "Loop",
320
+ "paginatedLoop": false,
321
+ "conditionFilter": {
322
+ "type": "VTL",
323
+ "value": "true"
324
+ },
325
+ "loopDependencies": ["NBHAB", "PRENOM"]
326
+ },
327
+ {
328
+ "id": "lypxwut2",
329
+ "item": {
330
+ "label": {
331
+ "type": "VTL|MD",
332
+ "value": "PRENOM || \", qui est l'individu n°\" || cast(GLOBAL_ITERATION_INDEX,string) || \" \" "
333
+ },
334
+ "disabled": {
335
+ "type": "VTL",
336
+ "value": "not(not(PRENOM = \"Paul\"))"
337
+ },
338
+ "description": {
339
+ "type": "VTL|MD",
340
+ "value": "if PRENOM=\"Paul\" then \"Individu non interrogé car s'appelle Paul\" else \"\" "
341
+ }
342
+ },
343
+ "page": "4",
344
+ "label": {
345
+ "type": "VTL|MD",
346
+ "value": "\"Test de rond point\""
347
+ },
348
+ "locked": false,
349
+ "controls": [
350
+ {
351
+ "id": "lypxwut2-CI-1",
352
+ "type": "SIMPLE",
353
+ "control": {
354
+ "type": "VTL",
355
+ "value": "not(5 in AGE_N)"
356
+ },
357
+ "criticality": "WARN",
358
+ "errorMessage": {
359
+ "type": "VTL|MD",
360
+ "value": "\"quelqu'un a 5 ans !!!\""
361
+ },
362
+ "typeOfControl": "CONSISTENCY"
363
+ },
364
+ {
365
+ "id": "lypxwut2-CI-2",
366
+ "type": "SIMPLE",
367
+ "control": {
368
+ "type": "VTL",
369
+ "value": "not(SUM_AGE > 20)"
370
+ },
371
+ "criticality": "WARN",
372
+ "errorMessage": {
373
+ "type": "VTL|MD",
374
+ "value": "\"la somme des ages des individus est supérieure à 20 ans.\""
375
+ },
376
+ "typeOfControl": "CONSISTENCY"
377
+ },
378
+ {
379
+ "id": "lypxwut2-CI-0",
380
+ "type": "ROW",
381
+ "control": {
382
+ "type": "VTL",
383
+ "value": "not(AGE_N > 35)"
384
+ },
385
+ "criticality": "WARN",
386
+ "errorMessage": {
387
+ "type": "VTL|MD",
388
+ "value": "\"L'individu \" || PRENOM || \" a plus de 35 ans.\" "
389
+ },
390
+ "typeOfControl": "CONSISTENCY"
391
+ }
392
+ ],
393
+ "components": [
394
+ {
395
+ "id": "lyoiu1hr",
396
+ "page": "4.1",
397
+ "label": {
398
+ "type": "VTL",
399
+ "value": "\"II - \" || \"S2 \" || PRENOM "
400
+ },
401
+ "componentType": "Sequence",
402
+ "conditionFilter": {
403
+ "type": "VTL",
404
+ "value": "true"
405
+ }
406
+ },
407
+ {
408
+ "id": "question-lyoir96l",
409
+ "page": "4.2",
410
+ "label": {
411
+ "type": "VTL|MD",
412
+ "value": "\"Age de \" || nvl(PRENOM,\"cet individu sans prénom\") "
413
+ },
414
+ "components": [
415
+ {
416
+ "id": "lyoir96l",
417
+ "max": 99,
418
+ "min": 1,
419
+ "page": "4.2",
420
+ "controls": [
421
+ {
422
+ "id": "lyoir96l-mandatory-check",
423
+ "type": "SIMPLE",
424
+ "control": {
425
+ "type": "VTL",
426
+ "value": "not(isnull(AGE))"
427
+ },
428
+ "criticality": "ERROR",
429
+ "errorMessage": {
430
+ "type": "TXT",
431
+ "value": "La réponse à cette question est obligatoire."
432
+ },
433
+ "typeOfControl": "MANDATORY"
434
+ },
435
+ {
436
+ "id": "lyoir96l-format-borne-inf-sup",
437
+ "type": "SIMPLE",
438
+ "control": {
439
+ "type": "VTL",
440
+ "value": "not(not(isnull(AGE)) and (1>AGE or 99<AGE))"
441
+ },
442
+ "criticality": "ERROR",
443
+ "errorMessage": {
444
+ "type": "VTL|MD",
445
+ "value": "\" La valeur doit être comprise entre 1 et 99\""
446
+ },
447
+ "typeOfControl": "FORMAT"
448
+ },
449
+ {
450
+ "id": "lyoir96l-format-decimal",
451
+ "type": "SIMPLE",
452
+ "control": {
453
+ "type": "VTL",
454
+ "value": "not(not(isnull(AGE)) and round(AGE,0)<>AGE)"
455
+ },
456
+ "criticality": "ERROR",
457
+ "errorMessage": {
458
+ "type": "VTL|MD",
459
+ "value": "\"Le nombre doit comporter au maximum 0 chiffre(s) après la virgule\""
460
+ },
461
+ "typeOfControl": "FORMAT"
462
+ }
463
+ ],
464
+ "decimals": 0,
465
+ "response": {
466
+ "name": "AGE"
467
+ },
468
+ "description": {
469
+ "type": "TXT",
470
+ "value": "Format attendu : un nombre entre 1 et 99"
471
+ },
472
+ "isMandatory": true,
473
+ "componentType": "InputNumber"
474
+ }
475
+ ],
476
+ "componentType": "Question",
477
+ "conditionFilter": {
478
+ "type": "VTL",
479
+ "value": "true"
480
+ }
481
+ },
482
+ {
483
+ "id": "question-mcd3qlyd",
484
+ "page": "4.3",
485
+ "label": {
486
+ "type": "VTL|MD",
487
+ "value": "\"question avec contrôle non bloquant\""
488
+ },
489
+ "components": [
490
+ {
491
+ "id": "mcd3qlyd",
492
+ "page": "4.3",
493
+ "controls": [
494
+ {
495
+ "id": "mcd3qlyd-CI-0",
496
+ "type": "SIMPLE",
497
+ "control": {
498
+ "type": "VTL",
499
+ "value": "not(true)"
500
+ },
501
+ "criticality": "WARN",
502
+ "errorMessage": {
503
+ "type": "VTL|MD",
504
+ "value": "\"contrôle non bloquant\""
505
+ },
506
+ "typeOfControl": "CONSISTENCY"
507
+ }
508
+ ],
509
+ "response": {
510
+ "name": "QUESTIONAV"
511
+ },
512
+ "maxLength": 249,
513
+ "isMandatory": false,
514
+ "componentType": "Input"
515
+ }
516
+ ],
517
+ "componentType": "Question",
518
+ "conditionFilter": {
519
+ "type": "VTL",
520
+ "value": "true"
521
+ }
522
+ }
523
+ ],
524
+ "iterations": {
525
+ "type": "VTL",
526
+ "value": "count(PRENOM)"
527
+ },
528
+ "description": {
529
+ "type": "VTL|MD",
530
+ "value": "\"On n'interroge pas les prénoms A\""
531
+ },
532
+ "componentType": "Roundabout",
533
+ "conditionFilter": {
534
+ "type": "VTL",
535
+ "value": "true"
536
+ },
537
+ "progressVariable": "BOUCLE1_PROGRESS"
538
+ },
539
+ {
540
+ "id": "m4qtvjda",
541
+ "page": "5",
542
+ "label": {
543
+ "type": "VTL",
544
+ "value": "\"III - \" || \"FIN\""
545
+ },
546
+ "componentType": "Sequence",
547
+ "conditionFilter": {
548
+ "type": "VTL",
549
+ "value": "true"
550
+ }
551
+ },
552
+ {
553
+ "id": "question-m4qtkzve",
554
+ "page": "6",
555
+ "label": {
556
+ "type": "VTL|MD",
557
+ "value": "\"test Controle - \" || cast(SUM_AGE,string) "
558
+ },
559
+ "components": [
560
+ {
561
+ "id": "m4qtkzve",
562
+ "page": "6",
563
+ "controls": [
564
+ {
565
+ "id": "m4qtkzve-CI-0",
566
+ "type": "SIMPLE",
567
+ "control": {
568
+ "type": "VTL",
569
+ "value": "not(sum(AGE) > 10)"
570
+ },
571
+ "criticality": "WARN",
572
+ "errorMessage": {
573
+ "type": "VTL|MD",
574
+ "value": "\"la somme des ages des individus est supérieure à 10 ans.\""
575
+ },
576
+ "typeOfControl": "CONSISTENCY"
577
+ }
578
+ ],
579
+ "response": {
580
+ "name": "TESTCONTRO"
581
+ },
582
+ "maxLength": 249,
583
+ "isMandatory": false,
584
+ "componentType": "Input"
585
+ }
586
+ ],
587
+ "componentType": "Question",
588
+ "conditionFilter": {
589
+ "type": "VTL",
590
+ "value": "true"
591
+ }
592
+ }
593
+ ],
594
+ "pagination": "question",
595
+ "componentType": "Questionnaire",
596
+ "enoCoreVersion": "3.52.1",
597
+ "generatingDate": "26-06-2025 08:45:40",
598
+ "lunaticModelVersion": "5.5.0"
599
+ }
@@ -24,13 +24,28 @@ type InterpretedLoopComponent = DeepTranslateExpression<
24
24
  componentType: 'Loop' | 'RosterForLoop';
25
25
  }
26
26
  >;
27
+ type InterpretedRoundaboutComponent = DeepTranslateExpression<
28
+ ComponentDefinition & {
29
+ componentType: 'Roundabout';
30
+ }
31
+ >;
27
32
 
33
+ /**
34
+ * Check if the component is a Loop or a RosterForLoop
35
+ */
28
36
  const isLoopComponent = (
29
37
  component: ComponentDefinition | InterpretedComponent
30
38
  ): component is InterpretedLoopComponent => {
31
- return ['Loop', 'RosterForLoop', 'Roundabout'].includes(
32
- component.componentType
33
- );
39
+ return ['Loop', 'RosterForLoop'].includes(component.componentType);
40
+ };
41
+
42
+ /**
43
+ * Check if the component is a Roundabout
44
+ */
45
+ const isRoundaboutComponent = (
46
+ component: ComponentDefinition | InterpretedComponent
47
+ ): component is InterpretedRoundaboutComponent => {
48
+ return component.componentType === 'Roundabout';
34
49
  };
35
50
 
36
51
  const isQuestionComponent = (
@@ -63,7 +78,11 @@ function checkComponents(
63
78
  }
64
79
  }
65
80
 
66
- // For loop, inspect children
81
+ // For Loop and RosterForLoop, inspect iterations for row controls
82
+ if (isRoundaboutComponent(component))
83
+ errors = checkRoundabout(state, component, errors);
84
+
85
+ // For Loop and RosterForLoop, inspect children
67
86
  if (isLoopComponent(component))
68
87
  errors = checkLoop(state, component, errors);
69
88
 
@@ -75,6 +94,22 @@ function checkComponents(
75
94
  return errors;
76
95
  }
77
96
 
97
+ function checkRoundabout(
98
+ state: StateForControls,
99
+ component: InterpretedRoundaboutComponent,
100
+ errors: Record<string, LunaticError[]>
101
+ ) {
102
+ const rowControls = component.controls?.filter((c) => c.type === 'ROW');
103
+ if (rowControls?.length) {
104
+ errors = checkComponentInLoop(
105
+ state,
106
+ { ...component, controls: rowControls },
107
+ errors
108
+ );
109
+ }
110
+ return errors;
111
+ }
112
+
78
113
  function checkLoop(
79
114
  state: StateForControls,
80
115
  component: InterpretedLoopComponent,
@@ -101,14 +136,12 @@ function checkControls(
101
136
  ): LunaticError[] {
102
137
  return controls
103
138
  .map((control) => {
104
- switch (control.type) {
105
- case 'roundabout':
106
- return checkRoundaboutControl(control, executeExpression);
107
- default:
108
- return checkBaseControl(control, executeExpression, pager);
139
+ if (control.type === 'roundabout') {
140
+ return checkRoundaboutControl(control, executeExpression);
109
141
  }
142
+ return checkBaseControl(control, executeExpression, pager);
110
143
  })
111
- .filter((error) => error !== undefined) as LunaticError[];
144
+ .filter((error) => error !== undefined);
112
145
  }
113
146
 
114
147
  /**
@@ -152,7 +185,10 @@ function computeIterations(
152
185
  */
153
186
  function checkComponentInLoop(
154
187
  state: StateForControls,
155
- component: ComponentDefinition | InterpretedLoopComponent,
188
+ component:
189
+ | ComponentDefinition
190
+ | InterpretedLoopComponent
191
+ | InterpretedRoundaboutComponent,
156
192
  errors: Record<string, LunaticError[]>
157
193
  ): Record<string, LunaticError[]> {
158
194
  // For Question, loop over children