@legalplace/wizardx-core 4.12.1 → 4.13.0
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.
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const trimInputs = (inputs) => {
|
|
2
|
+
const trimmedVariables = Object.keys(inputs.variables).reduce((acc, key) => {
|
|
3
|
+
acc[key] = inputs.variables[key].map((value) => typeof value === "string" ? value.trim() : value);
|
|
4
|
+
return acc;
|
|
5
|
+
}, {});
|
|
6
|
+
return Object.assign(Object.assign({}, inputs), { variables: trimmedVariables });
|
|
7
|
+
};
|
|
@@ -7,6 +7,7 @@ import { selectInputs } from "../selectors/inputs";
|
|
|
7
7
|
import { OvcConverter } from "../../libs/OvcConverter";
|
|
8
8
|
import { updateInstanceArguments } from "../../service/api.manager";
|
|
9
9
|
import { cancelOnResetState } from "../../helpers/sagaCancelOnResetState";
|
|
10
|
+
import { trimInputs } from "../../helpers/trimInputs";
|
|
10
11
|
function* saveDataDecorator(action) {
|
|
11
12
|
try {
|
|
12
13
|
yield put(setDataStatus("saving"));
|
|
@@ -14,7 +15,7 @@ function* saveDataDecorator(action) {
|
|
|
14
15
|
const uniqid = selectInstanceUniqid();
|
|
15
16
|
if (uniqid === undefined)
|
|
16
17
|
throw new Error("Cannot save data, uniqid is not defined");
|
|
17
|
-
const response = yield call(fetch, ...updateInstanceArguments(permalink, uniqid, OvcConverter.convertToOvc(selectInputs()), action.confirmAnswer ? 0 : 1, action.additionalProperties));
|
|
18
|
+
const response = yield call(fetch, ...updateInstanceArguments(permalink, uniqid, OvcConverter.convertToOvc(trimInputs(selectInputs())), action.confirmAnswer ? 0 : 1, action.additionalProperties));
|
|
18
19
|
const responseData = yield call([response, "json"]);
|
|
19
20
|
if (action.redirect === true) {
|
|
20
21
|
const searchParams = new URLSearchParams(window.location.search);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legalplace/wizardx-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.13.0",
|
|
4
4
|
"author": "Moncef Hammou (moncef@legalplace.fr)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@legalplace/model-healthcheck": "^1.1.5",
|
|
27
27
|
"@legalplace/referencesparser": "^3.1.16",
|
|
28
28
|
"@legalplace/storybook": "^2.171.0",
|
|
29
|
-
"@legalplace/typeorm-constants": "^3.
|
|
29
|
+
"@legalplace/typeorm-constants": "^3.32.0",
|
|
30
30
|
"@loadable/component": "^5.15.0",
|
|
31
31
|
"@redux-saga/core": "^1.1.3",
|
|
32
32
|
"connected-react-router": "^6.8.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.10",
|
|
58
58
|
"@legalplace/eslint-config": "^2.2.0",
|
|
59
|
-
"@legalplace/models-v3-types": "^5.11.
|
|
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.6",
|
|
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": "331e8226c0c2a9f66024621240f8485cabe874de"
|
|
100
100
|
}
|