@legalplace/wizardx-core 4.42.10-nightly.20251125120616 → 4.42.11
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/README.md +1 -376
- package/dist/App.d.ts +6 -1
- package/dist/App.js +7 -2
- package/dist/App.test.js +37 -0
- package/dist/Loader.d.ts +1 -1
- package/dist/Loader.js +1 -1
- package/dist/PluginLoader.d.ts +36 -21
- package/dist/PluginLoader.js +227 -90
- package/dist/PluginLoader.test.d.ts +1 -0
- package/dist/PluginLoader.test.js +52 -0
- package/dist/Shimmer.d.ts +11 -8
- package/dist/Shimmer.js +4 -4
- package/dist/ThemeLoader.d.ts +8 -8
- package/dist/ThemeLoader.test.d.ts +2 -0
- package/dist/ThemeLoader.test.js +65 -0
- package/dist/components/PluginRoute.d.ts +2 -2
- package/dist/components/PluginRoute.js +4 -3
- package/dist/components/SmartScript.d.ts +6 -2
- package/dist/components/SmartScript.js +1 -1
- package/dist/components/UserLocked/UserLockedComponent.js +2 -2
- package/dist/components/View.d.ts +3 -3
- package/dist/components/View.js +7 -5
- package/dist/components/View.test.d.ts +2 -0
- package/dist/components/View.test.js +84 -0
- package/dist/componentsConnectors/connectBox.d.ts +6 -4
- package/dist/componentsConnectors/connectBox.test.d.ts +1 -0
- package/dist/componentsConnectors/connectBox.test.js +218 -0
- package/dist/componentsConnectors/connectDocument.d.ts +6 -4
- package/dist/componentsConnectors/connectDocument.test.d.ts +1 -0
- package/dist/componentsConnectors/connectDocument.test.js +95 -0
- package/dist/componentsConnectors/connectHeader.d.ts +6 -4
- package/dist/componentsConnectors/connectMetaTitle.d.ts +7 -3
- package/dist/componentsConnectors/connectMetaTitle.test.d.ts +1 -0
- package/dist/componentsConnectors/connectMetaTitle.test.js +32 -0
- package/dist/componentsConnectors/connectOption.d.ts +7 -5
- package/dist/componentsConnectors/connectPagination.d.ts +7 -5
- package/dist/componentsConnectors/connectPreview.d.ts +7 -3
- package/dist/componentsConnectors/connectProgress.d.ts +6 -4
- package/dist/componentsConnectors/connectRootOption.d.ts +7 -5
- package/dist/componentsConnectors/connectSection.d.ts +6 -4
- package/dist/componentsConnectors/connectSummary.d.ts +9 -5
- package/dist/componentsConnectors/connectSummaryItem.d.ts +6 -4
- package/dist/componentsConnectors/connectTermsheet.js +1 -1
- package/dist/componentsConnectors/connectVariable.d.ts +8 -6
- package/dist/componentsConnectors/connectWizardWrapper.d.ts +6 -4
- package/dist/componentsConnectors/connector/componentConnector.d.ts +10 -7
- package/dist/componentsConnectors/connector/componentConnector.js +3 -3
- package/dist/componentsConnectors/library.d.ts +81 -47
- package/dist/config.test.d.ts +1 -0
- package/dist/config.test.js +54 -0
- package/dist/helpers/activitiesHelper.d.ts +3 -3
- package/dist/helpers/autocomplete.helper.d.ts +2 -2
- package/dist/helpers/autocomplete.helper.js +1 -1
- package/dist/helpers/autosave.helper.d.ts +13 -3
- package/dist/helpers/autosave.helper.js +70 -3
- package/dist/helpers/inpiCitiesHelper.js +1 -1
- package/dist/helpers/outputsParsing.d.ts +9 -9
- package/dist/hooks/useDispatch.d.ts +1 -1
- package/dist/hooks/usePrevious.js +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -3
- package/dist/libs/ConditionsRunner.d.ts +1 -1
- package/dist/libs/Formatter/FormatAddress.d.ts +1 -1
- package/dist/libs/InputsInitiator.d.ts +1 -1
- package/dist/libs/NumAuto.test.d.ts +1 -0
- package/dist/libs/NumAuto.test.js +43 -0
- package/dist/libs/PathReader.d.ts +1 -96
- package/dist/libs/PathReader.js +2 -1
- package/dist/libs/SectionValidity.test.d.ts +1 -0
- package/dist/libs/SectionValidity.test.js +116 -0
- package/dist/libs/SmartScriptStore.d.ts +6 -6
- package/dist/redux/actions/app.d.ts +1 -1
- package/dist/redux/actions/app.test.d.ts +1 -0
- package/dist/redux/actions/app.test.js +90 -0
- package/dist/redux/actions/conditions.test.d.ts +1 -0
- package/dist/redux/actions/conditions.test.js +68 -0
- package/dist/redux/actions/inputs.d.ts +1 -1
- package/dist/redux/actions/inputs.test.d.ts +1 -0
- package/dist/redux/actions/inputs.test.js +53 -0
- package/dist/redux/actions/library.d.ts +21 -15
- package/dist/redux/actions/references.d.ts +2 -2
- package/dist/redux/actions/references.test.d.ts +1 -0
- package/dist/redux/actions/references.test.js +43 -0
- package/dist/redux/actions/sagas/data.d.ts +1 -1
- package/dist/redux/actions/sagas/data.test.d.ts +1 -0
- package/dist/redux/actions/sagas/data.test.js +11 -0
- package/dist/redux/actions/sagas/model.test.d.ts +1 -0
- package/dist/redux/actions/sagas/model.test.js +11 -0
- package/dist/redux/actions/sagas/user.d.ts +1 -1
- package/dist/redux/actions/user.test.d.ts +1 -0
- package/dist/redux/actions/user.test.js +16 -0
- package/dist/redux/listeners/subscriber.d.ts +1 -1
- package/dist/redux/listeners/subscriber.test.d.ts +1 -0
- package/dist/redux/listeners/subscriber.test.js +31 -0
- package/dist/redux/middlewares/conditionsWatcherMiddleware.d.ts +1 -1
- package/dist/redux/middlewares/conditionsWatcherMiddleware.test.d.ts +1 -0
- package/dist/redux/middlewares/conditionsWatcherMiddleware.test.js +330 -0
- package/dist/redux/middlewares/evaluationsWatcherMiddleware.d.ts +1 -1
- package/dist/redux/middlewares/evaluationsWatcherMiddleware.test.d.ts +1 -0
- package/dist/redux/middlewares/evaluationsWatcherMiddleware.test.js +242 -0
- package/dist/redux/middlewares/mandatoriesWatcherMiddleware.d.ts +1 -1
- package/dist/redux/middlewares/multiplesActionsMiddleware.d.ts +1 -1
- package/dist/redux/middlewares/multiplesActionsMiddleware.test.d.ts +1 -0
- package/dist/redux/middlewares/multiplesActionsMiddleware.test.js +209 -0
- package/dist/redux/middlewares/paginationWatcherMiddleware.d.ts +2 -2
- package/dist/redux/middlewares/pluginsHookMiddleware.d.ts +2 -1
- package/dist/redux/middlewares/pluginsHookMiddleware.js +7 -1
- package/dist/redux/middlewares/prefillerWatcherMiddleware.d.ts +1 -1
- package/dist/redux/middlewares/prefillerWatcherMiddleware.test.d.ts +1 -0
- package/dist/redux/middlewares/prefillerWatcherMiddleware.test.js +84 -0
- package/dist/redux/middlewares/smartscriptMiddleware.d.ts +1 -1
- package/dist/redux/middlewares/smartscriptMiddleware.js +2 -2
- package/dist/redux/middlewares/thirdpartyScriptsMiddleware.d.ts +1 -1
- package/dist/redux/reducers/app/instance.test.d.ts +1 -0
- package/dist/redux/reducers/app/instance.test.js +75 -0
- package/dist/redux/reducers/app/meta.test.d.ts +1 -0
- package/dist/redux/reducers/app/meta.test.js +70 -0
- package/dist/redux/reducers/app/pagination/updateAvailableAppStates.js +2 -1
- package/dist/redux/reducers/app/pagination.test.d.ts +1 -0
- package/dist/redux/reducers/app/pagination.test.js +134 -0
- package/dist/redux/reducers/app/wizard.test.d.ts +1 -0
- package/dist/redux/reducers/app/wizard.test.js +53 -0
- package/dist/redux/reducers/app.d.ts +6 -6
- package/dist/redux/reducers/app.test.d.ts +1 -0
- package/dist/redux/reducers/app.test.js +175 -0
- package/dist/redux/reducers/conditions/addMultipleOccurency.test.d.ts +1 -0
- package/dist/redux/reducers/conditions/addMultipleOccurency.test.js +108 -0
- package/dist/redux/reducers/conditions/deleteMultipleOccurency.test.d.ts +1 -0
- package/dist/redux/reducers/conditions/deleteMultipleOccurency.test.js +77 -0
- package/dist/redux/reducers/conditions/updateDocumentConditions.test.d.ts +1 -0
- package/dist/redux/reducers/conditions/updateDocumentConditions.test.js +35 -0
- package/dist/redux/reducers/conditions/updateOptionValidatorCondition.test.d.ts +1 -0
- package/dist/redux/reducers/conditions/updateOptionValidatorCondition.test.js +35 -0
- package/dist/redux/reducers/conditions/updateVariableValidatorCondition.test.d.ts +1 -0
- package/dist/redux/reducers/conditions/updateVariableValidatorCondition.test.js +35 -0
- package/dist/redux/reducers/conditions.test.d.ts +1 -0
- package/dist/redux/reducers/conditions.test.js +196 -0
- package/dist/redux/reducers/inputs/addMultipleOccurency.test.d.ts +1 -0
- package/dist/redux/reducers/inputs/addMultipleOccurency.test.js +101 -0
- package/dist/redux/reducers/inputs/deleteMultipleOccurency.test.d.ts +1 -0
- package/dist/redux/reducers/inputs/deleteMultipleOccurency.test.js +56 -0
- package/dist/redux/reducers/inputs.test.d.ts +1 -0
- package/dist/redux/reducers/inputs.test.js +171 -0
- package/dist/redux/reducers/references.js +0 -2
- package/dist/redux/reducers/user.test.d.ts +1 -0
- package/dist/redux/reducers/user.test.js +42 -0
- package/dist/redux/routerHistore.test.d.ts +1 -0
- package/dist/redux/routerHistore.test.js +15 -0
- package/dist/redux/sagas/fetchModel.test.d.ts +1 -0
- package/dist/redux/sagas/fetchModel.test.js +127 -0
- package/dist/redux/sagas/runner.test.d.ts +1 -0
- package/dist/redux/sagas/runner.test.js +10 -0
- package/dist/redux/sagas/saveData.test.d.ts +1 -0
- package/dist/redux/sagas/saveData.test.js +74 -0
- package/dist/redux/sagas/setDefaults.test.d.ts +1 -0
- package/dist/redux/sagas/setDefaults.test.js +73 -0
- package/dist/redux/selectors/app.test.d.ts +1 -0
- package/dist/redux/selectors/app.test.js +99 -0
- package/dist/redux/selectors/conditions.test.d.ts +1 -0
- package/dist/redux/selectors/conditions.test.js +70 -0
- package/dist/redux/selectors/inputs.d.ts +1 -1
- package/dist/redux/selectors/inputs.test.d.ts +1 -0
- package/dist/redux/selectors/inputs.test.js +44 -0
- package/dist/redux/selectors/references.test.d.ts +1 -0
- package/dist/redux/selectors/references.test.js +471 -0
- package/dist/redux/selectors/selectors.d.ts +4 -4
- package/dist/redux/selectors/selectors.test.d.ts +1 -0
- package/dist/redux/selectors/selectors.test.js +16 -0
- package/dist/redux/selectors/user.test.d.ts +1 -0
- package/dist/redux/selectors/user.test.js +29 -0
- package/dist/redux/store.d.ts +3 -5
- package/dist/redux/store.js +1 -2
- package/dist/redux/store.test.d.ts +1 -0
- package/dist/redux/store.test.js +16 -0
- package/dist/service/api.manager.d.ts +2 -2
- package/dist/service/autocomplete.manager.d.ts +3 -3
- package/dist/service/autocomplete.manager.js +3 -3
- package/dist/tests-misc/plugins/jestTestPlugin/after.js +1 -1
- package/dist/tests-misc/plugins/jestTestPlugin/before.js +1 -1
- package/dist/tests-misc/plugins/jestTestPlugin/title.js +1 -1
- package/dist/tests-misc/themes/jestTestTheme/components/EmailComponent.d.ts +1 -1
- package/dist/tests-misc/themes/jestTestTheme/components/EmailComponent.js +1 -1
- package/dist/tests-misc/themes/jestTestTheme/components/TermsheetComponent.d.ts +1 -1
- package/dist/tests-misc/themes/jestTestTheme/components/TermsheetComponent.js +1 -1
- package/dist/tests-misc/themes/jestTestTheme/components/WizardComponent.d.ts +1 -1
- package/dist/tests-misc/themes/jestTestTheme/components/WizardComponent.js +1 -1
- package/dist/types/Actions.type.d.ts +6 -70
- package/dist/types/Components.type.d.ts +2 -3
- package/dist/types/PluginConfig.type.d.ts +52 -18
- package/dist/types/State.type.d.ts +2 -2
- package/dist/types/config.type.d.ts +1 -1
- package/dist/types/getActions.type.d.ts +1 -1
- package/dist/types/getConnectors.type.d.ts +2 -2
- package/dist/types/getSelectors.type.d.ts +1 -1
- package/package.json +22 -45
- package/dist/WizardCore.d.ts +0 -29
- package/dist/WizardCore.js +0 -153
- package/dist/app.entry.d.ts +0 -2
- package/dist/app.entry.js +0 -1
- package/dist/routing/adapters/nextjs.adapter.d.ts +0 -3
- package/dist/routing/adapters/nextjs.adapter.js +0 -61
- package/dist/routing/adapters/reactRouter.adapter.d.ts +0 -2
- package/dist/routing/adapters/reactRouter.adapter.js +0 -16
- package/dist/routing/context.d.ts +0 -14
- package/dist/routing/context.js +0 -23
- package/dist/routing/index.d.ts +0 -4
- package/dist/routing/index.js +0 -4
- package/dist/routing/types.d.ts +0 -26
- package/dist/wizardcore.entry.d.ts +0 -3
- package/dist/wizardcore.entry.js +0 -2
- /package/dist/{routing/types.js → App.test.d.ts} +0 -0
|
@@ -1,33 +1,36 @@
|
|
|
1
1
|
import * as app from "./app";
|
|
2
2
|
export declare const actionsLibrary: {
|
|
3
|
-
setUserEmail: (email: string, disableRedirect?: boolean, inBackground?: boolean) => import("../..").ActionsType.User.setUserEmail;
|
|
3
|
+
setUserEmail: (email: string, disableRedirect?: boolean | undefined, inBackground?: boolean | undefined) => import("../..").ActionsType.User.setUserEmail;
|
|
4
4
|
setUserEmailSucceeded: () => import("../..").ActionsType.User.setUserEmailSucceeded;
|
|
5
5
|
fetchModelPrerequisitesAction: (permalink: string, prefix?: string) => import("../..").ActionsType.Sagas.Model.fetchModelPrerequisites;
|
|
6
6
|
fetchModelAction: (permalink: string, prefix: string | undefined, uniqid: string | undefined, uniqidParam: string | undefined, queryParams: URLSearchParams, pathReader: import("../..").PathReader, urlParams: URLSearchParams, clientConfigReturnValue: {
|
|
7
7
|
appStates: string[];
|
|
8
8
|
enableShadowInstance: boolean;
|
|
9
9
|
}, wizardConfig: import("../..").WizardConfigResponse) => import("../..").ActionsType.Sagas.Model.fetchModel;
|
|
10
|
-
saveDataAction: (redirect?: boolean, confirmAnswer?: boolean, redirectFallback?: string, redirectOverride?: string, additionalProperties?: Record<string, string | number>) => import("../..").ActionsType.Sagas.Data.saveData;
|
|
10
|
+
saveDataAction: (redirect?: boolean, confirmAnswer?: boolean | undefined, redirectFallback?: string | undefined, redirectOverride?: string | undefined, additionalProperties?: Record<string, string | number> | undefined) => import("../..").ActionsType.Sagas.Data.saveData;
|
|
11
11
|
initUserAction: (user: Omit<import("../..").StateType.User, "status">) => import("../..").ActionsType.User.initUser;
|
|
12
|
-
setUserStatusAction: (status: "
|
|
12
|
+
setUserStatusAction: (status: "failed" | "authenticated" | "unauthenticated" | "inprogress") => import("../..").ActionsType.User.setUserStatus;
|
|
13
13
|
setUserValidTokenAction: (validToken: boolean) => import("../..").ActionsType.User.setUserValidToken;
|
|
14
14
|
enableSmartscriptAction: () => import("../..").ActionsType.SmartScript.enableSmartScript;
|
|
15
|
-
initDataSmartscriptAction: (data:
|
|
15
|
+
initDataSmartscriptAction: (data: object | undefined) => import("../..").ActionsType.SmartScript.initDataSmartscript;
|
|
16
16
|
callInitDataSmartscriptAction: () => import("../..").ActionsType.SmartScript.requestinitDataSmartscript;
|
|
17
|
-
initSmartscriptTriggersAction: (triggers:
|
|
17
|
+
initSmartscriptTriggersAction: (triggers: {
|
|
18
|
+
options: number[];
|
|
19
|
+
variables: number[];
|
|
20
|
+
}) => import("../..").ActionsType.SmartScript.initSmartscriptTriggers;
|
|
18
21
|
updateSmartscriptOptionHiddenAction: (id: number, index: number, hide: boolean) => import("../..").ActionsType.SmartScript.updateSmartscriptOptionHidden;
|
|
19
22
|
updateSmartscriptVariableHiddenAction: (id: number, index: number, hide: boolean) => import("../..").ActionsType.SmartScript.updateSmartscriptVariableHidden;
|
|
20
23
|
initReferencesAction: (references: import("../..").StateType.References) => import("../..").ActionsType.References.initReferences;
|
|
21
|
-
updateVariableMetaAction: (id: number, meta: import("../..").ActionsType.References.
|
|
22
|
-
updateOptionMetaAction: (id: number, meta: import("../..").ActionsType.References.
|
|
23
|
-
setDisabledVariableAction: (id: number, disabled: boolean, index: number, disabledTooltip?: string) => import("../..").ActionsType.References.setDisabledVariable;
|
|
24
|
+
updateVariableMetaAction: (id: number, meta: import("../..").ActionsType.References.VariableUpdatableMeta, index?: number | undefined) => import("../..").ActionsType.References.updateVariableMeta;
|
|
25
|
+
updateOptionMetaAction: (id: number, meta: import("../..").ActionsType.References.OptionUpdatableMeta) => import("../..").ActionsType.References.updateOptionMeta;
|
|
26
|
+
setDisabledVariableAction: (id: number, disabled: boolean, index: number, disabledTooltip?: string | undefined) => import("../..").ActionsType.References.setDisabledVariable;
|
|
24
27
|
initMandatoryOptionAction: (id: number, value: boolean[]) => import("../..").ActionsType.Mandatories.initMandatoryOption;
|
|
25
28
|
initMandatoryVariableAction: (id: number, value: boolean[]) => import("../..").ActionsType.Mandatories.initMandatoryVariable;
|
|
26
29
|
setMandatoryIgnoreAction: (value: boolean) => import("../..").ActionsType.Mandatories.setMandatoryIgnore;
|
|
27
30
|
setMandatorySectionAction: (id: number, value: boolean) => import("../..").ActionsType.Mandatories.setMandatorySection;
|
|
28
31
|
setMandatoryOptionAction: (id: number, index: number, value: boolean) => import("../..").ActionsType.Mandatories.setMandatoryOption;
|
|
29
32
|
setMandatoryVariableAction: (id: number, index: number, value: boolean) => import("../..").ActionsType.Mandatories.setMandatoryVariable;
|
|
30
|
-
initInputsAction: (inputs: import("../..").StateType.Inputs, references?: import("../..").StateType.References) => import("../..").ActionsType.Inputs.initInputs;
|
|
33
|
+
initInputsAction: (inputs: import("../..").StateType.Inputs, references?: import("../..").StateType.References | undefined) => import("../..").ActionsType.Inputs.initInputs;
|
|
31
34
|
initOptionAction: (id: number, values: boolean[]) => import("../..").ActionsType.Inputs.initOption;
|
|
32
35
|
updateOptionAction: (id: number, value: boolean, index: number) => import("../..").ActionsType.Inputs.updateOptionInput;
|
|
33
36
|
initVariableAction: (id: number, values: (string | number)[]) => import("../..").ActionsType.Inputs.initVariable;
|
|
@@ -43,26 +46,29 @@ export declare const actionsLibrary: {
|
|
|
43
46
|
updateOptionValidatorConditionsAction: (id: number, index: number, value: boolean) => import("../..").ActionsType.Conditions.updateOptionValidatorCondition;
|
|
44
47
|
updateVariableValidatorConditionsAction: (id: number, index: number, value: boolean) => import("../..").ActionsType.Conditions.updateVariableValidatorCondition;
|
|
45
48
|
initMetaAction: (meta: Omit<import("../..").StateType.App.Meta, "fetchStatus">) => import("../..").ActionsType.App.initMeta;
|
|
46
|
-
setModelUuidAction: (modelUuid:
|
|
49
|
+
setModelUuidAction: (modelUuid: string | undefined) => import("../..").ActionsType.App.setModelUuid;
|
|
47
50
|
fetchModelSucceededAction: () => import("../..").ActionsType.App.fetchModelSucceeded;
|
|
48
51
|
fetchModelNonBlockingAction: () => import("../..").ActionsType.App.fetchModelNonBlocking;
|
|
49
|
-
fetchModelUnhealthyAction: (report:
|
|
52
|
+
fetchModelUnhealthyAction: (report: {
|
|
53
|
+
object: import("@legalplace/model-healthcheck/dist/libs/HealthCheck.type").HealthCheckReport;
|
|
54
|
+
raw: string;
|
|
55
|
+
} | undefined) => import("../..").ActionsType.App.fetchModelUnhealthy;
|
|
50
56
|
fetchModelUserLockedAction: () => import("../..").ActionsType.App.fetchModelUserLocked;
|
|
51
57
|
fetchModelFailedAction: () => import("../..").ActionsType.App.fetchModelFailed;
|
|
52
58
|
setDataStatus: (dataStatus: "saved" | "unsaved" | "saving" | "failed") => import("../..").ActionsType.App.setDataStatus;
|
|
53
|
-
setFetchStatus: (fetchStatus: "
|
|
59
|
+
setFetchStatus: (fetchStatus: "failed" | "waiting" | "succeeded" | "unhealthy" | "userLocked") => import("../..").ActionsType.App.setFetchStatus;
|
|
54
60
|
initInstanceAction: (instance: import("../..").StateType.App.Instance) => import("../..").ActionsType.App.initInstance;
|
|
55
61
|
updateInstanceAction: (instance: Partial<import("../..").StateType.App.Instance>) => import("../..").ActionsType.App.updateInstance;
|
|
56
62
|
updateInstancePaidAction: (isPaid: boolean) => import("../..").ActionsType.App.updateInstancePaid;
|
|
57
63
|
initPaginationAction: (pagination: app.initPaginationActionPropsType) => import("../..").ActionsType.App.initPagination;
|
|
58
|
-
updateAvailableAppStatesAction: (availableAppStates:
|
|
64
|
+
updateAvailableAppStatesAction: (availableAppStates: string[], ingorePluginAppStateReset?: boolean) => import("../..").ActionsType.App.updateAvailableAppStates;
|
|
59
65
|
goPageAction: (page: number, pushHistory?: boolean) => import("../..").ActionsType.App.goPage;
|
|
60
66
|
goNextPageAction: () => import("../..").ActionsType.App.goNextPage;
|
|
61
67
|
goPreviousPageAction: () => import("../..").ActionsType.App.goPreviousPage;
|
|
62
68
|
updateCurrentAppStateAction: (currentAppState: string) => import("../..").ActionsType.App.updateCurrentAppState;
|
|
63
69
|
updateAvailableSectionsAction: (availableSections: number[]) => import("../..").ActionsType.App.updateAvailableSections;
|
|
64
70
|
updateCurrentSectionIdAction: (currentSectionId: number) => import("../..").ActionsType.App.updateCurrentSectionId;
|
|
65
|
-
initCustomizationMetaAction: (meta:
|
|
66
|
-
initCustomizationAutoDefaultAction: (disableAutoDefault:
|
|
71
|
+
initCustomizationMetaAction: (meta: import("@legalplace/models-v3-types").CustomizationMetaDefault) => import("../..").ActionsType.App.initCustomizationMeta;
|
|
72
|
+
initCustomizationAutoDefaultAction: (disableAutoDefault: boolean | undefined) => import("../..").ActionsType.App.initCustomizationAutoDefault;
|
|
67
73
|
resetStateAction: () => import("../..").ActionsType.App.resetState;
|
|
68
74
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { StateType } from "../../types/State.type";
|
|
2
2
|
import type { ActionsType } from "../../types/Actions.type";
|
|
3
3
|
export declare const initReferencesAction: (references: StateType.References) => ActionsType.References.initReferences;
|
|
4
|
-
export declare const updateVariableMetaAction: (id: number, meta: ActionsType.References.updateVariableMeta["meta"], index?: number) => ActionsType.References.updateVariableMeta;
|
|
4
|
+
export declare const updateVariableMetaAction: (id: number, meta: ActionsType.References.updateVariableMeta["meta"], index?: number | undefined) => ActionsType.References.updateVariableMeta;
|
|
5
5
|
export declare const updateOptionMetaAction: (id: number, meta: ActionsType.References.updateOptionMeta["meta"]) => ActionsType.References.updateOptionMeta;
|
|
6
|
-
export declare const setDisabledVariableAction: (id: number, disabled: boolean, index: number, disabledTooltip?: string) => ActionsType.References.setDisabledVariable;
|
|
6
|
+
export declare const setDisabledVariableAction: (id: number, disabled: boolean, index: number, disabledTooltip?: string | undefined) => ActionsType.References.setDisabledVariable;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { initReferencesAction } from './references';
|
|
2
|
+
describe('References actions test suit', () => {
|
|
3
|
+
it('initReferences Action', () => {
|
|
4
|
+
const _obj = {
|
|
5
|
+
options: {},
|
|
6
|
+
variables: {},
|
|
7
|
+
relations: {
|
|
8
|
+
options: {},
|
|
9
|
+
variables: {},
|
|
10
|
+
sections: {},
|
|
11
|
+
},
|
|
12
|
+
conditions: {
|
|
13
|
+
options: {},
|
|
14
|
+
variables: {},
|
|
15
|
+
prefillers: {},
|
|
16
|
+
validators: {
|
|
17
|
+
options: {},
|
|
18
|
+
variables: {},
|
|
19
|
+
},
|
|
20
|
+
sections: {},
|
|
21
|
+
documents: {},
|
|
22
|
+
},
|
|
23
|
+
sections: {
|
|
24
|
+
main: {
|
|
25
|
+
'1': {
|
|
26
|
+
id: 1,
|
|
27
|
+
label: 'Some label',
|
|
28
|
+
options: [],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
documents: {},
|
|
33
|
+
defaults: {},
|
|
34
|
+
outputs: {},
|
|
35
|
+
evaluations: {},
|
|
36
|
+
boxes: {},
|
|
37
|
+
optionTags: {},
|
|
38
|
+
variableTags: {}
|
|
39
|
+
};
|
|
40
|
+
const action = initReferencesAction(_obj);
|
|
41
|
+
expect(action).toEqual(Object.assign({ type: 'INIT_REFERENCES' }, _obj));
|
|
42
|
+
});
|
|
43
|
+
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ActionsType } from "../../../types/Actions.type";
|
|
2
|
-
export declare const saveDataAction: (redirect?: boolean, confirmAnswer?: boolean, redirectFallback?: string, redirectOverride?: string, additionalProperties?: Record<string, string | number>) => ActionsType.Sagas.Data.saveData;
|
|
2
|
+
export declare const saveDataAction: (redirect?: boolean, confirmAnswer?: boolean | undefined, redirectFallback?: string | undefined, redirectOverride?: string | undefined, additionalProperties?: Record<string, string | number> | undefined) => ActionsType.Sagas.Data.saveData;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { saveDataAction } from './data';
|
|
2
|
+
it('Returns saveData action properkt', () => {
|
|
3
|
+
expect(saveDataAction()).toStrictEqual({
|
|
4
|
+
confirmAnswer: undefined,
|
|
5
|
+
additionalProperties: undefined,
|
|
6
|
+
type: 'SAVE_DATA',
|
|
7
|
+
redirect: false,
|
|
8
|
+
redirectFallback: undefined,
|
|
9
|
+
redirectOverride: undefined,
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { fetchModelPrerequisitesAction } from './model';
|
|
2
|
+
describe('Saga model actions test suit', () => {
|
|
3
|
+
it('fetchModelPrerequisites Action', () => {
|
|
4
|
+
const action = fetchModelPrerequisitesAction('test-debug');
|
|
5
|
+
return expect(action).toStrictEqual({
|
|
6
|
+
type: 'FETCH_MODEL_PREREQUISITES',
|
|
7
|
+
permalink: 'test-debug',
|
|
8
|
+
prefix: '',
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ActionsType } from "../../../types/Actions.type";
|
|
2
|
-
export declare const setUserEmail: (email: string, disableRedirect?: boolean, inBackground?: boolean) => ActionsType.User.setUserEmail;
|
|
2
|
+
export declare const setUserEmail: (email: string, disableRedirect?: boolean | undefined, inBackground?: boolean | undefined) => ActionsType.User.setUserEmail;
|
|
3
3
|
export declare const setUserEmailSucceeded: () => ActionsType.User.setUserEmailSucceeded;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { initUserAction } from './user';
|
|
2
|
+
describe('User actions test suit', () => {
|
|
3
|
+
it('initUser Action', () => {
|
|
4
|
+
const action = initUserAction({
|
|
5
|
+
level: 'ADMIN',
|
|
6
|
+
email: 'doe@legalplace.fr',
|
|
7
|
+
displayName: 'John Doe',
|
|
8
|
+
});
|
|
9
|
+
return expect(action).toStrictEqual({
|
|
10
|
+
type: 'INIT_USER',
|
|
11
|
+
level: 'ADMIN',
|
|
12
|
+
email: 'doe@legalplace.fr',
|
|
13
|
+
displayName: 'John Doe',
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Store, Dispatch, AnyAction } from "redux";
|
|
2
2
|
import type { StateType } from "../../types/State.type";
|
|
3
|
-
export type StoreListener = (previousState: StateType, currentState: StateType, dispatch: Dispatch<AnyAction>) => void;
|
|
3
|
+
export declare type StoreListener = (previousState: StateType, currentState: StateType, dispatch: Dispatch<AnyAction>) => void;
|
|
4
4
|
declare const subscribeListeners: (store: Store, listenersToSubscribe?: StoreListener[]) => void;
|
|
5
5
|
export default subscribeListeners;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { combineReducers, createStore } from 'redux';
|
|
2
|
+
import subscribeListeners from './subscriber';
|
|
3
|
+
describe('Store subscriber test suit', () => {
|
|
4
|
+
it('Subscribes a listener correctly to the store', () => {
|
|
5
|
+
const initialState = 0;
|
|
6
|
+
const goNextPageReducer = (state = initialState, action) => {
|
|
7
|
+
let page = state;
|
|
8
|
+
if (action.type === 'GO_NEXT_PAGE')
|
|
9
|
+
page += 1;
|
|
10
|
+
return page;
|
|
11
|
+
};
|
|
12
|
+
const store = createStore(combineReducers({ page: goNextPageReducer }));
|
|
13
|
+
const result = {
|
|
14
|
+
currentPage: 0,
|
|
15
|
+
previousPage: 0,
|
|
16
|
+
};
|
|
17
|
+
const listener = (previousState, currentState, dispatch) => {
|
|
18
|
+
result.currentPage = currentState.page;
|
|
19
|
+
if (typeof dispatch === 'function')
|
|
20
|
+
result.previousPage = previousState ? previousState.page : 0;
|
|
21
|
+
};
|
|
22
|
+
subscribeListeners(store, [listener]);
|
|
23
|
+
store.dispatch({ type: 'GO_NEXT_PAGE' });
|
|
24
|
+
store.dispatch({ type: 'GO_NEXT_PAGE' });
|
|
25
|
+
store.dispatch({ type: 'GO_NEXT_PAGE' });
|
|
26
|
+
expect(result).toStrictEqual({
|
|
27
|
+
currentPage: 3,
|
|
28
|
+
previousPage: 2,
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Dispatch, MiddlewareAPI } from "redux";
|
|
2
2
|
import type { ActionsType } from "../../types/Actions.type";
|
|
3
|
-
export type WatcherActions = ActionsType.Inputs.updateOptionInput | ActionsType.Inputs.updateVariableInput | ActionsType.Inputs.addMultipleOccurency | ActionsType.Inputs.deleteMultipleOccurency | ActionsType.Conditions.initConditions;
|
|
3
|
+
export declare type WatcherActions = ActionsType.Inputs.updateOptionInput | ActionsType.Inputs.updateVariableInput | ActionsType.Inputs.addMultipleOccurency | ActionsType.Inputs.deleteMultipleOccurency | ActionsType.Conditions.initConditions;
|
|
4
4
|
declare const conditionsWatcherMiddleware: (mpi: MiddlewareAPI) => (next: Dispatch) => (action: WatcherActions) => void | WatcherActions;
|
|
5
5
|
export default conditionsWatcherMiddleware;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import conditionsWatcherMiddleware from "./conditionsWatcherMiddleware";
|
|
2
|
+
import { addMultipleOccurencyAction, deleteMultipleOccurencyAction, updateOptionAction, updateVariableAction, } from "../actions/inputs";
|
|
3
|
+
import { initConditionsAction } from "../actions/conditions";
|
|
4
|
+
import { selectorsMiddleware } from "../selectors/selectors";
|
|
5
|
+
const mockInputs = {
|
|
6
|
+
variables: {
|
|
7
|
+
1: ["Hello"],
|
|
8
|
+
2: [],
|
|
9
|
+
3: [],
|
|
10
|
+
},
|
|
11
|
+
options: {
|
|
12
|
+
1: [true],
|
|
13
|
+
2: [true, true],
|
|
14
|
+
3: [true, false],
|
|
15
|
+
4: [false, true],
|
|
16
|
+
7: [true, true],
|
|
17
|
+
8: [true, true],
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
const mpi = {
|
|
21
|
+
dispatch: jest.fn(),
|
|
22
|
+
getState: () => ({
|
|
23
|
+
app: {
|
|
24
|
+
instance: {
|
|
25
|
+
dataStatus: "saved",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
inputs: mockInputs,
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
31
|
+
const next = jest.fn();
|
|
32
|
+
const initialConditions = {
|
|
33
|
+
options: {},
|
|
34
|
+
variables: {},
|
|
35
|
+
documents: {},
|
|
36
|
+
sections: {},
|
|
37
|
+
prefillers: {},
|
|
38
|
+
validators: {
|
|
39
|
+
options: {},
|
|
40
|
+
variables: {},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
const mockOptionsRelations = {
|
|
44
|
+
2: {
|
|
45
|
+
options: [],
|
|
46
|
+
variables: [],
|
|
47
|
+
sections: {},
|
|
48
|
+
documents: [],
|
|
49
|
+
prefillers: [],
|
|
50
|
+
validators: {
|
|
51
|
+
options: [],
|
|
52
|
+
variables: [],
|
|
53
|
+
},
|
|
54
|
+
parents: [],
|
|
55
|
+
children: {
|
|
56
|
+
options: [3, 4],
|
|
57
|
+
variables: [2, 3],
|
|
58
|
+
},
|
|
59
|
+
dependants: [7, 8],
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
jest.mock("../selectors/inputs", () => ({
|
|
63
|
+
__esModule: true,
|
|
64
|
+
selectOptionInput: (id) => mockInputs.options[id],
|
|
65
|
+
selectOptionInputByIndex: (id, index) => mockInputs.options[id][index],
|
|
66
|
+
selectVariableInput: (id) => mockInputs.variables[id],
|
|
67
|
+
selectVariableInputByIndex: (id, index) => mockInputs.variables[id][index],
|
|
68
|
+
}));
|
|
69
|
+
jest.mock("../../libs/ConditionsRunner", () => {
|
|
70
|
+
class ConditionsRunnerMock {
|
|
71
|
+
constructor(dispatch) {
|
|
72
|
+
this.dispatch = dispatch;
|
|
73
|
+
}
|
|
74
|
+
executeHooks(...args) {
|
|
75
|
+
this.dispatch({
|
|
76
|
+
type: "EXEC_HOOKS_MOCK",
|
|
77
|
+
arguments: args,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
__esModule: true,
|
|
83
|
+
ConditionsRunner: ConditionsRunnerMock,
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
const mockOptionsConditions = {};
|
|
87
|
+
const mockVariablesConditions = {};
|
|
88
|
+
jest.mock("../selectors/references", () => ({
|
|
89
|
+
__esModule: true,
|
|
90
|
+
selectOptionRelations: (id) => mockOptionsRelations[id],
|
|
91
|
+
selectOptionConditionsObject: (id) => mockOptionsConditions[id],
|
|
92
|
+
selectVariableConditionsObject: (id) => mockVariablesConditions[id],
|
|
93
|
+
}));
|
|
94
|
+
describe("Conditions Watcher Middleware Test suit", () => {
|
|
95
|
+
beforeEach(() => {
|
|
96
|
+
selectorsMiddleware(mpi)(next)({ type: "@INIT" });
|
|
97
|
+
jest.clearAllMocks();
|
|
98
|
+
});
|
|
99
|
+
it("Completes INIT_CONDITIONS action correctly", () => {
|
|
100
|
+
conditionsWatcherMiddleware(mpi)(next)(initConditionsAction(initialConditions));
|
|
101
|
+
expect(next.mock.calls.length).toBe(1);
|
|
102
|
+
expect(next.mock.calls[0][0]).toStrictEqual(Object.assign({ type: "INIT_CONDITIONS" }, initialConditions));
|
|
103
|
+
expect(mpi.dispatch.mock.calls.length).toBe(12);
|
|
104
|
+
expect(mpi.dispatch.mock.calls[0][0]).toStrictEqual({
|
|
105
|
+
type: "EXEC_HOOKS_MOCK",
|
|
106
|
+
arguments: ["options", 1, 0],
|
|
107
|
+
});
|
|
108
|
+
expect(mpi.dispatch.mock.calls[1][0]).toStrictEqual({
|
|
109
|
+
type: "EXEC_HOOKS_MOCK",
|
|
110
|
+
arguments: ["options", 2, 0],
|
|
111
|
+
});
|
|
112
|
+
expect(mpi.dispatch.mock.calls[2][0]).toStrictEqual({
|
|
113
|
+
type: "EXEC_HOOKS_MOCK",
|
|
114
|
+
arguments: ["options", 2, 1],
|
|
115
|
+
});
|
|
116
|
+
expect(mpi.dispatch.mock.calls[3][0]).toStrictEqual({
|
|
117
|
+
type: "EXEC_HOOKS_MOCK",
|
|
118
|
+
arguments: ["options", 3, 0],
|
|
119
|
+
});
|
|
120
|
+
expect(mpi.dispatch.mock.calls[4][0]).toStrictEqual({
|
|
121
|
+
type: "EXEC_HOOKS_MOCK",
|
|
122
|
+
arguments: ["options", 3, 1],
|
|
123
|
+
});
|
|
124
|
+
expect(mpi.dispatch.mock.calls[5][0]).toStrictEqual({
|
|
125
|
+
type: "EXEC_HOOKS_MOCK",
|
|
126
|
+
arguments: ["options", 4, 0],
|
|
127
|
+
});
|
|
128
|
+
expect(mpi.dispatch.mock.calls[6][0]).toStrictEqual({
|
|
129
|
+
type: "EXEC_HOOKS_MOCK",
|
|
130
|
+
arguments: ["options", 4, 1],
|
|
131
|
+
});
|
|
132
|
+
expect(mpi.dispatch.mock.calls[7][0]).toStrictEqual({
|
|
133
|
+
type: "EXEC_HOOKS_MOCK",
|
|
134
|
+
arguments: ["options", 7, 0],
|
|
135
|
+
});
|
|
136
|
+
expect(mpi.dispatch.mock.calls[8][0]).toStrictEqual({
|
|
137
|
+
type: "EXEC_HOOKS_MOCK",
|
|
138
|
+
arguments: ["options", 7, 1],
|
|
139
|
+
});
|
|
140
|
+
expect(mpi.dispatch.mock.calls[9][0]).toStrictEqual({
|
|
141
|
+
type: "EXEC_HOOKS_MOCK",
|
|
142
|
+
arguments: ["options", 8, 0],
|
|
143
|
+
});
|
|
144
|
+
expect(mpi.dispatch.mock.calls[10][0]).toStrictEqual({
|
|
145
|
+
type: "EXEC_HOOKS_MOCK",
|
|
146
|
+
arguments: ["options", 8, 1],
|
|
147
|
+
});
|
|
148
|
+
expect(mpi.dispatch.mock.calls[11][0]).toStrictEqual({
|
|
149
|
+
type: "EXEC_HOOKS_MOCK",
|
|
150
|
+
arguments: ["variables", 1, 0],
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
it("Completes UPDATE_OPTION_INPUT action correctly", () => {
|
|
154
|
+
conditionsWatcherMiddleware(mpi)(next)(updateOptionAction(3, false, 0));
|
|
155
|
+
expect(next.mock.calls.length).toBe(1);
|
|
156
|
+
expect(next.mock.calls[0][0]).toStrictEqual({
|
|
157
|
+
type: "UPDATE_OPTION_INPUT",
|
|
158
|
+
id: 3,
|
|
159
|
+
index: 0,
|
|
160
|
+
value: false,
|
|
161
|
+
});
|
|
162
|
+
expect(mpi.dispatch.mock.calls.length).toBe(2);
|
|
163
|
+
expect(mpi.dispatch.mock.calls[0][0]).toStrictEqual({
|
|
164
|
+
type: "SET_DATA_STATUS",
|
|
165
|
+
dataStatus: "unsaved",
|
|
166
|
+
});
|
|
167
|
+
expect(mpi.dispatch.mock.calls[1][0]).toStrictEqual({
|
|
168
|
+
type: "EXEC_HOOKS_MOCK",
|
|
169
|
+
arguments: ["options", 3, 0],
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
it("Completes UPDATE_VARIABLE_INPUT action correctly", () => {
|
|
173
|
+
conditionsWatcherMiddleware(mpi)(next)(updateVariableAction(1, "Hey", 0));
|
|
174
|
+
expect(next.mock.calls.length).toBe(1);
|
|
175
|
+
expect(next.mock.calls[0][0]).toStrictEqual({
|
|
176
|
+
type: "UPDATE_VARIABLE_INPUT",
|
|
177
|
+
id: 1,
|
|
178
|
+
index: 0,
|
|
179
|
+
value: "Hey",
|
|
180
|
+
});
|
|
181
|
+
expect(mpi.dispatch.mock.calls.length).toBe(2);
|
|
182
|
+
expect(mpi.dispatch.mock.calls[0][0]).toStrictEqual({
|
|
183
|
+
type: "SET_DATA_STATUS",
|
|
184
|
+
dataStatus: "unsaved",
|
|
185
|
+
});
|
|
186
|
+
expect(mpi.dispatch.mock.calls[1][0]).toStrictEqual({
|
|
187
|
+
type: "EXEC_HOOKS_MOCK",
|
|
188
|
+
arguments: ["variables", 1, 0],
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
it("Completes ADD_MULTIPLE_OCCURENCY action correctly", () => {
|
|
192
|
+
conditionsWatcherMiddleware(mpi)(next)(addMultipleOccurencyAction(2));
|
|
193
|
+
expect(next.mock.calls.length).toBe(1);
|
|
194
|
+
expect(next.mock.calls[0][0]).toStrictEqual({
|
|
195
|
+
type: "ADD_MULTIPLE_OCCURENCY",
|
|
196
|
+
id: 2,
|
|
197
|
+
});
|
|
198
|
+
expect(mpi.dispatch.mock.calls.length).toBe(15);
|
|
199
|
+
expect(mpi.dispatch.mock.calls[0][0]).toStrictEqual({
|
|
200
|
+
type: "SET_DATA_STATUS",
|
|
201
|
+
dataStatus: "unsaved",
|
|
202
|
+
});
|
|
203
|
+
expect(mpi.dispatch.mock.calls[1][0]).toStrictEqual({
|
|
204
|
+
type: "EXEC_HOOKS_MOCK",
|
|
205
|
+
arguments: ["options", 2, 0],
|
|
206
|
+
});
|
|
207
|
+
expect(mpi.dispatch.mock.calls[2][0]).toStrictEqual({
|
|
208
|
+
type: "EXEC_HOOKS_MOCK",
|
|
209
|
+
arguments: ["options", 2, 1],
|
|
210
|
+
});
|
|
211
|
+
expect(mpi.dispatch.mock.calls[3][0]).toStrictEqual({
|
|
212
|
+
type: "EXEC_HOOKS_MOCK",
|
|
213
|
+
arguments: ["options", 3, 0],
|
|
214
|
+
});
|
|
215
|
+
expect(mpi.dispatch.mock.calls[4][0]).toStrictEqual({
|
|
216
|
+
type: "EXEC_HOOKS_MOCK",
|
|
217
|
+
arguments: ["options", 3, 1],
|
|
218
|
+
});
|
|
219
|
+
expect(mpi.dispatch.mock.calls[5][0]).toStrictEqual({
|
|
220
|
+
type: "EXEC_HOOKS_MOCK",
|
|
221
|
+
arguments: ["options", 4, 0],
|
|
222
|
+
});
|
|
223
|
+
expect(mpi.dispatch.mock.calls[6][0]).toStrictEqual({
|
|
224
|
+
type: "EXEC_HOOKS_MOCK",
|
|
225
|
+
arguments: ["options", 4, 1],
|
|
226
|
+
});
|
|
227
|
+
expect(mpi.dispatch.mock.calls[7][0]).toStrictEqual({
|
|
228
|
+
type: "EXEC_HOOKS_MOCK",
|
|
229
|
+
arguments: ["options", 7, 0],
|
|
230
|
+
});
|
|
231
|
+
expect(mpi.dispatch.mock.calls[8][0]).toStrictEqual({
|
|
232
|
+
type: "EXEC_HOOKS_MOCK",
|
|
233
|
+
arguments: ["options", 7, 1],
|
|
234
|
+
});
|
|
235
|
+
expect(mpi.dispatch.mock.calls[9][0]).toStrictEqual({
|
|
236
|
+
type: "EXEC_HOOKS_MOCK",
|
|
237
|
+
arguments: ["options", 8, 0],
|
|
238
|
+
});
|
|
239
|
+
expect(mpi.dispatch.mock.calls[10][0]).toStrictEqual({
|
|
240
|
+
type: "EXEC_HOOKS_MOCK",
|
|
241
|
+
arguments: ["options", 8, 1],
|
|
242
|
+
});
|
|
243
|
+
expect(mpi.dispatch.mock.calls[11][0]).toStrictEqual({
|
|
244
|
+
type: "EXEC_HOOKS_MOCK",
|
|
245
|
+
arguments: ["variables", 2, 0],
|
|
246
|
+
});
|
|
247
|
+
expect(mpi.dispatch.mock.calls[12][0]).toStrictEqual({
|
|
248
|
+
type: "EXEC_HOOKS_MOCK",
|
|
249
|
+
arguments: ["variables", 2, 1],
|
|
250
|
+
});
|
|
251
|
+
expect(mpi.dispatch.mock.calls[13][0]).toStrictEqual({
|
|
252
|
+
type: "EXEC_HOOKS_MOCK",
|
|
253
|
+
arguments: ["variables", 3, 0],
|
|
254
|
+
});
|
|
255
|
+
expect(mpi.dispatch.mock.calls[14][0]).toStrictEqual({
|
|
256
|
+
type: "EXEC_HOOKS_MOCK",
|
|
257
|
+
arguments: ["variables", 3, 1],
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
it("Completes DELETE_MULTIPLE_OCCURENCY action correctly", () => {
|
|
261
|
+
conditionsWatcherMiddleware(mpi)(next)(deleteMultipleOccurencyAction(2, 1));
|
|
262
|
+
expect(next.mock.calls.length).toBe(1);
|
|
263
|
+
expect(next.mock.calls[0][0]).toStrictEqual({
|
|
264
|
+
type: "DELETE_MULTIPLE_OCCURENCY",
|
|
265
|
+
id: 2,
|
|
266
|
+
index: 1,
|
|
267
|
+
});
|
|
268
|
+
expect(mpi.dispatch.mock.calls.length).toBe(15);
|
|
269
|
+
expect(mpi.dispatch.mock.calls[0][0]).toStrictEqual({
|
|
270
|
+
type: "SET_DATA_STATUS",
|
|
271
|
+
dataStatus: "unsaved",
|
|
272
|
+
});
|
|
273
|
+
expect(mpi.dispatch.mock.calls[1][0]).toStrictEqual({
|
|
274
|
+
type: "EXEC_HOOKS_MOCK",
|
|
275
|
+
arguments: ["options", 2, 0],
|
|
276
|
+
});
|
|
277
|
+
expect(mpi.dispatch.mock.calls[2][0]).toStrictEqual({
|
|
278
|
+
type: "EXEC_HOOKS_MOCK",
|
|
279
|
+
arguments: ["options", 2, 1],
|
|
280
|
+
});
|
|
281
|
+
expect(mpi.dispatch.mock.calls[3][0]).toStrictEqual({
|
|
282
|
+
type: "EXEC_HOOKS_MOCK",
|
|
283
|
+
arguments: ["options", 3, 0],
|
|
284
|
+
});
|
|
285
|
+
expect(mpi.dispatch.mock.calls[4][0]).toStrictEqual({
|
|
286
|
+
type: "EXEC_HOOKS_MOCK",
|
|
287
|
+
arguments: ["options", 3, 1],
|
|
288
|
+
});
|
|
289
|
+
expect(mpi.dispatch.mock.calls[5][0]).toStrictEqual({
|
|
290
|
+
type: "EXEC_HOOKS_MOCK",
|
|
291
|
+
arguments: ["options", 4, 0],
|
|
292
|
+
});
|
|
293
|
+
expect(mpi.dispatch.mock.calls[6][0]).toStrictEqual({
|
|
294
|
+
type: "EXEC_HOOKS_MOCK",
|
|
295
|
+
arguments: ["options", 4, 1],
|
|
296
|
+
});
|
|
297
|
+
expect(mpi.dispatch.mock.calls[7][0]).toStrictEqual({
|
|
298
|
+
type: "EXEC_HOOKS_MOCK",
|
|
299
|
+
arguments: ["options", 7, 0],
|
|
300
|
+
});
|
|
301
|
+
expect(mpi.dispatch.mock.calls[8][0]).toStrictEqual({
|
|
302
|
+
type: "EXEC_HOOKS_MOCK",
|
|
303
|
+
arguments: ["options", 7, 1],
|
|
304
|
+
});
|
|
305
|
+
expect(mpi.dispatch.mock.calls[9][0]).toStrictEqual({
|
|
306
|
+
type: "EXEC_HOOKS_MOCK",
|
|
307
|
+
arguments: ["options", 8, 0],
|
|
308
|
+
});
|
|
309
|
+
expect(mpi.dispatch.mock.calls[10][0]).toStrictEqual({
|
|
310
|
+
type: "EXEC_HOOKS_MOCK",
|
|
311
|
+
arguments: ["options", 8, 1],
|
|
312
|
+
});
|
|
313
|
+
expect(mpi.dispatch.mock.calls[11][0]).toStrictEqual({
|
|
314
|
+
type: "EXEC_HOOKS_MOCK",
|
|
315
|
+
arguments: ["variables", 2, 0],
|
|
316
|
+
});
|
|
317
|
+
expect(mpi.dispatch.mock.calls[12][0]).toStrictEqual({
|
|
318
|
+
type: "EXEC_HOOKS_MOCK",
|
|
319
|
+
arguments: ["variables", 2, 1],
|
|
320
|
+
});
|
|
321
|
+
expect(mpi.dispatch.mock.calls[13][0]).toStrictEqual({
|
|
322
|
+
type: "EXEC_HOOKS_MOCK",
|
|
323
|
+
arguments: ["variables", 3, 0],
|
|
324
|
+
});
|
|
325
|
+
expect(mpi.dispatch.mock.calls[14][0]).toStrictEqual({
|
|
326
|
+
type: "EXEC_HOOKS_MOCK",
|
|
327
|
+
arguments: ["variables", 3, 1],
|
|
328
|
+
});
|
|
329
|
+
});
|
|
330
|
+
});
|
|
@@ -2,6 +2,6 @@ import type { MiddlewareAPI, Dispatch } from "redux";
|
|
|
2
2
|
import type { ActionsType } from "../../types/Actions.type";
|
|
3
3
|
import type { StateType } from "../../types/State.type";
|
|
4
4
|
export declare const watchUpdateVariable: (mpi: MiddlewareAPI<Dispatch, StateType>, next: Dispatch, action: ActionsType.Inputs.updateVariableInput | ActionsType.Conditions.updateVariableCondition) => ActionsType.Inputs.updateVariableInput | ActionsType.Conditions.updateVariableCondition;
|
|
5
|
-
export type WatcherActions = ActionsType.Conditions.updateVariableCondition | ActionsType.Conditions.updateOptionCondition | ActionsType.Inputs.updateOptionInput | ActionsType.Inputs.updateVariableInput | ActionsType.App.fetchModelSucceeded;
|
|
5
|
+
export declare type WatcherActions = ActionsType.Conditions.updateVariableCondition | ActionsType.Conditions.updateOptionCondition | ActionsType.Inputs.updateOptionInput | ActionsType.Inputs.updateVariableInput | ActionsType.App.fetchModelSucceeded;
|
|
6
6
|
declare const evaluationsWatcherMiddleware: (mpi: MiddlewareAPI) => (next: Dispatch) => (action: WatcherActions) => void | WatcherActions;
|
|
7
7
|
export default evaluationsWatcherMiddleware;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|