@legalplace/wizardx-core 2.3.0 → 2.5.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 +37 -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 +3 -1
- package/dist/redux/actions/inputs.js +6 -1
- package/dist/redux/actions/library.d.ts +74 -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.d.ts +1 -0
- package/dist/redux/constants/inputs.js +7 -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 +33 -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 +79 -131
- package/dist/redux/sagas/fetchModel.test.js +2 -3
- package/dist/redux/sagas/homogeneousRadioInputsSaga.js +5 -5
- package/dist/redux/sagas/initInputs.d.ts +5 -0
- package/dist/redux/sagas/initInputs.js +63 -0
- package/dist/redux/sagas/runner.d.ts +1 -1
- package/dist/redux/sagas/runner.js +7 -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} +17 -16
- package/dist/redux/selectors/library.js +8 -0
- package/dist/redux/selectors/mandatories.js +10 -10
- package/dist/redux/selectors/references.d.ts +1 -0
- package/dist/redux/selectors/references.js +20 -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 +42 -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 +18 -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 +8 -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 +61 -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 +86 -187
- package/src/redux/sagas/homogeneousRadioInputsSaga.ts +6 -6
- package/src/redux/sagas/initInputs.ts +110 -0
- package/src/redux/sagas/runner.ts +8 -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 +25 -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 +63 -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,32 +1,32 @@
|
|
|
1
|
-
import { compose } from
|
|
2
|
-
import { connect } from
|
|
3
|
-
import React from
|
|
4
|
-
import type { SectionV3 } from
|
|
5
|
-
import { StateType } from
|
|
6
|
-
import { TermsheetRow } from
|
|
7
|
-
import { TermsheetPropsType } from
|
|
8
|
-
import { PluginLoader, ReplaceComponent } from
|
|
9
|
-
import { selectAvailableSections } from
|
|
1
|
+
import { compose } from "redux";
|
|
2
|
+
import { connect } from "react-redux";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import type { SectionV3 } from "@legalplace/models-v3-types";
|
|
5
|
+
import { StateType } from "../types/State.type";
|
|
6
|
+
import { TermsheetRow } from "../types/Termsheet.type";
|
|
7
|
+
import { TermsheetPropsType } from "../types/Components.type";
|
|
8
|
+
import { PluginLoader, ReplaceComponent } from "../PluginLoader";
|
|
9
|
+
import { selectAvailableSections } from "../redux/selectors/app";
|
|
10
10
|
import {
|
|
11
11
|
selectSectionReference,
|
|
12
12
|
selectOptionReference,
|
|
13
13
|
selectVariableReference,
|
|
14
|
-
} from
|
|
14
|
+
} from "../redux/selectors/references";
|
|
15
15
|
import {
|
|
16
16
|
selectOptionInput,
|
|
17
17
|
selectVariableInputByIndex,
|
|
18
18
|
selectOptionInputByIndex,
|
|
19
|
-
} from
|
|
19
|
+
} from "../redux/selectors/inputs";
|
|
20
20
|
import {
|
|
21
21
|
selectOptionConditionValue,
|
|
22
22
|
selectSectionConditionValue,
|
|
23
23
|
selectVariableConditionValue,
|
|
24
24
|
selectOptionValidatorConditionValue,
|
|
25
25
|
selectVariableValidatorConditionValue,
|
|
26
|
-
} from
|
|
27
|
-
import { PathReader } from
|
|
28
|
-
import { isLevelAccessibleForUser } from
|
|
29
|
-
import { parseOptionLabel } from
|
|
26
|
+
} from "../redux/selectors/conditions";
|
|
27
|
+
import { PathReader } from "../libs/PathReader";
|
|
28
|
+
import { isLevelAccessibleForUser } from "../redux/selectors/user";
|
|
29
|
+
import { parseOptionLabel } from "../helpers/outputsParsing";
|
|
30
30
|
|
|
31
31
|
const pushMultipleLabelForOption = (
|
|
32
32
|
optionId: number,
|
|
@@ -47,7 +47,7 @@ const pushMultipleLabelForOption = (
|
|
|
47
47
|
const label =
|
|
48
48
|
optionReference.meta?.multiple?.label ||
|
|
49
49
|
optionReference.meta?.multiple?.cta ||
|
|
50
|
-
|
|
50
|
+
""; // TODO: Should we add default string?
|
|
51
51
|
|
|
52
52
|
// Incrementation step
|
|
53
53
|
if (optionReference.meta.multiple?.incrementationStart) {
|
|
@@ -57,10 +57,10 @@ const pushMultipleLabelForOption = (
|
|
|
57
57
|
|
|
58
58
|
termsheet.push({
|
|
59
59
|
label: `${label} ${occurencyId}`,
|
|
60
|
-
type:
|
|
60
|
+
type: "multiplelabel",
|
|
61
61
|
pageNumber,
|
|
62
|
-
hash:
|
|
63
|
-
value:
|
|
62
|
+
hash: "",
|
|
63
|
+
value: "",
|
|
64
64
|
allowUpdate: false,
|
|
65
65
|
});
|
|
66
66
|
};
|
|
@@ -87,7 +87,7 @@ const rolldownTermsheetForVariable = (
|
|
|
87
87
|
|
|
88
88
|
// Getting variable's value
|
|
89
89
|
let value = selectVariableInputByIndex(variableId, index);
|
|
90
|
-
value = value ||
|
|
90
|
+
value = value || "";
|
|
91
91
|
|
|
92
92
|
// Checking variable's condition
|
|
93
93
|
const variableCondition = selectVariableConditionValue(variableId, index);
|
|
@@ -98,24 +98,24 @@ const rolldownTermsheetForVariable = (
|
|
|
98
98
|
|
|
99
99
|
// Making sure variable is accessible for current user
|
|
100
100
|
const { grantLevel } = variableReference;
|
|
101
|
-
if (!isLevelAccessibleForUser(grantLevel ||
|
|
101
|
+
if (!isLevelAccessibleForUser(grantLevel || "GUEST")) return;
|
|
102
102
|
|
|
103
103
|
let { label } = variableReference;
|
|
104
104
|
if (
|
|
105
|
-
typeof variableReference.termsheet?.label ===
|
|
105
|
+
typeof variableReference.termsheet?.label === "string" &&
|
|
106
106
|
variableReference.termsheet?.label.trim().length > 0
|
|
107
107
|
) {
|
|
108
108
|
label = variableReference.termsheet?.label;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
const variableTermsheet: TermsheetRow = {
|
|
112
|
-
type:
|
|
112
|
+
type: "variable",
|
|
113
113
|
label,
|
|
114
114
|
valid: variableValidator !== false,
|
|
115
|
-
value: typeof value ===
|
|
115
|
+
value: typeof value === "number" ? value.toString() : value,
|
|
116
116
|
pageNumber,
|
|
117
117
|
hash: `variable-${variableId}-${index}`,
|
|
118
|
-
allowUpdate: variableReference.type !==
|
|
118
|
+
allowUpdate: variableReference.type !== "eval",
|
|
119
119
|
};
|
|
120
120
|
|
|
121
121
|
if (variableCondition !== false && variableReference.hidden !== false)
|
|
@@ -144,9 +144,9 @@ const rolldownTermsheetForOption = (
|
|
|
144
144
|
const optionValidator = selectOptionValidatorConditionValue(optionId, index);
|
|
145
145
|
|
|
146
146
|
if (
|
|
147
|
-
(optionReference.meta.type !==
|
|
147
|
+
(optionReference.meta.type !== "checkbox" && optionInput === false) ||
|
|
148
148
|
optionCondition === false ||
|
|
149
|
-
[
|
|
149
|
+
["hidden", "repeated", "box", "separator", "brut-text"].includes(
|
|
150
150
|
optionReference.meta.type
|
|
151
151
|
)
|
|
152
152
|
) {
|
|
@@ -161,7 +161,7 @@ const rolldownTermsheetForOption = (
|
|
|
161
161
|
if (childReference === undefined)
|
|
162
162
|
throw new Error(`Option ${childId} does not exist`);
|
|
163
163
|
|
|
164
|
-
return childReference.meta.type ===
|
|
164
|
+
return childReference.meta.type === "radio";
|
|
165
165
|
});
|
|
166
166
|
const selectedChild = radioChilds.filter((childId) =>
|
|
167
167
|
selectOptionInputByIndex(childId, index)
|
|
@@ -174,21 +174,21 @@ const rolldownTermsheetForOption = (
|
|
|
174
174
|
const label = parseOptionLabel(childId, index);
|
|
175
175
|
return label;
|
|
176
176
|
})
|
|
177
|
-
.join(
|
|
177
|
+
.join("");
|
|
178
178
|
|
|
179
179
|
// Checkbox
|
|
180
|
-
if (optionReference.meta.type ===
|
|
181
|
-
value = optionInput === true ?
|
|
180
|
+
if (optionReference.meta.type === "checkbox") {
|
|
181
|
+
value = optionInput === true ? "Oui" : "Non";
|
|
182
182
|
} else if (
|
|
183
|
-
optionReference.meta.type ===
|
|
183
|
+
optionReference.meta.type === "static" &&
|
|
184
184
|
radioChilds.length === 0
|
|
185
185
|
) {
|
|
186
|
-
value =
|
|
186
|
+
value = "null-value";
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
let { label } = optionReference.meta;
|
|
190
190
|
if (
|
|
191
|
-
typeof optionReference.meta.termsheet?.label ===
|
|
191
|
+
typeof optionReference.meta.termsheet?.label === "string" &&
|
|
192
192
|
optionReference.meta.termsheet?.label.trim().length > 0
|
|
193
193
|
) {
|
|
194
194
|
label = optionReference.meta.termsheet?.label;
|
|
@@ -205,7 +205,7 @@ const rolldownTermsheetForOption = (
|
|
|
205
205
|
valid: optionValidator !== false,
|
|
206
206
|
label,
|
|
207
207
|
value,
|
|
208
|
-
type:
|
|
208
|
+
type: "option",
|
|
209
209
|
allowUpdate: true,
|
|
210
210
|
});
|
|
211
211
|
}
|
|
@@ -243,10 +243,10 @@ const rolldownTermsheetForSection = (
|
|
|
243
243
|
const sectionTermsheetRow: TermsheetRow = {
|
|
244
244
|
label: section.label,
|
|
245
245
|
preLabel: pageNumber < 10 ? `0${pageNumber}` : pageNumber.toString(),
|
|
246
|
-
type:
|
|
246
|
+
type: "section",
|
|
247
247
|
pageNumber,
|
|
248
|
-
hash:
|
|
249
|
-
value:
|
|
248
|
+
hash: "",
|
|
249
|
+
value: "",
|
|
250
250
|
allowUpdate: false,
|
|
251
251
|
};
|
|
252
252
|
|
|
@@ -263,7 +263,7 @@ const rolldownTermsheetForSection = (
|
|
|
263
263
|
throw new Error(`Option ${optionId} does not exist`);
|
|
264
264
|
|
|
265
265
|
const { grantLevel } = optionReference.meta;
|
|
266
|
-
if (!isLevelAccessibleForUser(grantLevel ||
|
|
266
|
+
if (!isLevelAccessibleForUser(grantLevel || "GUEST")) return;
|
|
267
267
|
|
|
268
268
|
// Adding multiples termsheet pointer
|
|
269
269
|
inputs.forEach((value, index) => {
|
|
@@ -279,11 +279,11 @@ const rolldownTermsheetForSection = (
|
|
|
279
279
|
// Adding an empty multiple label to act as a separator
|
|
280
280
|
if (inputs.length > 1 && optionReference.meta.termsheet?.hide !== true) {
|
|
281
281
|
termsheet.push({
|
|
282
|
-
label:
|
|
283
|
-
type:
|
|
282
|
+
label: "",
|
|
283
|
+
type: "multiplelabel",
|
|
284
284
|
pageNumber,
|
|
285
|
-
hash:
|
|
286
|
-
value:
|
|
285
|
+
hash: "",
|
|
286
|
+
value: "",
|
|
287
287
|
allowUpdate: false,
|
|
288
288
|
});
|
|
289
289
|
}
|
|
@@ -305,13 +305,13 @@ const TermsheetHooc =
|
|
|
305
305
|
// eslint-disable-next-line react/display-name
|
|
306
306
|
(props) => {
|
|
307
307
|
// Before tags anchor
|
|
308
|
-
const beforeAnchors = [
|
|
308
|
+
const beforeAnchors = ["beforeTermsheet"];
|
|
309
309
|
|
|
310
310
|
// After tags anchor
|
|
311
|
-
const afterAnchors = [
|
|
311
|
+
const afterAnchors = ["afterTermsheet"];
|
|
312
312
|
|
|
313
313
|
// Component replace
|
|
314
|
-
const replaceAnchors = [
|
|
314
|
+
const replaceAnchors = ["Termsheet"];
|
|
315
315
|
const FinalComponent = ReplaceComponent(replaceAnchors, Component);
|
|
316
316
|
|
|
317
317
|
return (
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { VariableV3 } from
|
|
1
|
+
import type { VariableV3 } from "@legalplace/models-v3-types";
|
|
2
2
|
import {
|
|
3
3
|
componentConnector,
|
|
4
4
|
ConnectorStateToProps,
|
|
5
5
|
ConnectorDispatchProps,
|
|
6
6
|
ConnectorMapSelectors,
|
|
7
|
-
} from
|
|
8
|
-
import { isStepAvailable } from
|
|
7
|
+
} from "./connector/componentConnector";
|
|
8
|
+
import { isStepAvailable } from "../redux/selectors/app";
|
|
9
9
|
import {
|
|
10
10
|
parseRawWithVariables,
|
|
11
11
|
parseVariableLabel,
|
|
12
|
-
} from
|
|
12
|
+
} from "../helpers/outputsParsing";
|
|
13
13
|
|
|
14
14
|
export type ConnectVariableOwnProps = {
|
|
15
15
|
id: number;
|
|
@@ -64,7 +64,7 @@ const canVariableDisplay = (
|
|
|
64
64
|
display && !selectors.selectIsSmartscriptVariableIndexHidden(id, index);
|
|
65
65
|
|
|
66
66
|
// Grant
|
|
67
|
-
display = display && isLevelAccessibleForUser(variable.grantLevel ||
|
|
67
|
+
display = display && isLevelAccessibleForUser(variable.grantLevel || "GUEST");
|
|
68
68
|
|
|
69
69
|
// Returning result
|
|
70
70
|
return display;
|
|
@@ -103,7 +103,7 @@ const stateToProps: ConnectorStateToProps<
|
|
|
103
103
|
const display = canVariableDisplay(id, index, selectors);
|
|
104
104
|
|
|
105
105
|
// Getting variable's value
|
|
106
|
-
const value = selectVariableInputByIndex(id, index) ||
|
|
106
|
+
const value = selectVariableInputByIndex(id, index) || "";
|
|
107
107
|
|
|
108
108
|
// Getting condition
|
|
109
109
|
const condition = selectVariableConditionValue(id, index);
|
|
@@ -122,18 +122,18 @@ const stateToProps: ConnectorStateToProps<
|
|
|
122
122
|
|
|
123
123
|
// Injecting variables into validator message
|
|
124
124
|
const validatorMessage =
|
|
125
|
-
typeof variable.validator?.message ===
|
|
125
|
+
typeof variable.validator?.message === "string"
|
|
126
126
|
? parseRawWithVariables(variable.validator.message)
|
|
127
|
-
:
|
|
127
|
+
: "";
|
|
128
128
|
|
|
129
129
|
// Parsing helper's variables
|
|
130
130
|
const helper = variable.helper
|
|
131
|
-
? parseRawWithVariables(variable.helper, undefined,
|
|
131
|
+
? parseRawWithVariables(variable.helper, undefined, "________________")
|
|
132
132
|
: undefined;
|
|
133
133
|
|
|
134
134
|
// Parsing warning's variables
|
|
135
135
|
const warning = variable.warning
|
|
136
|
-
? parseRawWithVariables(variable.warning, undefined,
|
|
136
|
+
? parseRawWithVariables(variable.warning, undefined, "________________")
|
|
137
137
|
: undefined;
|
|
138
138
|
|
|
139
139
|
return {
|
|
@@ -175,7 +175,7 @@ const dispatchToProps: ConnectorDispatchProps<
|
|
|
175
175
|
* Creating our component connector
|
|
176
176
|
*/
|
|
177
177
|
export const connectVariable = componentConnector({
|
|
178
|
-
componentName:
|
|
178
|
+
componentName: "Variable",
|
|
179
179
|
stateToProps,
|
|
180
180
|
dispatchToProps,
|
|
181
181
|
additionnalHooks: (props, hookType) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
componentConnector,
|
|
3
3
|
ConnectorDispatchProps,
|
|
4
|
-
} from
|
|
4
|
+
} from "./connector/componentConnector";
|
|
5
5
|
|
|
6
6
|
export type ConnectWizardWrapperDispatchProps = {
|
|
7
7
|
openPreview: () => void;
|
|
@@ -20,11 +20,11 @@ const dispatchToProps: ConnectorDispatchProps<
|
|
|
20
20
|
ConnectWizardWrapperOwnProps,
|
|
21
21
|
ConnectWizardWrapperDispatchProps
|
|
22
22
|
> = () => (dispatch) => ({
|
|
23
|
-
openPreview: () => dispatch({ type:
|
|
24
|
-
closePreview: () => dispatch({ type:
|
|
23
|
+
openPreview: () => dispatch({ type: "OPEN_PREVIEW" }),
|
|
24
|
+
closePreview: () => dispatch({ type: "CLOSE_PREVIEW" }),
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
export const connectWizardWrapper = componentConnector({
|
|
28
|
-
componentName:
|
|
28
|
+
componentName: "WizardWrapper",
|
|
29
29
|
dispatchToProps,
|
|
30
30
|
});
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { Dispatch, Store } from
|
|
2
|
-
import { connect } from
|
|
3
|
-
import React, { ComponentType } from
|
|
4
|
-
import { PluginLoader, ReplaceComponent } from
|
|
5
|
-
import { StateType } from
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { Dispatch, Store } from "redux";
|
|
2
|
+
import { connect } from "react-redux";
|
|
3
|
+
import React, { ComponentType } from "react";
|
|
4
|
+
import { PluginLoader, ReplaceComponent } from "../../PluginLoader";
|
|
5
|
+
import type { StateType } from "../../types/State.type";
|
|
6
|
+
import type { SelectorsLibraryType } from "../../types/getSelectors.type";
|
|
7
|
+
import type { ActionsLibraryType } from "../../types/getActions.type";
|
|
8
|
+
import { selectorsLibrary } from "../../redux/selectors/library";
|
|
9
|
+
import { actionsLibrary } from "../../redux/actions/library";
|
|
8
10
|
|
|
9
11
|
// Connector exportable types
|
|
10
12
|
export type AdditionnalHooksFunction<P> = (
|
|
@@ -16,8 +18,8 @@ export type ConnectorDispatchProps<
|
|
|
16
18
|
DispatchProps,
|
|
17
19
|
OwnPropsWithStore = OwnProps & { store?: Store }
|
|
18
20
|
> = (
|
|
19
|
-
actions: Readonly<
|
|
20
|
-
selectors: Readonly<
|
|
21
|
+
actions: Readonly<ActionsLibraryType>,
|
|
22
|
+
selectors: Readonly<SelectorsLibraryType>
|
|
21
23
|
) => (dispatch: Dispatch, ownProps: OwnPropsWithStore) => DispatchProps;
|
|
22
24
|
export type ConnectorStateToProps<
|
|
23
25
|
OwnProps,
|
|
@@ -25,14 +27,14 @@ export type ConnectorStateToProps<
|
|
|
25
27
|
OwnPropsWithStore = OwnProps & { store?: Store }
|
|
26
28
|
> =
|
|
27
29
|
| ((
|
|
28
|
-
selectors: Readonly<
|
|
30
|
+
selectors: Readonly<SelectorsLibraryType>
|
|
29
31
|
) => (state: StateType, ownProps: OwnPropsWithStore) => MapProps)
|
|
30
32
|
| undefined;
|
|
31
33
|
export type ConnectorAdditionnalHooks<InjectedProps> = (
|
|
32
34
|
props: InjectedProps,
|
|
33
35
|
hookType: string
|
|
34
36
|
) => string[];
|
|
35
|
-
export type ConnectorMapSelectors =
|
|
37
|
+
export type ConnectorMapSelectors = SelectorsLibraryType;
|
|
36
38
|
|
|
37
39
|
// Connector self types
|
|
38
40
|
type ConnectorHoocFunction = <P = {}>(
|
|
@@ -71,10 +73,10 @@ const AnchorsHooks: AnchorsHooksFunction = (
|
|
|
71
73
|
let replaceAnchors = [`${componentName}`];
|
|
72
74
|
|
|
73
75
|
// Adding additionnal hooks
|
|
74
|
-
if (typeof additionnalHooks ===
|
|
75
|
-
beforeAnchors = [...beforeAnchors, ...additionnalHooks(props,
|
|
76
|
-
afterAnchors = [...afterAnchors, ...additionnalHooks(props,
|
|
77
|
-
replaceAnchors = [...replaceAnchors, ...additionnalHooks(props,
|
|
76
|
+
if (typeof additionnalHooks === "function") {
|
|
77
|
+
beforeAnchors = [...beforeAnchors, ...additionnalHooks(props, "before")];
|
|
78
|
+
afterAnchors = [...afterAnchors, ...additionnalHooks(props, "after")];
|
|
79
|
+
replaceAnchors = [...replaceAnchors, ...additionnalHooks(props, "replace")];
|
|
78
80
|
}
|
|
79
81
|
|
|
80
82
|
return {
|
|
@@ -93,9 +95,9 @@ const AnchorsHooks: AnchorsHooksFunction = (
|
|
|
93
95
|
const PluginWrapper: PluginWrapperFunction = (props, anchors) => {
|
|
94
96
|
const WrappedPlugin = () => <PluginLoader anchor={anchors} props={props} />;
|
|
95
97
|
WrappedPlugin.displayName = `Plugin(${anchors
|
|
96
|
-
.join(
|
|
97
|
-
.replace(/\(/g,
|
|
98
|
-
.replace(/\)/g,
|
|
98
|
+
.join(", ")
|
|
99
|
+
.replace(/\(/g, "[")
|
|
100
|
+
.replace(/\)/g, "]")})`.trim();
|
|
99
101
|
return WrappedPlugin;
|
|
100
102
|
};
|
|
101
103
|
|
|
@@ -164,12 +166,12 @@ function ConnectorConnect<
|
|
|
164
166
|
|
|
165
167
|
// Executing first function layer with selectors for stateToProps if it's defined
|
|
166
168
|
const mapStateToProps = stateToProps
|
|
167
|
-
? stateToProps(
|
|
169
|
+
? stateToProps(selectorsLibrary)
|
|
168
170
|
: undefined;
|
|
169
171
|
|
|
170
172
|
// Executing first function layer with actions for dispatchToProps if it's defined
|
|
171
173
|
const mapDispatchToProps = dispatchToProps
|
|
172
|
-
? dispatchToProps(
|
|
174
|
+
? dispatchToProps(actionsLibrary, selectorsLibrary)
|
|
173
175
|
: undefined;
|
|
174
176
|
|
|
175
177
|
return connect(mapStateToProps, mapDispatchToProps);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { connectBox } from "./connectBox";
|
|
2
|
+
import { connectDocument } from "./connectDocument";
|
|
3
|
+
import { connectHeader } from "./connectHeader";
|
|
4
|
+
import { connectMetaTitle } from "./connectMetaTitle";
|
|
5
|
+
import { connectOption } from "./connectOption";
|
|
6
|
+
import { connectPagination } from "./connectPagination";
|
|
7
|
+
import { connectPreview } from "./connectPreview";
|
|
8
|
+
import { connectProgress } from "./connectProgress";
|
|
9
|
+
import { connectRootOption } from "./connectRootOption";
|
|
10
|
+
import { connectSection } from "./connectSection";
|
|
11
|
+
import { connectSummary } from "./connectSummary";
|
|
12
|
+
import { connectSummaryItem } from "./connectSummaryItem";
|
|
13
|
+
import { connectTermsheet } from "./connectTermsheet";
|
|
14
|
+
import { connectVariable } from "./connectVariable";
|
|
15
|
+
import { connectWizardWrapper } from "./connectWizardWrapper";
|
|
16
|
+
import { componentConnector } from "./connector/componentConnector";
|
|
17
|
+
|
|
18
|
+
export const connectorsLibrary = {
|
|
19
|
+
connectBox,
|
|
20
|
+
connectDocument,
|
|
21
|
+
connectHeader,
|
|
22
|
+
connectMetaTitle,
|
|
23
|
+
connectOption,
|
|
24
|
+
connectPagination,
|
|
25
|
+
connectPreview,
|
|
26
|
+
connectProgress,
|
|
27
|
+
connectRootOption,
|
|
28
|
+
connectSection,
|
|
29
|
+
connectSummary,
|
|
30
|
+
connectSummaryItem,
|
|
31
|
+
connectTermsheet,
|
|
32
|
+
connectVariable,
|
|
33
|
+
connectWizardWrapper,
|
|
34
|
+
componentConnector,
|
|
35
|
+
};
|
package/src/config.test.ts
CHANGED
package/src/config.ts
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const phoneNumberRegX =
|
|
2
|
+
/^[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4,6}$/im;
|
|
3
|
+
export const phonePatternFR =
|
|
4
|
+
/^(?:(?:\+|00)33|0)\s*[1-9](?:[\s.-]*\d{2}){4}$/gim;
|
|
5
|
+
export const FRENCH_OVERSEAS_NUMBERS_REGEX =
|
|
6
|
+
/\+33(?:6(?:39|9[0123467])|7(?:[0-2]\d))\d{6}/;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { filterXSS } from
|
|
1
|
+
import { filterXSS } from "xss";
|
|
2
2
|
import {
|
|
3
3
|
selectVariableParents,
|
|
4
4
|
selectOptionRelations,
|
|
5
5
|
selectVariableReference,
|
|
6
6
|
selectOptionReference,
|
|
7
7
|
selectVariableRelations,
|
|
8
|
-
} from
|
|
8
|
+
} from "../redux/selectors/references";
|
|
9
9
|
import {
|
|
10
10
|
selectVariableInput,
|
|
11
11
|
selectVariableInputByIndex,
|
|
12
|
-
} from
|
|
13
|
-
import { OVC_TYPE } from
|
|
12
|
+
} from "../redux/selectors/inputs";
|
|
13
|
+
import { OVC_TYPE } from "../libs/InputsInitiator";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Parses number to correct french number format ("," instead of ".")
|
|
17
17
|
*/
|
|
18
18
|
const frenchNumber = (value: string | number) => {
|
|
19
|
-
let result = typeof value ===
|
|
19
|
+
let result = typeof value === "number" ? value.toString() : value;
|
|
20
20
|
if (/^([0-9]+)\.([0-9]+)$/.test(result.trim()))
|
|
21
|
-
result = result.trim().replace(
|
|
21
|
+
result = result.trim().replace(".", ",");
|
|
22
22
|
return result;
|
|
23
23
|
};
|
|
24
24
|
|
|
@@ -55,7 +55,7 @@ export const getRelatedVariablesValues: getRelatedVarsT = (
|
|
|
55
55
|
if (rootVariableParentRelations === undefined)
|
|
56
56
|
throw new Error(`Option ${rootVariableParentId} does not exist`);
|
|
57
57
|
|
|
58
|
-
if (typeof variableParents ===
|
|
58
|
+
if (typeof variableParents === "undefined") return;
|
|
59
59
|
|
|
60
60
|
// Getting rootOption parent
|
|
61
61
|
|
|
@@ -69,17 +69,17 @@ export const getRelatedVariablesValues: getRelatedVarsT = (
|
|
|
69
69
|
|
|
70
70
|
// Making sure all values are strings
|
|
71
71
|
const cleanValues = value.map((currentValue) => {
|
|
72
|
-
if ([
|
|
72
|
+
if (["number", "string"].includes(typeof currentValue))
|
|
73
73
|
return frenchNumber(currentValue);
|
|
74
|
-
return
|
|
74
|
+
return "";
|
|
75
75
|
});
|
|
76
76
|
|
|
77
77
|
// Joining multiple variables if needed
|
|
78
78
|
let currentVariableValue =
|
|
79
|
-
cleanValues.length === 1 ? cleanValues[0] : cleanValues.join(
|
|
79
|
+
cleanValues.length === 1 ? cleanValues[0] : cleanValues.join(", ");
|
|
80
80
|
|
|
81
81
|
// Replacing \n with <br /> tags
|
|
82
|
-
currentVariableValue = currentVariableValue.replace(/\n/g,
|
|
82
|
+
currentVariableValue = currentVariableValue.replace(/\n/g, "<br />");
|
|
83
83
|
|
|
84
84
|
// Setting variable value
|
|
85
85
|
variablesValues[currentVariableId] = currentVariableValue;
|
|
@@ -123,10 +123,10 @@ export const parseContentWithVariables: parseContentT = (
|
|
|
123
123
|
Object.keys(variables).forEach((variableId) => {
|
|
124
124
|
let value: string = variables[variableId].toString();
|
|
125
125
|
if (value.trim().length === 0) {
|
|
126
|
-
value = new Array(16).join(
|
|
126
|
+
value = new Array(16).join("_");
|
|
127
127
|
}
|
|
128
128
|
parsedContent = parsedContent.replace(
|
|
129
|
-
new RegExp(`\\[var:${variableId}\\]`,
|
|
129
|
+
new RegExp(`\\[var:${variableId}\\]`, "gi"),
|
|
130
130
|
filterXSS(value, {
|
|
131
131
|
whiteList: {
|
|
132
132
|
a: [],
|
|
@@ -181,10 +181,10 @@ export const parseOutputWithVariables: parseOutputT = (
|
|
|
181
181
|
Object.keys(variables).forEach((variableId) => {
|
|
182
182
|
let value: string = variables[variableId].toString();
|
|
183
183
|
if (value.trim().length === 0) {
|
|
184
|
-
value = new Array(16).join(
|
|
184
|
+
value = new Array(16).join("_");
|
|
185
185
|
}
|
|
186
186
|
parsedOutput = parsedOutput.replace(
|
|
187
|
-
new RegExp(`\\[var:${variableId}\\]`,
|
|
187
|
+
new RegExp(`\\[var:${variableId}\\]`, "gi"),
|
|
188
188
|
filterXSS(value)
|
|
189
189
|
);
|
|
190
190
|
});
|
|
@@ -196,10 +196,10 @@ export const parseOutputWithVariables: parseOutputT = (
|
|
|
196
196
|
);
|
|
197
197
|
|
|
198
198
|
// Cleaning BLURS
|
|
199
|
-
parsedOutput = parsedOutput.replace(/\[(E|B)_BLUR\]/gi,
|
|
199
|
+
parsedOutput = parsedOutput.replace(/\[(E|B)_BLUR\]/gi, "");
|
|
200
200
|
|
|
201
201
|
// Removing signature tags
|
|
202
|
-
parsedOutput = parsedOutput.replace(/\[signature:([0-9]+)\]/g,
|
|
202
|
+
parsedOutput = parsedOutput.replace(/\[signature:([0-9]+)\]/g, "");
|
|
203
203
|
|
|
204
204
|
// Inserting autonums
|
|
205
205
|
autonums.forEach((currentAn) => {
|
|
@@ -263,7 +263,7 @@ export const parseVariableLabel: parseVariableLabelT = (id, index = 0) => {
|
|
|
263
263
|
if (
|
|
264
264
|
value === undefined ||
|
|
265
265
|
value === null ||
|
|
266
|
-
(typeof value ===
|
|
266
|
+
(typeof value === "string" && value.trim().length === 0)
|
|
267
267
|
) {
|
|
268
268
|
useFallback = true;
|
|
269
269
|
return;
|
|
@@ -271,7 +271,7 @@ export const parseVariableLabel: parseVariableLabelT = (id, index = 0) => {
|
|
|
271
271
|
variablesValues[variableId] = value.toString();
|
|
272
272
|
});
|
|
273
273
|
|
|
274
|
-
if (useFallback === true && typeof fallbackLabel ===
|
|
274
|
+
if (useFallback === true && typeof fallbackLabel === "string")
|
|
275
275
|
return fallbackLabel;
|
|
276
276
|
|
|
277
277
|
// Inserting values
|
|
@@ -279,7 +279,7 @@ export const parseVariableLabel: parseVariableLabelT = (id, index = 0) => {
|
|
|
279
279
|
variablesList.forEach((variableId) => {
|
|
280
280
|
const value: string = variablesValues[variableId];
|
|
281
281
|
parsedLabel = parsedLabel.replace(
|
|
282
|
-
new RegExp(`\\[var:${variableId}\\]`,
|
|
282
|
+
new RegExp(`\\[var:${variableId}\\]`, "gi"),
|
|
283
283
|
filterXSS(value)
|
|
284
284
|
);
|
|
285
285
|
});
|
|
@@ -322,7 +322,7 @@ export const parseOptionLabel: parseOptionLabelT = (id, index = 0) => {
|
|
|
322
322
|
if (
|
|
323
323
|
value === undefined ||
|
|
324
324
|
value === null ||
|
|
325
|
-
(typeof value ===
|
|
325
|
+
(typeof value === "string" && value.trim().length === 0)
|
|
326
326
|
) {
|
|
327
327
|
useFallback = true;
|
|
328
328
|
return;
|
|
@@ -330,7 +330,7 @@ export const parseOptionLabel: parseOptionLabelT = (id, index = 0) => {
|
|
|
330
330
|
variablesValues[variableId] = value.toString();
|
|
331
331
|
});
|
|
332
332
|
|
|
333
|
-
if (useFallback === true && typeof fallbackLabel ===
|
|
333
|
+
if (useFallback === true && typeof fallbackLabel === "string")
|
|
334
334
|
return fallbackLabel;
|
|
335
335
|
|
|
336
336
|
// Inserting values
|
|
@@ -338,7 +338,7 @@ export const parseOptionLabel: parseOptionLabelT = (id, index = 0) => {
|
|
|
338
338
|
variablesList.forEach((variableId) => {
|
|
339
339
|
const value: string = variablesValues[variableId];
|
|
340
340
|
parsedLabel = parsedLabel.replace(
|
|
341
|
-
new RegExp(`\\[var:${variableId}\\]`,
|
|
341
|
+
new RegExp(`\\[var:${variableId}\\]`, "gi"),
|
|
342
342
|
filterXSS(value)
|
|
343
343
|
);
|
|
344
344
|
});
|
|
@@ -390,9 +390,9 @@ export const parseRawWithVariables: parseRawT = (text, inputs, placeholder) => {
|
|
|
390
390
|
if (
|
|
391
391
|
value === undefined ||
|
|
392
392
|
value === null ||
|
|
393
|
-
(typeof value ===
|
|
393
|
+
(typeof value === "string" && value.trim().length === 0)
|
|
394
394
|
) {
|
|
395
|
-
variablesValues[variableId] = placeholder ||
|
|
395
|
+
variablesValues[variableId] = placeholder || "";
|
|
396
396
|
} else {
|
|
397
397
|
variablesValues[variableId] = value.toString();
|
|
398
398
|
}
|
|
@@ -403,7 +403,7 @@ export const parseRawWithVariables: parseRawT = (text, inputs, placeholder) => {
|
|
|
403
403
|
variables.forEach((variableId) => {
|
|
404
404
|
const value: string = variablesValues[variableId];
|
|
405
405
|
parsedText = parsedText.replace(
|
|
406
|
-
new RegExp(`\\[var:${variableId}\\]`,
|
|
406
|
+
new RegExp(`\\[var:${variableId}\\]`, "gi"),
|
|
407
407
|
filterXSS(value)
|
|
408
408
|
);
|
|
409
409
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LoadableComponent } from
|
|
2
|
-
import Globals from
|
|
1
|
+
import { LoadableComponent } from "@loadable/component";
|
|
2
|
+
import Globals from "../Globals";
|
|
3
3
|
|
|
4
4
|
export const preloadTheme = async (theme: string) => {
|
|
5
5
|
// Preloading theme
|