@legalplace/wizardx-core 4.39.15 → 4.40.1
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/dist/App.js
CHANGED
|
@@ -69,8 +69,8 @@ class WizardXCore extends React.Component {
|
|
|
69
69
|
parent = source;
|
|
70
70
|
}
|
|
71
71
|
if (data.from && data.from === "BO") {
|
|
72
|
-
const
|
|
73
|
-
autoSave(
|
|
72
|
+
const { variables } = data;
|
|
73
|
+
autoSave(variables, getStore());
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
76
|
dispatch(callInitDataSmartscriptAction());
|
|
@@ -25,6 +25,7 @@ export const autocompleteDatasetConfig = {
|
|
|
25
25
|
[DatasetTypeEnum.KANOON_COLLECTIVE_AGREEMENTS]: Object.assign(Object.assign({}, AutocompleteDefaultDatasetConfig), { limit: 5, minInputLenght: 3, debounceDelay: 300, timeoutLimit: 10000, shouldDisableLinkedVariables: false, cannotChooseOther: false, noResultPlaceholder: (value) => `Aucun résultat, utiliser <b>${value}</b> comme valeur`, loadingPlaceholder: "Chargement...", otherPlaceholder: (value) => `Aucun de ces choix, utiliser <b>${value}</b> comme valeur`, linkedVariablesDisabledTooltip: "Veuillez sélectionner la convention collective" }),
|
|
26
26
|
[DatasetTypeEnum.DATAGOUV_ADDRESSES_V2]: Object.assign(Object.assign({}, AutocompleteDefaultDatasetConfig), { limit: 20, minInputLenght: 5, debounceDelay: 500, timeoutLimit: 10000, shouldDisableLinkedVariables: true, cannotChooseOther: false, otherPlaceholder: () => "<b>Aucun de ces choix</b><br>Entrer mon adresse manuellement", noResultPlaceholder: () => "<b>Aucun de ces choix</b><br>Entrer mon adresse manuellement" }),
|
|
27
27
|
[DatasetTypeEnum.DATAGOUV_CITIES_WITH_INPI]: Object.assign(Object.assign({}, AutocompleteDefaultDatasetConfig), { limit: 20, minInputLenght: 3, debounceDelay: 300, timeoutLimit: 10000, shouldDisableLinkedVariables: true, cannotChooseOther: true, noResultPlaceholder: () => "<b>Aucun résultat</b><br/> Veuillez vérifier l'orthographe de la ville ou insérer un code postal" }),
|
|
28
|
+
[DatasetTypeEnum.RBE]: Object.assign(Object.assign({}, AutocompleteDefaultDatasetConfig), { limit: 10, minInputLenght: 3, debounceDelay: 300, timeoutLimit: 10000, shouldDisableLinkedVariables: false, cannotChooseOther: false }),
|
|
28
29
|
};
|
|
29
30
|
export const ACCENTS_MAP = {
|
|
30
31
|
Á: "A",
|
|
@@ -6,10 +6,10 @@ export declare const getRelatedParentsByVariableId: (variableId: number, index:
|
|
|
6
6
|
condition: boolean | undefined;
|
|
7
7
|
}[];
|
|
8
8
|
export declare const getAutoCompleteParentVariableId: (variableId: number, index: number, type?: string | undefined) => number | undefined;
|
|
9
|
-
export declare const autoSave: (
|
|
9
|
+
export declare const autoSave: (variablesData: {
|
|
10
10
|
variablesIds: number[];
|
|
11
11
|
updateValue: string;
|
|
12
12
|
index: number;
|
|
13
|
-
}, store: Store<EmptyObject & StateType, AnyAction> & {
|
|
13
|
+
}[], store: Store<EmptyObject & StateType, AnyAction> & {
|
|
14
14
|
dispatch: unknown;
|
|
15
15
|
}) => Promise<void>;
|
|
@@ -56,21 +56,26 @@ const getResultAutoComplete = (variableId, updateValue, index, store) => __await
|
|
|
56
56
|
store.dispatch(saveDataAction());
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
|
-
export const autoSave = (
|
|
60
|
-
yield
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
59
|
+
export const autoSave = (variablesData, store) => __awaiter(void 0, void 0, void 0, function* () {
|
|
60
|
+
yield variablesData.forEach((variableData, indexVariablesData) => __awaiter(void 0, void 0, void 0, function* () {
|
|
61
|
+
yield variableData.variablesIds.forEach((variableId, indexVariable) => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
|
+
let contentVariable = variableData.updateValue;
|
|
63
|
+
if (variableData.variablesIds.length > 1) {
|
|
64
|
+
contentVariable = `${variableData.updateValue.split(",")[indexVariable] || ""}`.trim();
|
|
65
|
+
}
|
|
66
|
+
const variable = store.getState().references.variables[variableId];
|
|
67
|
+
const variableParentId = getAutoCompleteParentVariableId(variableId, variableData.index, variable === null || variable === void 0 ? void 0 : variable.type);
|
|
68
|
+
if (variableParentId) {
|
|
69
|
+
yield getResultAutoComplete(variableParentId, contentVariable, variableData.index, store);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
yield store.dispatch(updateVariableAction(variableId, contentVariable, variableData.index));
|
|
73
|
+
setTimeout(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
74
|
+
if (indexVariable === variableData.variablesIds.length - 1 &&
|
|
75
|
+
indexVariablesData === variablesData.length - 1) {
|
|
76
|
+
store.dispatch(saveDataAction());
|
|
77
|
+
}
|
|
78
|
+
}), 200);
|
|
79
|
+
}));
|
|
75
80
|
}));
|
|
76
81
|
});
|
|
@@ -5,7 +5,8 @@ export declare enum DatasetTypeEnum {
|
|
|
5
5
|
DATAGOUV_CITIES_WITH_INPI = "datagouv_cities_with_inpi",
|
|
6
6
|
PAPPERS = "pappers",
|
|
7
7
|
ACTIVITIES = "activities",
|
|
8
|
-
KANOON_COLLECTIVE_AGREEMENTS = "kanoon_collective_agreements"
|
|
8
|
+
KANOON_COLLECTIVE_AGREEMENTS = "kanoon_collective_agreements",
|
|
9
|
+
RBE = "rbe"
|
|
9
10
|
}
|
|
10
11
|
export interface IAutocompleteDatasetConfig {
|
|
11
12
|
limit: number;
|
|
@@ -7,4 +7,5 @@ export var DatasetTypeEnum;
|
|
|
7
7
|
DatasetTypeEnum["PAPPERS"] = "pappers";
|
|
8
8
|
DatasetTypeEnum["ACTIVITIES"] = "activities";
|
|
9
9
|
DatasetTypeEnum["KANOON_COLLECTIVE_AGREEMENTS"] = "kanoon_collective_agreements";
|
|
10
|
+
DatasetTypeEnum["RBE"] = "rbe";
|
|
10
11
|
})(DatasetTypeEnum || (DatasetTypeEnum = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legalplace/wizardx-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.40.1",
|
|
4
4
|
"author": "Moncef Hammou (moncef@legalplace.fr)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@appnest/masonry-layout": "^2.0.8",
|
|
23
23
|
"@cryptography/sha1": "^0.2.0",
|
|
24
|
-
"@legalplace/data-gouv": "^1.6.
|
|
24
|
+
"@legalplace/data-gouv": "^1.6.79",
|
|
25
25
|
"@legalplace/lp-events": "1.14.0",
|
|
26
26
|
"@legalplace/lplogic": "2.3.1",
|
|
27
27
|
"@legalplace/model-healthcheck": "^1.1.5",
|
|
28
28
|
"@legalplace/pappers": "^1.2.4",
|
|
29
|
-
"@legalplace/referencesparser": "^3.1.
|
|
29
|
+
"@legalplace/referencesparser": "^3.1.68",
|
|
30
30
|
"@legalplace/storybook": "2.364.5",
|
|
31
|
-
"@legalplace/typeorm-constants": "^3.
|
|
31
|
+
"@legalplace/typeorm-constants": "^3.71.0",
|
|
32
32
|
"@loadable/component": "^5.15.0",
|
|
33
33
|
"@redux-saga/core": "^1.1.3",
|
|
34
34
|
"axios": "^0.24.0",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@legalplace/data-gouv": "^1.6.30",
|
|
62
62
|
"@legalplace/eslint-config": "^2.3.0",
|
|
63
|
-
"@legalplace/models-v3-types": "^5.
|
|
63
|
+
"@legalplace/models-v3-types": "^5.14.0",
|
|
64
64
|
"@legalplace/prettier-config": "^2.1.3",
|
|
65
|
-
"@legalplace/typeorm-entities": "^5.65.
|
|
65
|
+
"@legalplace/typeorm-entities": "^5.65.8",
|
|
66
66
|
"@swc-node/jest": "^1.3.2",
|
|
67
67
|
"@swc/core": "^1.2.93",
|
|
68
68
|
"@swc/jest": "^0.2.4",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"*.test.ts",
|
|
101
101
|
"*.test.tsx"
|
|
102
102
|
],
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "0a7c701e3708f82e62c65047e7a6525ace7ecf41"
|
|
104
104
|
}
|