@legalplace/wizardx-core 2.2.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 +31 -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.d.ts +1 -0
- package/dist/libs/EventsTracking.js +38 -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 +48 -34
- 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,37 +1,37 @@
|
|
|
1
|
-
import { call, fork, put, takeLatest } from
|
|
2
|
-
import { getContractFunnelGAEvent } from
|
|
3
|
-
import { v4 as uuid } from
|
|
4
|
-
import { getConfig } from
|
|
5
|
-
import { selectPermalink, selectInstanceUniqid, selectDocumentTitle, selectAvailableAppStates, selectDocumentModelVersion, } from
|
|
6
|
-
import { selectInputs } from
|
|
7
|
-
import { SET_USER_EMAIL } from
|
|
8
|
-
import { setUserStatusAction, initUserAction } from
|
|
9
|
-
import { updateAvailableAppStatesAction, initInstanceAction, goNextPageAction, } from
|
|
10
|
-
import { OvcConverter } from
|
|
11
|
-
import { getSendinblueIdentifyAttributes } from
|
|
12
|
-
import { setUserEmailSucceeded } from
|
|
13
|
-
import { EMAIL_REGEX } 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
|
+
import { selectPermalink, selectInstanceUniqid, selectDocumentTitle, selectAvailableAppStates, selectDocumentModelVersion, } from "../selectors/app";
|
|
6
|
+
import { selectInputs } from "../selectors/inputs";
|
|
7
|
+
import { SET_USER_EMAIL } from "../constants/sagas/user";
|
|
8
|
+
import { setUserStatusAction, initUserAction } from "../actions/user";
|
|
9
|
+
import { updateAvailableAppStatesAction, initInstanceAction, goNextPageAction, } from "../actions/app";
|
|
10
|
+
import { OvcConverter } from "../../libs/OvcConverter";
|
|
11
|
+
import { getSendinblueIdentifyAttributes } from "../../helpers/sendinblueHelper";
|
|
12
|
+
import { setUserEmailSucceeded } from "../actions/sagas/user";
|
|
13
|
+
import { EMAIL_REGEX } from "../../constants/emailValidation";
|
|
14
14
|
const canalHeaders = {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
"lp-referrer": window.document.referrer,
|
|
16
|
+
"lp-origin": window.location.href,
|
|
17
17
|
};
|
|
18
18
|
function* setUserEmailDecorator(action) {
|
|
19
19
|
try {
|
|
20
20
|
const { email, tags, inBackground } = action;
|
|
21
21
|
if (!EMAIL_REGEX.test(email)) {
|
|
22
22
|
if (!inBackground)
|
|
23
|
-
yield put(setUserStatusAction(
|
|
23
|
+
yield put(setUserStatusAction("failed"));
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
yield put(setUserStatusAction(
|
|
26
|
+
yield put(setUserStatusAction("inprogress"));
|
|
27
27
|
const permalink = selectPermalink();
|
|
28
28
|
const instanceUniqid = selectInstanceUniqid();
|
|
29
29
|
const ovc = OvcConverter.convertToOvc(selectInputs());
|
|
30
30
|
const nbFilledVars = Object.keys(ovc.v).reduce((p, c) => {
|
|
31
31
|
const currentValue = ovc.v[c];
|
|
32
32
|
const o = Array.isArray(currentValue)
|
|
33
|
-
? currentValue.reduce((_p, _c) => _p + (_c !==
|
|
34
|
-
: currentValue !==
|
|
33
|
+
? currentValue.reduce((_p, _c) => _p + (_c !== "" ? 1 : 0), 0)
|
|
34
|
+
: currentValue !== ""
|
|
35
35
|
? 1
|
|
36
36
|
: 0;
|
|
37
37
|
return p + o;
|
|
@@ -44,45 +44,45 @@ function* setUserEmailDecorator(action) {
|
|
|
44
44
|
tags,
|
|
45
45
|
};
|
|
46
46
|
if (instanceUniqid === undefined || instanceUniqid.length === 0) {
|
|
47
|
-
body = Object.assign(Object.assign({}, body), { app_type:
|
|
47
|
+
body = Object.assign(Object.assign({}, body), { app_type: "wizardx", draft: 1, contract_version: selectDocumentModelVersion() });
|
|
48
48
|
}
|
|
49
49
|
const apiEndpoint = getConfig().apiEndpoint +
|
|
50
|
-
(/\/$/.test(getConfig().apiEndpoint) ?
|
|
51
|
-
const instanceResponse = yield call(fetch, `${apiEndpoint}wizard/instance/${permalink}/${instanceUniqid ||
|
|
50
|
+
(/\/$/.test(getConfig().apiEndpoint) ? "" : "/");
|
|
51
|
+
const instanceResponse = yield call(fetch, `${apiEndpoint}wizard/instance/${permalink}/${instanceUniqid || ""}`, {
|
|
52
52
|
method: instanceUniqid === undefined || instanceUniqid.length === 0
|
|
53
|
-
?
|
|
54
|
-
:
|
|
55
|
-
credentials:
|
|
56
|
-
headers: Object.assign({
|
|
53
|
+
? "POST"
|
|
54
|
+
: "PUT",
|
|
55
|
+
credentials: "include",
|
|
56
|
+
headers: Object.assign({ "Content-Type": "application/json" }, canalHeaders),
|
|
57
57
|
body: JSON.stringify(body),
|
|
58
58
|
});
|
|
59
59
|
const response = yield call([
|
|
60
60
|
instanceResponse,
|
|
61
|
-
|
|
61
|
+
"json",
|
|
62
62
|
]);
|
|
63
63
|
const { redirect_to: redirectTo, user, uniqid, isPaid } = response;
|
|
64
|
-
if (typeof redirectTo !==
|
|
65
|
-
if (instanceUniqid ===
|
|
64
|
+
if (typeof redirectTo !== "string" || action.disableRedirect) {
|
|
65
|
+
if (!(instanceUniqid === null || instanceUniqid === void 0 ? void 0 : instanceUniqid.length)) {
|
|
66
66
|
yield put(initInstanceAction({
|
|
67
|
-
dataStatus:
|
|
67
|
+
dataStatus: "saved",
|
|
68
68
|
uniqid,
|
|
69
69
|
isPaid: isPaid || false,
|
|
70
70
|
steps: [1],
|
|
71
71
|
}));
|
|
72
72
|
}
|
|
73
|
-
yield put(setUserStatusAction(
|
|
73
|
+
yield put(setUserStatusAction("authenticated"));
|
|
74
74
|
if (user) {
|
|
75
75
|
yield put(initUserAction(Object.assign(Object.assign({}, user), { level: user.role || user.level })));
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
if (typeof window.sendinblue !==
|
|
79
|
-
const attributes = getSendinblueIdentifyAttributes(uniqid, selectDocumentTitle(), nbFilledVars, false, window.location.host);
|
|
78
|
+
if (typeof window.sendinblue !== "undefined" && response.user) {
|
|
79
|
+
const attributes = yield getSendinblueIdentifyAttributes(uniqid, selectDocumentTitle(), nbFilledVars, false, window.location.host);
|
|
80
80
|
window.sendinblue.identify(email, attributes);
|
|
81
81
|
const fetchParams = {
|
|
82
|
-
method:
|
|
83
|
-
credentials:
|
|
82
|
+
method: "POST",
|
|
83
|
+
credentials: "include",
|
|
84
84
|
headers: {
|
|
85
|
-
|
|
85
|
+
"Content-Type": "application/json",
|
|
86
86
|
},
|
|
87
87
|
body: JSON.stringify({
|
|
88
88
|
email,
|
|
@@ -90,7 +90,7 @@ function* setUserEmailDecorator(action) {
|
|
|
90
90
|
}),
|
|
91
91
|
};
|
|
92
92
|
try {
|
|
93
|
-
if (typeof redirectTo ===
|
|
93
|
+
if (typeof redirectTo === "string" && !action.disableRedirect) {
|
|
94
94
|
yield call(fetch, `${apiEndpoint}event/create/${uniqid}/${uuid()}`, fetchParams);
|
|
95
95
|
}
|
|
96
96
|
else {
|
|
@@ -101,25 +101,25 @@ function* setUserEmailDecorator(action) {
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
try {
|
|
104
|
-
if (redirectTo && redirectTo.includes(
|
|
104
|
+
if (redirectTo && redirectTo.includes("generation"))
|
|
105
105
|
window.dataLayer.push(getContractFunnelGAEvent({
|
|
106
106
|
currentStep: 1,
|
|
107
107
|
contractName: selectDocumentTitle(),
|
|
108
|
-
sectionTitle:
|
|
109
|
-
pageAction:
|
|
108
|
+
sectionTitle: "Choississez votre pack",
|
|
109
|
+
pageAction: "Confirmation avant paiement 1 | 2",
|
|
110
110
|
}));
|
|
111
111
|
}
|
|
112
112
|
catch (error) {
|
|
113
113
|
console.error(error);
|
|
114
114
|
}
|
|
115
|
-
if (typeof redirectTo ===
|
|
115
|
+
if (typeof redirectTo === "string" && !action.disableRedirect) {
|
|
116
116
|
window.onbeforeunload = () => { };
|
|
117
117
|
setTimeout(() => {
|
|
118
118
|
window.location.href = redirectTo;
|
|
119
119
|
}, 1000);
|
|
120
120
|
}
|
|
121
121
|
const availableAppStates = [...selectAvailableAppStates()];
|
|
122
|
-
availableAppStates.splice(availableAppStates.indexOf(
|
|
122
|
+
availableAppStates.splice(availableAppStates.indexOf("email"), 1);
|
|
123
123
|
yield put(updateAvailableAppStatesAction(availableAppStates));
|
|
124
124
|
if (!inBackground)
|
|
125
125
|
yield put(goNextPageAction());
|
|
@@ -127,7 +127,7 @@ function* setUserEmailDecorator(action) {
|
|
|
127
127
|
}
|
|
128
128
|
catch (e) {
|
|
129
129
|
console.error(e);
|
|
130
|
-
yield put(setUserStatusAction(
|
|
130
|
+
yield put(setUserStatusAction("inprogress"));
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
function* setUserEmailSaga() {
|
|
@@ -28,3 +28,4 @@ export declare const isStepAvailable: (steps: number[] | "*" | undefined) => Rea
|
|
|
28
28
|
export declare const selectCustomizationMeta: () => Readonly<import("../../types/State.type").AppCustomizationMetaType | undefined>;
|
|
29
29
|
export declare const selectCustomizationAutoDefaultType: () => Readonly<boolean | undefined>;
|
|
30
30
|
export declare const selectModelUuid: () => Readonly<string | undefined>;
|
|
31
|
+
export declare const CompletelyUnusedSelector: () => Readonly<string | undefined>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createSelector } from
|
|
2
|
-
import { selectOptionInput } from
|
|
1
|
+
import { createSelector } from "./selectors";
|
|
2
|
+
import { selectOptionInput } from "./inputs";
|
|
3
3
|
export const selectCurrentPage = createSelector((state) => state.app.pagination.currentPage, (state) => state.app.pagination.currentPage.toString());
|
|
4
|
-
export const selectAvailableAppStates = createSelector((state) => state.app.pagination.availableAppStates, (state) => state.app.pagination.availableAppStates.join(
|
|
4
|
+
export const selectAvailableAppStates = createSelector((state) => state.app.pagination.availableAppStates, (state) => state.app.pagination.availableAppStates.join("-"));
|
|
5
5
|
export const selectCurrentAppState = createSelector((state) => state.app.pagination.currentAppState, (state) => state.app.pagination.currentAppState);
|
|
6
6
|
export const selectIsFirstPage = createSelector((state) => state.app.pagination.isFirstPage, (state) => state.app.pagination.isFirstPage.toString());
|
|
7
7
|
export const selectIsLastPage = createSelector((state) => state.app.pagination.isLastPage, (state) => state.app.pagination.isLastPage.toString());
|
|
@@ -10,24 +10,24 @@ export const selectIsLastWizardPage = createSelector((state) => state.app.pagina
|
|
|
10
10
|
export const selectGreatestPage = createSelector((state) => state.app.pagination.greatestPage, (state) => state.app.pagination.greatestPage);
|
|
11
11
|
export const selectCurrentSectionId = createSelector((state) => state.app.wizard.currentSectionId, (state) => state.app.wizard.currentSectionId);
|
|
12
12
|
export const selectAvailableSections = createSelector((state) => [...state.app.wizard.availableSections], (state) => state.app.wizard.availableSections.reduce((p, c) => p + c, 0));
|
|
13
|
-
export const selectAvailableOptions = createSelector((state, document =
|
|
13
|
+
export const selectAvailableOptions = createSelector((state, document = "main") => {
|
|
14
14
|
let availableOptions = [];
|
|
15
15
|
const { availableSections } = state.app.wizard;
|
|
16
16
|
const documentSections = Object.keys(state.references.sections[document]).map((id) => parseInt(id, 10));
|
|
17
|
-
const sections = document ===
|
|
17
|
+
const sections = document === "main" ? availableSections : documentSections;
|
|
18
18
|
sections.forEach((sectionId) => {
|
|
19
19
|
const { options } = state.references.sections[document][sectionId];
|
|
20
20
|
availableOptions = [...availableOptions, ...options];
|
|
21
21
|
});
|
|
22
22
|
return availableOptions;
|
|
23
|
-
}, (state, document =
|
|
24
|
-
if (document ===
|
|
25
|
-
return state.app.wizard.availableSections.reduce((a, b) => `${a}${b}`,
|
|
23
|
+
}, (state, document = "main") => {
|
|
24
|
+
if (document === "main")
|
|
25
|
+
return state.app.wizard.availableSections.reduce((a, b) => `${a}${b}`, "");
|
|
26
26
|
return document;
|
|
27
27
|
});
|
|
28
28
|
export const selectMultipleOccurencies = createSelector((state) => {
|
|
29
29
|
const multipleOptionsOccurencies = {};
|
|
30
|
-
const availableOptions = selectAvailableOptions(
|
|
30
|
+
const availableOptions = selectAvailableOptions("main");
|
|
31
31
|
if (availableOptions === undefined)
|
|
32
32
|
return {};
|
|
33
33
|
availableOptions.forEach((optionId) => {
|
|
@@ -50,9 +50,9 @@ export const selectOutputsIds = createSelector((state, document) => {
|
|
|
50
50
|
});
|
|
51
51
|
return outputs;
|
|
52
52
|
}, (state, document) => {
|
|
53
|
-
if (document !==
|
|
53
|
+
if (document !== "main")
|
|
54
54
|
return document;
|
|
55
|
-
return state.app.wizard.availableSections.reduce((a, b) => `${a}${b}`,
|
|
55
|
+
return state.app.wizard.availableSections.reduce((a, b) => `${a}${b}`, "");
|
|
56
56
|
});
|
|
57
57
|
export const selectPermalink = createSelector((state) => state.app.meta.permalink, (state) => state.app.meta.permalink);
|
|
58
58
|
export const selectDocumentTitle = createSelector((state) => state.app.meta.title, (state) => state.app.meta.title);
|
|
@@ -61,38 +61,39 @@ export const selectDocumentModelVersion = createSelector((state) => state.app.me
|
|
|
61
61
|
export const selectDocumentProductType = createSelector((state) => state.app.meta.productType, (state) => state.app.meta.productType);
|
|
62
62
|
export const selectMeta = createSelector((state) => state.app.meta, (state) => state.app.meta.title);
|
|
63
63
|
export const selectMetaFetchStatus = createSelector((state) => state.app.meta.fetchStatus, (state) => state.app.meta.fetchStatus);
|
|
64
|
-
export const selectPrefix = createSelector((state) => (!state.app.meta ? undefined : state.app.meta.prefix), (state) => (!state.app.meta ?
|
|
65
|
-
export const selectInstanceUniqid = createSelector((state) => !state.app.instance ? undefined : state.app.instance.uniqid, (state) => (!state.app.instance ?
|
|
64
|
+
export const selectPrefix = createSelector((state) => (!state.app.meta ? undefined : state.app.meta.prefix), (state) => (!state.app.meta ? "0" : state.app.meta.permalink));
|
|
65
|
+
export const selectInstanceUniqid = createSelector((state) => !state.app.instance ? undefined : state.app.instance.uniqid, (state) => (!state.app.instance ? "0" : state.app.instance.uniqid));
|
|
66
66
|
export const selectInstanceCompanyId = createSelector((state) => !state.app.instance ? undefined : state.app.instance.companyId, (state) => !state.app.instance || !state.app.instance.companyId
|
|
67
|
-
?
|
|
67
|
+
? "0"
|
|
68
68
|
: state.app.instance.companyId);
|
|
69
69
|
export const selectInstanceEmployeeId = createSelector((state) => !state.app.instance ? undefined : state.app.instance.employeeId, (state) => !state.app.instance || !state.app.instance.employeeId
|
|
70
|
-
?
|
|
70
|
+
? "0"
|
|
71
71
|
: state.app.instance.employeeId);
|
|
72
|
-
export const selectDataStatus = createSelector((state) => !state.app.instance ?
|
|
72
|
+
export const selectDataStatus = createSelector((state) => !state.app.instance ? "unsaved" : state.app.instance.dataStatus, (state) => !state.app.instance ? "0" : state.app.instance.dataStatus);
|
|
73
73
|
export const selectInstanceIsPaid = createSelector((state) => !!(state.app.instance && state.app.instance.isPaid), (state) => state.app.instance && state.app.instance.isPaid
|
|
74
74
|
? state.app.instance.isPaid.toString()
|
|
75
|
-
:
|
|
75
|
+
: "0");
|
|
76
76
|
export const selectInstanceSteps = createSelector((state) => !!(state.app.instance && state.app.instance.steps), (state) => state.app.instance && state.app.instance.steps
|
|
77
77
|
? state.app.instance.steps.toString()
|
|
78
|
-
:
|
|
78
|
+
: "0");
|
|
79
79
|
export const isStepAvailable = createSelector((state, steps) => {
|
|
80
80
|
if (steps === undefined)
|
|
81
81
|
return true;
|
|
82
82
|
if (state.app.instance === undefined)
|
|
83
|
-
return steps ===
|
|
84
|
-
if (steps ===
|
|
83
|
+
return steps === "*" ? true : steps.includes(1);
|
|
84
|
+
if (steps === "*")
|
|
85
85
|
return true;
|
|
86
|
-
if (state.app.instance.steps ===
|
|
86
|
+
if (state.app.instance.steps === "*")
|
|
87
87
|
return true;
|
|
88
88
|
return state.app.instance.steps
|
|
89
89
|
.map((c) => steps.includes(c))
|
|
90
90
|
.reduce((a, b) => a || b, false);
|
|
91
91
|
}, (state, steps) => state.app.instance && state.app.instance.steps && steps
|
|
92
92
|
? `${state.app.instance.steps.toString()}-${steps.toString()}`
|
|
93
|
-
:
|
|
94
|
-
export const selectCustomizationMeta = createSelector((state) => state.app.customization.meta, (state) => state.app.customization.meta !== undefined ?
|
|
93
|
+
: "0");
|
|
94
|
+
export const selectCustomizationMeta = createSelector((state) => state.app.customization.meta, (state) => state.app.customization.meta !== undefined ? "1" : Math.random());
|
|
95
95
|
export const selectCustomizationAutoDefaultType = createSelector((state) => state.app.customization.disableAutoDefault, (state) => state.app.customization.disableAutoDefault !== undefined
|
|
96
|
-
?
|
|
96
|
+
? "1"
|
|
97
97
|
: Math.random());
|
|
98
|
-
export const selectModelUuid = createSelector((state) => state.app.meta.modelUuid, (state) => state.app.meta.modelUuid !== undefined ?
|
|
98
|
+
export const selectModelUuid = createSelector((state) => state.app.meta.modelUuid, (state) => state.app.meta.modelUuid !== undefined ? "1" : Math.random());
|
|
99
|
+
export const CompletelyUnusedSelector = createSelector((state) => state.app.meta.modelUuid, (state) => state.app.meta.modelUuid !== undefined ? "1" : Math.random());
|
|
@@ -1,104 +1,104 @@
|
|
|
1
|
-
import { createSelector } from
|
|
2
|
-
import { selectVariableParents, selectOptionParents, selectVariableParentSection, selectOptionParentSection, } from
|
|
3
|
-
import { selectOptionInputByIndex } from
|
|
1
|
+
import { createSelector } from "./selectors";
|
|
2
|
+
import { selectVariableParents, selectOptionParents, selectVariableParentSection, selectOptionParentSection, } from "./references";
|
|
3
|
+
import { selectOptionInputByIndex } from "./inputs";
|
|
4
4
|
const optionConditionValueSelector = createSelector((state, id, index) => {
|
|
5
|
-
if (typeof state.conditions.options[id] ===
|
|
5
|
+
if (typeof state.conditions.options[id] === "undefined")
|
|
6
6
|
return undefined;
|
|
7
|
-
return typeof index ===
|
|
7
|
+
return typeof index === "number"
|
|
8
8
|
? state.conditions.options[id][index]
|
|
9
9
|
: state.conditions.options[id];
|
|
10
10
|
}, (state, id, index) => {
|
|
11
|
-
if (typeof state.conditions.options[id] ===
|
|
11
|
+
if (typeof state.conditions.options[id] === "undefined")
|
|
12
12
|
return Math.random();
|
|
13
|
-
return `${state.conditions.options[id].reduce((p, c) => p + (c ?
|
|
13
|
+
return `${state.conditions.options[id].reduce((p, c) => p + (c ? "1" : "0"), "")}_${id}_${index}`;
|
|
14
14
|
});
|
|
15
15
|
export function selectOptionConditionValue(id, index) {
|
|
16
|
-
if (typeof index ===
|
|
16
|
+
if (typeof index === "number")
|
|
17
17
|
return optionConditionValueSelector(id, index);
|
|
18
18
|
return optionConditionValueSelector(id);
|
|
19
19
|
}
|
|
20
20
|
const variableConditionValueSelector = createSelector((state, id, index) => {
|
|
21
|
-
if (typeof state.conditions.variables[id] ===
|
|
21
|
+
if (typeof state.conditions.variables[id] === "undefined")
|
|
22
22
|
return undefined;
|
|
23
|
-
return typeof index ===
|
|
23
|
+
return typeof index === "number"
|
|
24
24
|
? state.conditions.variables[id][index]
|
|
25
25
|
: state.conditions.variables[id];
|
|
26
26
|
}, (state, id, index) => {
|
|
27
|
-
if (typeof state.conditions.variables[id] ===
|
|
27
|
+
if (typeof state.conditions.variables[id] === "undefined")
|
|
28
28
|
return Math.random();
|
|
29
|
-
return `${state.conditions.variables[id].reduce((p, c) => p + (c ?
|
|
29
|
+
return `${state.conditions.variables[id].reduce((p, c) => p + (c ? "1" : "0"), "")}_${id}_${index}`;
|
|
30
30
|
});
|
|
31
31
|
export function selectVariableConditionValue(id, index) {
|
|
32
|
-
if (typeof index ===
|
|
32
|
+
if (typeof index === "number")
|
|
33
33
|
return variableConditionValueSelector(id, index);
|
|
34
34
|
return variableConditionValueSelector(id);
|
|
35
35
|
}
|
|
36
|
-
export const selectSectionConditionValue = createSelector((state, id, document =
|
|
36
|
+
export const selectSectionConditionValue = createSelector((state, id, document = "main") => {
|
|
37
37
|
if (state.conditions.sections[document] === undefined)
|
|
38
38
|
return undefined;
|
|
39
39
|
return state.conditions.sections[document][id];
|
|
40
|
-
}, (state, id, document =
|
|
40
|
+
}, (state, id, document = "main") => {
|
|
41
41
|
const key = state.conditions.sections[document][id] ? `1_${id}` : `0_${id}`;
|
|
42
42
|
return document + key;
|
|
43
43
|
});
|
|
44
44
|
export const selectDocumentConditionValue = createSelector((state, name) => {
|
|
45
|
-
if (typeof state.conditions.documents[name] ===
|
|
45
|
+
if (typeof state.conditions.documents[name] === "undefined")
|
|
46
46
|
return undefined;
|
|
47
47
|
return state.conditions.documents[name];
|
|
48
48
|
}, (state, name) => {
|
|
49
|
-
if (typeof state.conditions.documents[name] ===
|
|
49
|
+
if (typeof state.conditions.documents[name] === "undefined")
|
|
50
50
|
return Math.random().toString();
|
|
51
|
-
return state.conditions.documents[name] ?
|
|
51
|
+
return state.conditions.documents[name] ? "true" : "false";
|
|
52
52
|
});
|
|
53
53
|
const prefillerConditionValueSelector = createSelector((state, id, index) => {
|
|
54
54
|
if (state.conditions.prefillers === undefined)
|
|
55
55
|
return undefined;
|
|
56
56
|
if (state.conditions.prefillers[id] === undefined)
|
|
57
57
|
return undefined;
|
|
58
|
-
return typeof index ===
|
|
58
|
+
return typeof index === "number"
|
|
59
59
|
? state.conditions.prefillers[id][index]
|
|
60
60
|
: state.conditions.prefillers[id];
|
|
61
61
|
}, (state, id, index) => {
|
|
62
|
-
const prefillers = state.conditions.prefillers[id].map((v) => v.reduce((p, c) => p + (c ?
|
|
63
|
-
return `${prefillers.reduce((p, c) => p + c,
|
|
62
|
+
const prefillers = state.conditions.prefillers[id].map((v) => v.reduce((p, c) => p + (c ? "1" : "0"), ""));
|
|
63
|
+
return `${prefillers.reduce((p, c) => p + c, "")}_${id}_${index}`;
|
|
64
64
|
});
|
|
65
65
|
export function selectPrefillerConditionValue(id, index) {
|
|
66
|
-
if (typeof index ===
|
|
66
|
+
if (typeof index === "number")
|
|
67
67
|
return prefillerConditionValueSelector(id, index);
|
|
68
68
|
return prefillerConditionValueSelector(id);
|
|
69
69
|
}
|
|
70
70
|
const optionValidatorConditionValueSelector = createSelector((state, id, index) => {
|
|
71
|
-
if (typeof state.conditions.validators.options[id] ===
|
|
71
|
+
if (typeof state.conditions.validators.options[id] === "undefined")
|
|
72
72
|
return undefined;
|
|
73
|
-
if (typeof index ===
|
|
74
|
-
typeof state.conditions.validators.options[id][index] ===
|
|
73
|
+
if (typeof index === "number" &&
|
|
74
|
+
typeof state.conditions.validators.options[id][index] === "undefined")
|
|
75
75
|
return undefined;
|
|
76
|
-
return typeof index ===
|
|
76
|
+
return typeof index === "number"
|
|
77
77
|
? state.conditions.validators.options[id][index]
|
|
78
78
|
: state.conditions.validators.options[id];
|
|
79
79
|
}, (state, id, index) => {
|
|
80
|
-
if (typeof state.conditions.validators.options[id] ===
|
|
80
|
+
if (typeof state.conditions.validators.options[id] === "undefined")
|
|
81
81
|
return Math.random();
|
|
82
|
-
return `${state.conditions.validators.options[id].reduce((p, c) => p + (c ?
|
|
82
|
+
return `${state.conditions.validators.options[id].reduce((p, c) => p + (c ? "1" : "0"), "")}-${id.toString()}${index ? index.toString() : ""}`;
|
|
83
83
|
});
|
|
84
84
|
export function selectOptionValidatorConditionValue(id, index) {
|
|
85
|
-
if (typeof index ===
|
|
85
|
+
if (typeof index === "number")
|
|
86
86
|
return optionValidatorConditionValueSelector(id, index);
|
|
87
87
|
return optionValidatorConditionValueSelector(id);
|
|
88
88
|
}
|
|
89
89
|
const variableValidatorConditionValueSelector = createSelector((state, id, index) => {
|
|
90
|
-
if (typeof state.conditions.validators.variables[id] ===
|
|
90
|
+
if (typeof state.conditions.validators.variables[id] === "undefined")
|
|
91
91
|
return undefined;
|
|
92
|
-
return typeof index ===
|
|
92
|
+
return typeof index === "number"
|
|
93
93
|
? state.conditions.validators.variables[id][index]
|
|
94
94
|
: state.conditions.validators.variables[id];
|
|
95
95
|
}, (state, id, index) => {
|
|
96
|
-
if (typeof state.conditions.validators.variables[id] ===
|
|
96
|
+
if (typeof state.conditions.validators.variables[id] === "undefined")
|
|
97
97
|
return Math.random();
|
|
98
|
-
return `${state.conditions.validators.variables[id].reduce((p, c) => p + (c ?
|
|
98
|
+
return `${state.conditions.validators.variables[id].reduce((p, c) => p + (c ? "1" : "0"), "")}-${id.toString()}${index ? index.toString() : ""}`;
|
|
99
99
|
});
|
|
100
100
|
export function selectVariableValidatorConditionValue(id, index) {
|
|
101
|
-
if (typeof index ===
|
|
101
|
+
if (typeof index === "number")
|
|
102
102
|
return variableValidatorConditionValueSelector(id, index);
|
|
103
103
|
return variableValidatorConditionValueSelector(id);
|
|
104
104
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StateType } from
|
|
1
|
+
import { StateType } from "../../types/State.type";
|
|
2
2
|
export declare type selectInputsType = () => StateType.Inputs;
|
|
3
3
|
export declare const selectInputs: selectInputsType;
|
|
4
4
|
export declare const selectOptionInput: (id: number) => readonly boolean[];
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { createSelector } from
|
|
1
|
+
import { createSelector } from "./selectors";
|
|
2
2
|
export const selectInputs = createSelector((state) => state.inputs, () => Math.random());
|
|
3
|
-
export const selectOptionInput = createSelector((state, id) => state.inputs.options[id], (state, id) => `${state.inputs.options[id].reduce((p, c) => p + (c ?
|
|
3
|
+
export const selectOptionInput = createSelector((state, id) => state.inputs.options[id], (state, id) => `${state.inputs.options[id].reduce((p, c) => p + (c ? "1" : "0"), "")}_${id.toString()}`);
|
|
4
4
|
export const selectOptionInputByIndex = createSelector((state, id, index) => {
|
|
5
5
|
if (state.inputs.options[id] === undefined)
|
|
6
6
|
return undefined;
|
|
7
7
|
return state.inputs.options[id][index];
|
|
8
8
|
}, (state, id, index) => state.inputs.options[id] !== undefined
|
|
9
|
-
? `${state.inputs.options[id].reduce((p, c) => p + (c ?
|
|
9
|
+
? `${state.inputs.options[id].reduce((p, c) => p + (c ? "1" : "0"), "")}_${id.toString()}_${index}`
|
|
10
10
|
: Math.random());
|
|
11
11
|
export const selectVariableInput = createSelector((state, id) => {
|
|
12
|
-
if (typeof state.inputs.variables[id] ===
|
|
13
|
-
return [
|
|
12
|
+
if (typeof state.inputs.variables[id] === "undefined")
|
|
13
|
+
return [""];
|
|
14
14
|
return state.inputs.variables[id];
|
|
15
15
|
}, (state, id) => {
|
|
16
|
-
if (typeof state.inputs.variables[id] ===
|
|
16
|
+
if (typeof state.inputs.variables[id] === "undefined")
|
|
17
17
|
return Math.random();
|
|
18
|
-
return `${state.inputs.variables[id].reduce((p, c) => `${p}-${c}`,
|
|
18
|
+
return `${state.inputs.variables[id].reduce((p, c) => `${p}-${c}`, "")}_${id.toString()}`;
|
|
19
19
|
});
|
|
20
|
-
export const selectVariableInputByIndex = createSelector((state, id, index) => state.inputs.variables[id][index], (state, id, index) => `${state.inputs.variables[id].reduce((p, c) => `${p}-${c}`,
|
|
20
|
+
export const selectVariableInputByIndex = createSelector((state, id, index) => state.inputs.variables[id][index], (state, id, index) => `${state.inputs.variables[id].reduce((p, c) => `${p}-${c}`, "")}_${id.toString()}_${index}`);
|
package/dist/{componentsConnectors/connector/connectorSelectors.d.ts → redux/selectors/library.d.ts}
RENAMED
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
declare const
|
|
3
|
-
selectIsSmartscriptOptionIndexHidden: (id: number, index: number) => Readonly<boolean>;
|
|
4
|
-
selectIsSmartscriptVariableIndexHidden: (id: number, index: number) => Readonly<boolean>;
|
|
5
|
-
selectMandatoryIgnore: () => Readonly<boolean>;
|
|
6
|
-
selectMandatorySection: (id: number) => Readonly<boolean>;
|
|
7
|
-
selectFirstUnfinishedSectionId: (id: number) => number;
|
|
8
|
-
selectMandatoryOptionItem: (id: number) => readonly boolean[];
|
|
9
|
-
selectMandatoryOption: (id: number) => readonly boolean[];
|
|
10
|
-
selectMandatoryOptionByIndex: (id: number, index: number) => Readonly<boolean>;
|
|
11
|
-
selectMandatoryVariable: (id: number) => readonly boolean[];
|
|
12
|
-
selectMandatoryVariableByIndex: (id: number, index: number) => Readonly<boolean>;
|
|
1
|
+
import * as inputs from "./inputs";
|
|
2
|
+
export declare const selectorsLibrary: {
|
|
13
3
|
selectCurrentUserLevel: () => Readonly<"ADMIN" | "MANAGER" | "USER" | "GUEST" | "SUPER" | undefined>;
|
|
14
4
|
selectUserStatus: () => Readonly<"failed" | "authenticated" | "unauthenticated" | "inprogress">;
|
|
15
5
|
selectUserValidToken: () => Readonly<boolean>;
|
|
16
6
|
selectUserEmail: () => string;
|
|
17
7
|
isLevelAccessibleForUser: (level: "ADMIN" | "MANAGER" | "USER" | "GUEST" | "SUPER") => Readonly<boolean>;
|
|
8
|
+
selectIsSmartscriptOptionIndexHidden: (id: number, index: number) => Readonly<boolean>;
|
|
9
|
+
selectIsSmartscriptVariableIndexHidden: (id: number, index: number) => Readonly<boolean>;
|
|
18
10
|
selectOutputReference: (id: number) => Readonly<import("@legalplace/referencesparser/dist/libs/References.type").ReferencesSingleOutputType | undefined>;
|
|
19
11
|
selectBoxReference: (id: number) => Readonly<import("@legalplace/referencesparser/dist/libs/References.type").ReferencesSingleBoxType>;
|
|
20
12
|
isOptionMultiple: (id: number) => Readonly<boolean | undefined>;
|
|
@@ -44,7 +36,15 @@ declare const connectorSelectors: {
|
|
|
44
36
|
selectOptionParentSection: (id: number) => number;
|
|
45
37
|
selectVariableParentSection: (id: number) => number;
|
|
46
38
|
selectUserEmailSectionVariableIds: (sectionId: number) => readonly string[];
|
|
47
|
-
|
|
39
|
+
selectMandatoryIgnore: () => Readonly<boolean>;
|
|
40
|
+
selectMandatorySection: (id: number) => Readonly<boolean>;
|
|
41
|
+
selectFirstUnfinishedSectionId: (id: number) => number;
|
|
42
|
+
selectMandatoryOptionItem: (id: number) => readonly boolean[];
|
|
43
|
+
selectMandatoryOption: (id: number) => readonly boolean[];
|
|
44
|
+
selectMandatoryOptionByIndex: (id: number, index: number) => Readonly<boolean>;
|
|
45
|
+
selectMandatoryVariable: (id: number) => readonly boolean[];
|
|
46
|
+
selectMandatoryVariableByIndex: (id: number, index: number) => Readonly<boolean>;
|
|
47
|
+
selectInputs: inputs.selectInputsType;
|
|
48
48
|
selectOptionInput: (id: number) => readonly boolean[];
|
|
49
49
|
selectOptionInputByIndex: (id: number, index: number) => Readonly<boolean | undefined>;
|
|
50
50
|
selectVariableInput: (id: number) => readonly (string | number)[];
|
|
@@ -80,7 +80,7 @@ declare const connectorSelectors: {
|
|
|
80
80
|
selectDocumentId: () => number;
|
|
81
81
|
selectDocumentModelVersion: () => number;
|
|
82
82
|
selectDocumentProductType: () => string;
|
|
83
|
-
selectMeta: () => Readonly<import("
|
|
83
|
+
selectMeta: () => Readonly<import("../../types/State.type").AppMetaType>;
|
|
84
84
|
selectMetaFetchStatus: () => Readonly<"failed" | "waiting" | "succeeded" | "unhealthy" | "userLocked" | "nonBlocking">;
|
|
85
85
|
selectPrefix: () => Readonly<string | undefined>;
|
|
86
86
|
selectInstanceUniqid: () => Readonly<string | undefined>;
|
|
@@ -90,8 +90,8 @@ declare const connectorSelectors: {
|
|
|
90
90
|
selectInstanceIsPaid: () => Readonly<boolean>;
|
|
91
91
|
selectInstanceSteps: () => Readonly<boolean>;
|
|
92
92
|
isStepAvailable: (steps: number[] | "*" | undefined) => Readonly<boolean>;
|
|
93
|
-
selectCustomizationMeta: () => Readonly<import("
|
|
93
|
+
selectCustomizationMeta: () => Readonly<import("../../types/State.type").AppCustomizationMetaType | undefined>;
|
|
94
94
|
selectCustomizationAutoDefaultType: () => Readonly<boolean | undefined>;
|
|
95
95
|
selectModelUuid: () => Readonly<string | undefined>;
|
|
96
|
+
CompletelyUnusedSelector: () => Readonly<string | undefined>;
|
|
96
97
|
};
|
|
97
|
-
export default connectorSelectors;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as app from "./app";
|
|
2
|
+
import * as conditions from "./conditions";
|
|
3
|
+
import * as inputs from "./inputs";
|
|
4
|
+
import * as mandatories from "./mandatories";
|
|
5
|
+
import * as references from "./references";
|
|
6
|
+
import * as smartscript from "./smartscript";
|
|
7
|
+
import * as user from "./user";
|
|
8
|
+
export const selectorsLibrary = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, app), conditions), inputs), mandatories), references), smartscript), user);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createSelector } from
|
|
2
|
-
export const selectMandatoryIgnore = createSelector((state) => state.mandatories.ignore, (state) => (state.mandatories.ignore ?
|
|
3
|
-
export const selectMandatorySection = createSelector((state, id) => state.mandatories.sections[id] === true, (state, id) => `${id}:${state.mandatories.sections[id] ?
|
|
1
|
+
import { createSelector } from "./selectors";
|
|
2
|
+
export const selectMandatoryIgnore = createSelector((state) => state.mandatories.ignore, (state) => (state.mandatories.ignore ? "1" : "0"));
|
|
3
|
+
export const selectMandatorySection = createSelector((state, id) => state.mandatories.sections[id] === true, (state, id) => `${id}:${state.mandatories.sections[id] ? "1" : "0"}`);
|
|
4
4
|
export const selectFirstUnfinishedSectionId = createSelector((state, id) => {
|
|
5
5
|
const sectionIds = Object.keys(state.mandatories.sections);
|
|
6
6
|
if (!sectionIds || !sectionIds.length)
|
|
@@ -9,18 +9,18 @@ export const selectFirstUnfinishedSectionId = createSelector((state, id) => {
|
|
|
9
9
|
const firstUnfinishedSectionId = extractedSectionIds.find((sectionId) => state.mandatories.sections[sectionId] === false) || `${id}`;
|
|
10
10
|
return parseInt(firstUnfinishedSectionId, 10);
|
|
11
11
|
});
|
|
12
|
-
export const selectMandatoryOptionItem = createSelector((state, id) => state.mandatories.options[id], (state, id) => (state.mandatories.options[id] ?
|
|
12
|
+
export const selectMandatoryOptionItem = createSelector((state, id) => state.mandatories.options[id], (state, id) => (state.mandatories.options[id] ? "1" : "0"));
|
|
13
13
|
export const selectMandatoryOption = createSelector((state, id) => state.mandatories.options[id].map((c) => c && true), (state, id) => `${id}:${state.mandatories.options[id]
|
|
14
|
-
.map((c) => (c ?
|
|
15
|
-
.join(
|
|
14
|
+
.map((c) => (c ? "1" : "0"))
|
|
15
|
+
.join("-")}`);
|
|
16
16
|
export const selectMandatoryOptionByIndex = createSelector((state, id, index) => { var _a; return ((_a = state.mandatories.options[id]) === null || _a === void 0 ? void 0 : _a[index]) === true; }, (state, id, index) => {
|
|
17
17
|
var _a;
|
|
18
|
-
return `${id}-${index}:${((_a = state.mandatories.options[id]) === null || _a === void 0 ? void 0 : _a[index]) === true ?
|
|
18
|
+
return `${id}-${index}:${((_a = state.mandatories.options[id]) === null || _a === void 0 ? void 0 : _a[index]) === true ? "1" : "0"}`;
|
|
19
19
|
});
|
|
20
20
|
export const selectMandatoryVariable = createSelector((state, id) => state.mandatories.variables[id].map((c) => c && true), (state, id) => `${id}:${state.mandatories.variables[id]
|
|
21
|
-
.map((c) => (c ?
|
|
22
|
-
.join(
|
|
21
|
+
.map((c) => (c ? "1" : "0"))
|
|
22
|
+
.join("-")}`);
|
|
23
23
|
export const selectMandatoryVariableByIndex = createSelector((state, id, index) => { var _a; return ((_a = state.mandatories.variables[id]) === null || _a === void 0 ? void 0 : _a[index]) === true; }, (state, id, index) => {
|
|
24
24
|
var _a;
|
|
25
|
-
return `${id}-${index}:${((_a = state.mandatories.variables[id]) === null || _a === void 0 ? void 0 : _a[index]) === true ?
|
|
25
|
+
return `${id}-${index}:${((_a = state.mandatories.variables[id]) === null || _a === void 0 ? void 0 : _a[index]) === true ? "1" : "0"}`;
|
|
26
26
|
});
|