@legalplace/wizardx-core 4.1.22 → 4.2.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/redux/reducers/app/instance/initInstance.js +3 -3
- package/dist/redux/reducers/app/instance/updateInstance.js +3 -3
- package/dist/redux/reducers/app/instance.test.js +2 -2
- package/dist/redux/reducers/app.test.js +6 -6
- package/dist/redux/sagas/fetchModel.js +4 -4
- package/dist/redux/selectors/app.d.ts +2 -2
- package/dist/redux/selectors/app.js +3 -5
- package/dist/redux/selectors/library.d.ts +2 -2
- package/dist/types/State.type.d.ts +2 -2
- package/package.json +5 -5
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export const initInstanceReducer = (state, action) => {
|
|
2
|
-
const { uniqid, isPaid, dataStatus, steps,
|
|
2
|
+
const { uniqid, isPaid, dataStatus, steps, companyUuid, employeeUuid } = action;
|
|
3
3
|
return Object.assign(Object.assign({}, state), { instance: {
|
|
4
4
|
dataStatus,
|
|
5
5
|
uniqid,
|
|
6
6
|
isPaid,
|
|
7
7
|
steps,
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
companyUuid,
|
|
9
|
+
employeeUuid,
|
|
10
10
|
} });
|
|
11
11
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const updateInstanceReducer = (state, action) => {
|
|
2
|
-
const { uniqid, isPaid, dataStatus, steps,
|
|
3
|
-
return Object.assign(Object.assign({}, state), { instance: Object.assign(Object.assign({}, state.instance), { dataStatus: dataStatus || state.instance.dataStatus, uniqid: uniqid || state.instance.uniqid, isPaid, steps: steps || state.instance.steps,
|
|
4
|
-
|
|
2
|
+
const { uniqid, isPaid, dataStatus, steps, companyUuid, employeeUuid } = action;
|
|
3
|
+
return Object.assign(Object.assign({}, state), { instance: Object.assign(Object.assign({}, state.instance), { dataStatus: dataStatus || state.instance.dataStatus, uniqid: uniqid || state.instance.uniqid, isPaid, steps: steps || state.instance.steps, companyUuid,
|
|
4
|
+
employeeUuid }) });
|
|
5
5
|
};
|
|
@@ -44,8 +44,8 @@ describe('App Instance Reducer', () => {
|
|
|
44
44
|
return expect(reducer).toStrictEqual(Object.assign(Object.assign({}, appStateMock), { instance: {
|
|
45
45
|
dataStatus: 'saved',
|
|
46
46
|
uniqid: '3jHD42343sDE',
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
companyUuid: undefined,
|
|
48
|
+
employeeUuid: undefined,
|
|
49
49
|
isPaid: true,
|
|
50
50
|
steps: '*',
|
|
51
51
|
} }));
|
|
@@ -26,8 +26,8 @@ const appStateMock = {
|
|
|
26
26
|
totalPages: 3,
|
|
27
27
|
},
|
|
28
28
|
instance: {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
companyUuid: undefined,
|
|
30
|
+
employeeUuid: undefined,
|
|
31
31
|
dataStatus: 'saved',
|
|
32
32
|
uniqid: '3jHD42343sDE',
|
|
33
33
|
isPaid: false,
|
|
@@ -96,8 +96,8 @@ describe('App Reducer test suit', () => {
|
|
|
96
96
|
return expect(reducer).toStrictEqual(Object.assign(Object.assign({}, appStateMock), { instance: {
|
|
97
97
|
dataStatus: 'saved',
|
|
98
98
|
uniqid: 'SomeUniqid123',
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
employeeUuid: undefined,
|
|
100
|
+
companyUuid: undefined,
|
|
101
101
|
isPaid: true,
|
|
102
102
|
steps: '*',
|
|
103
103
|
} }));
|
|
@@ -112,8 +112,8 @@ describe('App Reducer test suit', () => {
|
|
|
112
112
|
});
|
|
113
113
|
return expect(reducer).toStrictEqual(Object.assign(Object.assign({}, appStateMock), { instance: {
|
|
114
114
|
dataStatus: 'saved',
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
employeeUuid: undefined,
|
|
116
|
+
companyUuid: undefined,
|
|
117
117
|
uniqid: '3jHD42343sDE',
|
|
118
118
|
isPaid: false,
|
|
119
119
|
steps: '*',
|
|
@@ -155,8 +155,8 @@ function* fetchInstanceInformation(appStates, permalink, uniqid, uniqidParam, pr
|
|
|
155
155
|
dataStatus: "saved",
|
|
156
156
|
uniqid: uniqid || "",
|
|
157
157
|
draft: response.instance && response.instance.draft,
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
companyUuid: (_a = response.instance) === null || _a === void 0 ? void 0 : _a.companyUuid,
|
|
159
|
+
employeeUuid: (_b = response.instance) === null || _b === void 0 ? void 0 : _b.employeeUuid,
|
|
160
160
|
isPaid: response.instance &&
|
|
161
161
|
(response.instance.isPaid.toString() === "1" ||
|
|
162
162
|
response.instance.isPaid === true),
|
|
@@ -197,8 +197,8 @@ function* createInstance(enableShadowInstance, modelInformation, uniqid, permali
|
|
|
197
197
|
dataStatus: "saved",
|
|
198
198
|
uniqid: uniqid || "",
|
|
199
199
|
draft: false,
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
companyUuid: undefined,
|
|
201
|
+
employeeUuid: undefined,
|
|
202
202
|
isPaid: false,
|
|
203
203
|
steps: [1],
|
|
204
204
|
};
|
|
@@ -19,8 +19,8 @@ export declare const selectMeta: () => Readonly<import("../../types/State.type")
|
|
|
19
19
|
export declare const selectMetaFetchStatus: () => Readonly<"failed" | "waiting" | "succeeded" | "unhealthy" | "userLocked" | "nonBlocking">;
|
|
20
20
|
export declare const selectPrefix: () => Readonly<string | undefined>;
|
|
21
21
|
export declare const selectInstanceUniqid: () => Readonly<string | undefined>;
|
|
22
|
-
export declare const
|
|
23
|
-
export declare const
|
|
22
|
+
export declare const selectInstanceCompanyUuid: () => Readonly<string | undefined>;
|
|
23
|
+
export declare const selectInstanceEmployeeUuid: () => Readonly<string | undefined>;
|
|
24
24
|
export declare const selectDataStatus: () => Readonly<"saved" | "unsaved" | "saving" | "failed">;
|
|
25
25
|
export declare const selectInstanceIsPaid: () => Readonly<boolean>;
|
|
26
26
|
export declare const selectInstanceSteps: () => Readonly<boolean>;
|
|
@@ -60,12 +60,10 @@ export const selectMeta = createSelector((state) => state.app.meta, (state) => s
|
|
|
60
60
|
export const selectMetaFetchStatus = createSelector((state) => state.app.meta.fetchStatus, (state) => state.app.meta.fetchStatus);
|
|
61
61
|
export const selectPrefix = createSelector((state) => (!state.app.meta ? undefined : state.app.meta.prefix), (state) => (!state.app.meta ? "0" : state.app.meta.permalink));
|
|
62
62
|
export const selectInstanceUniqid = createSelector((state) => !state.app.instance ? undefined : state.app.instance.uniqid, (state) => (!state.app.instance ? "0" : state.app.instance.uniqid));
|
|
63
|
-
export const
|
|
63
|
+
export const selectInstanceCompanyUuid = createSelector((state) => !state.app.instance ? undefined : state.app.instance.companyUuid, (state) => !state.app.instance || !state.app.instance.companyUuid
|
|
64
64
|
? "0"
|
|
65
|
-
: state.app.instance.
|
|
66
|
-
export const
|
|
67
|
-
? "0"
|
|
68
|
-
: state.app.instance.employeeId.toString());
|
|
65
|
+
: state.app.instance.companyUuid);
|
|
66
|
+
export const selectInstanceEmployeeUuid = createSelector((state) => !state.app.instance ? undefined : state.app.instance.employeeUuid, (state) => { var _a; return !((_a = state.app.instance) === null || _a === void 0 ? void 0 : _a.employeeUuid) ? "0" : state.app.instance.employeeUuid; });
|
|
69
67
|
export const selectDataStatus = createSelector((state) => !state.app.instance ? "unsaved" : state.app.instance.dataStatus, (state) => !state.app.instance ? "0" : state.app.instance.dataStatus);
|
|
70
68
|
export const selectInstanceIsPaid = createSelector((state) => !!(state.app.instance && state.app.instance.isPaid), (state) => state.app.instance && state.app.instance.isPaid
|
|
71
69
|
? state.app.instance.isPaid.toString()
|
|
@@ -85,8 +85,8 @@ export declare const selectorsLibrary: {
|
|
|
85
85
|
selectMetaFetchStatus: () => Readonly<"failed" | "waiting" | "succeeded" | "unhealthy" | "userLocked" | "nonBlocking">;
|
|
86
86
|
selectPrefix: () => Readonly<string | undefined>;
|
|
87
87
|
selectInstanceUniqid: () => Readonly<string | undefined>;
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
selectInstanceCompanyUuid: () => Readonly<string | undefined>;
|
|
89
|
+
selectInstanceEmployeeUuid: () => Readonly<string | undefined>;
|
|
90
90
|
selectDataStatus: () => Readonly<"saved" | "unsaved" | "saving" | "failed">;
|
|
91
91
|
selectInstanceIsPaid: () => Readonly<boolean>;
|
|
92
92
|
selectInstanceSteps: () => Readonly<boolean>;
|
|
@@ -166,8 +166,8 @@ export interface AppCustomizationMetaType extends ModelV3CustomizationMeta {
|
|
|
166
166
|
export interface AppInstanceType {
|
|
167
167
|
dataStatus: "saved" | "unsaved" | "saving" | "failed";
|
|
168
168
|
uniqid: string;
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
companyUuid?: string;
|
|
170
|
+
employeeUuid?: string;
|
|
171
171
|
isPaid?: boolean;
|
|
172
172
|
draft?: boolean;
|
|
173
173
|
steps: "*" | number[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legalplace/wizardx-core",
|
|
3
|
-
"version": "4.1
|
|
3
|
+
"version": "4.2.1",
|
|
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.0.3",
|
|
28
28
|
"@legalplace/storybook": "^2.171.0",
|
|
29
|
-
"@legalplace/typeorm-constants": "^3.
|
|
29
|
+
"@legalplace/typeorm-constants": "^3.8.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": "^5.1.
|
|
58
|
+
"@legalplace/models-v3-types": "^5.1.9",
|
|
59
59
|
"@legalplace/prettier-config": "^2.1.3",
|
|
60
|
-
"@legalplace/typeorm-entities": "^5.
|
|
60
|
+
"@legalplace/typeorm-entities": "^5.13.1",
|
|
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": "bf705f3c771d17a70b3c37761ba4c20383920343"
|
|
99
99
|
}
|