@legalplace/wizardx-core 4.13.1 → 4.13.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.
|
@@ -185,18 +185,22 @@ const watchFetchModelSucceeded = (mpi, next, action) => {
|
|
|
185
185
|
const variableId = parseInt(variableStrId, 10);
|
|
186
186
|
const { prefillings, prioritizePrefillings } = selectVariableReference(variableId);
|
|
187
187
|
if (Array.isArray(prefillings)) {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
188
|
+
variables[variableId].forEach((value, variableIndex) => {
|
|
189
|
+
var _a;
|
|
190
|
+
const firstUnconditionnedIndex = prefillings
|
|
191
|
+
.map((c) => c.conditions === undefined ||
|
|
192
|
+
ConditionsMapper.countConditions(c.conditions) === 0)
|
|
193
|
+
.indexOf(true);
|
|
194
|
+
const prefillingConditions = (_a = selectPrefillerConditionValue(variableId)) === null || _a === void 0 ? void 0 : _a[variableIndex];
|
|
195
|
+
const firstTruthfulPrefill = prefillingConditions === null || prefillingConditions === void 0 ? void 0 : prefillingConditions.indexOf(true);
|
|
196
|
+
const prefillIndex = typeof firstTruthfulPrefill === "number" && firstTruthfulPrefill > -1
|
|
197
|
+
? firstTruthfulPrefill
|
|
198
|
+
: firstUnconditionnedIndex;
|
|
199
|
+
const prefillerValue = parsePrefillerValue(variableId, variableIndex, prefillIndex);
|
|
200
|
+
if (value.toString().trim().length === 0 || prioritizePrefillings) {
|
|
201
|
+
mpi.dispatch(updateVariableAction(variableId, prefillerValue, variableIndex));
|
|
202
|
+
}
|
|
203
|
+
});
|
|
200
204
|
}
|
|
201
205
|
});
|
|
202
206
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legalplace/wizardx-core",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.3",
|
|
4
4
|
"author": "Moncef Hammou (moncef@legalplace.fr)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@legalplace/lp-events": "1.14.0",
|
|
25
25
|
"@legalplace/lplogic": "2.3.1",
|
|
26
26
|
"@legalplace/model-healthcheck": "^1.1.5",
|
|
27
|
-
"@legalplace/referencesparser": "^3.1.
|
|
27
|
+
"@legalplace/referencesparser": "^3.1.17",
|
|
28
28
|
"@legalplace/storybook": "^2.171.0",
|
|
29
29
|
"@legalplace/typeorm-constants": "^3.32.0",
|
|
30
30
|
"@loadable/component": "^5.15.0",
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
"xss": "^1.0.9"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@legalplace/data-gouv": "^1.5.
|
|
57
|
+
"@legalplace/data-gouv": "^1.5.11",
|
|
58
58
|
"@legalplace/eslint-config": "^2.2.0",
|
|
59
59
|
"@legalplace/models-v3-types": "^5.11.4",
|
|
60
60
|
"@legalplace/prettier-config": "^2.1.3",
|
|
61
|
-
"@legalplace/typeorm-entities": "^5.29.
|
|
61
|
+
"@legalplace/typeorm-entities": "^5.29.7",
|
|
62
62
|
"@swc-node/jest": "^1.3.2",
|
|
63
63
|
"@swc/core": "^1.2.93",
|
|
64
64
|
"@swc/jest": "^0.2.4",
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"*.test.ts",
|
|
97
97
|
"*.test.tsx"
|
|
98
98
|
],
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "cc93b324728874d719c5d9fd544bbf3d8498c1a4"
|
|
100
100
|
}
|