@legalplace/wizardx-core 4.18.1 → 4.19.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.
@@ -5,7 +5,7 @@ import { selectPermalink, selectInstanceUniqid } from "../selectors/app";
5
5
  import { SAVE_DATA } from "../constants/sagas/data";
6
6
  import { selectInputs } from "../selectors/inputs";
7
7
  import { OvcConverter } from "../../libs/OvcConverter";
8
- import { updateInstanceArguments } from "../../service/api.manager";
8
+ import { updateInstanceArguments, updateProofModule, } from "../../service/api.manager";
9
9
  import { cancelOnResetState } from "../../helpers/sagaCancelOnResetState";
10
10
  function* saveDataDecorator(action) {
11
11
  try {
@@ -16,6 +16,7 @@ function* saveDataDecorator(action) {
16
16
  throw new Error("Cannot save data, uniqid is not defined");
17
17
  const response = yield call(fetch, ...updateInstanceArguments(permalink, uniqid, OvcConverter.convertToOvc(selectInputs()), action.confirmAnswer ? 0 : 1, action.additionalProperties));
18
18
  const responseData = yield call([response, "json"]);
19
+ yield call(fetch, ...updateProofModule(uniqid));
19
20
  if (action.redirect === true) {
20
21
  const searchParams = new URLSearchParams(window.location.search);
21
22
  const onRedirectClose = searchParams.get("onRedirectClose");
@@ -7,3 +7,4 @@ export declare const getCreateInstanceArguments: (permalink: string, searchParam
7
7
  export declare const getClientConfigArguments: (permalink?: string | undefined, uniqid?: string | undefined) => [RequestInfo, RequestInit?];
8
8
  export declare const getUserProfileArguments: () => [RequestInfo, RequestInit?];
9
9
  export declare const updateInstanceArguments: (permalink: string, uniqid: string | undefined, ovc: OvcType, draft: number, additionalProperties?: Record<string, string | number> | undefined) => [RequestInfo, RequestInit?];
10
+ export declare const updateProofModule: (uniqid: string) => [RequestInfo, RequestInit?];
@@ -158,3 +158,24 @@ export const updateInstanceArguments = (permalink, uniqid, ovc, draft, additiona
158
158
  },
159
159
  ];
160
160
  };
161
+ export const updateProofModule = (uniqid) => {
162
+ const apiEndpoint = getConfig().apiEndpoint + (/\/$/.test(getConfig().apiEndpoint) ? "" : "/");
163
+ let headers = {
164
+ "Content-Type": "application/json",
165
+ };
166
+ const traceHeader = getTraceHeader();
167
+ if (traceHeader) {
168
+ headers["X-Amzn-Trace-Id"] = traceHeader;
169
+ }
170
+ if (isAuthenticatedWizard) {
171
+ headers = Object.assign(Object.assign(Object.assign({}, headers), canalHeaders), { Authorization: `Bearer ${getAuthToken()}` });
172
+ }
173
+ return [
174
+ `${apiEndpoint}contract/module/justificatifswithuniqid/${uniqid}`,
175
+ {
176
+ method: "GET",
177
+ credentials: "include",
178
+ headers,
179
+ },
180
+ ];
181
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legalplace/wizardx-core",
3
- "version": "4.18.1",
3
+ "version": "4.19.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.22",
28
28
  "@legalplace/storybook": "^2.171.0",
29
- "@legalplace/typeorm-constants": "^3.36.2",
29
+ "@legalplace/typeorm-constants": "^3.37.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.26",
57
+ "@legalplace/data-gouv": "^1.5.27",
58
58
  "@legalplace/eslint-config": "^2.2.0",
59
- "@legalplace/models-v3-types": "^5.12.0",
59
+ "@legalplace/models-v3-types": "^5.12.1",
60
60
  "@legalplace/prettier-config": "^2.1.3",
61
- "@legalplace/typeorm-entities": "^5.31.3",
61
+ "@legalplace/typeorm-entities": "^5.32.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": "f50a2c6bcb33a9c5222179592505974a514434ce"
99
+ "gitHead": "b5925547ac5c90a9265fe53756c2032040ae5031"
100
100
  }