@inseefr/lunatic 3.0.0-rc.30 → 3.0.0-rc.31
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { LunaticControl, LunaticError, LunaticReducerState } from '../../type';
|
|
2
|
-
export declare function checkBaseControl(
|
|
2
|
+
export declare function checkBaseControl(controlItem: LunaticControl, executeExpression: LunaticReducerState['executeExpression'], pager: LunaticReducerState['pager']): LunaticError | undefined;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import {} from 'react';
|
|
2
|
-
export function checkBaseControl(
|
|
2
|
+
export function checkBaseControl(controlItem, executeExpression, pager) {
|
|
3
3
|
const { iteration, linksIterations } = pager;
|
|
4
|
-
const { criticality, errorMessage, id, typeOfControl } =
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const { criticality, errorMessage, id, typeOfControl, control } = controlItem;
|
|
5
|
+
// There is no control expression for this control (this is unexpected)
|
|
6
|
+
if (!control) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
const result = executeExpression(control, {
|
|
7
10
|
iteration: linksIterations ?? iteration,
|
|
8
11
|
});
|
|
9
12
|
try {
|
|
@@ -26,7 +29,7 @@ export function checkBaseControl(control, executeExpression, pager) {
|
|
|
26
29
|
};
|
|
27
30
|
}
|
|
28
31
|
catch (e) {
|
|
29
|
-
console.warn(`Error on validating control ${value}`);
|
|
32
|
+
console.warn(`Error on validating control ${control.value}`);
|
|
30
33
|
return undefined;
|
|
31
34
|
}
|
|
32
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-base-control.js","sourceRoot":"","sources":["../../../../src/use-lunatic/reducer/controls/check-base-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,MAAM,OAAO,CAAC;AAOvC,MAAM,UAAU,gBAAgB,CAC/B,
|
|
1
|
+
{"version":3,"file":"check-base-control.js","sourceRoot":"","sources":["../../../../src/use-lunatic/reducer/controls/check-base-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,MAAM,OAAO,CAAC;AAOvC,MAAM,UAAU,gBAAgB,CAC/B,WAA2B,EAC3B,iBAA2D,EAC3D,KAAmC;IAEnC,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAC7C,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC;IAE9E,uEAAuE;IACvE,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,EAAE;QACzC,SAAS,EAAE,eAAe,IAAI,SAAS;KACvC,CAAC,CAAC;IAEH,IAAI,CAAC;QACJ;;;;;WAKG;QACH,IAAI,MAAM;YAAE,OAAO,SAAS,CAAC;QAE7B,MAAM,KAAK,GAAG,iBAAiB,CAAY,YAAY,EAAE;YACxD,SAAS;SACT,CAAC,CAAC;QACH,OAAO;YACN,WAAW;YACX,YAAY,EAAE,KAAK;YACnB,EAAE;YACF,aAAa;SACb,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACZ,OAAO,CAAC,IAAI,CAAC,+BAA+B,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QAC7D,OAAO,SAAS,CAAC;IAClB,CAAC;AACF,CAAC"}
|