@legalplace/wizardx-core 2.3.0 → 2.4.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.
- package/CHANGELOG.md +20 -0
- package/dist/App.d.ts +5 -5
- package/dist/App.js +22 -35
- package/dist/App.test.js +2 -2
- package/dist/Globals.d.ts +4 -0
- package/dist/Globals.js +9 -6
- package/dist/Loader.d.ts +1 -0
- package/dist/Loader.js +2 -0
- package/dist/PluginLoader.d.ts +3 -3
- package/dist/PluginLoader.js +22 -26
- package/dist/PluginLoader.test.js +6 -6
- package/dist/Shimmer.d.ts +1 -1
- package/dist/Shimmer.js +45 -47
- package/dist/ThemeLoader.d.ts +6 -5
- package/dist/ThemeLoader.js +21 -25
- package/dist/ThemeLoader.test.js +4 -3
- package/dist/components/PluginRoute.d.ts +3 -3
- package/dist/components/PluginRoute.js +8 -7
- package/dist/components/SmartScript.d.ts +7 -8
- package/dist/components/SmartScript.js +22 -21
- package/dist/components/UserLocked/UserLockedComponent.d.ts +1 -1
- package/dist/components/UserLocked/UserLockedComponent.js +5 -6
- package/dist/components/View.d.ts +8 -4
- package/dist/components/View.js +46 -55
- package/dist/components/View.test.js +6 -5
- package/dist/componentsConnectors/connectBox.d.ts +2 -3
- package/dist/componentsConnectors/connectBox.js +4 -4
- package/dist/componentsConnectors/connectBox.test.js +7 -7
- package/dist/componentsConnectors/connectDocument.d.ts +0 -1
- package/dist/componentsConnectors/connectDocument.js +6 -6
- package/dist/componentsConnectors/connectDocument.test.js +5 -5
- package/dist/componentsConnectors/connectHeader.d.ts +0 -1
- package/dist/componentsConnectors/connectHeader.js +2 -2
- package/dist/componentsConnectors/connectMetaTitle.d.ts +0 -1
- package/dist/componentsConnectors/connectMetaTitle.js +2 -2
- package/dist/componentsConnectors/connectMetaTitle.test.js +3 -3
- package/dist/componentsConnectors/connectOption.d.ts +2 -3
- package/dist/componentsConnectors/connectOption.js +9 -9
- package/dist/componentsConnectors/connectPagination.d.ts +0 -1
- package/dist/componentsConnectors/connectPagination.js +3 -3
- package/dist/componentsConnectors/connectPreview.d.ts +0 -1
- package/dist/componentsConnectors/connectPreview.js +2 -2
- package/dist/componentsConnectors/connectProgress.d.ts +0 -1
- package/dist/componentsConnectors/connectProgress.js +3 -3
- package/dist/componentsConnectors/connectRootOption.d.ts +2 -3
- package/dist/componentsConnectors/connectRootOption.js +2 -2
- package/dist/componentsConnectors/connectSection.d.ts +0 -1
- package/dist/componentsConnectors/connectSection.js +4 -4
- package/dist/componentsConnectors/connectSummary.d.ts +0 -1
- package/dist/componentsConnectors/connectSummary.js +2 -2
- package/dist/componentsConnectors/connectSummaryItem.d.ts +0 -1
- package/dist/componentsConnectors/connectSummaryItem.js +6 -6
- package/dist/componentsConnectors/connectTermsheet.d.ts +2 -2
- package/dist/componentsConnectors/connectTermsheet.js +43 -46
- package/dist/componentsConnectors/connectVariable.d.ts +1 -2
- package/dist/componentsConnectors/connectVariable.js +10 -10
- package/dist/componentsConnectors/connectWizardWrapper.d.ts +0 -1
- package/dist/componentsConnectors/connectWizardWrapper.js +4 -4
- package/dist/componentsConnectors/connector/componentConnector.d.ts +8 -8
- package/dist/componentsConnectors/connector/componentConnector.js +16 -19
- package/dist/componentsConnectors/library.d.ts +61 -0
- package/dist/componentsConnectors/library.js +34 -0
- package/dist/config.d.ts +1 -1
- package/dist/constants/phoneValidation.d.ts +3 -0
- package/dist/constants/phoneValidation.js +3 -0
- package/dist/helpers/outputsParsing.d.ts +1 -1
- package/dist/helpers/outputsParsing.js +25 -25
- package/dist/helpers/preloadTheme.js +1 -1
- package/dist/helpers/scriptsLoader.d.ts +1 -0
- package/dist/helpers/scriptsLoader.js +24 -0
- package/dist/helpers/sendinblueHelper.d.ts +3 -3
- package/dist/helpers/sendinblueHelper.js +29 -18
- package/dist/hooks/usePrevious.js +1 -1
- package/dist/libs/ConditionsInitiator.d.ts +1 -1
- package/dist/libs/ConditionsInitiator.js +2 -2
- package/dist/libs/ConditionsRunner/DataPopulator.js +7 -7
- package/dist/libs/ConditionsRunner.d.ts +3 -3
- package/dist/libs/ConditionsRunner.js +43 -43
- package/dist/libs/DocumentsOutputs.d.ts +2 -2
- package/dist/libs/DocumentsOutputs.js +5 -5
- package/dist/libs/Eval/EvalBase.js +17 -17
- package/dist/libs/Eval/EvalFunctions.d.ts +1 -1
- package/dist/libs/Eval/EvalFunctions.js +100 -100
- package/dist/libs/Eval/NumbersToLetters.js +46 -46
- package/dist/libs/EvalVariable.d.ts +2 -2
- package/dist/libs/EvalVariable.js +30 -29
- package/dist/libs/EventsTracking.js +32 -32
- package/dist/libs/Extracts.js +20 -20
- package/dist/libs/InputsInitiator.d.ts +1 -1
- package/dist/libs/InputsInitiator.js +15 -15
- package/dist/libs/NumAuto.js +1 -1
- package/dist/libs/OvcConverter.d.ts +1 -1
- package/dist/libs/OvcConverter.js +23 -23
- package/dist/libs/PathReader.d.ts +1 -1
- package/dist/libs/PathReader.js +22 -22
- package/dist/libs/SectionValidity.js +3 -3
- package/dist/libs/SmartScriptStore.d.ts +6 -6
- package/dist/libs/SmartScriptStore.js +33 -33
- package/dist/misc/test_model.d.ts +2 -2
- package/dist/misc/test_model.js +3807 -3807
- package/dist/polyfills/index.d.ts +5 -0
- package/dist/polyfills/index.js +5 -0
- package/dist/polyfills/prepend.js +2 -2
- package/dist/polyfills/stringRepeat.js +4 -4
- package/dist/redux/actions/app.d.ts +12 -12
- package/dist/redux/actions/app.js +1 -1
- package/dist/redux/actions/conditions.d.ts +2 -2
- package/dist/redux/actions/conditions.js +1 -1
- package/dist/redux/actions/inputs.d.ts +1 -1
- package/dist/redux/actions/inputs.js +1 -1
- package/dist/redux/actions/library.d.ts +73 -0
- package/dist/redux/actions/library.js +11 -0
- package/dist/redux/actions/mandatories.d.ts +1 -1
- package/dist/redux/actions/mandatories.js +1 -1
- package/dist/redux/actions/references.d.ts +4 -4
- package/dist/redux/actions/references.js +1 -1
- package/dist/redux/actions/sagas/data.d.ts +1 -1
- package/dist/redux/actions/sagas/data.js +1 -1
- package/dist/redux/actions/sagas/model.d.ts +3 -3
- package/dist/redux/actions/sagas/model.js +3 -3
- package/dist/redux/actions/sagas/user.d.ts +1 -1
- package/dist/redux/actions/sagas/user.js +1 -1
- package/dist/redux/actions/smartscript.d.ts +3 -3
- package/dist/redux/actions/smartscript.js +1 -1
- package/dist/redux/actions/user.d.ts +4 -4
- package/dist/redux/actions/user.js +1 -1
- package/dist/redux/constants/app.js +22 -22
- package/dist/redux/constants/conditions.js +8 -8
- package/dist/redux/constants/inputs.js +6 -6
- package/dist/redux/constants/mandatories.js +6 -6
- package/dist/redux/constants/references.js +3 -3
- package/dist/redux/constants/sagas/data.js +1 -1
- package/dist/redux/constants/sagas/model.js +2 -2
- package/dist/redux/constants/sagas/user.js +2 -2
- package/dist/redux/constants/smartscript.js +4 -4
- package/dist/redux/constants/user.js +3 -3
- package/dist/redux/listeners/subscriber.d.ts +2 -2
- package/dist/redux/middlewares/conditionsWatcherMiddleware.d.ts +2 -2
- package/dist/redux/middlewares/conditionsWatcherMiddleware.js +28 -28
- package/dist/redux/middlewares/evaluationsWatcherMiddleware.d.ts +4 -2
- package/dist/redux/middlewares/evaluationsWatcherMiddleware.js +10 -10
- package/dist/redux/middlewares/mandatoriesWatcherMiddleware.d.ts +2 -2
- package/dist/redux/middlewares/mandatoriesWatcherMiddleware.js +13 -13
- package/dist/redux/middlewares/multiplesActionsMiddleware.d.ts +2 -2
- package/dist/redux/middlewares/multiplesActionsMiddleware.js +2 -2
- package/dist/redux/middlewares/paginationWatcherMiddleware.d.ts +3 -3
- package/dist/redux/middlewares/paginationWatcherMiddleware.js +24 -24
- package/dist/redux/middlewares/pluginsHookMiddleware.d.ts +1 -1
- package/dist/redux/middlewares/pluginsHookMiddleware.js +1 -1
- package/dist/redux/middlewares/prefillerWatcherMiddleware.d.ts +2 -2
- package/dist/redux/middlewares/prefillerWatcherMiddleware.js +28 -28
- package/dist/redux/middlewares/smartscriptMiddleware.d.ts +2 -2
- package/dist/redux/middlewares/smartscriptMiddleware.js +15 -15
- package/dist/redux/middlewares/thirdpartyScriptsMiddleware.d.ts +5 -0
- package/dist/redux/middlewares/thirdpartyScriptsMiddleware.js +16 -0
- package/dist/redux/reducers/app/customizations/initCustomizationAutoDefault.d.ts +2 -2
- package/dist/redux/reducers/app/customizations/initCustomizationMeta.d.ts +2 -2
- package/dist/redux/reducers/app/instance/initInstance.d.ts +2 -2
- package/dist/redux/reducers/app/instance/setDataStatus.d.ts +2 -2
- package/dist/redux/reducers/app/instance/updateInstance.d.ts +2 -2
- package/dist/redux/reducers/app/instance/updateInstancePaid.d.ts +2 -2
- package/dist/redux/reducers/app/meta/fetchModelFailed.d.ts +1 -1
- package/dist/redux/reducers/app/meta/fetchModelFailed.js +1 -1
- package/dist/redux/reducers/app/meta/fetchModelNonBlocking.d.ts +1 -1
- package/dist/redux/reducers/app/meta/fetchModelNonBlocking.js +1 -1
- package/dist/redux/reducers/app/meta/fetchModelSucceeded.d.ts +1 -1
- package/dist/redux/reducers/app/meta/fetchModelSucceeded.js +1 -1
- package/dist/redux/reducers/app/meta/fetchModelUnhealthy.d.ts +2 -2
- package/dist/redux/reducers/app/meta/fetchModelUnhealthy.js +1 -1
- package/dist/redux/reducers/app/meta/fetchModelUserLocked.d.ts +1 -1
- package/dist/redux/reducers/app/meta/fetchModelUserLocked.js +1 -1
- package/dist/redux/reducers/app/meta/initMeta.d.ts +2 -2
- package/dist/redux/reducers/app/meta/setModelUuid.d.ts +2 -2
- package/dist/redux/reducers/app/pagination/goNextPage.d.ts +1 -1
- package/dist/redux/reducers/app/pagination/goNextPage.js +1 -1
- package/dist/redux/reducers/app/pagination/goPage.d.ts +2 -2
- package/dist/redux/reducers/app/pagination/goPage.js +2 -2
- package/dist/redux/reducers/app/pagination/goPreviousPage.d.ts +1 -1
- package/dist/redux/reducers/app/pagination/goPreviousPage.js +1 -1
- package/dist/redux/reducers/app/pagination/initPagination.d.ts +2 -2
- package/dist/redux/reducers/app/pagination/initPagination.js +1 -1
- package/dist/redux/reducers/app/pagination/updateAvailableAppStates.d.ts +2 -2
- package/dist/redux/reducers/app/pagination/updateAvailableAppStates.js +5 -5
- package/dist/redux/reducers/app/wizard/updateAvailableSections.d.ts +2 -2
- package/dist/redux/reducers/app/wizard/updateAvailableSections.js +2 -2
- package/dist/redux/reducers/app.d.ts +2 -2
- package/dist/redux/reducers/app.js +30 -30
- package/dist/redux/reducers/conditions/addMultipleOccurency.d.ts +2 -2
- package/dist/redux/reducers/conditions/addMultipleOccurency.js +3 -3
- package/dist/redux/reducers/conditions/deleteMultipleOccurency.d.ts +2 -2
- package/dist/redux/reducers/conditions/deleteMultipleOccurency.js +2 -2
- package/dist/redux/reducers/conditions/initConditions.d.ts +2 -2
- package/dist/redux/reducers/conditions/updateDocumentConditions.d.ts +2 -2
- package/dist/redux/reducers/conditions/updateOptionConditions.d.ts +2 -2
- package/dist/redux/reducers/conditions/updateOptionValidatorCondition.d.ts +2 -2
- package/dist/redux/reducers/conditions/updatePrefillerConditions.d.ts +2 -2
- package/dist/redux/reducers/conditions/updatePrefillerConditions.js +2 -2
- package/dist/redux/reducers/conditions/updateSectionConditions.d.ts +2 -2
- package/dist/redux/reducers/conditions/updateVariableConditions.d.ts +2 -2
- package/dist/redux/reducers/conditions/updateVariableValidatorCondition.d.ts +2 -2
- package/dist/redux/reducers/conditions.d.ts +2 -2
- package/dist/redux/reducers/conditions.js +13 -13
- package/dist/redux/reducers/inputs/addMultipleOccurency.d.ts +2 -2
- package/dist/redux/reducers/inputs/addMultipleOccurency.js +4 -4
- package/dist/redux/reducers/inputs/deleteMultipleOccurency.d.ts +2 -2
- package/dist/redux/reducers/inputs/deleteMultipleOccurency.js +2 -2
- package/dist/redux/reducers/inputs/initOption.d.ts +2 -2
- package/dist/redux/reducers/inputs/initVariable.d.ts +2 -2
- package/dist/redux/reducers/inputs/updateOptionInput.d.ts +2 -2
- package/dist/redux/reducers/inputs/updateVariableInput.d.ts +2 -2
- package/dist/redux/reducers/inputs.d.ts +2 -2
- package/dist/redux/reducers/inputs.js +8 -8
- package/dist/redux/reducers/mandatories/addMultipleOccurency.d.ts +2 -2
- package/dist/redux/reducers/mandatories/addMultipleOccurency.js +2 -2
- package/dist/redux/reducers/mandatories/deleteMultipleOccurency.d.ts +2 -2
- package/dist/redux/reducers/mandatories/deleteMultipleOccurency.js +2 -2
- package/dist/redux/reducers/mandatories/initMandatoryOption.d.ts +2 -2
- package/dist/redux/reducers/mandatories/initMandatoryVariable.d.ts +2 -2
- package/dist/redux/reducers/mandatories/setMandatoryIgnore.d.ts +2 -2
- package/dist/redux/reducers/mandatories/setMandatoryOption.d.ts +2 -2
- package/dist/redux/reducers/mandatories/setMandatorySection.d.ts +2 -2
- package/dist/redux/reducers/mandatories/setMandatoryVariable.d.ts +2 -2
- package/dist/redux/reducers/mandatories.d.ts +2 -2
- package/dist/redux/reducers/mandatories.js +11 -11
- package/dist/redux/reducers/references/initReferences.d.ts +2 -2
- package/dist/redux/reducers/references/updateOptionMeta.d.ts +2 -2
- package/dist/redux/reducers/references/updateOptionMeta.js +2 -2
- package/dist/redux/reducers/references/updateVariableMeta.d.ts +2 -2
- package/dist/redux/reducers/references/updateVariableMeta.js +2 -2
- package/dist/redux/reducers/references.d.ts +2 -2
- package/dist/redux/reducers/references.js +5 -5
- package/dist/redux/reducers/smartscript/enableSmartScript.d.ts +1 -1
- package/dist/redux/reducers/smartscript/initSmartScriptTriggers.d.ts +2 -2
- package/dist/redux/reducers/smartscript/updateSmartscriptOptionHidden.d.ts +2 -2
- package/dist/redux/reducers/smartscript/updateSmartscriptVariableHidden.d.ts +2 -2
- package/dist/redux/reducers/smartscript.d.ts +2 -2
- package/dist/redux/reducers/smartscript.js +6 -6
- package/dist/redux/reducers/user/initUser.d.ts +2 -2
- package/dist/redux/reducers/user/setUserStatus.d.ts +2 -2
- package/dist/redux/reducers/user/setUserValidToken.d.ts +2 -2
- package/dist/redux/reducers/user.d.ts +2 -2
- package/dist/redux/reducers/user.js +9 -9
- package/dist/redux/routerHistory.d.ts +2 -2
- package/dist/redux/routerHistory.js +5 -5
- package/dist/redux/sagas/fetchModel.d.ts +4 -4
- package/dist/redux/sagas/fetchModel.js +84 -88
- package/dist/redux/sagas/fetchModel.test.js +2 -3
- package/dist/redux/sagas/homogeneousRadioInputsSaga.js +5 -5
- package/dist/redux/sagas/runner.d.ts +1 -1
- package/dist/redux/sagas/runner.js +5 -5
- package/dist/redux/sagas/saveData.js +34 -25
- package/dist/redux/sagas/setDefaults.js +8 -8
- package/dist/redux/sagas/setUserEmail.js +43 -43
- package/dist/redux/selectors/app.d.ts +1 -0
- package/dist/redux/selectors/app.js +26 -25
- package/dist/redux/selectors/conditions.js +34 -34
- package/dist/redux/selectors/inputs.d.ts +1 -1
- package/dist/redux/selectors/inputs.js +8 -8
- package/dist/{componentsConnectors/connector/connectorSelectors.d.ts → redux/selectors/library.d.ts} +16 -16
- package/dist/redux/selectors/library.js +8 -0
- package/dist/redux/selectors/mandatories.js +10 -10
- package/dist/redux/selectors/references.js +19 -19
- package/dist/redux/selectors/selectors.d.ts +2 -2
- package/dist/redux/selectors/selectors.js +2 -2
- package/dist/redux/selectors/smartscript.js +5 -5
- package/dist/redux/selectors/user.js +5 -5
- package/dist/redux/store.d.ts +6 -2
- package/dist/redux/store.js +31 -31
- package/dist/service/api.manager.d.ts +2 -2
- package/dist/service/api.manager.js +46 -46
- package/dist/service/auth.service.js +2 -2
- package/dist/service/pardot.service.js +2 -2
- package/dist/tests-misc/plugins/jestTestPlugin/after.d.ts +1 -1
- package/dist/tests-misc/plugins/jestTestPlugin/after.js +2 -2
- package/dist/tests-misc/plugins/jestTestPlugin/before.d.ts +1 -1
- package/dist/tests-misc/plugins/jestTestPlugin/before.js +2 -5
- package/dist/tests-misc/plugins/jestTestPlugin/index.js +4 -4
- package/dist/tests-misc/plugins/jestTestPlugin/title.d.ts +1 -1
- package/dist/tests-misc/plugins/jestTestPlugin/title.js +2 -2
- package/dist/tests-misc/themes/jestTestTheme/components/EmailComponent.d.ts +0 -1
- package/dist/tests-misc/themes/jestTestTheme/components/EmailComponent.js +2 -2
- package/dist/tests-misc/themes/jestTestTheme/components/TermsheetComponent.d.ts +0 -1
- package/dist/tests-misc/themes/jestTestTheme/components/TermsheetComponent.js +2 -2
- package/dist/tests-misc/themes/jestTestTheme/components/WizardComponent.d.ts +0 -1
- package/dist/tests-misc/themes/jestTestTheme/components/WizardComponent.js +2 -2
- package/dist/tests-misc/themes/jestTestTheme/faltyIndex.js +1 -1
- package/dist/tests-misc/themes/jestTestTheme/faltyIndexLoader.js +1 -1
- package/dist/tests-misc/themes/jestTestTheme/index.js +4 -4
- package/dist/types/Actions.type.d.ts +37 -37
- package/dist/types/Components.type.d.ts +4 -5
- package/dist/types/State.type.d.ts +9 -9
- package/dist/types/Termsheet.type.d.ts +4 -4
- package/dist/types/api.type.d.ts +4 -4
- package/dist/types/config.type.d.ts +2 -3
- package/dist/types/getActions.type.d.ts +2 -2
- package/dist/types/getConnectors.type.d.ts +2 -3
- package/dist/types/getSelectors.type.d.ts +2 -2
- package/dist/wizard-params.d.ts +1 -1
- package/dist/wizard-params.js +16 -16
- package/jest.config.ts +1 -1
- package/package.json +16 -8
- package/setupJest.ts +8 -0
- package/src/App.tsx +22 -25
- package/src/Globals.ts +12 -8
- package/src/Loader.tsx +8 -0
- package/src/PluginLoader.tsx +20 -37
- package/src/Shimmer.tsx +58 -45
- package/src/ThemeLoader.test.tsx +1 -0
- package/src/ThemeLoader.tsx +27 -42
- package/src/components/PluginRoute.tsx +8 -6
- package/src/components/SmartScript.tsx +29 -28
- package/src/components/UserLocked/UserLockedComponent.tsx +3 -3
- package/src/components/View.test.tsx +3 -0
- package/src/components/View.tsx +52 -54
- package/src/componentsConnectors/connectBox.tsx +6 -6
- package/src/componentsConnectors/connectDocument.tsx +6 -6
- package/src/componentsConnectors/connectHeader.tsx +2 -2
- package/src/componentsConnectors/connectMetaTitle.tsx +2 -2
- package/src/componentsConnectors/connectOption.tsx +11 -11
- package/src/componentsConnectors/connectPagination.tsx +3 -3
- package/src/componentsConnectors/connectPreview.tsx +2 -2
- package/src/componentsConnectors/connectProgress.tsx +3 -3
- package/src/componentsConnectors/connectRootOption.tsx +4 -4
- package/src/componentsConnectors/connectSection.tsx +4 -4
- package/src/componentsConnectors/connectSummary.tsx +2 -2
- package/src/componentsConnectors/connectSummaryItem.tsx +6 -6
- package/src/componentsConnectors/connectTermsheet.tsx +46 -46
- package/src/componentsConnectors/connectVariable.tsx +11 -11
- package/src/componentsConnectors/connectWizardWrapper.tsx +4 -4
- package/src/componentsConnectors/connector/componentConnector.tsx +22 -20
- package/src/componentsConnectors/library.ts +35 -0
- package/src/config.test.ts +2 -1
- package/src/config.ts +1 -1
- package/src/constants/phoneValidation.ts +6 -0
- package/src/definitions/path.join.d.ts +1 -1
- package/src/helpers/outputsParsing.ts +26 -26
- package/src/helpers/preloadTheme.ts +2 -2
- package/src/helpers/scriptsLoader.ts +20 -0
- package/src/helpers/sendinblueHelper.ts +23 -17
- package/src/hooks/usePrevious.ts +1 -1
- package/src/libs/ConditionsInitiator.ts +3 -3
- package/src/libs/ConditionsRunner/DataPopulator.ts +7 -7
- package/src/libs/ConditionsRunner.ts +53 -53
- package/src/libs/DocumentsOutputs.ts +7 -7
- package/src/libs/Eval/EvalBase.ts +17 -17
- package/src/libs/Eval/EvalFunctions.ts +100 -100
- package/src/libs/Eval/NumbersToLetters.ts +48 -48
- package/src/libs/EvalVariable.ts +34 -31
- package/src/libs/EventsTracking.ts +38 -38
- package/src/libs/Extracts.ts +21 -21
- package/src/libs/InputsInitiator.ts +16 -16
- package/src/libs/NumAuto.ts +1 -1
- package/src/libs/OvcConverter.ts +25 -25
- package/src/libs/PathReader.ts +23 -23
- package/src/libs/SectionValidity.ts +3 -3
- package/src/libs/SmartScriptStore.ts +40 -40
- package/src/misc/test_model.ts +3809 -3809
- package/src/polyfills/index.ts +5 -0
- package/src/polyfills/prepend.ts +2 -2
- package/src/polyfills/stringRepeat.ts +4 -4
- package/src/redux/actions/app.ts +13 -13
- package/src/redux/actions/conditions.ts +3 -3
- package/src/redux/actions/inputs.ts +2 -2
- package/src/redux/actions/library.ts +23 -0
- package/src/redux/actions/mandatories.ts +2 -2
- package/src/redux/actions/references.ts +5 -5
- package/src/redux/actions/sagas/data.ts +2 -2
- package/src/redux/actions/sagas/model.ts +6 -6
- package/src/redux/actions/sagas/user.ts +2 -2
- package/src/redux/actions/smartscript.ts +4 -4
- package/src/redux/actions/user.ts +5 -5
- package/src/redux/constants/app.ts +22 -22
- package/src/redux/constants/conditions.ts +8 -8
- package/src/redux/constants/inputs.ts +6 -6
- package/src/redux/constants/mandatories.ts +6 -6
- package/src/redux/constants/references.ts +3 -3
- package/src/redux/constants/sagas/data.ts +1 -1
- package/src/redux/constants/sagas/model.ts +2 -2
- package/src/redux/constants/sagas/user.ts +2 -2
- package/src/redux/constants/smartscript.ts +4 -4
- package/src/redux/constants/user.ts +3 -3
- package/src/redux/listeners/subscriber.ts +2 -2
- package/src/redux/middlewares/conditionsWatcherMiddleware.ts +31 -31
- package/src/redux/middlewares/evaluationsWatcherMiddleware.test.ts +1 -1
- package/src/redux/middlewares/evaluationsWatcherMiddleware.ts +13 -13
- package/src/redux/middlewares/mandatoriesWatcherMiddleware.ts +16 -16
- package/src/redux/middlewares/multiplesActionsMiddleware.ts +6 -6
- package/src/redux/middlewares/paginationWatcherMiddleware.ts +27 -27
- package/src/redux/middlewares/pluginsHookMiddleware.ts +2 -2
- package/src/redux/middlewares/prefillerWatcherMiddleware.ts +31 -31
- package/src/redux/middlewares/smartscriptMiddleware.ts +20 -20
- package/src/redux/middlewares/thirdpartyScriptsMiddleware.ts +41 -0
- package/src/redux/reducers/app/customizations/initCustomizationAutoDefault.ts +2 -2
- package/src/redux/reducers/app/customizations/initCustomizationMeta.ts +2 -2
- package/src/redux/reducers/app/instance/initInstance.ts +2 -2
- package/src/redux/reducers/app/instance/setDataStatus.ts +2 -2
- package/src/redux/reducers/app/instance/updateInstance.ts +2 -2
- package/src/redux/reducers/app/instance/updateInstancePaid.ts +2 -2
- package/src/redux/reducers/app/meta/fetchModelFailed.ts +2 -2
- package/src/redux/reducers/app/meta/fetchModelNonBlocking.ts +2 -2
- package/src/redux/reducers/app/meta/fetchModelSucceeded.ts +2 -2
- package/src/redux/reducers/app/meta/fetchModelUnhealthy.ts +3 -3
- package/src/redux/reducers/app/meta/fetchModelUserLocked.ts +2 -2
- package/src/redux/reducers/app/meta/initMeta.ts +2 -2
- package/src/redux/reducers/app/meta/setModelUuid.ts +2 -2
- package/src/redux/reducers/app/pagination/goNextPage.ts +2 -2
- package/src/redux/reducers/app/pagination/goPage.ts +4 -4
- package/src/redux/reducers/app/pagination/goPreviousPage.ts +2 -2
- package/src/redux/reducers/app/pagination/initPagination.ts +3 -3
- package/src/redux/reducers/app/pagination/updateAvailableAppStates.ts +7 -7
- package/src/redux/reducers/app/wizard/updateAvailableSections.ts +4 -4
- package/src/redux/reducers/app.ts +32 -32
- package/src/redux/reducers/conditions/addMultipleOccurency.ts +5 -5
- package/src/redux/reducers/conditions/deleteMultipleOccurency.ts +4 -4
- package/src/redux/reducers/conditions/initConditions.ts +2 -2
- package/src/redux/reducers/conditions/updateDocumentConditions.ts +2 -2
- package/src/redux/reducers/conditions/updateOptionConditions.ts +2 -2
- package/src/redux/reducers/conditions/updateOptionValidatorCondition.ts +2 -2
- package/src/redux/reducers/conditions/updatePrefillerConditions.ts +4 -4
- package/src/redux/reducers/conditions/updateSectionConditions.ts +2 -2
- package/src/redux/reducers/conditions/updateVariableConditions.ts +2 -2
- package/src/redux/reducers/conditions/updateVariableValidatorCondition.ts +2 -2
- package/src/redux/reducers/conditions.ts +15 -15
- package/src/redux/reducers/inputs/addMultipleOccurency.ts +6 -6
- package/src/redux/reducers/inputs/deleteMultipleOccurency.ts +4 -4
- package/src/redux/reducers/inputs/initOption.ts +2 -2
- package/src/redux/reducers/inputs/initVariable.ts +2 -2
- package/src/redux/reducers/inputs/updateOptionInput.ts +2 -2
- package/src/redux/reducers/inputs/updateVariableInput.ts +2 -2
- package/src/redux/reducers/inputs.ts +10 -10
- package/src/redux/reducers/mandatories/addMultipleOccurency.ts +4 -4
- package/src/redux/reducers/mandatories/deleteMultipleOccurency.ts +4 -4
- package/src/redux/reducers/mandatories/initMandatoryOption.ts +2 -2
- package/src/redux/reducers/mandatories/initMandatoryVariable.ts +2 -2
- package/src/redux/reducers/mandatories/setMandatoryIgnore.ts +2 -2
- package/src/redux/reducers/mandatories/setMandatoryOption.ts +2 -2
- package/src/redux/reducers/mandatories/setMandatorySection.ts +2 -2
- package/src/redux/reducers/mandatories/setMandatoryVariable.ts +2 -2
- package/src/redux/reducers/mandatories.ts +13 -13
- package/src/redux/reducers/references/initReferences.ts +2 -2
- package/src/redux/reducers/references/updateOptionMeta.ts +4 -4
- package/src/redux/reducers/references/updateVariableMeta.ts +4 -4
- package/src/redux/reducers/references.ts +7 -7
- package/src/redux/reducers/smartscript/enableSmartScript.ts +1 -1
- package/src/redux/reducers/smartscript/initSmartScriptTriggers.ts +2 -2
- package/src/redux/reducers/smartscript/updateSmartscriptOptionHidden.ts +2 -2
- package/src/redux/reducers/smartscript/updateSmartscriptVariableHidden.ts +2 -2
- package/src/redux/reducers/smartscript.ts +8 -8
- package/src/redux/reducers/user/initUser.ts +2 -2
- package/src/redux/reducers/user/setUserStatus.ts +2 -2
- package/src/redux/reducers/user/setUserValidToken.ts +2 -2
- package/src/redux/reducers/user.ts +11 -11
- package/src/redux/routerHistory.ts +6 -6
- package/src/redux/sagas/fetchModel.test.ts +2 -5
- package/src/redux/sagas/fetchModel.ts +91 -100
- package/src/redux/sagas/homogeneousRadioInputsSaga.ts +6 -6
- package/src/redux/sagas/runner.ts +6 -6
- package/src/redux/sagas/saveData.ts +32 -28
- package/src/redux/sagas/setDefaults.ts +8 -8
- package/src/redux/sagas/setUserEmail.ts +46 -45
- package/src/redux/selectors/app.ts +34 -28
- package/src/redux/selectors/conditions.ts +41 -41
- package/src/redux/selectors/inputs.ts +10 -10
- package/src/redux/selectors/library.ts +17 -0
- package/src/redux/selectors/mandatories.ts +10 -10
- package/src/redux/selectors/references.ts +21 -21
- package/src/redux/selectors/selectors.ts +4 -4
- package/src/redux/selectors/smartscript.ts +6 -6
- package/src/redux/selectors/user.ts +8 -8
- package/src/redux/store.ts +42 -32
- package/src/service/api.manager.ts +53 -53
- package/src/service/auth.service.ts +2 -2
- package/src/service/pardot.service.ts +2 -2
- package/src/tests-misc/plugins/jestTestPlugin/after.tsx +1 -1
- package/src/tests-misc/plugins/jestTestPlugin/before.tsx +1 -1
- package/src/tests-misc/plugins/jestTestPlugin/index.ts +4 -4
- package/src/tests-misc/plugins/jestTestPlugin/title.tsx +2 -2
- package/src/tests-misc/themes/jestTestTheme/components/EmailComponent.tsx +1 -1
- package/src/tests-misc/themes/jestTestTheme/components/TermsheetComponent.tsx +1 -1
- package/src/tests-misc/themes/jestTestTheme/components/WizardComponent.tsx +1 -1
- package/src/tests-misc/themes/jestTestTheme/faltyIndex.ts +1 -1
- package/src/tests-misc/themes/jestTestTheme/faltyIndexLoader.ts +1 -1
- package/src/tests-misc/themes/jestTestTheme/index.ts +4 -4
- package/src/types/Actions.type.ts +55 -55
- package/src/types/Components.type.ts +4 -4
- package/src/types/State.type.ts +14 -14
- package/src/types/Termsheet.type.ts +4 -4
- package/src/types/api.type.ts +4 -4
- package/src/types/config.type.ts +3 -3
- package/src/types/getActions.type.ts +2 -2
- package/src/types/getConnectors.type.ts +2 -2
- package/src/types/getSelectors.type.ts +2 -2
- package/src/wizard-params.ts +17 -17
- package/tsconfig.json +1 -1
- package/dist/componentsConnectors/connector/connectorSelectors.js +0 -9
- package/dist/componentsConnectors/index.d.ts +0 -16
- package/dist/componentsConnectors/index.js +0 -16
- package/dist/constants/index.d.ts +0 -1
- package/dist/constants/index.js +0 -1
- package/dist/helpers/index.d.ts +0 -2
- package/dist/helpers/index.js +0 -2
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.js +0 -1
- package/dist/index.d.ts +0 -23
- package/dist/index.js +0 -23
- package/dist/libs/index.d.ts +0 -12
- package/dist/libs/index.js +0 -12
- package/dist/redux/actions/index.d.ts +0 -8
- package/dist/redux/actions/index.js +0 -8
- package/dist/redux/actions/sagas/index.d.ts +0 -3
- package/dist/redux/actions/sagas/index.js +0 -3
- package/dist/redux/constants/index.d.ts +0 -8
- package/dist/redux/constants/index.js +0 -8
- package/dist/redux/constants/sagas/index.d.ts +0 -3
- package/dist/redux/constants/sagas/index.js +0 -3
- package/dist/redux/index.d.ts +0 -4
- package/dist/redux/index.js +0 -4
- package/dist/redux/selectors/index.d.ts +0 -7
- package/dist/redux/selectors/index.js +0 -7
- package/dist/service/index.d.ts +0 -3
- package/dist/service/index.js +0 -3
- package/dist/types/index.d.ts +0 -10
- package/dist/types/index.js +0 -10
- package/src/componentsConnectors/connector/connectorSelectors.ts +0 -19
- package/src/componentsConnectors/index.ts +0 -16
- package/src/constants/index.ts +0 -1
- package/src/helpers/index.ts +0 -2
- package/src/hooks/index.ts +0 -1
- package/src/index.ts +0 -47
- package/src/libs/index.ts +0 -12
- package/src/redux/actions/index.ts +0 -8
- package/src/redux/actions/sagas/index.ts +0 -3
- package/src/redux/constants/index.ts +0 -8
- package/src/redux/constants/sagas/index.ts +0 -3
- package/src/redux/index.ts +0 -4
- package/src/redux/selectors/index.ts +0 -7
- package/src/service/index.ts +0 -3
- package/src/types/index.ts +0 -10
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { call, fork, put, takeLatest } from
|
|
2
|
-
import { getContractFunnelGAEvent } from
|
|
3
|
-
import { v4 as uuid } from
|
|
4
|
-
import { getConfig } from
|
|
1
|
+
import { call, fork, put, takeLatest } from "redux-saga/effects";
|
|
2
|
+
import { getContractFunnelGAEvent } from "@legalplace/lp-events";
|
|
3
|
+
import { v4 as uuid } from "uuid";
|
|
4
|
+
import { getConfig } from "../../config";
|
|
5
5
|
import {
|
|
6
6
|
selectPermalink,
|
|
7
7
|
selectInstanceUniqid,
|
|
8
8
|
selectDocumentTitle,
|
|
9
9
|
selectAvailableAppStates,
|
|
10
10
|
selectDocumentModelVersion,
|
|
11
|
-
} from
|
|
12
|
-
import { selectInputs } from
|
|
13
|
-
import { SET_USER_EMAIL } from
|
|
14
|
-
import { setUserStatusAction, initUserAction } from
|
|
15
|
-
import { ActionsType } from
|
|
16
|
-
import { IInstanceCreationResponse } from
|
|
11
|
+
} from "../selectors/app";
|
|
12
|
+
import { selectInputs } from "../selectors/inputs";
|
|
13
|
+
import { SET_USER_EMAIL } from "../constants/sagas/user";
|
|
14
|
+
import { setUserStatusAction, initUserAction } from "../actions/user";
|
|
15
|
+
import { ActionsType } from "../../types/Actions.type";
|
|
16
|
+
import { IInstanceCreationResponse } from "../../types/api.type";
|
|
17
17
|
import {
|
|
18
18
|
updateAvailableAppStatesAction,
|
|
19
19
|
initInstanceAction,
|
|
20
20
|
goNextPageAction,
|
|
21
|
-
} from
|
|
21
|
+
} from "../actions/app";
|
|
22
22
|
|
|
23
|
-
import { OvcConverter } from
|
|
24
|
-
import { getSendinblueIdentifyAttributes } from
|
|
25
|
-
import { setUserEmailSucceeded } from
|
|
26
|
-
import { EMAIL_REGEX } from
|
|
23
|
+
import { OvcConverter } from "../../libs/OvcConverter";
|
|
24
|
+
import { getSendinblueIdentifyAttributes } from "../../helpers/sendinblueHelper";
|
|
25
|
+
import { setUserEmailSucceeded } from "../actions/sagas/user";
|
|
26
|
+
import { EMAIL_REGEX } from "../../constants/emailValidation";
|
|
27
27
|
|
|
28
28
|
const canalHeaders = {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
"lp-referrer": window.document.referrer,
|
|
30
|
+
"lp-origin": window.location.href,
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
function* setUserEmailDecorator(action: ActionsType.User.setUserEmail): any {
|
|
@@ -37,11 +37,11 @@ function* setUserEmailDecorator(action: ActionsType.User.setUserEmail): any {
|
|
|
37
37
|
*/
|
|
38
38
|
const { email, tags, inBackground } = action;
|
|
39
39
|
if (!EMAIL_REGEX.test(email)) {
|
|
40
|
-
if (!inBackground) yield put(setUserStatusAction(
|
|
40
|
+
if (!inBackground) yield put(setUserStatusAction("failed"));
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
yield put(setUserStatusAction(
|
|
44
|
+
yield put(setUserStatusAction("inprogress"));
|
|
45
45
|
|
|
46
46
|
// Getting Permalink & uniqid
|
|
47
47
|
const permalink = selectPermalink();
|
|
@@ -55,8 +55,8 @@ function* setUserEmailDecorator(action: ActionsType.User.setUserEmail): any {
|
|
|
55
55
|
const currentValue = ovc.v[c];
|
|
56
56
|
// eslint-disable-next-line no-nested-ternary
|
|
57
57
|
const o: number = Array.isArray(currentValue)
|
|
58
|
-
? currentValue.reduce((_p: number, _c) => _p + (_c !==
|
|
59
|
-
: currentValue !==
|
|
58
|
+
? currentValue.reduce((_p: number, _c) => _p + (_c !== "" ? 1 : 0), 0)
|
|
59
|
+
: currentValue !== ""
|
|
60
60
|
? 1
|
|
61
61
|
: 0;
|
|
62
62
|
return p + o;
|
|
@@ -75,7 +75,7 @@ function* setUserEmailDecorator(action: ActionsType.User.setUserEmail): any {
|
|
|
75
75
|
if (instanceUniqid === undefined || instanceUniqid.length === 0) {
|
|
76
76
|
body = {
|
|
77
77
|
...body,
|
|
78
|
-
app_type:
|
|
78
|
+
app_type: "wizardx",
|
|
79
79
|
draft: 1,
|
|
80
80
|
contract_version: selectDocumentModelVersion(),
|
|
81
81
|
};
|
|
@@ -83,19 +83,19 @@ function* setUserEmailDecorator(action: ActionsType.User.setUserEmail): any {
|
|
|
83
83
|
|
|
84
84
|
const apiEndpoint =
|
|
85
85
|
getConfig().apiEndpoint +
|
|
86
|
-
(/\/$/.test(getConfig().apiEndpoint) ?
|
|
86
|
+
(/\/$/.test(getConfig().apiEndpoint) ? "" : "/");
|
|
87
87
|
|
|
88
88
|
const instanceResponse = yield call(
|
|
89
89
|
fetch,
|
|
90
|
-
`${apiEndpoint}wizard/instance/${permalink}/${instanceUniqid ||
|
|
90
|
+
`${apiEndpoint}wizard/instance/${permalink}/${instanceUniqid || ""}`,
|
|
91
91
|
{
|
|
92
92
|
method:
|
|
93
93
|
instanceUniqid === undefined || instanceUniqid.length === 0
|
|
94
|
-
?
|
|
95
|
-
:
|
|
96
|
-
credentials:
|
|
94
|
+
? "POST"
|
|
95
|
+
: "PUT",
|
|
96
|
+
credentials: "include",
|
|
97
97
|
headers: {
|
|
98
|
-
|
|
98
|
+
"Content-Type": "application/json",
|
|
99
99
|
...canalHeaders,
|
|
100
100
|
},
|
|
101
101
|
body: JSON.stringify(body),
|
|
@@ -103,25 +103,25 @@ function* setUserEmailDecorator(action: ActionsType.User.setUserEmail): any {
|
|
|
103
103
|
);
|
|
104
104
|
const response: IInstanceCreationResponse = yield call([
|
|
105
105
|
instanceResponse,
|
|
106
|
-
|
|
106
|
+
"json",
|
|
107
107
|
]);
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* Redirecting user in case we recieved a redirect order
|
|
111
111
|
*/
|
|
112
112
|
const { redirect_to: redirectTo, user, uniqid, isPaid } = response;
|
|
113
|
-
if (typeof redirectTo !==
|
|
114
|
-
if (instanceUniqid
|
|
113
|
+
if (typeof redirectTo !== "string" || action.disableRedirect) {
|
|
114
|
+
if (!instanceUniqid?.length) {
|
|
115
115
|
yield put(
|
|
116
116
|
initInstanceAction({
|
|
117
|
-
dataStatus:
|
|
117
|
+
dataStatus: "saved",
|
|
118
118
|
uniqid,
|
|
119
119
|
isPaid: isPaid || false,
|
|
120
120
|
steps: [1],
|
|
121
121
|
})
|
|
122
122
|
);
|
|
123
123
|
}
|
|
124
|
-
yield put(setUserStatusAction(
|
|
124
|
+
yield put(setUserStatusAction("authenticated"));
|
|
125
125
|
if (user) {
|
|
126
126
|
yield put(
|
|
127
127
|
initUserAction({
|
|
@@ -133,8 +133,8 @@ function* setUserEmailDecorator(action: ActionsType.User.setUserEmail): any {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
// Identifying user
|
|
136
|
-
if (typeof window.sendinblue !==
|
|
137
|
-
const attributes = getSendinblueIdentifyAttributes(
|
|
136
|
+
if (typeof window.sendinblue !== "undefined" && response.user) {
|
|
137
|
+
const attributes = yield getSendinblueIdentifyAttributes(
|
|
138
138
|
uniqid,
|
|
139
139
|
selectDocumentTitle(),
|
|
140
140
|
nbFilledVars,
|
|
@@ -143,10 +143,10 @@ function* setUserEmailDecorator(action: ActionsType.User.setUserEmail): any {
|
|
|
143
143
|
);
|
|
144
144
|
window.sendinblue.identify(email, attributes);
|
|
145
145
|
const fetchParams = {
|
|
146
|
-
method:
|
|
147
|
-
credentials:
|
|
146
|
+
method: "POST",
|
|
147
|
+
credentials: "include",
|
|
148
148
|
headers: {
|
|
149
|
-
|
|
149
|
+
"Content-Type": "application/json",
|
|
150
150
|
},
|
|
151
151
|
body: JSON.stringify({
|
|
152
152
|
email,
|
|
@@ -155,7 +155,7 @@ function* setUserEmailDecorator(action: ActionsType.User.setUserEmail): any {
|
|
|
155
155
|
};
|
|
156
156
|
try {
|
|
157
157
|
// if we redirect afterwards we wait for the call to finish otherwise we do it in background
|
|
158
|
-
if (typeof redirectTo ===
|
|
158
|
+
if (typeof redirectTo === "string" && !action.disableRedirect) {
|
|
159
159
|
yield call(
|
|
160
160
|
// @ts-ignore for some reason saga doesn't like fetchParams being in a seperate variable
|
|
161
161
|
fetch,
|
|
@@ -176,13 +176,13 @@ function* setUserEmailDecorator(action: ActionsType.User.setUserEmail): any {
|
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
try {
|
|
179
|
-
if (redirectTo && redirectTo.includes(
|
|
179
|
+
if (redirectTo && redirectTo.includes("generation"))
|
|
180
180
|
window.dataLayer.push(
|
|
181
181
|
getContractFunnelGAEvent({
|
|
182
182
|
currentStep: 1,
|
|
183
183
|
contractName: selectDocumentTitle(),
|
|
184
|
-
sectionTitle:
|
|
185
|
-
pageAction:
|
|
184
|
+
sectionTitle: "Choississez votre pack",
|
|
185
|
+
pageAction: "Confirmation avant paiement 1 | 2",
|
|
186
186
|
})
|
|
187
187
|
);
|
|
188
188
|
} catch (error) {
|
|
@@ -190,17 +190,18 @@ function* setUserEmailDecorator(action: ActionsType.User.setUserEmail): any {
|
|
|
190
190
|
console.error(error);
|
|
191
191
|
}
|
|
192
192
|
// Redirecting user
|
|
193
|
-
if (typeof redirectTo ===
|
|
193
|
+
if (typeof redirectTo === "string" && !action.disableRedirect) {
|
|
194
194
|
// Disabling onbeforeunload
|
|
195
195
|
window.onbeforeunload = () => {};
|
|
196
196
|
|
|
197
|
+
// Add 1 second before redirection to wait for all HTTP requests to finish
|
|
197
198
|
setTimeout(() => {
|
|
198
199
|
window.location.href = redirectTo;
|
|
199
200
|
}, 1000);
|
|
200
201
|
}
|
|
201
202
|
|
|
202
203
|
const availableAppStates = [...selectAvailableAppStates()];
|
|
203
|
-
availableAppStates.splice(availableAppStates.indexOf(
|
|
204
|
+
availableAppStates.splice(availableAppStates.indexOf("email"), 1);
|
|
204
205
|
|
|
205
206
|
// Updating appstates
|
|
206
207
|
yield put(updateAvailableAppStatesAction(availableAppStates));
|
|
@@ -209,7 +210,7 @@ function* setUserEmailDecorator(action: ActionsType.User.setUserEmail): any {
|
|
|
209
210
|
} catch (e) {
|
|
210
211
|
// eslint-disable-next-line no-console
|
|
211
212
|
console.error(e);
|
|
212
|
-
yield put(setUserStatusAction(
|
|
213
|
+
yield put(setUserStatusAction("inprogress"));
|
|
213
214
|
}
|
|
214
215
|
}
|
|
215
216
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createSelector } from
|
|
2
|
-
import { selectOptionInput } from
|
|
3
|
-
import { StateType } from
|
|
1
|
+
import { createSelector } from "./selectors";
|
|
2
|
+
import { selectOptionInput } from "./inputs";
|
|
3
|
+
import { StateType } from "../../types/State.type";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Returns current page number
|
|
@@ -15,7 +15,7 @@ export const selectCurrentPage = createSelector(
|
|
|
15
15
|
*/
|
|
16
16
|
export const selectAvailableAppStates = createSelector(
|
|
17
17
|
(state: StateType) => state.app.pagination.availableAppStates,
|
|
18
|
-
(state: StateType) => state.app.pagination.availableAppStates.join(
|
|
18
|
+
(state: StateType) => state.app.pagination.availableAppStates.join("-")
|
|
19
19
|
);
|
|
20
20
|
|
|
21
21
|
/**
|
|
@@ -78,14 +78,14 @@ export const selectAvailableSections = createSelector(
|
|
|
78
78
|
* Returns all available options
|
|
79
79
|
*/
|
|
80
80
|
export const selectAvailableOptions = createSelector(
|
|
81
|
-
(state: StateType, document =
|
|
81
|
+
(state: StateType, document = "main") => {
|
|
82
82
|
let availableOptions: number[] = [];
|
|
83
83
|
|
|
84
84
|
const { availableSections } = state.app.wizard;
|
|
85
85
|
const documentSections = Object.keys(
|
|
86
86
|
state.references.sections[document]
|
|
87
87
|
).map((id) => parseInt(id, 10));
|
|
88
|
-
const sections = document ===
|
|
88
|
+
const sections = document === "main" ? availableSections : documentSections;
|
|
89
89
|
|
|
90
90
|
sections.forEach((sectionId) => {
|
|
91
91
|
const { options } = state.references.sections[document][sectionId];
|
|
@@ -93,11 +93,11 @@ export const selectAvailableOptions = createSelector(
|
|
|
93
93
|
});
|
|
94
94
|
return availableOptions;
|
|
95
95
|
},
|
|
96
|
-
(state: StateType, document =
|
|
97
|
-
if (document ===
|
|
96
|
+
(state: StateType, document = "main") => {
|
|
97
|
+
if (document === "main")
|
|
98
98
|
return state.app.wizard.availableSections.reduce(
|
|
99
99
|
(a, b) => `${a}${b}`,
|
|
100
|
-
|
|
100
|
+
""
|
|
101
101
|
);
|
|
102
102
|
return document;
|
|
103
103
|
}
|
|
@@ -109,7 +109,7 @@ export const selectAvailableOptions = createSelector(
|
|
|
109
109
|
export const selectMultipleOccurencies = createSelector(
|
|
110
110
|
(state: StateType) => {
|
|
111
111
|
const multipleOptionsOccurencies: Record<string, number> = {};
|
|
112
|
-
const availableOptions = selectAvailableOptions(
|
|
112
|
+
const availableOptions = selectAvailableOptions("main");
|
|
113
113
|
if (availableOptions === undefined) return {};
|
|
114
114
|
availableOptions.forEach((optionId) => {
|
|
115
115
|
const ref = state.references.options[optionId];
|
|
@@ -135,8 +135,8 @@ export const selectOutputsIds = createSelector(
|
|
|
135
135
|
return outputs;
|
|
136
136
|
},
|
|
137
137
|
(state: StateType, document: string) => {
|
|
138
|
-
if (document !==
|
|
139
|
-
return state.app.wizard.availableSections.reduce((a, b) => `${a}${b}`,
|
|
138
|
+
if (document !== "main") return document;
|
|
139
|
+
return state.app.wizard.availableSections.reduce((a, b) => `${a}${b}`, "");
|
|
140
140
|
}
|
|
141
141
|
);
|
|
142
142
|
|
|
@@ -201,7 +201,7 @@ export const selectMetaFetchStatus = createSelector(
|
|
|
201
201
|
*/
|
|
202
202
|
export const selectPrefix = createSelector(
|
|
203
203
|
(state: StateType) => (!state.app.meta ? undefined : state.app.meta.prefix),
|
|
204
|
-
(state: StateType) => (!state.app.meta ?
|
|
204
|
+
(state: StateType) => (!state.app.meta ? "0" : state.app.meta.permalink)
|
|
205
205
|
);
|
|
206
206
|
|
|
207
207
|
/**
|
|
@@ -210,7 +210,7 @@ export const selectPrefix = createSelector(
|
|
|
210
210
|
export const selectInstanceUniqid = createSelector(
|
|
211
211
|
(state: StateType) =>
|
|
212
212
|
!state.app.instance ? undefined : state.app.instance.uniqid,
|
|
213
|
-
(state: StateType) => (!state.app.instance ?
|
|
213
|
+
(state: StateType) => (!state.app.instance ? "0" : state.app.instance.uniqid)
|
|
214
214
|
);
|
|
215
215
|
|
|
216
216
|
/**
|
|
@@ -221,7 +221,7 @@ export const selectInstanceCompanyId = createSelector(
|
|
|
221
221
|
!state.app.instance ? undefined : state.app.instance.companyId,
|
|
222
222
|
(state: StateType) =>
|
|
223
223
|
!state.app.instance || !state.app.instance.companyId
|
|
224
|
-
?
|
|
224
|
+
? "0"
|
|
225
225
|
: state.app.instance.companyId
|
|
226
226
|
);
|
|
227
227
|
|
|
@@ -233,7 +233,7 @@ export const selectInstanceEmployeeId = createSelector(
|
|
|
233
233
|
!state.app.instance ? undefined : state.app.instance.employeeId,
|
|
234
234
|
(state: StateType) =>
|
|
235
235
|
!state.app.instance || !state.app.instance.employeeId
|
|
236
|
-
?
|
|
236
|
+
? "0"
|
|
237
237
|
: state.app.instance.employeeId
|
|
238
238
|
);
|
|
239
239
|
|
|
@@ -242,9 +242,9 @@ export const selectInstanceEmployeeId = createSelector(
|
|
|
242
242
|
*/
|
|
243
243
|
export const selectDataStatus = createSelector(
|
|
244
244
|
(state: StateType) =>
|
|
245
|
-
!state.app.instance ?
|
|
245
|
+
!state.app.instance ? "unsaved" : state.app.instance.dataStatus,
|
|
246
246
|
(state: StateType) =>
|
|
247
|
-
!state.app.instance ?
|
|
247
|
+
!state.app.instance ? "0" : state.app.instance.dataStatus
|
|
248
248
|
);
|
|
249
249
|
|
|
250
250
|
/**
|
|
@@ -255,7 +255,7 @@ export const selectInstanceIsPaid = createSelector(
|
|
|
255
255
|
(state: StateType) =>
|
|
256
256
|
state.app.instance && state.app.instance.isPaid
|
|
257
257
|
? state.app.instance.isPaid.toString()
|
|
258
|
-
:
|
|
258
|
+
: "0"
|
|
259
259
|
);
|
|
260
260
|
|
|
261
261
|
/**
|
|
@@ -266,25 +266,25 @@ export const selectInstanceSteps = createSelector(
|
|
|
266
266
|
(state: StateType) =>
|
|
267
267
|
state.app.instance && state.app.instance.steps
|
|
268
268
|
? state.app.instance.steps.toString()
|
|
269
|
-
:
|
|
269
|
+
: "0"
|
|
270
270
|
);
|
|
271
271
|
|
|
272
272
|
/**
|
|
273
273
|
* Verifies whether step is available for insatnce
|
|
274
274
|
*/
|
|
275
275
|
export const isStepAvailable = createSelector(
|
|
276
|
-
(state: StateType, steps:
|
|
276
|
+
(state: StateType, steps: "*" | number[] | undefined) => {
|
|
277
277
|
if (steps === undefined) return true;
|
|
278
278
|
|
|
279
279
|
// If instance isn't defined
|
|
280
280
|
if (state.app.instance === undefined)
|
|
281
|
-
return steps ===
|
|
281
|
+
return steps === "*" ? true : steps.includes(1);
|
|
282
282
|
|
|
283
283
|
// If step is accessible by all
|
|
284
|
-
if (steps ===
|
|
284
|
+
if (steps === "*") return true;
|
|
285
285
|
|
|
286
286
|
// If instance gives access to all steps
|
|
287
|
-
if (state.app.instance.steps ===
|
|
287
|
+
if (state.app.instance.steps === "*") return true;
|
|
288
288
|
return state.app.instance.steps
|
|
289
289
|
.map((c) => steps.includes(c))
|
|
290
290
|
.reduce((a, b) => a || b, false);
|
|
@@ -292,7 +292,7 @@ export const isStepAvailable = createSelector(
|
|
|
292
292
|
(state: StateType, steps) =>
|
|
293
293
|
state.app.instance && state.app.instance.steps && steps
|
|
294
294
|
? `${state.app.instance.steps.toString()}-${steps.toString()}`
|
|
295
|
-
:
|
|
295
|
+
: "0"
|
|
296
296
|
);
|
|
297
297
|
|
|
298
298
|
/**
|
|
@@ -301,7 +301,7 @@ export const isStepAvailable = createSelector(
|
|
|
301
301
|
export const selectCustomizationMeta = createSelector(
|
|
302
302
|
(state: StateType) => state.app.customization.meta,
|
|
303
303
|
(state: StateType) =>
|
|
304
|
-
state.app.customization.meta !== undefined ?
|
|
304
|
+
state.app.customization.meta !== undefined ? "1" : Math.random()
|
|
305
305
|
);
|
|
306
306
|
|
|
307
307
|
/**
|
|
@@ -311,7 +311,7 @@ export const selectCustomizationAutoDefaultType = createSelector(
|
|
|
311
311
|
(state: StateType) => state.app.customization.disableAutoDefault,
|
|
312
312
|
(state: StateType) =>
|
|
313
313
|
state.app.customization.disableAutoDefault !== undefined
|
|
314
|
-
?
|
|
314
|
+
? "1"
|
|
315
315
|
: Math.random()
|
|
316
316
|
);
|
|
317
317
|
|
|
@@ -321,5 +321,11 @@ export const selectCustomizationAutoDefaultType = createSelector(
|
|
|
321
321
|
export const selectModelUuid = createSelector(
|
|
322
322
|
(state: StateType) => state.app.meta.modelUuid,
|
|
323
323
|
(state: StateType) =>
|
|
324
|
-
state.app.meta.modelUuid !== undefined ?
|
|
324
|
+
state.app.meta.modelUuid !== undefined ? "1" : Math.random()
|
|
325
|
+
);
|
|
326
|
+
|
|
327
|
+
export const CompletelyUnusedSelector = createSelector(
|
|
328
|
+
(state: StateType) => state.app.meta.modelUuid,
|
|
329
|
+
(state: StateType) =>
|
|
330
|
+
state.app.meta.modelUuid !== undefined ? "1" : Math.random()
|
|
325
331
|
);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { createSelector } from
|
|
2
|
-
import { StateType } from
|
|
1
|
+
import { createSelector } from "./selectors";
|
|
2
|
+
import { StateType } from "../../types/State.type";
|
|
3
3
|
import {
|
|
4
4
|
selectVariableParents,
|
|
5
5
|
selectOptionParents,
|
|
6
6
|
selectVariableParentSection,
|
|
7
7
|
selectOptionParentSection,
|
|
8
|
-
} from
|
|
9
|
-
import { selectOptionInputByIndex } from
|
|
8
|
+
} from "./references";
|
|
9
|
+
import { selectOptionInputByIndex } from "./inputs";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Returns option's condition value
|
|
@@ -17,17 +17,17 @@ import { selectOptionInputByIndex } from './inputs';
|
|
|
17
17
|
// Let's start by creation the selector
|
|
18
18
|
const optionConditionValueSelector = createSelector(
|
|
19
19
|
(state: StateType, id: number, index?: number) => {
|
|
20
|
-
if (typeof state.conditions.options[id] ===
|
|
21
|
-
return typeof index ===
|
|
20
|
+
if (typeof state.conditions.options[id] === "undefined") return undefined;
|
|
21
|
+
return typeof index === "number"
|
|
22
22
|
? state.conditions.options[id][index]
|
|
23
23
|
: state.conditions.options[id];
|
|
24
24
|
},
|
|
25
25
|
(state, id: number, index?: number) => {
|
|
26
|
-
if (typeof state.conditions.options[id] ===
|
|
26
|
+
if (typeof state.conditions.options[id] === "undefined")
|
|
27
27
|
return Math.random();
|
|
28
28
|
return `${state.conditions.options[id].reduce(
|
|
29
|
-
(p, c) => p + (c ?
|
|
30
|
-
|
|
29
|
+
(p, c) => p + (c ? "1" : "0"),
|
|
30
|
+
""
|
|
31
31
|
)}_${id}_${index}`;
|
|
32
32
|
}
|
|
33
33
|
);
|
|
@@ -42,7 +42,7 @@ export function selectOptionConditionValue(
|
|
|
42
42
|
index: number
|
|
43
43
|
): Readonly<boolean | undefined>;
|
|
44
44
|
export function selectOptionConditionValue(id: number, index?: number) {
|
|
45
|
-
if (typeof index ===
|
|
45
|
+
if (typeof index === "number") return optionConditionValueSelector(id, index);
|
|
46
46
|
return optionConditionValueSelector(id);
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -53,17 +53,17 @@ export function selectOptionConditionValue(id: number, index?: number) {
|
|
|
53
53
|
*/
|
|
54
54
|
const variableConditionValueSelector = createSelector(
|
|
55
55
|
(state, id: number, index?: number) => {
|
|
56
|
-
if (typeof state.conditions.variables[id] ===
|
|
57
|
-
return typeof index ===
|
|
56
|
+
if (typeof state.conditions.variables[id] === "undefined") return undefined;
|
|
57
|
+
return typeof index === "number"
|
|
58
58
|
? state.conditions.variables[id][index]
|
|
59
59
|
: state.conditions.variables[id];
|
|
60
60
|
},
|
|
61
61
|
(state, id: number, index?: number) => {
|
|
62
|
-
if (typeof state.conditions.variables[id] ===
|
|
62
|
+
if (typeof state.conditions.variables[id] === "undefined")
|
|
63
63
|
return Math.random();
|
|
64
64
|
return `${state.conditions.variables[id].reduce(
|
|
65
|
-
(p, c) => p + (c ?
|
|
66
|
-
|
|
65
|
+
(p, c) => p + (c ? "1" : "0"),
|
|
66
|
+
""
|
|
67
67
|
)}_${id}_${index}`;
|
|
68
68
|
}
|
|
69
69
|
);
|
|
@@ -76,7 +76,7 @@ export function selectVariableConditionValue(
|
|
|
76
76
|
index: number
|
|
77
77
|
): boolean | undefined;
|
|
78
78
|
export function selectVariableConditionValue(id: number, index?: number) {
|
|
79
|
-
if (typeof index ===
|
|
79
|
+
if (typeof index === "number")
|
|
80
80
|
return variableConditionValueSelector(id, index);
|
|
81
81
|
return variableConditionValueSelector(id);
|
|
82
82
|
}
|
|
@@ -86,11 +86,11 @@ export function selectVariableConditionValue(id: number, index?: number) {
|
|
|
86
86
|
* @param id Section's id
|
|
87
87
|
*/
|
|
88
88
|
export const selectSectionConditionValue = createSelector(
|
|
89
|
-
(state, id: number, document =
|
|
89
|
+
(state, id: number, document = "main") => {
|
|
90
90
|
if (state.conditions.sections[document] === undefined) return undefined;
|
|
91
91
|
return state.conditions.sections[document][id];
|
|
92
92
|
},
|
|
93
|
-
(state, id: number, document =
|
|
93
|
+
(state, id: number, document = "main") => {
|
|
94
94
|
const key = state.conditions.sections[document][id] ? `1_${id}` : `0_${id}`;
|
|
95
95
|
return document + key;
|
|
96
96
|
}
|
|
@@ -102,14 +102,14 @@ export const selectSectionConditionValue = createSelector(
|
|
|
102
102
|
*/
|
|
103
103
|
export const selectDocumentConditionValue = createSelector(
|
|
104
104
|
(state, name: string) => {
|
|
105
|
-
if (typeof state.conditions.documents[name] ===
|
|
105
|
+
if (typeof state.conditions.documents[name] === "undefined")
|
|
106
106
|
return undefined;
|
|
107
107
|
return state.conditions.documents[name];
|
|
108
108
|
},
|
|
109
109
|
(state, name: string) => {
|
|
110
|
-
if (typeof state.conditions.documents[name] ===
|
|
110
|
+
if (typeof state.conditions.documents[name] === "undefined")
|
|
111
111
|
return Math.random().toString();
|
|
112
|
-
return state.conditions.documents[name] ?
|
|
112
|
+
return state.conditions.documents[name] ? "true" : "false";
|
|
113
113
|
}
|
|
114
114
|
);
|
|
115
115
|
|
|
@@ -122,15 +122,15 @@ const prefillerConditionValueSelector = createSelector(
|
|
|
122
122
|
(state, id: number, index?: number) => {
|
|
123
123
|
if (state.conditions.prefillers === undefined) return undefined;
|
|
124
124
|
if (state.conditions.prefillers[id] === undefined) return undefined;
|
|
125
|
-
return typeof index ===
|
|
125
|
+
return typeof index === "number"
|
|
126
126
|
? state.conditions.prefillers[id][index]
|
|
127
127
|
: state.conditions.prefillers[id];
|
|
128
128
|
},
|
|
129
129
|
(state, id: number, index?: number) => {
|
|
130
130
|
const prefillers = state.conditions.prefillers[id].map((v) =>
|
|
131
|
-
v.reduce((p, c) => p + (c ?
|
|
131
|
+
v.reduce((p, c) => p + (c ? "1" : "0"), "")
|
|
132
132
|
);
|
|
133
|
-
return `${prefillers.reduce((p, c) => p + c,
|
|
133
|
+
return `${prefillers.reduce((p, c) => p + c, "")}_${id}_${index}`;
|
|
134
134
|
}
|
|
135
135
|
);
|
|
136
136
|
|
|
@@ -144,7 +144,7 @@ export function selectPrefillerConditionValue(
|
|
|
144
144
|
index: number
|
|
145
145
|
): boolean[] | undefined;
|
|
146
146
|
export function selectPrefillerConditionValue(id: number, index?: number) {
|
|
147
|
-
if (typeof index ===
|
|
147
|
+
if (typeof index === "number")
|
|
148
148
|
return prefillerConditionValueSelector(id, index);
|
|
149
149
|
return prefillerConditionValueSelector(id);
|
|
150
150
|
}
|
|
@@ -156,24 +156,24 @@ export function selectPrefillerConditionValue(id: number, index?: number) {
|
|
|
156
156
|
*/
|
|
157
157
|
const optionValidatorConditionValueSelector = createSelector(
|
|
158
158
|
(state, id: number, index?: number) => {
|
|
159
|
-
if (typeof state.conditions.validators.options[id] ===
|
|
159
|
+
if (typeof state.conditions.validators.options[id] === "undefined")
|
|
160
160
|
return undefined;
|
|
161
161
|
if (
|
|
162
|
-
typeof index ===
|
|
163
|
-
typeof state.conditions.validators.options[id][index] ===
|
|
162
|
+
typeof index === "number" &&
|
|
163
|
+
typeof state.conditions.validators.options[id][index] === "undefined"
|
|
164
164
|
)
|
|
165
165
|
return undefined;
|
|
166
|
-
return typeof index ===
|
|
166
|
+
return typeof index === "number"
|
|
167
167
|
? state.conditions.validators.options[id][index]
|
|
168
168
|
: state.conditions.validators.options[id];
|
|
169
169
|
},
|
|
170
170
|
(state, id: number, index?: number) => {
|
|
171
|
-
if (typeof state.conditions.validators.options[id] ===
|
|
171
|
+
if (typeof state.conditions.validators.options[id] === "undefined")
|
|
172
172
|
return Math.random();
|
|
173
173
|
return `${state.conditions.validators.options[id].reduce(
|
|
174
|
-
(p, c) => p + (c ?
|
|
175
|
-
|
|
176
|
-
)}-${id.toString()}${index ? index.toString() :
|
|
174
|
+
(p, c) => p + (c ? "1" : "0"),
|
|
175
|
+
""
|
|
176
|
+
)}-${id.toString()}${index ? index.toString() : ""}`;
|
|
177
177
|
}
|
|
178
178
|
);
|
|
179
179
|
|
|
@@ -190,7 +190,7 @@ export function selectOptionValidatorConditionValue(
|
|
|
190
190
|
id: number,
|
|
191
191
|
index?: number
|
|
192
192
|
) {
|
|
193
|
-
if (typeof index ===
|
|
193
|
+
if (typeof index === "number")
|
|
194
194
|
return optionValidatorConditionValueSelector(id, index);
|
|
195
195
|
return optionValidatorConditionValueSelector(id);
|
|
196
196
|
}
|
|
@@ -202,19 +202,19 @@ export function selectOptionValidatorConditionValue(
|
|
|
202
202
|
*/
|
|
203
203
|
const variableValidatorConditionValueSelector = createSelector(
|
|
204
204
|
(state, id: number, index?: number) => {
|
|
205
|
-
if (typeof state.conditions.validators.variables[id] ===
|
|
205
|
+
if (typeof state.conditions.validators.variables[id] === "undefined")
|
|
206
206
|
return undefined;
|
|
207
|
-
return typeof index ===
|
|
207
|
+
return typeof index === "number"
|
|
208
208
|
? state.conditions.validators.variables[id][index]
|
|
209
209
|
: state.conditions.validators.variables[id];
|
|
210
210
|
},
|
|
211
211
|
(state, id: number, index?: number) => {
|
|
212
|
-
if (typeof state.conditions.validators.variables[id] ===
|
|
212
|
+
if (typeof state.conditions.validators.variables[id] === "undefined")
|
|
213
213
|
return Math.random();
|
|
214
214
|
return `${state.conditions.validators.variables[id].reduce(
|
|
215
|
-
(p, c) => p + (c ?
|
|
216
|
-
|
|
217
|
-
)}-${id.toString()}${index ? index.toString() :
|
|
215
|
+
(p, c) => p + (c ? "1" : "0"),
|
|
216
|
+
""
|
|
217
|
+
)}-${id.toString()}${index ? index.toString() : ""}`;
|
|
218
218
|
}
|
|
219
219
|
);
|
|
220
220
|
|
|
@@ -231,7 +231,7 @@ export function selectVariableValidatorConditionValue(
|
|
|
231
231
|
id: number,
|
|
232
232
|
index?: number
|
|
233
233
|
) {
|
|
234
|
-
if (typeof index ===
|
|
234
|
+
if (typeof index === "number")
|
|
235
235
|
return variableValidatorConditionValueSelector(id, index);
|
|
236
236
|
return variableValidatorConditionValueSelector(id);
|
|
237
237
|
}
|