@legalplace/wizardx-core 3.3.4 → 4.0.2
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/CHANGELOG.md +22 -0
- package/dist/App.js +5 -2
- package/dist/components/SmartScript.js +6 -0
- package/dist/constants/smartscript.d.ts +1 -0
- package/dist/constants/smartscript.js +1 -0
- package/dist/redux/middlewares/smartscriptMiddleware.js +13 -10
- package/dist/redux/sagas/setUserEmail.js +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.0.2](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@4.0.1...@legalplace/wizardx-core@4.0.2) (2023-05-11)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @legalplace/wizardx-core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [4.0.1](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@3.3.4...@legalplace/wizardx-core@4.0.1) (2023-05-10)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* fix versionning package ([f9a4709](https://git.legalplace.eu/legalplace/monorepo/commits/f9a47093e4c4d884c109e3c89b477bc688f12d4f))
|
|
20
|
+
* fixing smartscript loading listener api[#8564](https://git.legalplace.eu/legalplace/monorepo/issues/8564) ([ab10003](https://git.legalplace.eu/legalplace/monorepo/commits/ab100034dce4bed416aa5d2101f7a6c7acdd9805))
|
|
21
|
+
* fixing wizardx double render causing saving issues api[#8310](https://git.legalplace.eu/legalplace/monorepo/issues/8310) ([de3926c](https://git.legalplace.eu/legalplace/monorepo/commits/de3926cff122c36f183aa3e7fb3a5c81d81a09e9))
|
|
22
|
+
* lerna versionning package major ([d4d078b](https://git.legalplace.eu/legalplace/monorepo/commits/d4d078bfff957c9fa1b8dff49c9c241b06d98b10)), closes [api#8592](https://git.legalplace.eu/legalplace/monorepo/issues/8592)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## [3.3.4](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@3.3.3...@legalplace/wizardx-core@3.3.4) (2023-04-12)
|
|
7
29
|
|
|
8
30
|
**Note:** Version bump only for package @legalplace/wizardx-core
|
package/dist/App.js
CHANGED
|
@@ -13,7 +13,8 @@ import ViewComponent from "./components/View";
|
|
|
13
13
|
import PluginRoute from "./components/PluginRoute";
|
|
14
14
|
import SmartScriptComponent from "./components/SmartScript";
|
|
15
15
|
import { clearPlugins } from "./PluginLoader";
|
|
16
|
-
import { DANGEROUS_DESTROY_STORE } from "
|
|
16
|
+
import { DANGEROUS_DESTROY_STORE } from "./redux/constants/app";
|
|
17
|
+
import { PathReader } from "./libs/PathReader";
|
|
17
18
|
class WizardXCore extends React.Component {
|
|
18
19
|
constructor(props) {
|
|
19
20
|
var _a;
|
|
@@ -43,7 +44,9 @@ class WizardXCore extends React.Component {
|
|
|
43
44
|
componentDidMount() {
|
|
44
45
|
const { dispatch, getState } = getStore();
|
|
45
46
|
const state = getState();
|
|
46
|
-
|
|
47
|
+
if (!PathReader.isSmartScriptPath()) {
|
|
48
|
+
dispatch(fetchModelPrerequisitesAction(getConfig().permalink || state.app.meta.permalink, getConfig().prefix || state.app.meta.prefix || ""));
|
|
49
|
+
}
|
|
47
50
|
}
|
|
48
51
|
componentWillUnmount() {
|
|
49
52
|
getStore().dispatch({ type: DANGEROUS_DESTROY_STORE });
|
|
@@ -5,6 +5,7 @@ import queryString from "query-string";
|
|
|
5
5
|
import moment from "moment-business-days";
|
|
6
6
|
import { getConfig } from "../config";
|
|
7
7
|
import { SmartScriptStore } from "../libs/SmartScriptStore";
|
|
8
|
+
import { smartScriptLoadedMessage } from "../constants/smartscript";
|
|
8
9
|
let initTriggersCallback = null;
|
|
9
10
|
const SmartScriptComponent = () => {
|
|
10
11
|
const [smartScriptLoaded, setSmartScriptLoaded] = useState(false);
|
|
@@ -55,6 +56,11 @@ const SmartScriptComponent = () => {
|
|
|
55
56
|
uniqid,
|
|
56
57
|
isNewInstance,
|
|
57
58
|
]);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
if (smartScriptLoaded) {
|
|
61
|
+
window.parent.postMessage(smartScriptLoadedMessage, window.location.origin);
|
|
62
|
+
}
|
|
63
|
+
}, [smartScriptLoaded]);
|
|
58
64
|
window.initTriggers = (callback, inputs, newInstance = true) => {
|
|
59
65
|
SmartScriptStore.inputs = inputs;
|
|
60
66
|
if (smartScriptLoaded) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const smartScriptLoadedMessage = "SmartScriptLoaded";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const smartScriptLoadedMessage = "SmartScriptLoaded";
|
|
@@ -6,6 +6,7 @@ import { ENABLE_SMARTSCRIPT } from "../constants/smartscript";
|
|
|
6
6
|
import { PathReader } from "../../libs/PathReader";
|
|
7
7
|
import { initSmartscriptTriggersAction } from "../actions/smartscript";
|
|
8
8
|
import { updateOptionAction, updateVariableAction } from "../actions/inputs";
|
|
9
|
+
import { smartScriptLoadedMessage } from "../../constants/smartscript";
|
|
9
10
|
let iframe = null;
|
|
10
11
|
const watchEnableSmartScript = (mpi, next, action) => {
|
|
11
12
|
next(action);
|
|
@@ -36,17 +37,19 @@ const watchEnableSmartScript = (mpi, next, action) => {
|
|
|
36
37
|
iframe.src = `${window.location.protocol}//${window.location.host}/contrats/${permalink}/smartscript/${uniqid || ""}${modelVersion ? `?version=${modelVersion}` : ""}`;
|
|
37
38
|
}
|
|
38
39
|
const isNewInstance = !(typeof uniqid === "string" && uniqid.trim().length > 0);
|
|
39
|
-
|
|
40
|
+
window.addEventListener("message", (event) => {
|
|
40
41
|
var _a, _b;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
if (event.data === smartScriptLoadedMessage) {
|
|
43
|
+
(_b = (_a = iframe === null || iframe === void 0 ? void 0 : iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.initTriggers) === null || _b === void 0 ? void 0 : _b.call(_a, (triggers, actions) => {
|
|
44
|
+
mpi.dispatch(initSmartscriptTriggersAction(triggers));
|
|
45
|
+
if (Array.isArray(actions)) {
|
|
46
|
+
actions.forEach((_action) => {
|
|
47
|
+
mpi.dispatch(_action);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}, cloneDeep(mpi.getState().inputs), isNewInstance);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
50
53
|
document.body.append(iframe);
|
|
51
54
|
};
|
|
52
55
|
const watchUpdateOptionInput = (mpi, next, action) => {
|
|
@@ -24,7 +24,7 @@ function* setUserEmailDecorator(action) {
|
|
|
24
24
|
}
|
|
25
25
|
yield put(setUserStatusAction("inprogress"));
|
|
26
26
|
const permalink = selectPermalink();
|
|
27
|
-
const instanceUniqid = selectInstanceUniqid();
|
|
27
|
+
const instanceUniqid = selectInstanceUniqid() || getConfig().uniqid;
|
|
28
28
|
const ovc = OvcConverter.convertToOvc(selectInputs());
|
|
29
29
|
const nbFilledVars = Object.keys(ovc.v).reduce((p, c) => {
|
|
30
30
|
const currentValue = ovc.v[c];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legalplace/wizardx-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"author": "Moncef Hammou (moncef@legalplace.fr)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"@legalplace/lp-events": "1.14.0",
|
|
25
25
|
"@legalplace/lplogic": "^2.1.6",
|
|
26
26
|
"@legalplace/model-healthcheck": "^1.1.5",
|
|
27
|
-
"@legalplace/referencesparser": "^
|
|
27
|
+
"@legalplace/referencesparser": "^3.0.1",
|
|
28
28
|
"@legalplace/storybook": "^2.171.0",
|
|
29
|
-
"@legalplace/typeorm-constants": "^
|
|
29
|
+
"@legalplace/typeorm-constants": "^3.1.0",
|
|
30
30
|
"@loadable/component": "^5.15.0",
|
|
31
31
|
"@redux-saga/core": "^1.1.3",
|
|
32
32
|
"connected-react-router": "^6.8.0",
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@legalplace/eslint-config": "^2.2.0",
|
|
58
|
-
"@legalplace/models-v3-types": "^
|
|
58
|
+
"@legalplace/models-v3-types": "^5.1.1",
|
|
59
59
|
"@legalplace/prettier-config": "^2.1.3",
|
|
60
|
-
"@legalplace/typeorm-entities": "^
|
|
60
|
+
"@legalplace/typeorm-entities": "^5.2.0",
|
|
61
61
|
"@swc-node/jest": "^1.3.2",
|
|
62
62
|
"@swc/core": "^1.2.93",
|
|
63
63
|
"@swc/jest": "^0.2.4",
|
|
@@ -95,5 +95,5 @@
|
|
|
95
95
|
"*.test.ts",
|
|
96
96
|
"*.test.tsx"
|
|
97
97
|
],
|
|
98
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "2f40e19d65be152db1992290a75596de49eb3828"
|
|
99
99
|
}
|