@legalplace/wizardx-core 4.22.3 → 4.23.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.
|
@@ -27,5 +27,9 @@ declare global {
|
|
|
27
27
|
initTriggers: (callback: TInitTriggersCallback, inputs: StateType.Inputs, newInstance: boolean) => void;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
declare const
|
|
31
|
-
|
|
30
|
+
declare const _default: import("react-redux").ConnectedComponent<({ inpiActivities }: {
|
|
31
|
+
inpiActivities?: never[] | undefined;
|
|
32
|
+
}) => JSX.Element, import("react-redux").Omit<{
|
|
33
|
+
inpiActivities?: never[] | undefined;
|
|
34
|
+
}, never>>;
|
|
35
|
+
export default _default;
|
|
@@ -3,11 +3,13 @@ import { useEffect, useState } from "react";
|
|
|
3
3
|
import { useParams } from "react-router-dom";
|
|
4
4
|
import queryString from "query-string";
|
|
5
5
|
import moment from "moment-business-days";
|
|
6
|
+
import { connect } from "react-redux";
|
|
6
7
|
import { getConfig } from "../config";
|
|
7
8
|
import { SmartScriptStore } from "../libs/SmartScriptStore";
|
|
8
9
|
import { smartScriptLoadedMessage } from "../constants/smartscript";
|
|
10
|
+
import { selectDataSmartscript } from "../redux";
|
|
9
11
|
let initTriggersCallback = null;
|
|
10
|
-
const SmartScriptComponent = () => {
|
|
12
|
+
const SmartScriptComponent = ({ inpiActivities = [] }) => {
|
|
11
13
|
const [smartScriptLoaded, setSmartScriptLoaded] = useState(false);
|
|
12
14
|
const [isNewInstance, setIsNewInstance] = useState(true);
|
|
13
15
|
window.onInit = SmartScriptStore.onInit;
|
|
@@ -32,7 +34,7 @@ const SmartScriptComponent = () => {
|
|
|
32
34
|
const { permalink, uniqid } = useParams();
|
|
33
35
|
const modelVersion = queryString.parse(window.location.search).version;
|
|
34
36
|
useEffect(() => {
|
|
35
|
-
if (!smartScriptLoaded) {
|
|
37
|
+
if (inpiActivities.length && !smartScriptLoaded) {
|
|
36
38
|
const src = `${apiEndpoint}wizard/contractv1/smartscript/${permalink}${uniqid ? `/${uniqid}` : ""}${modelVersion ? `?version=${modelVersion}` : ""}`;
|
|
37
39
|
const scriptElement = document.createElement("script");
|
|
38
40
|
scriptElement.setAttribute("src", src);
|
|
@@ -56,6 +58,7 @@ const SmartScriptComponent = () => {
|
|
|
56
58
|
permalink,
|
|
57
59
|
uniqid,
|
|
58
60
|
isNewInstance,
|
|
61
|
+
inpiActivities,
|
|
59
62
|
]);
|
|
60
63
|
useEffect(() => {
|
|
61
64
|
if (smartScriptLoaded) {
|
|
@@ -91,4 +94,10 @@ const SmartScriptComponent = () => {
|
|
|
91
94
|
};
|
|
92
95
|
return _jsx(_Fragment, { children: smartScriptLoaded ? "SmartScript" : "Loading..." }, void 0);
|
|
93
96
|
};
|
|
94
|
-
|
|
97
|
+
const mapStateToProps = () => {
|
|
98
|
+
const inpiActivities = selectDataSmartscript();
|
|
99
|
+
return {
|
|
100
|
+
inpiActivities,
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
export default connect(mapStateToProps, null)(SmartScriptComponent);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legalplace/wizardx-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.23.1",
|
|
4
4
|
"author": "Moncef Hammou (moncef@legalplace.fr)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -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.33",
|
|
58
58
|
"@legalplace/eslint-config": "^2.2.0",
|
|
59
59
|
"@legalplace/models-v3-types": "^5.12.2",
|
|
60
60
|
"@legalplace/prettier-config": "^2.1.3",
|
|
61
|
-
"@legalplace/typeorm-entities": "^5.
|
|
61
|
+
"@legalplace/typeorm-entities": "^5.35.0",
|
|
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": "eceb339ab5069856455a7d8641709074d9e97bc6"
|
|
100
100
|
}
|