@inseefr/lunatic 3.5.1 → 3.5.3
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.
- package/components/FilterDescription/FilterDescription.d.ts +5 -7
- package/components/FilterDescription/FilterDescription.js +10 -3
- package/components/FilterDescription/FilterDescription.js.map +1 -1
- package/components/InputNumber/InputNumber.js +2 -2
- package/components/InputNumber/InputNumber.js.map +1 -1
- package/components/InputNumber/InputNumberThousand.d.ts +2 -1
- package/components/InputNumber/InputNumberThousand.js +14 -6
- package/components/InputNumber/InputNumberThousand.js.map +1 -1
- package/components/library.d.ts +2 -4
- package/components/shared/HOC/slottableComponent.d.ts +2 -0
- package/components/shared/HOC/slottableComponent.js.map +1 -1
- package/esm/components/FilterDescription/FilterDescription.d.ts +5 -7
- package/esm/components/FilterDescription/FilterDescription.js +8 -1
- package/esm/components/FilterDescription/FilterDescription.js.map +1 -1
- package/esm/components/InputNumber/InputNumber.js +2 -2
- package/esm/components/InputNumber/InputNumber.js.map +1 -1
- package/esm/components/InputNumber/InputNumberThousand.d.ts +2 -1
- package/esm/components/InputNumber/InputNumberThousand.js +14 -6
- package/esm/components/InputNumber/InputNumberThousand.js.map +1 -1
- package/esm/components/library.d.ts +2 -4
- package/esm/components/shared/HOC/slottableComponent.d.ts +2 -0
- package/esm/components/shared/HOC/slottableComponent.js.map +1 -1
- package/esm/type.source.d.ts +5 -1
- package/esm/use-lunatic/commons/fill-components/fill-component.spec.d.ts +1 -0
- package/esm/use-lunatic/commons/fill-components/fill-component.spec.js +485 -0
- package/esm/use-lunatic/commons/fill-components/fill-component.spec.js.map +1 -0
- package/esm/use-lunatic/commons/fill-components/fill-components.d.ts +3 -3
- package/esm/use-lunatic/commons/fill-components/fill-components.js +29 -5
- package/esm/use-lunatic/commons/fill-components/fill-components.js.map +1 -1
- package/esm/use-lunatic/props/getComponentTypeProps.d.ts +4 -4
- package/esm/use-lunatic/props/getComponentTypeProps.js +1 -1
- package/esm/use-lunatic/props/getComponentTypeProps.js.map +1 -1
- package/esm/use-lunatic/props/propOptions.d.ts +1 -1
- package/esm/use-lunatic/props/propOptions.js +5 -3
- package/esm/use-lunatic/props/propOptions.js.map +1 -1
- package/esm/use-lunatic/props/propOptions.spec.js +100 -2
- package/esm/use-lunatic/props/propOptions.spec.js.map +1 -1
- package/esm/use-lunatic/reducer/reducerInitializer.d.ts +2 -1
- package/esm/use-lunatic/reducer/reducerInitializer.js +3 -3
- package/esm/use-lunatic/reducer/reducerInitializer.js.map +1 -1
- package/esm/use-lunatic/replace-component-sequence.d.ts +1 -1
- package/esm/use-lunatic/type.d.ts +3 -0
- package/esm/use-lunatic/use-lunatic.js +3 -1
- package/esm/use-lunatic/use-lunatic.js.map +1 -1
- package/package.json +8 -2
- package/src/components/FilterDescription/FilterDescription.tsx +24 -13
- package/src/components/InputNumber/InputNumber.tsx +2 -0
- package/src/components/InputNumber/InputNumberThousand.tsx +13 -5
- package/src/components/shared/HOC/slottableComponent.tsx +2 -0
- package/src/stories/behaviour/paste/test.stories.jsx +5 -0
- package/src/stories/filter-description/filter-description.stories.jsx +7 -3
- package/src/stories/loop/roster-for-loop.stories.jsx +1 -4
- package/src/stories/loop/source-roster.json +65 -2
- package/src/stories/utils/default-arg-types.js +1 -1
- package/src/stories/utils/orchestrator.jsx +3 -3
- package/src/type.source.ts +6 -1
- package/src/use-lunatic/commons/fill-components/fill-component.spec.ts +581 -0
- package/src/use-lunatic/commons/fill-components/fill-components.ts +39 -7
- package/src/use-lunatic/props/getComponentTypeProps.ts +15 -11
- package/src/use-lunatic/props/propOptions.spec.ts +140 -2
- package/src/use-lunatic/props/propOptions.ts +8 -3
- package/src/use-lunatic/reducer/reducerInitializer.tsx +4 -2
- package/src/use-lunatic/type.ts +5 -0
- package/src/use-lunatic/use-lunatic.ts +3 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/type.source.d.ts +5 -1
- package/use-lunatic/commons/fill-components/fill-component.spec.d.ts +1 -0
- package/use-lunatic/commons/fill-components/fill-component.spec.js +487 -0
- package/use-lunatic/commons/fill-components/fill-component.spec.js.map +1 -0
- package/use-lunatic/commons/fill-components/fill-components.d.ts +3 -3
- package/use-lunatic/commons/fill-components/fill-components.js +26 -5
- package/use-lunatic/commons/fill-components/fill-components.js.map +1 -1
- package/use-lunatic/props/getComponentTypeProps.d.ts +4 -4
- package/use-lunatic/props/getComponentTypeProps.js +1 -1
- package/use-lunatic/props/getComponentTypeProps.js.map +1 -1
- package/use-lunatic/props/propOptions.d.ts +1 -1
- package/use-lunatic/props/propOptions.js +5 -3
- package/use-lunatic/props/propOptions.js.map +1 -1
- package/use-lunatic/props/propOptions.spec.js +100 -2
- package/use-lunatic/props/propOptions.spec.js.map +1 -1
- package/use-lunatic/reducer/reducerInitializer.d.ts +2 -1
- package/use-lunatic/reducer/reducerInitializer.js +3 -3
- package/use-lunatic/reducer/reducerInitializer.js.map +1 -1
- package/use-lunatic/replace-component-sequence.d.ts +1 -1
- package/use-lunatic/type.d.ts +3 -0
- package/use-lunatic/use-lunatic.js +3 -1
- package/use-lunatic/use-lunatic.js.map +1 -1
- package/src/stories/loop/source-with-header.json +0 -128
package/type.source.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type ComponentDefinitionWithPage = ComponentDefinition & ({
|
|
|
8
8
|
} | {
|
|
9
9
|
goToPage: string;
|
|
10
10
|
});
|
|
11
|
-
export type ComponentDefinition = ComponentInputDefinition | ComponentSequenceDefinition | ComponentRoundaboutDefinition | ComponentLoopDefinition | ComponentRosterForLoopDefinition | ComponentTableDefinition | ComponentNumberDefinition | ComponentDurationDefinition | ComponentDatePickerDefinition | ComponentCheckboxGroupDefinition | ComponentCheckboxBooleanDefinition | ComponentRadioDefinition | ComponentDropdownDefinition | ComponentQuestionDefinition | ComponentCheckboxOneDefinition | ComponentSuggesterDefinition | ComponentPairWiseLinksDefinition | ComponentSummaryDefinition | ComponentText | ComponentAccordion;
|
|
11
|
+
export type ComponentDefinition = ComponentInputDefinition | ComponentSequenceDefinition | ComponentRoundaboutDefinition | ComponentLoopDefinition | ComponentRosterForLoopDefinition | ComponentTableDefinition | ComponentNumberDefinition | ComponentDurationDefinition | ComponentDatePickerDefinition | ComponentCheckboxGroupDefinition | ComponentCheckboxBooleanDefinition | ComponentRadioDefinition | ComponentDropdownDefinition | ComponentQuestionDefinition | ComponentCheckboxOneDefinition | ComponentSuggesterDefinition | ComponentPairWiseLinksDefinition | ComponentSummaryDefinition | ComponentText | ComponentAccordion | ComponentFilterDescriptionDefinition;
|
|
12
12
|
export type ComponentInputDefinition = ComponentDefinitionBaseWithResponse & {
|
|
13
13
|
componentType: 'Input' | 'Textarea';
|
|
14
14
|
maxLength?: number;
|
|
@@ -332,6 +332,10 @@ export type ComponentAccordion = {
|
|
|
332
332
|
body: VTLExpression;
|
|
333
333
|
}[];
|
|
334
334
|
};
|
|
335
|
+
export type ComponentFilterDescriptionDefinition = {
|
|
336
|
+
componentType: 'FilterDescription';
|
|
337
|
+
label: VTLExpression;
|
|
338
|
+
};
|
|
335
339
|
export type SuggesterDefinition = {
|
|
336
340
|
/**
|
|
337
341
|
* Name of the list (will be used as storeName for suggester)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const fill_components_1 = require("./fill-components");
|
|
5
|
+
const lunatic_variables_store_1 = require("../variables/lunatic-variables-store");
|
|
6
|
+
const defaultMockVariables = lunatic_variables_store_1.LunaticVariablesStore.makeFromObject({
|
|
7
|
+
TESTTEXTE: 'Some test value',
|
|
8
|
+
});
|
|
9
|
+
const defaultMockState = {
|
|
10
|
+
handleChanges: vitest_1.vi.fn(),
|
|
11
|
+
executeExpression: (expression) => expression.value,
|
|
12
|
+
goToPage: vitest_1.vi.fn(),
|
|
13
|
+
goNextPage: vitest_1.vi.fn(),
|
|
14
|
+
goPreviousPage: vitest_1.vi.fn(),
|
|
15
|
+
logger: vitest_1.vi.fn(),
|
|
16
|
+
pager: { page: 1, maxPage: 1 },
|
|
17
|
+
variables: defaultMockVariables,
|
|
18
|
+
};
|
|
19
|
+
// in every test, filledComponents is forced to any type since the function
|
|
20
|
+
// fillComponent does not handle types well, returning object forced as any
|
|
21
|
+
(0, vitest_1.describe)('fillComponents', () => {
|
|
22
|
+
(0, vitest_1.it)('should fill an Input component correctly', () => {
|
|
23
|
+
const components = [
|
|
24
|
+
{
|
|
25
|
+
componentType: 'Input',
|
|
26
|
+
response: {
|
|
27
|
+
name: 'TESTINPUT',
|
|
28
|
+
},
|
|
29
|
+
conditionFilter: {
|
|
30
|
+
type: 'VTL',
|
|
31
|
+
value: 'true',
|
|
32
|
+
},
|
|
33
|
+
id: 'kfxn6f16',
|
|
34
|
+
page: '1',
|
|
35
|
+
label: {
|
|
36
|
+
type: 'VTL|MD',
|
|
37
|
+
value: '"Input label"',
|
|
38
|
+
},
|
|
39
|
+
mandatory: true,
|
|
40
|
+
maxLength: 15,
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
const mockVariables = lunatic_variables_store_1.LunaticVariablesStore.makeFromObject({
|
|
44
|
+
TESTINPUT: 'Some test value',
|
|
45
|
+
});
|
|
46
|
+
const mockState = {
|
|
47
|
+
...defaultMockState,
|
|
48
|
+
variables: mockVariables,
|
|
49
|
+
};
|
|
50
|
+
const filledComponents = (0, fill_components_1.fillComponents)(components, mockState);
|
|
51
|
+
const input = filledComponents[0];
|
|
52
|
+
(0, vitest_1.expect)(input.componentType).toBe('Input');
|
|
53
|
+
(0, vitest_1.expect)(input.id).toBe('kfxn6f16');
|
|
54
|
+
(0, vitest_1.expect)(input.label).toBe('"Input label"');
|
|
55
|
+
(0, vitest_1.expect)(input.response.name).toBe('TESTINPUT');
|
|
56
|
+
(0, vitest_1.expect)(input.required).toBe(true);
|
|
57
|
+
(0, vitest_1.expect)(input.maxLength).toBe(15);
|
|
58
|
+
(0, vitest_1.expect)(input.conditionFilter).toBe(true);
|
|
59
|
+
});
|
|
60
|
+
(0, vitest_1.it)('should fill a Radio component correctly with options', () => {
|
|
61
|
+
const components = [
|
|
62
|
+
{
|
|
63
|
+
id: 'radio',
|
|
64
|
+
componentType: 'Radio',
|
|
65
|
+
mandatory: false,
|
|
66
|
+
page: '1',
|
|
67
|
+
label: {
|
|
68
|
+
value: '"Radio label"',
|
|
69
|
+
type: 'VTL|MD',
|
|
70
|
+
},
|
|
71
|
+
conditionFilter: {
|
|
72
|
+
type: 'VTL',
|
|
73
|
+
value: '"true"',
|
|
74
|
+
},
|
|
75
|
+
options: [
|
|
76
|
+
{
|
|
77
|
+
value: '1',
|
|
78
|
+
description: {
|
|
79
|
+
value: '"Déclaration oui"',
|
|
80
|
+
type: 'VTL|MD',
|
|
81
|
+
},
|
|
82
|
+
label: {
|
|
83
|
+
value: '"oui"',
|
|
84
|
+
type: 'VTL|MD',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
value: '2',
|
|
89
|
+
description: {
|
|
90
|
+
value: '"Déclaration non"',
|
|
91
|
+
type: 'VTL|MD',
|
|
92
|
+
},
|
|
93
|
+
label: {
|
|
94
|
+
value: '"non"',
|
|
95
|
+
type: 'VTL|MD',
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
response: {
|
|
100
|
+
name: 'TESTRADIO',
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
];
|
|
104
|
+
const mockVariables = lunatic_variables_store_1.LunaticVariablesStore.makeFromObject({
|
|
105
|
+
TESTRADIO: '1',
|
|
106
|
+
});
|
|
107
|
+
const mockState = {
|
|
108
|
+
...defaultMockState,
|
|
109
|
+
variables: mockVariables,
|
|
110
|
+
};
|
|
111
|
+
const filledComponents = (0, fill_components_1.fillComponents)(components, mockState);
|
|
112
|
+
const radio = filledComponents[0];
|
|
113
|
+
(0, vitest_1.expect)(radio.componentType).toBe('Radio');
|
|
114
|
+
(0, vitest_1.expect)(radio.id).toBe('radio');
|
|
115
|
+
(0, vitest_1.expect)(radio.label).toBe('"Radio label"');
|
|
116
|
+
(0, vitest_1.expect)(radio.options).toHaveLength(2);
|
|
117
|
+
(0, vitest_1.expect)(radio.options[0].label).toBe('"oui"');
|
|
118
|
+
(0, vitest_1.expect)(radio.options[1].label).toBe('"non"');
|
|
119
|
+
(0, vitest_1.expect)(radio.conditionFilter).toBe(true);
|
|
120
|
+
(0, vitest_1.expect)(radio.response.name).toBe('TESTRADIO');
|
|
121
|
+
});
|
|
122
|
+
(0, vitest_1.it)('should fill a Question component with a child Input correctly', () => {
|
|
123
|
+
const components = [
|
|
124
|
+
{
|
|
125
|
+
id: 'question-m8ilvkbt',
|
|
126
|
+
componentType: 'Question',
|
|
127
|
+
page: '1',
|
|
128
|
+
label: {
|
|
129
|
+
value: '"Question label"',
|
|
130
|
+
type: 'VTL|MD',
|
|
131
|
+
},
|
|
132
|
+
conditionFilter: {
|
|
133
|
+
type: 'VTL',
|
|
134
|
+
value: 'true',
|
|
135
|
+
},
|
|
136
|
+
components: [
|
|
137
|
+
{
|
|
138
|
+
id: 'm8ilvkbt',
|
|
139
|
+
componentType: 'Input',
|
|
140
|
+
page: '1',
|
|
141
|
+
maxLength: 249,
|
|
142
|
+
response: {
|
|
143
|
+
name: 'TESTTEXTE',
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
];
|
|
149
|
+
const mockVariables = lunatic_variables_store_1.LunaticVariablesStore.makeFromObject({
|
|
150
|
+
TESTTEXTE: 'some value',
|
|
151
|
+
});
|
|
152
|
+
const mockState = {
|
|
153
|
+
...defaultMockState,
|
|
154
|
+
variables: mockVariables,
|
|
155
|
+
};
|
|
156
|
+
const filledComponents = (0, fill_components_1.fillComponents)(components, mockState);
|
|
157
|
+
const question = filledComponents[0];
|
|
158
|
+
(0, vitest_1.expect)(question.componentType).toBe('Question');
|
|
159
|
+
(0, vitest_1.expect)(question.id).toBe('question-m8ilvkbt');
|
|
160
|
+
(0, vitest_1.expect)(question.label).toBe('"Question label"');
|
|
161
|
+
(0, vitest_1.expect)(question.conditionFilter).toBe(true);
|
|
162
|
+
(0, vitest_1.expect)(question.components.length).toBe(1);
|
|
163
|
+
const input = question.components[0];
|
|
164
|
+
(0, vitest_1.expect)(input.componentType).toBe('Input');
|
|
165
|
+
(0, vitest_1.expect)(input.id).toBe('m8ilvkbt');
|
|
166
|
+
(0, vitest_1.expect)(input.maxLength).toBe(249);
|
|
167
|
+
(0, vitest_1.expect)(input.response.name).toBe('TESTTEXTE');
|
|
168
|
+
});
|
|
169
|
+
(0, vitest_1.it)('should fill multiple components correctly', () => {
|
|
170
|
+
const components = [
|
|
171
|
+
{
|
|
172
|
+
id: 'input1',
|
|
173
|
+
componentType: 'Input',
|
|
174
|
+
page: '1',
|
|
175
|
+
maxLength: 100,
|
|
176
|
+
response: {
|
|
177
|
+
name: 'TESTINPUT',
|
|
178
|
+
},
|
|
179
|
+
label: {
|
|
180
|
+
type: 'VTL|MD',
|
|
181
|
+
value: '"Input label"',
|
|
182
|
+
},
|
|
183
|
+
conditionFilter: {
|
|
184
|
+
type: 'VTL',
|
|
185
|
+
value: 'true',
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
id: 'radio1',
|
|
190
|
+
componentType: 'Radio',
|
|
191
|
+
page: '1',
|
|
192
|
+
label: {
|
|
193
|
+
type: 'VTL|MD',
|
|
194
|
+
value: '"Radio label"',
|
|
195
|
+
},
|
|
196
|
+
options: [
|
|
197
|
+
{ value: 'yes', label: { value: '"Yes"', type: 'VTL|MD' } },
|
|
198
|
+
{ value: 'no', label: { value: '"No"', type: 'VTL|MD' } },
|
|
199
|
+
],
|
|
200
|
+
response: {
|
|
201
|
+
name: 'TESTRADIO',
|
|
202
|
+
},
|
|
203
|
+
conditionFilter: {
|
|
204
|
+
type: 'VTL',
|
|
205
|
+
value: 'true',
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
];
|
|
209
|
+
const mockVariables = lunatic_variables_store_1.LunaticVariablesStore.makeFromObject({
|
|
210
|
+
TESTINPUT: 'Filled input',
|
|
211
|
+
TESTRADIO: 'yes',
|
|
212
|
+
});
|
|
213
|
+
const mockState = {
|
|
214
|
+
...defaultMockState,
|
|
215
|
+
variables: mockVariables,
|
|
216
|
+
};
|
|
217
|
+
const filledComponents = (0, fill_components_1.fillComponents)(components, mockState);
|
|
218
|
+
(0, vitest_1.expect)(filledComponents).toHaveLength(2);
|
|
219
|
+
const input = filledComponents[0];
|
|
220
|
+
(0, vitest_1.expect)(input.componentType).toBe('Input');
|
|
221
|
+
(0, vitest_1.expect)(input.response.name).toBe('TESTINPUT');
|
|
222
|
+
(0, vitest_1.expect)(input.maxLength).toBe(100);
|
|
223
|
+
const radio = filledComponents[1];
|
|
224
|
+
(0, vitest_1.expect)(radio.componentType).toBe('Radio');
|
|
225
|
+
(0, vitest_1.expect)(radio.response.name).toBe('TESTRADIO');
|
|
226
|
+
(0, vitest_1.expect)(radio.options[0].label).toBe('"Yes"');
|
|
227
|
+
(0, vitest_1.expect)(radio.options[1].label).toBe('"No"');
|
|
228
|
+
});
|
|
229
|
+
(0, vitest_1.it)('should filter out FilterDescription components if disableFiltersDescription is true', () => {
|
|
230
|
+
const components = [
|
|
231
|
+
{
|
|
232
|
+
id: 'filter-desc',
|
|
233
|
+
componentType: 'FilterDescription',
|
|
234
|
+
page: '1',
|
|
235
|
+
label: {
|
|
236
|
+
type: 'VTL|MD',
|
|
237
|
+
value: '"filter description"',
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
id: 'input1',
|
|
242
|
+
componentType: 'Input',
|
|
243
|
+
page: '1',
|
|
244
|
+
maxLength: 100,
|
|
245
|
+
response: {
|
|
246
|
+
name: 'TESTINPUT',
|
|
247
|
+
},
|
|
248
|
+
label: {
|
|
249
|
+
type: 'VTL|MD',
|
|
250
|
+
value: '"Input label"',
|
|
251
|
+
},
|
|
252
|
+
conditionFilter: {
|
|
253
|
+
type: 'VTL',
|
|
254
|
+
value: 'true',
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
];
|
|
258
|
+
const mockVariables = lunatic_variables_store_1.LunaticVariablesStore.makeFromObject({
|
|
259
|
+
TESTINPUT: 'Filled input',
|
|
260
|
+
});
|
|
261
|
+
const mockState = {
|
|
262
|
+
...defaultMockState,
|
|
263
|
+
variables: mockVariables,
|
|
264
|
+
disableFiltersDescription: true,
|
|
265
|
+
};
|
|
266
|
+
const filledComponents = (0, fill_components_1.fillComponents)(components, mockState);
|
|
267
|
+
(0, vitest_1.expect)(filledComponents).toHaveLength(1);
|
|
268
|
+
const input = filledComponents[0];
|
|
269
|
+
(0, vitest_1.expect)(input.componentType).toBe('Input');
|
|
270
|
+
});
|
|
271
|
+
(0, vitest_1.it)('should keep FilterDescription components if disableFiltersDescription is false', () => {
|
|
272
|
+
const components = [
|
|
273
|
+
{
|
|
274
|
+
id: 'filter-desc',
|
|
275
|
+
componentType: 'FilterDescription',
|
|
276
|
+
page: '1',
|
|
277
|
+
label: {
|
|
278
|
+
type: 'VTL|MD',
|
|
279
|
+
value: '"Some filter description"',
|
|
280
|
+
},
|
|
281
|
+
conditionFilter: {
|
|
282
|
+
type: 'VTL',
|
|
283
|
+
value: 'true',
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
id: 'input1',
|
|
288
|
+
componentType: 'Input',
|
|
289
|
+
page: '1',
|
|
290
|
+
maxLength: 100,
|
|
291
|
+
response: {
|
|
292
|
+
name: 'TESTINPUT',
|
|
293
|
+
},
|
|
294
|
+
label: {
|
|
295
|
+
type: 'VTL|MD',
|
|
296
|
+
value: '"Input label"',
|
|
297
|
+
},
|
|
298
|
+
conditionFilter: {
|
|
299
|
+
type: 'VTL',
|
|
300
|
+
value: 'true',
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
];
|
|
304
|
+
const mockVariables = lunatic_variables_store_1.LunaticVariablesStore.makeFromObject({
|
|
305
|
+
TESTINPUT: 'Filled input',
|
|
306
|
+
});
|
|
307
|
+
const mockState = {
|
|
308
|
+
...defaultMockState,
|
|
309
|
+
variables: mockVariables,
|
|
310
|
+
disableFiltersDescription: false,
|
|
311
|
+
};
|
|
312
|
+
const filledComponents = (0, fill_components_1.fillComponents)(components, mockState);
|
|
313
|
+
(0, vitest_1.expect)(filledComponents).toHaveLength(2);
|
|
314
|
+
(0, vitest_1.expect)(filledComponents[0].componentType).toBe('FilterDescription');
|
|
315
|
+
(0, vitest_1.expect)(filledComponents[1].componentType).toBe('Input');
|
|
316
|
+
});
|
|
317
|
+
(0, vitest_1.it)('should filter out components with conditionFilter=false when disableFilters is false or undefined', () => {
|
|
318
|
+
const components = [
|
|
319
|
+
{
|
|
320
|
+
id: 'input1',
|
|
321
|
+
componentType: 'Input',
|
|
322
|
+
page: '1',
|
|
323
|
+
response: {
|
|
324
|
+
name: 'TESTINPUT',
|
|
325
|
+
},
|
|
326
|
+
label: {
|
|
327
|
+
type: 'VTL|MD',
|
|
328
|
+
value: '"Should be kept even with conditionFilter false"',
|
|
329
|
+
},
|
|
330
|
+
conditionFilter: {
|
|
331
|
+
type: 'VTL',
|
|
332
|
+
// value should be string, but did not find how to execute correctly with mocks
|
|
333
|
+
// for having a false conditionFilter at the end
|
|
334
|
+
value: false,
|
|
335
|
+
},
|
|
336
|
+
},
|
|
337
|
+
];
|
|
338
|
+
const mockVariables = lunatic_variables_store_1.LunaticVariablesStore.makeFromObject({
|
|
339
|
+
TESTINPUT: 'Some value',
|
|
340
|
+
});
|
|
341
|
+
const mockState = {
|
|
342
|
+
...defaultMockState,
|
|
343
|
+
variables: mockVariables,
|
|
344
|
+
disableFilters: false,
|
|
345
|
+
};
|
|
346
|
+
const filledComponents = (0, fill_components_1.fillComponents)(components, mockState);
|
|
347
|
+
(0, vitest_1.expect)(filledComponents).toHaveLength(0);
|
|
348
|
+
});
|
|
349
|
+
(0, vitest_1.it)('should not filter out components with conditionFilter=false when disableFilters is true', () => {
|
|
350
|
+
const components = [
|
|
351
|
+
{
|
|
352
|
+
id: 'input1',
|
|
353
|
+
componentType: 'Input',
|
|
354
|
+
page: '1',
|
|
355
|
+
response: {
|
|
356
|
+
name: 'TESTINPUT',
|
|
357
|
+
},
|
|
358
|
+
label: {
|
|
359
|
+
type: 'VTL|MD',
|
|
360
|
+
value: '"Should be kept even with conditionFilter false"',
|
|
361
|
+
},
|
|
362
|
+
conditionFilter: {
|
|
363
|
+
type: 'VTL',
|
|
364
|
+
// value should be string, but did not find how to execute correctly with mocks
|
|
365
|
+
// for having a false conditionFilter at the end
|
|
366
|
+
value: false,
|
|
367
|
+
},
|
|
368
|
+
},
|
|
369
|
+
];
|
|
370
|
+
const mockVariables = lunatic_variables_store_1.LunaticVariablesStore.makeFromObject({
|
|
371
|
+
TESTINPUT: 'Some value',
|
|
372
|
+
});
|
|
373
|
+
const mockState = {
|
|
374
|
+
...defaultMockState,
|
|
375
|
+
variables: mockVariables,
|
|
376
|
+
disableFilters: true,
|
|
377
|
+
};
|
|
378
|
+
const filledComponents = (0, fill_components_1.fillComponents)(components, mockState);
|
|
379
|
+
(0, vitest_1.expect)(filledComponents).toHaveLength(1);
|
|
380
|
+
const input = filledComponents[0];
|
|
381
|
+
(0, vitest_1.expect)(input.id).toBe('input1');
|
|
382
|
+
(0, vitest_1.expect)(input.conditionFilter).toBe(false);
|
|
383
|
+
});
|
|
384
|
+
(0, vitest_1.it)('should transform components into Text with empty label when conditionFilter is false and parentType is RosterForLoop', () => {
|
|
385
|
+
const components = [
|
|
386
|
+
{
|
|
387
|
+
id: 'input1',
|
|
388
|
+
componentType: 'Input',
|
|
389
|
+
page: '1',
|
|
390
|
+
label: { value: '"Input label"', type: 'VTL|MD' },
|
|
391
|
+
conditionFilter: {
|
|
392
|
+
type: 'VTL',
|
|
393
|
+
// value should be string, but did not find how to execute correctly with mocks
|
|
394
|
+
// for having a false conditionFilter at the end
|
|
395
|
+
value: false,
|
|
396
|
+
},
|
|
397
|
+
response: { name: 'TESTINPUT' },
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
id: 'radio1',
|
|
401
|
+
componentType: 'Radio',
|
|
402
|
+
page: '1',
|
|
403
|
+
label: { value: '"Radio label"', type: 'VTL|MD' },
|
|
404
|
+
options: [
|
|
405
|
+
{ value: 'yes', label: { value: '"Yes"', type: 'VTL|MD' } },
|
|
406
|
+
{ value: 'no', label: { value: '"No"', type: 'VTL|MD' } },
|
|
407
|
+
],
|
|
408
|
+
response: { name: 'TESTRADIO' },
|
|
409
|
+
},
|
|
410
|
+
];
|
|
411
|
+
const mockVariables = lunatic_variables_store_1.LunaticVariablesStore.makeFromObject({
|
|
412
|
+
TESTINPUT: 'Filled input',
|
|
413
|
+
TESTRADIO: 'yes',
|
|
414
|
+
});
|
|
415
|
+
const mockState = {
|
|
416
|
+
...defaultMockState,
|
|
417
|
+
variables: mockVariables,
|
|
418
|
+
};
|
|
419
|
+
const filledComponents = (0, fill_components_1.fillComponents)(components, mockState, 'RosterForLoop');
|
|
420
|
+
(0, vitest_1.expect)(filledComponents).toHaveLength(2);
|
|
421
|
+
// Check the first component that has conditionFilter: false
|
|
422
|
+
const input = filledComponents[0];
|
|
423
|
+
// The component should be transformed into a Text without label
|
|
424
|
+
(0, vitest_1.expect)(input.componentType).toBe('Text');
|
|
425
|
+
(0, vitest_1.expect)(input.label).toBe('');
|
|
426
|
+
(0, vitest_1.expect)(input.id).toBe('input1');
|
|
427
|
+
// Check the second component that has conditionFilter: true
|
|
428
|
+
const radio = filledComponents[1];
|
|
429
|
+
// The component should remain unchanged
|
|
430
|
+
(0, vitest_1.expect)(radio.componentType).toBe('Radio');
|
|
431
|
+
(0, vitest_1.expect)(radio.label).toBe('"Radio label"');
|
|
432
|
+
(0, vitest_1.expect)(radio.options[0].label).toBe('"Yes"');
|
|
433
|
+
(0, vitest_1.expect)(radio.options[1].label).toBe('"No"');
|
|
434
|
+
});
|
|
435
|
+
(0, vitest_1.it)('should never transform components into Text when disableFilters is true', () => {
|
|
436
|
+
const components = [
|
|
437
|
+
{
|
|
438
|
+
id: 'input1',
|
|
439
|
+
componentType: 'Input',
|
|
440
|
+
page: '1',
|
|
441
|
+
label: { value: '"Input label"', type: 'VTL|MD' },
|
|
442
|
+
conditionFilter: {
|
|
443
|
+
type: 'VTL',
|
|
444
|
+
// value should be string, but did not find how to execute correctly with mocks
|
|
445
|
+
// for having a false conditionFilter at the end
|
|
446
|
+
value: false,
|
|
447
|
+
},
|
|
448
|
+
response: { name: 'TESTINPUT' },
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
id: 'radio1',
|
|
452
|
+
componentType: 'Radio',
|
|
453
|
+
page: '1',
|
|
454
|
+
label: { value: '"Radio label"', type: 'VTL|MD' },
|
|
455
|
+
options: [
|
|
456
|
+
{ value: 'yes', label: { value: '"Yes"', type: 'VTL|MD' } },
|
|
457
|
+
{ value: 'no', label: { value: '"No"', type: 'VTL|MD' } },
|
|
458
|
+
],
|
|
459
|
+
response: { name: 'TESTRADIO' },
|
|
460
|
+
},
|
|
461
|
+
];
|
|
462
|
+
const mockVariables = lunatic_variables_store_1.LunaticVariablesStore.makeFromObject({
|
|
463
|
+
TESTINPUT: 'Filled input',
|
|
464
|
+
TESTRADIO: 'yes',
|
|
465
|
+
});
|
|
466
|
+
const mockState = {
|
|
467
|
+
...defaultMockState,
|
|
468
|
+
disableFilters: true,
|
|
469
|
+
variables: mockVariables,
|
|
470
|
+
};
|
|
471
|
+
const filledComponents = (0, fill_components_1.fillComponents)(components, mockState, 'RosterForLoop');
|
|
472
|
+
(0, vitest_1.expect)(filledComponents).toHaveLength(2);
|
|
473
|
+
// Check the first component that has conditionFilter: false
|
|
474
|
+
const input = filledComponents[0];
|
|
475
|
+
// The component should remain unchanged
|
|
476
|
+
(0, vitest_1.expect)(input.componentType).toBe('Input');
|
|
477
|
+
(0, vitest_1.expect)(input.label).toBe('"Input label"');
|
|
478
|
+
// Check the second component that has conditionFilter: true
|
|
479
|
+
const radio = filledComponents[1];
|
|
480
|
+
// The component should remain unchanged
|
|
481
|
+
(0, vitest_1.expect)(radio.componentType).toBe('Radio');
|
|
482
|
+
(0, vitest_1.expect)(radio.label).toBe('"Radio label"');
|
|
483
|
+
(0, vitest_1.expect)(radio.options[0].label).toBe('"Yes"');
|
|
484
|
+
(0, vitest_1.expect)(radio.options[1].label).toBe('"No"');
|
|
485
|
+
});
|
|
486
|
+
});
|
|
487
|
+
//# sourceMappingURL=fill-component.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fill-component.spec.js","sourceRoot":"","sources":["../../../src/use-lunatic/commons/fill-components/fill-component.spec.ts"],"names":[],"mappings":";;AAAA,mCAAkD;AAClD,uDAAsE;AAEtE,kFAA6E;AAE7E,MAAM,oBAAoB,GAAG,+CAAqB,CAAC,cAAc,CAAC;IACjE,SAAS,EAAE,iBAAiB;CAC5B,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG;IACxB,aAAa,EAAE,WAAE,CAAC,EAAE,EAAE;IACtB,iBAAiB,EAAE,CAAC,UAAe,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK;IACxD,QAAQ,EAAE,WAAE,CAAC,EAAE,EAAE;IACjB,UAAU,EAAE,WAAE,CAAC,EAAE,EAAE;IACnB,cAAc,EAAE,WAAE,CAAC,EAAE,EAAE;IACvB,MAAM,EAAE,WAAE,CAAC,EAAE,EAAE;IACf,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE;IAC9B,SAAS,EAAE,oBAAoB;CAC/B,CAAC;AAEF,2EAA2E;AAC3E,2EAA2E;AAC3E,IAAA,iBAAQ,EAAC,gBAAgB,EAAE,GAAG,EAAE;IAC/B,IAAA,WAAE,EAAC,0CAA0C,EAAE,GAAG,EAAE;QACnD,M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IAAA,eAAM,EAAC,KAAK,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAA,eAAM,EAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC1C,IAAA,eAAM,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7C,IAAA,eAAM,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { LunaticChangesHandler, LunaticComponentDefinition, LunaticOptions, LunaticReducerState, LunaticState } from '../../type';
|
|
2
2
|
import type { LunaticComponentProps } from '../../../components/type';
|
|
3
3
|
import { LunaticLogger } from '../../logger/type';
|
|
4
|
-
type FillComponentArgs = {
|
|
4
|
+
export type FillComponentArgs = {
|
|
5
5
|
disableFilters?: boolean;
|
|
6
|
+
disableFiltersDescription?: true;
|
|
6
7
|
handleChanges: LunaticChangesHandler;
|
|
7
8
|
executeExpression: LunaticReducerState['executeExpression'];
|
|
8
9
|
goToPage: LunaticState['goToPage'];
|
|
@@ -24,5 +25,4 @@ export declare const fillComponent: (component: LunaticComponentDefinition, stat
|
|
|
24
25
|
/**
|
|
25
26
|
* Fill components with values coming from the state, and interpret VTL expression
|
|
26
27
|
*/
|
|
27
|
-
export declare function fillComponents(components: LunaticComponentDefinition[], state: FillComponentArgs): LunaticComponentProps[];
|
|
28
|
-
export {};
|
|
28
|
+
export declare function fillComponents(components: LunaticComponentDefinition[], state: FillComponentArgs, parentType?: LunaticComponentDefinition['componentType']): LunaticComponentProps[];
|
|
@@ -29,7 +29,7 @@ const fillComponent = (component, state) => {
|
|
|
29
29
|
missingResponse: (0, propMissingResponse_1.getMissingResponseProp)(component, state),
|
|
30
30
|
management: state.management,
|
|
31
31
|
iterations: (0, propIterations_1.getIterationsProp)(component, state),
|
|
32
|
-
options: (0, propOptions_1.getOptionsProp)(interpretedProps, state.variables, state.handleChanges, state.pager.iteration, value, state.logger),
|
|
32
|
+
options: (0, propOptions_1.getOptionsProp)(interpretedProps, state.variables, state.handleChanges, state.pager.iteration, value, state.logger, state.disableFilters),
|
|
33
33
|
...(0, getComponentTypeProps_1.getComponentTypeProps)(interpretedProps, state),
|
|
34
34
|
// This is too dynamic to be typed correctly, so we allow any here
|
|
35
35
|
};
|
|
@@ -38,9 +38,30 @@ exports.fillComponent = fillComponent;
|
|
|
38
38
|
/**
|
|
39
39
|
* Fill components with values coming from the state, and interpret VTL expression
|
|
40
40
|
*/
|
|
41
|
-
function fillComponents(components, state) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
function fillComponents(components, state, parentType) {
|
|
42
|
+
// Flatmap to directly remove FilterDescription components if disableFiltersDescription is true
|
|
43
|
+
const filledComponents = components.flatMap((component) => {
|
|
44
|
+
if (component.componentType === 'FilterDescription' &&
|
|
45
|
+
state.disableFiltersDescription) {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
return [(0, exports.fillComponent)(component, state)];
|
|
49
|
+
});
|
|
50
|
+
if (state.disableFilters) {
|
|
51
|
+
return filledComponents;
|
|
52
|
+
}
|
|
53
|
+
// For rosterForLoop we want empty cell when the component is filtered
|
|
54
|
+
if (parentType === 'RosterForLoop') {
|
|
55
|
+
return filledComponents.map((filledComponent) => (filledComponent.conditionFilter ?? true)
|
|
56
|
+
? filledComponent
|
|
57
|
+
: // Replace the component by an empty text component
|
|
58
|
+
{
|
|
59
|
+
...filledComponent,
|
|
60
|
+
label: '',
|
|
61
|
+
componentType: 'Text',
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
// Remove filtered component (conditionFilter must be true to keep a component)
|
|
65
|
+
return filledComponents.filter(({ conditionFilter }) => conditionFilter ?? true);
|
|
45
66
|
}
|
|
46
67
|
//# sourceMappingURL=fill-components.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fill-components.js","sourceRoot":"","sources":["../../../src/use-lunatic/commons/fill-components/fill-components.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"fill-components.js","sourceRoot":"","sources":["../../../src/use-lunatic/commons/fill-components/fill-components.ts"],"names":[],"mappings":";;;AAyEA,wCAuCC;AAzGD,6EAAwE;AACxE,6EAA0E;AAE1E,yEAAyE;AACzE,qDAAqD;AACrD,+DAA+D;AAC/D,yDAAyD;AAmBzD;;GAEG;AACI,MAAM,aAAa,GAAG,CAC5B,SAAqC,EACrC,KAAwB,EACgC,EAAE;IAC1D,MAAM,gBAAgB,GAAG,IAAA,qDAAwB,EAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IACpE,MAAM,KAAK,GAAG,IAAA,wBAAY,EAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC7C,OAAO;QACN,GAAG,gBAAgB;QACnB,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;QAC1C,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS;QAChC,QAAQ,EAAE,WAAW,IAAI,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK;QAChE,KAAK,EAAE,KAAK;QACZ,eAAe,EAAE,IAAA,4CAAsB,EAAC,SAAS,EAAE,KAAK,CAAC;QACzD,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,UAAU,EAAE,IAAA,kCAA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CAAC,eAAe,IAAI,IAAI,CAChD,CAAC;AACH,CAAC"}
|
|
@@ -269,6 +269,10 @@ export declare function getComponentTypeProps(component: DeepTranslateExpression
|
|
|
269
269
|
}[];
|
|
270
270
|
} & {
|
|
271
271
|
conditionFilter?: boolean;
|
|
272
|
+
}) | (Pick<import("../../components/type").LunaticBaseProps<string>, "label" | "id"> & import("../..").LunaticExtraProps & {
|
|
273
|
+
componentType?: "FilterDescription";
|
|
274
|
+
} & {
|
|
275
|
+
conditionFilter?: boolean;
|
|
272
276
|
}) | (import("../../components/type").LunaticBaseProps<boolean> & import("../..").LunaticExtraProps & {
|
|
273
277
|
response: {
|
|
274
278
|
name: string;
|
|
@@ -280,10 +284,6 @@ export declare function getComponentTypeProps(component: DeepTranslateExpression
|
|
|
280
284
|
componentType?: "Switch";
|
|
281
285
|
} & {
|
|
282
286
|
conditionFilter?: boolean;
|
|
283
|
-
}) | (Pick<import("../../components/type").LunaticBaseProps<string>, "label" | "id"> & import("../..").LunaticExtraProps & {
|
|
284
|
-
componentType?: "FilterDescription";
|
|
285
|
-
} & {
|
|
286
|
-
conditionFilter?: boolean;
|
|
287
287
|
}) | {
|
|
288
288
|
label: unknown;
|
|
289
289
|
})[][];
|