@legalplace/wizardx-core 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/App.d.ts +5 -5
- package/dist/App.js +22 -35
- package/dist/App.test.js +2 -2
- package/dist/Globals.d.ts +4 -0
- package/dist/Globals.js +9 -6
- package/dist/Loader.d.ts +1 -0
- package/dist/Loader.js +2 -0
- package/dist/PluginLoader.d.ts +3 -3
- package/dist/PluginLoader.js +22 -26
- package/dist/PluginLoader.test.js +6 -6
- package/dist/Shimmer.d.ts +1 -1
- package/dist/Shimmer.js +45 -47
- package/dist/ThemeLoader.d.ts +6 -5
- package/dist/ThemeLoader.js +21 -25
- package/dist/ThemeLoader.test.js +4 -3
- package/dist/components/PluginRoute.d.ts +3 -3
- package/dist/components/PluginRoute.js +8 -7
- package/dist/components/SmartScript.d.ts +7 -8
- package/dist/components/SmartScript.js +22 -21
- package/dist/components/UserLocked/UserLockedComponent.d.ts +1 -1
- package/dist/components/UserLocked/UserLockedComponent.js +5 -6
- package/dist/components/View.d.ts +8 -4
- package/dist/components/View.js +46 -55
- package/dist/components/View.test.js +6 -5
- package/dist/componentsConnectors/connectBox.d.ts +2 -3
- package/dist/componentsConnectors/connectBox.js +4 -4
- package/dist/componentsConnectors/connectBox.test.js +7 -7
- package/dist/componentsConnectors/connectDocument.d.ts +0 -1
- package/dist/componentsConnectors/connectDocument.js +6 -6
- package/dist/componentsConnectors/connectDocument.test.js +5 -5
- package/dist/componentsConnectors/connectHeader.d.ts +0 -1
- package/dist/componentsConnectors/connectHeader.js +2 -2
- package/dist/componentsConnectors/connectMetaTitle.d.ts +0 -1
- package/dist/componentsConnectors/connectMetaTitle.js +2 -2
- package/dist/componentsConnectors/connectMetaTitle.test.js +3 -3
- package/dist/componentsConnectors/connectOption.d.ts +2 -3
- package/dist/componentsConnectors/connectOption.js +9 -9
- package/dist/componentsConnectors/connectPagination.d.ts +0 -1
- package/dist/componentsConnectors/connectPagination.js +3 -3
- package/dist/componentsConnectors/connectPreview.d.ts +0 -1
- package/dist/componentsConnectors/connectPreview.js +2 -2
- package/dist/componentsConnectors/connectProgress.d.ts +0 -1
- package/dist/componentsConnectors/connectProgress.js +3 -3
- package/dist/componentsConnectors/connectRootOption.d.ts +2 -3
- package/dist/componentsConnectors/connectRootOption.js +2 -2
- package/dist/componentsConnectors/connectSection.d.ts +0 -1
- package/dist/componentsConnectors/connectSection.js +4 -4
- package/dist/componentsConnectors/connectSummary.d.ts +0 -1
- package/dist/componentsConnectors/connectSummary.js +2 -2
- package/dist/componentsConnectors/connectSummaryItem.d.ts +0 -1
- package/dist/componentsConnectors/connectSummaryItem.js +6 -6
- package/dist/componentsConnectors/connectTermsheet.d.ts +2 -2
- package/dist/componentsConnectors/connectTermsheet.js +43 -46
- package/dist/componentsConnectors/connectVariable.d.ts +1 -2
- package/dist/componentsConnectors/connectVariable.js +10 -10
- package/dist/componentsConnectors/connectWizardWrapper.d.ts +0 -1
- package/dist/componentsConnectors/connectWizardWrapper.js +4 -4
- package/dist/componentsConnectors/connector/componentConnector.d.ts +8 -8
- package/dist/componentsConnectors/connector/componentConnector.js +16 -19
- package/dist/componentsConnectors/library.d.ts +61 -0
- package/dist/componentsConnectors/library.js +34 -0
- package/dist/config.d.ts +1 -1
- package/dist/constants/phoneValidation.d.ts +3 -0
- package/dist/constants/phoneValidation.js +3 -0
- package/dist/helpers/outputsParsing.d.ts +1 -1
- package/dist/helpers/outputsParsing.js +25 -25
- package/dist/helpers/preloadTheme.js +1 -1
- package/dist/helpers/scriptsLoader.d.ts +1 -0
- package/dist/helpers/scriptsLoader.js +24 -0
- package/dist/helpers/sendinblueHelper.d.ts +3 -3
- package/dist/helpers/sendinblueHelper.js +29 -18
- package/dist/hooks/usePrevious.js +1 -1
- package/dist/libs/ConditionsInitiator.d.ts +1 -1
- package/dist/libs/ConditionsInitiator.js +2 -2
- package/dist/libs/ConditionsRunner/DataPopulator.js +7 -7
- package/dist/libs/ConditionsRunner.d.ts +3 -3
- package/dist/libs/ConditionsRunner.js +43 -43
- package/dist/libs/DocumentsOutputs.d.ts +2 -2
- package/dist/libs/DocumentsOutputs.js +5 -5
- package/dist/libs/Eval/EvalBase.js +17 -17
- package/dist/libs/Eval/EvalFunctions.d.ts +1 -1
- package/dist/libs/Eval/EvalFunctions.js +100 -100
- package/dist/libs/Eval/NumbersToLetters.js +46 -46
- package/dist/libs/EvalVariable.d.ts +2 -2
- package/dist/libs/EvalVariable.js +30 -29
- package/dist/libs/EventsTracking.js +32 -32
- package/dist/libs/Extracts.js +20 -20
- package/dist/libs/InputsInitiator.d.ts +1 -1
- package/dist/libs/InputsInitiator.js +15 -15
- package/dist/libs/NumAuto.js +1 -1
- package/dist/libs/OvcConverter.d.ts +1 -1
- package/dist/libs/OvcConverter.js +23 -23
- package/dist/libs/PathReader.d.ts +1 -1
- package/dist/libs/PathReader.js +22 -22
- package/dist/libs/SectionValidity.js +3 -3
- package/dist/libs/SmartScriptStore.d.ts +6 -6
- package/dist/libs/SmartScriptStore.js +33 -33
- package/dist/misc/test_model.d.ts +2 -2
- package/dist/misc/test_model.js +3807 -3807
- package/dist/polyfills/index.d.ts +5 -0
- package/dist/polyfills/index.js +5 -0
- package/dist/polyfills/prepend.js +2 -2
- package/dist/polyfills/stringRepeat.js +4 -4
- package/dist/redux/actions/app.d.ts +12 -12
- package/dist/redux/actions/app.js +1 -1
- package/dist/redux/actions/conditions.d.ts +2 -2
- package/dist/redux/actions/conditions.js +1 -1
- package/dist/redux/actions/inputs.d.ts +1 -1
- package/dist/redux/actions/inputs.js +1 -1
- package/dist/redux/actions/library.d.ts +73 -0
- package/dist/redux/actions/library.js +11 -0
- package/dist/redux/actions/mandatories.d.ts +1 -1
- package/dist/redux/actions/mandatories.js +1 -1
- package/dist/redux/actions/references.d.ts +4 -4
- package/dist/redux/actions/references.js +1 -1
- package/dist/redux/actions/sagas/data.d.ts +1 -1
- package/dist/redux/actions/sagas/data.js +1 -1
- package/dist/redux/actions/sagas/model.d.ts +3 -3
- package/dist/redux/actions/sagas/model.js +3 -3
- package/dist/redux/actions/sagas/user.d.ts +1 -1
- package/dist/redux/actions/sagas/user.js +1 -1
- package/dist/redux/actions/smartscript.d.ts +3 -3
- package/dist/redux/actions/smartscript.js +1 -1
- package/dist/redux/actions/user.d.ts +4 -4
- package/dist/redux/actions/user.js +1 -1
- package/dist/redux/constants/app.js +22 -22
- package/dist/redux/constants/conditions.js +8 -8
- package/dist/redux/constants/inputs.js +6 -6
- package/dist/redux/constants/mandatories.js +6 -6
- package/dist/redux/constants/references.js +3 -3
- package/dist/redux/constants/sagas/data.js +1 -1
- package/dist/redux/constants/sagas/model.js +2 -2
- package/dist/redux/constants/sagas/user.js +2 -2
- package/dist/redux/constants/smartscript.js +4 -4
- package/dist/redux/constants/user.js +3 -3
- package/dist/redux/listeners/subscriber.d.ts +2 -2
- package/dist/redux/middlewares/conditionsWatcherMiddleware.d.ts +2 -2
- package/dist/redux/middlewares/conditionsWatcherMiddleware.js +28 -28
- package/dist/redux/middlewares/evaluationsWatcherMiddleware.d.ts +4 -2
- package/dist/redux/middlewares/evaluationsWatcherMiddleware.js +10 -10
- package/dist/redux/middlewares/mandatoriesWatcherMiddleware.d.ts +2 -2
- package/dist/redux/middlewares/mandatoriesWatcherMiddleware.js +13 -13
- package/dist/redux/middlewares/multiplesActionsMiddleware.d.ts +2 -2
- package/dist/redux/middlewares/multiplesActionsMiddleware.js +2 -2
- package/dist/redux/middlewares/paginationWatcherMiddleware.d.ts +3 -3
- package/dist/redux/middlewares/paginationWatcherMiddleware.js +24 -24
- package/dist/redux/middlewares/pluginsHookMiddleware.d.ts +1 -1
- package/dist/redux/middlewares/pluginsHookMiddleware.js +1 -1
- package/dist/redux/middlewares/prefillerWatcherMiddleware.d.ts +2 -2
- package/dist/redux/middlewares/prefillerWatcherMiddleware.js +28 -28
- package/dist/redux/middlewares/smartscriptMiddleware.d.ts +2 -2
- package/dist/redux/middlewares/smartscriptMiddleware.js +15 -15
- package/dist/redux/middlewares/thirdpartyScriptsMiddleware.d.ts +5 -0
- package/dist/redux/middlewares/thirdpartyScriptsMiddleware.js +16 -0
- package/dist/redux/reducers/app/customizations/initCustomizationAutoDefault.d.ts +2 -2
- package/dist/redux/reducers/app/customizations/initCustomizationMeta.d.ts +2 -2
- package/dist/redux/reducers/app/instance/initInstance.d.ts +2 -2
- package/dist/redux/reducers/app/instance/setDataStatus.d.ts +2 -2
- package/dist/redux/reducers/app/instance/updateInstance.d.ts +2 -2
- package/dist/redux/reducers/app/instance/updateInstancePaid.d.ts +2 -2
- package/dist/redux/reducers/app/meta/fetchModelFailed.d.ts +1 -1
- package/dist/redux/reducers/app/meta/fetchModelFailed.js +1 -1
- package/dist/redux/reducers/app/meta/fetchModelNonBlocking.d.ts +1 -1
- package/dist/redux/reducers/app/meta/fetchModelNonBlocking.js +1 -1
- package/dist/redux/reducers/app/meta/fetchModelSucceeded.d.ts +1 -1
- package/dist/redux/reducers/app/meta/fetchModelSucceeded.js +1 -1
- package/dist/redux/reducers/app/meta/fetchModelUnhealthy.d.ts +2 -2
- package/dist/redux/reducers/app/meta/fetchModelUnhealthy.js +1 -1
- package/dist/redux/reducers/app/meta/fetchModelUserLocked.d.ts +1 -1
- package/dist/redux/reducers/app/meta/fetchModelUserLocked.js +1 -1
- package/dist/redux/reducers/app/meta/initMeta.d.ts +2 -2
- package/dist/redux/reducers/app/meta/setModelUuid.d.ts +2 -2
- package/dist/redux/reducers/app/pagination/goNextPage.d.ts +1 -1
- package/dist/redux/reducers/app/pagination/goNextPage.js +1 -1
- package/dist/redux/reducers/app/pagination/goPage.d.ts +2 -2
- package/dist/redux/reducers/app/pagination/goPage.js +2 -2
- package/dist/redux/reducers/app/pagination/goPreviousPage.d.ts +1 -1
- package/dist/redux/reducers/app/pagination/goPreviousPage.js +1 -1
- package/dist/redux/reducers/app/pagination/initPagination.d.ts +2 -2
- package/dist/redux/reducers/app/pagination/initPagination.js +1 -1
- package/dist/redux/reducers/app/pagination/updateAvailableAppStates.d.ts +2 -2
- package/dist/redux/reducers/app/pagination/updateAvailableAppStates.js +5 -5
- package/dist/redux/reducers/app/wizard/updateAvailableSections.d.ts +2 -2
- package/dist/redux/reducers/app/wizard/updateAvailableSections.js +2 -2
- package/dist/redux/reducers/app.d.ts +2 -2
- package/dist/redux/reducers/app.js +30 -30
- package/dist/redux/reducers/conditions/addMultipleOccurency.d.ts +2 -2
- package/dist/redux/reducers/conditions/addMultipleOccurency.js +3 -3
- package/dist/redux/reducers/conditions/deleteMultipleOccurency.d.ts +2 -2
- package/dist/redux/reducers/conditions/deleteMultipleOccurency.js +2 -2
- package/dist/redux/reducers/conditions/initConditions.d.ts +2 -2
- package/dist/redux/reducers/conditions/updateDocumentConditions.d.ts +2 -2
- package/dist/redux/reducers/conditions/updateOptionConditions.d.ts +2 -2
- package/dist/redux/reducers/conditions/updateOptionValidatorCondition.d.ts +2 -2
- package/dist/redux/reducers/conditions/updatePrefillerConditions.d.ts +2 -2
- package/dist/redux/reducers/conditions/updatePrefillerConditions.js +2 -2
- package/dist/redux/reducers/conditions/updateSectionConditions.d.ts +2 -2
- package/dist/redux/reducers/conditions/updateVariableConditions.d.ts +2 -2
- package/dist/redux/reducers/conditions/updateVariableValidatorCondition.d.ts +2 -2
- package/dist/redux/reducers/conditions.d.ts +2 -2
- package/dist/redux/reducers/conditions.js +13 -13
- package/dist/redux/reducers/inputs/addMultipleOccurency.d.ts +2 -2
- package/dist/redux/reducers/inputs/addMultipleOccurency.js +4 -4
- package/dist/redux/reducers/inputs/deleteMultipleOccurency.d.ts +2 -2
- package/dist/redux/reducers/inputs/deleteMultipleOccurency.js +2 -2
- package/dist/redux/reducers/inputs/initOption.d.ts +2 -2
- package/dist/redux/reducers/inputs/initVariable.d.ts +2 -2
- package/dist/redux/reducers/inputs/updateOptionInput.d.ts +2 -2
- package/dist/redux/reducers/inputs/updateVariableInput.d.ts +2 -2
- package/dist/redux/reducers/inputs.d.ts +2 -2
- package/dist/redux/reducers/inputs.js +8 -8
- package/dist/redux/reducers/mandatories/addMultipleOccurency.d.ts +2 -2
- package/dist/redux/reducers/mandatories/addMultipleOccurency.js +2 -2
- package/dist/redux/reducers/mandatories/deleteMultipleOccurency.d.ts +2 -2
- package/dist/redux/reducers/mandatories/deleteMultipleOccurency.js +2 -2
- package/dist/redux/reducers/mandatories/initMandatoryOption.d.ts +2 -2
- package/dist/redux/reducers/mandatories/initMandatoryVariable.d.ts +2 -2
- package/dist/redux/reducers/mandatories/setMandatoryIgnore.d.ts +2 -2
- package/dist/redux/reducers/mandatories/setMandatoryOption.d.ts +2 -2
- package/dist/redux/reducers/mandatories/setMandatorySection.d.ts +2 -2
- package/dist/redux/reducers/mandatories/setMandatoryVariable.d.ts +2 -2
- package/dist/redux/reducers/mandatories.d.ts +2 -2
- package/dist/redux/reducers/mandatories.js +11 -11
- package/dist/redux/reducers/references/initReferences.d.ts +2 -2
- package/dist/redux/reducers/references/updateOptionMeta.d.ts +2 -2
- package/dist/redux/reducers/references/updateOptionMeta.js +2 -2
- package/dist/redux/reducers/references/updateVariableMeta.d.ts +2 -2
- package/dist/redux/reducers/references/updateVariableMeta.js +2 -2
- package/dist/redux/reducers/references.d.ts +2 -2
- package/dist/redux/reducers/references.js +5 -5
- package/dist/redux/reducers/smartscript/enableSmartScript.d.ts +1 -1
- package/dist/redux/reducers/smartscript/initSmartScriptTriggers.d.ts +2 -2
- package/dist/redux/reducers/smartscript/updateSmartscriptOptionHidden.d.ts +2 -2
- package/dist/redux/reducers/smartscript/updateSmartscriptVariableHidden.d.ts +2 -2
- package/dist/redux/reducers/smartscript.d.ts +2 -2
- package/dist/redux/reducers/smartscript.js +6 -6
- package/dist/redux/reducers/user/initUser.d.ts +2 -2
- package/dist/redux/reducers/user/setUserStatus.d.ts +2 -2
- package/dist/redux/reducers/user/setUserValidToken.d.ts +2 -2
- package/dist/redux/reducers/user.d.ts +2 -2
- package/dist/redux/reducers/user.js +9 -9
- package/dist/redux/routerHistory.d.ts +2 -2
- package/dist/redux/routerHistory.js +5 -5
- package/dist/redux/sagas/fetchModel.d.ts +4 -4
- package/dist/redux/sagas/fetchModel.js +84 -88
- package/dist/redux/sagas/fetchModel.test.js +2 -3
- package/dist/redux/sagas/homogeneousRadioInputsSaga.js +5 -5
- package/dist/redux/sagas/runner.d.ts +1 -1
- package/dist/redux/sagas/runner.js +5 -5
- package/dist/redux/sagas/saveData.js +34 -25
- package/dist/redux/sagas/setDefaults.js +8 -8
- package/dist/redux/sagas/setUserEmail.js +43 -43
- package/dist/redux/selectors/app.d.ts +1 -0
- package/dist/redux/selectors/app.js +26 -25
- package/dist/redux/selectors/conditions.js +34 -34
- package/dist/redux/selectors/inputs.d.ts +1 -1
- package/dist/redux/selectors/inputs.js +8 -8
- package/dist/{componentsConnectors/connector/connectorSelectors.d.ts → redux/selectors/library.d.ts} +16 -16
- package/dist/redux/selectors/library.js +8 -0
- package/dist/redux/selectors/mandatories.js +10 -10
- package/dist/redux/selectors/references.js +19 -19
- package/dist/redux/selectors/selectors.d.ts +2 -2
- package/dist/redux/selectors/selectors.js +2 -2
- package/dist/redux/selectors/smartscript.js +5 -5
- package/dist/redux/selectors/user.js +5 -5
- package/dist/redux/store.d.ts +6 -2
- package/dist/redux/store.js +31 -31
- package/dist/service/api.manager.d.ts +2 -2
- package/dist/service/api.manager.js +46 -46
- package/dist/service/auth.service.js +2 -2
- package/dist/service/pardot.service.js +2 -2
- package/dist/tests-misc/plugins/jestTestPlugin/after.d.ts +1 -1
- package/dist/tests-misc/plugins/jestTestPlugin/after.js +2 -2
- package/dist/tests-misc/plugins/jestTestPlugin/before.d.ts +1 -1
- package/dist/tests-misc/plugins/jestTestPlugin/before.js +2 -5
- package/dist/tests-misc/plugins/jestTestPlugin/index.js +4 -4
- package/dist/tests-misc/plugins/jestTestPlugin/title.d.ts +1 -1
- package/dist/tests-misc/plugins/jestTestPlugin/title.js +2 -2
- package/dist/tests-misc/themes/jestTestTheme/components/EmailComponent.d.ts +0 -1
- package/dist/tests-misc/themes/jestTestTheme/components/EmailComponent.js +2 -2
- package/dist/tests-misc/themes/jestTestTheme/components/TermsheetComponent.d.ts +0 -1
- package/dist/tests-misc/themes/jestTestTheme/components/TermsheetComponent.js +2 -2
- package/dist/tests-misc/themes/jestTestTheme/components/WizardComponent.d.ts +0 -1
- package/dist/tests-misc/themes/jestTestTheme/components/WizardComponent.js +2 -2
- package/dist/tests-misc/themes/jestTestTheme/faltyIndex.js +1 -1
- package/dist/tests-misc/themes/jestTestTheme/faltyIndexLoader.js +1 -1
- package/dist/tests-misc/themes/jestTestTheme/index.js +4 -4
- package/dist/types/Actions.type.d.ts +37 -37
- package/dist/types/Components.type.d.ts +4 -5
- package/dist/types/State.type.d.ts +9 -9
- package/dist/types/Termsheet.type.d.ts +4 -4
- package/dist/types/api.type.d.ts +4 -4
- package/dist/types/config.type.d.ts +2 -3
- package/dist/types/getActions.type.d.ts +2 -2
- package/dist/types/getConnectors.type.d.ts +2 -3
- package/dist/types/getSelectors.type.d.ts +2 -2
- package/dist/wizard-params.d.ts +1 -1
- package/dist/wizard-params.js +16 -16
- package/jest.config.ts +1 -1
- package/package.json +16 -8
- package/setupJest.ts +8 -0
- package/src/App.tsx +22 -25
- package/src/Globals.ts +12 -8
- package/src/Loader.tsx +8 -0
- package/src/PluginLoader.tsx +20 -37
- package/src/Shimmer.tsx +58 -45
- package/src/ThemeLoader.test.tsx +1 -0
- package/src/ThemeLoader.tsx +27 -42
- package/src/components/PluginRoute.tsx +8 -6
- package/src/components/SmartScript.tsx +29 -28
- package/src/components/UserLocked/UserLockedComponent.tsx +3 -3
- package/src/components/View.test.tsx +3 -0
- package/src/components/View.tsx +52 -54
- package/src/componentsConnectors/connectBox.tsx +6 -6
- package/src/componentsConnectors/connectDocument.tsx +6 -6
- package/src/componentsConnectors/connectHeader.tsx +2 -2
- package/src/componentsConnectors/connectMetaTitle.tsx +2 -2
- package/src/componentsConnectors/connectOption.tsx +11 -11
- package/src/componentsConnectors/connectPagination.tsx +3 -3
- package/src/componentsConnectors/connectPreview.tsx +2 -2
- package/src/componentsConnectors/connectProgress.tsx +3 -3
- package/src/componentsConnectors/connectRootOption.tsx +4 -4
- package/src/componentsConnectors/connectSection.tsx +4 -4
- package/src/componentsConnectors/connectSummary.tsx +2 -2
- package/src/componentsConnectors/connectSummaryItem.tsx +6 -6
- package/src/componentsConnectors/connectTermsheet.tsx +46 -46
- package/src/componentsConnectors/connectVariable.tsx +11 -11
- package/src/componentsConnectors/connectWizardWrapper.tsx +4 -4
- package/src/componentsConnectors/connector/componentConnector.tsx +22 -20
- package/src/componentsConnectors/library.ts +35 -0
- package/src/config.test.ts +2 -1
- package/src/config.ts +1 -1
- package/src/constants/phoneValidation.ts +6 -0
- package/src/definitions/path.join.d.ts +1 -1
- package/src/helpers/outputsParsing.ts +26 -26
- package/src/helpers/preloadTheme.ts +2 -2
- package/src/helpers/scriptsLoader.ts +20 -0
- package/src/helpers/sendinblueHelper.ts +23 -17
- package/src/hooks/usePrevious.ts +1 -1
- package/src/libs/ConditionsInitiator.ts +3 -3
- package/src/libs/ConditionsRunner/DataPopulator.ts +7 -7
- package/src/libs/ConditionsRunner.ts +53 -53
- package/src/libs/DocumentsOutputs.ts +7 -7
- package/src/libs/Eval/EvalBase.ts +17 -17
- package/src/libs/Eval/EvalFunctions.ts +100 -100
- package/src/libs/Eval/NumbersToLetters.ts +48 -48
- package/src/libs/EvalVariable.ts +34 -31
- package/src/libs/EventsTracking.ts +38 -38
- package/src/libs/Extracts.ts +21 -21
- package/src/libs/InputsInitiator.ts +16 -16
- package/src/libs/NumAuto.ts +1 -1
- package/src/libs/OvcConverter.ts +25 -25
- package/src/libs/PathReader.ts +23 -23
- package/src/libs/SectionValidity.ts +3 -3
- package/src/libs/SmartScriptStore.ts +40 -40
- package/src/misc/test_model.ts +3809 -3809
- package/src/polyfills/index.ts +5 -0
- package/src/polyfills/prepend.ts +2 -2
- package/src/polyfills/stringRepeat.ts +4 -4
- package/src/redux/actions/app.ts +13 -13
- package/src/redux/actions/conditions.ts +3 -3
- package/src/redux/actions/inputs.ts +2 -2
- package/src/redux/actions/library.ts +23 -0
- package/src/redux/actions/mandatories.ts +2 -2
- package/src/redux/actions/references.ts +5 -5
- package/src/redux/actions/sagas/data.ts +2 -2
- package/src/redux/actions/sagas/model.ts +6 -6
- package/src/redux/actions/sagas/user.ts +2 -2
- package/src/redux/actions/smartscript.ts +4 -4
- package/src/redux/actions/user.ts +5 -5
- package/src/redux/constants/app.ts +22 -22
- package/src/redux/constants/conditions.ts +8 -8
- package/src/redux/constants/inputs.ts +6 -6
- package/src/redux/constants/mandatories.ts +6 -6
- package/src/redux/constants/references.ts +3 -3
- package/src/redux/constants/sagas/data.ts +1 -1
- package/src/redux/constants/sagas/model.ts +2 -2
- package/src/redux/constants/sagas/user.ts +2 -2
- package/src/redux/constants/smartscript.ts +4 -4
- package/src/redux/constants/user.ts +3 -3
- package/src/redux/listeners/subscriber.ts +2 -2
- package/src/redux/middlewares/conditionsWatcherMiddleware.ts +31 -31
- package/src/redux/middlewares/evaluationsWatcherMiddleware.test.ts +1 -1
- package/src/redux/middlewares/evaluationsWatcherMiddleware.ts +13 -13
- package/src/redux/middlewares/mandatoriesWatcherMiddleware.ts +16 -16
- package/src/redux/middlewares/multiplesActionsMiddleware.ts +6 -6
- package/src/redux/middlewares/paginationWatcherMiddleware.ts +27 -27
- package/src/redux/middlewares/pluginsHookMiddleware.ts +2 -2
- package/src/redux/middlewares/prefillerWatcherMiddleware.ts +31 -31
- package/src/redux/middlewares/smartscriptMiddleware.ts +20 -20
- package/src/redux/middlewares/thirdpartyScriptsMiddleware.ts +41 -0
- package/src/redux/reducers/app/customizations/initCustomizationAutoDefault.ts +2 -2
- package/src/redux/reducers/app/customizations/initCustomizationMeta.ts +2 -2
- package/src/redux/reducers/app/instance/initInstance.ts +2 -2
- package/src/redux/reducers/app/instance/setDataStatus.ts +2 -2
- package/src/redux/reducers/app/instance/updateInstance.ts +2 -2
- package/src/redux/reducers/app/instance/updateInstancePaid.ts +2 -2
- package/src/redux/reducers/app/meta/fetchModelFailed.ts +2 -2
- package/src/redux/reducers/app/meta/fetchModelNonBlocking.ts +2 -2
- package/src/redux/reducers/app/meta/fetchModelSucceeded.ts +2 -2
- package/src/redux/reducers/app/meta/fetchModelUnhealthy.ts +3 -3
- package/src/redux/reducers/app/meta/fetchModelUserLocked.ts +2 -2
- package/src/redux/reducers/app/meta/initMeta.ts +2 -2
- package/src/redux/reducers/app/meta/setModelUuid.ts +2 -2
- package/src/redux/reducers/app/pagination/goNextPage.ts +2 -2
- package/src/redux/reducers/app/pagination/goPage.ts +4 -4
- package/src/redux/reducers/app/pagination/goPreviousPage.ts +2 -2
- package/src/redux/reducers/app/pagination/initPagination.ts +3 -3
- package/src/redux/reducers/app/pagination/updateAvailableAppStates.ts +7 -7
- package/src/redux/reducers/app/wizard/updateAvailableSections.ts +4 -4
- package/src/redux/reducers/app.ts +32 -32
- package/src/redux/reducers/conditions/addMultipleOccurency.ts +5 -5
- package/src/redux/reducers/conditions/deleteMultipleOccurency.ts +4 -4
- package/src/redux/reducers/conditions/initConditions.ts +2 -2
- package/src/redux/reducers/conditions/updateDocumentConditions.ts +2 -2
- package/src/redux/reducers/conditions/updateOptionConditions.ts +2 -2
- package/src/redux/reducers/conditions/updateOptionValidatorCondition.ts +2 -2
- package/src/redux/reducers/conditions/updatePrefillerConditions.ts +4 -4
- package/src/redux/reducers/conditions/updateSectionConditions.ts +2 -2
- package/src/redux/reducers/conditions/updateVariableConditions.ts +2 -2
- package/src/redux/reducers/conditions/updateVariableValidatorCondition.ts +2 -2
- package/src/redux/reducers/conditions.ts +15 -15
- package/src/redux/reducers/inputs/addMultipleOccurency.ts +6 -6
- package/src/redux/reducers/inputs/deleteMultipleOccurency.ts +4 -4
- package/src/redux/reducers/inputs/initOption.ts +2 -2
- package/src/redux/reducers/inputs/initVariable.ts +2 -2
- package/src/redux/reducers/inputs/updateOptionInput.ts +2 -2
- package/src/redux/reducers/inputs/updateVariableInput.ts +2 -2
- package/src/redux/reducers/inputs.ts +10 -10
- package/src/redux/reducers/mandatories/addMultipleOccurency.ts +4 -4
- package/src/redux/reducers/mandatories/deleteMultipleOccurency.ts +4 -4
- package/src/redux/reducers/mandatories/initMandatoryOption.ts +2 -2
- package/src/redux/reducers/mandatories/initMandatoryVariable.ts +2 -2
- package/src/redux/reducers/mandatories/setMandatoryIgnore.ts +2 -2
- package/src/redux/reducers/mandatories/setMandatoryOption.ts +2 -2
- package/src/redux/reducers/mandatories/setMandatorySection.ts +2 -2
- package/src/redux/reducers/mandatories/setMandatoryVariable.ts +2 -2
- package/src/redux/reducers/mandatories.ts +13 -13
- package/src/redux/reducers/references/initReferences.ts +2 -2
- package/src/redux/reducers/references/updateOptionMeta.ts +4 -4
- package/src/redux/reducers/references/updateVariableMeta.ts +4 -4
- package/src/redux/reducers/references.ts +7 -7
- package/src/redux/reducers/smartscript/enableSmartScript.ts +1 -1
- package/src/redux/reducers/smartscript/initSmartScriptTriggers.ts +2 -2
- package/src/redux/reducers/smartscript/updateSmartscriptOptionHidden.ts +2 -2
- package/src/redux/reducers/smartscript/updateSmartscriptVariableHidden.ts +2 -2
- package/src/redux/reducers/smartscript.ts +8 -8
- package/src/redux/reducers/user/initUser.ts +2 -2
- package/src/redux/reducers/user/setUserStatus.ts +2 -2
- package/src/redux/reducers/user/setUserValidToken.ts +2 -2
- package/src/redux/reducers/user.ts +11 -11
- package/src/redux/routerHistory.ts +6 -6
- package/src/redux/sagas/fetchModel.test.ts +2 -5
- package/src/redux/sagas/fetchModel.ts +91 -100
- package/src/redux/sagas/homogeneousRadioInputsSaga.ts +6 -6
- package/src/redux/sagas/runner.ts +6 -6
- package/src/redux/sagas/saveData.ts +32 -28
- package/src/redux/sagas/setDefaults.ts +8 -8
- package/src/redux/sagas/setUserEmail.ts +46 -45
- package/src/redux/selectors/app.ts +34 -28
- package/src/redux/selectors/conditions.ts +41 -41
- package/src/redux/selectors/inputs.ts +10 -10
- package/src/redux/selectors/library.ts +17 -0
- package/src/redux/selectors/mandatories.ts +10 -10
- package/src/redux/selectors/references.ts +21 -21
- package/src/redux/selectors/selectors.ts +4 -4
- package/src/redux/selectors/smartscript.ts +6 -6
- package/src/redux/selectors/user.ts +8 -8
- package/src/redux/store.ts +42 -32
- package/src/service/api.manager.ts +53 -53
- package/src/service/auth.service.ts +2 -2
- package/src/service/pardot.service.ts +2 -2
- package/src/tests-misc/plugins/jestTestPlugin/after.tsx +1 -1
- package/src/tests-misc/plugins/jestTestPlugin/before.tsx +1 -1
- package/src/tests-misc/plugins/jestTestPlugin/index.ts +4 -4
- package/src/tests-misc/plugins/jestTestPlugin/title.tsx +2 -2
- package/src/tests-misc/themes/jestTestTheme/components/EmailComponent.tsx +1 -1
- package/src/tests-misc/themes/jestTestTheme/components/TermsheetComponent.tsx +1 -1
- package/src/tests-misc/themes/jestTestTheme/components/WizardComponent.tsx +1 -1
- package/src/tests-misc/themes/jestTestTheme/faltyIndex.ts +1 -1
- package/src/tests-misc/themes/jestTestTheme/faltyIndexLoader.ts +1 -1
- package/src/tests-misc/themes/jestTestTheme/index.ts +4 -4
- package/src/types/Actions.type.ts +55 -55
- package/src/types/Components.type.ts +4 -4
- package/src/types/State.type.ts +14 -14
- package/src/types/Termsheet.type.ts +4 -4
- package/src/types/api.type.ts +4 -4
- package/src/types/config.type.ts +3 -3
- package/src/types/getActions.type.ts +2 -2
- package/src/types/getConnectors.type.ts +2 -2
- package/src/types/getSelectors.type.ts +2 -2
- package/src/wizard-params.ts +17 -17
- package/tsconfig.json +1 -1
- package/dist/componentsConnectors/connector/connectorSelectors.js +0 -9
- package/dist/componentsConnectors/index.d.ts +0 -16
- package/dist/componentsConnectors/index.js +0 -16
- package/dist/constants/index.d.ts +0 -1
- package/dist/constants/index.js +0 -1
- package/dist/helpers/index.d.ts +0 -2
- package/dist/helpers/index.js +0 -2
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.js +0 -1
- package/dist/index.d.ts +0 -23
- package/dist/index.js +0 -23
- package/dist/libs/index.d.ts +0 -12
- package/dist/libs/index.js +0 -12
- package/dist/redux/actions/index.d.ts +0 -8
- package/dist/redux/actions/index.js +0 -8
- package/dist/redux/actions/sagas/index.d.ts +0 -3
- package/dist/redux/actions/sagas/index.js +0 -3
- package/dist/redux/constants/index.d.ts +0 -8
- package/dist/redux/constants/index.js +0 -8
- package/dist/redux/constants/sagas/index.d.ts +0 -3
- package/dist/redux/constants/sagas/index.js +0 -3
- package/dist/redux/index.d.ts +0 -4
- package/dist/redux/index.js +0 -4
- package/dist/redux/selectors/index.d.ts +0 -7
- package/dist/redux/selectors/index.js +0 -7
- package/dist/service/index.d.ts +0 -3
- package/dist/service/index.js +0 -3
- package/dist/types/index.d.ts +0 -10
- package/dist/types/index.js +0 -10
- package/src/componentsConnectors/connector/connectorSelectors.ts +0 -19
- package/src/componentsConnectors/index.ts +0 -16
- package/src/constants/index.ts +0 -1
- package/src/helpers/index.ts +0 -2
- package/src/hooks/index.ts +0 -1
- package/src/index.ts +0 -47
- package/src/libs/index.ts +0 -12
- package/src/redux/actions/index.ts +0 -8
- package/src/redux/actions/sagas/index.ts +0 -3
- package/src/redux/constants/index.ts +0 -8
- package/src/redux/constants/sagas/index.ts +0 -3
- package/src/redux/index.ts +0 -4
- package/src/redux/selectors/index.ts +0 -7
- package/src/service/index.ts +0 -3
- package/src/types/index.ts +0 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { VariableV3 } from
|
|
2
|
-
import { EvalFunctions } from
|
|
1
|
+
import type { VariableV3 } from "@legalplace/models-v3-types";
|
|
2
|
+
import { EvalFunctions } from "./Eval/EvalFunctions";
|
|
3
3
|
export declare class EvalVariable extends EvalFunctions {
|
|
4
4
|
variablesValues: Record<string, string | number>;
|
|
5
5
|
evaluation: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { selectVariableReference } from
|
|
2
|
-
import { EvalFunctions } from
|
|
1
|
+
import { selectVariableReference } from "../redux/selectors/references";
|
|
2
|
+
import { EvalFunctions } from "./Eval/EvalFunctions";
|
|
3
3
|
export class EvalVariable extends EvalFunctions {
|
|
4
4
|
constructor(variable, index) {
|
|
5
5
|
var _a, _b;
|
|
@@ -9,7 +9,7 @@ export class EvalVariable extends EvalFunctions {
|
|
|
9
9
|
this.hasFunctions = false;
|
|
10
10
|
this.abortEvaluation = false;
|
|
11
11
|
this.evaluation =
|
|
12
|
-
typeof ((_a = variable.eval) === null || _a === void 0 ? void 0 : _a.formula) ===
|
|
12
|
+
typeof ((_a = variable.eval) === null || _a === void 0 ? void 0 : _a.formula) === "string" ? (_b = variable.eval) === null || _b === void 0 ? void 0 : _b.formula : "0";
|
|
13
13
|
this.rawEvaluation = this.evaluation;
|
|
14
14
|
this.index = index;
|
|
15
15
|
if (/^D=(.*)/i.test(this.evaluation)) {
|
|
@@ -32,8 +32,8 @@ export class EvalVariable extends EvalFunctions {
|
|
|
32
32
|
});
|
|
33
33
|
evalVariablesIds.forEach((variableId) => {
|
|
34
34
|
let value = this.getVariableValue(variableId, false);
|
|
35
|
-
if (typeof value ===
|
|
36
|
-
value =
|
|
35
|
+
if (typeof value === "string" && value.trim().length === 0) {
|
|
36
|
+
value = "___EMPTY___";
|
|
37
37
|
if (this.isVariableEditable(variableId))
|
|
38
38
|
this.abortEvaluation = true;
|
|
39
39
|
}
|
|
@@ -44,8 +44,8 @@ export class EvalVariable extends EvalFunctions {
|
|
|
44
44
|
let operation = `${this.evaluation}`;
|
|
45
45
|
Object.keys(this.variablesValues).forEach((variableId) => {
|
|
46
46
|
let value = this.variablesValues[variableId];
|
|
47
|
-
value = typeof value ===
|
|
48
|
-
operation = operation.replace(new RegExp(`\\[var:${variableId}\\]`,
|
|
47
|
+
value = typeof value === "number" ? value.toString() : value;
|
|
48
|
+
operation = operation.replace(new RegExp(`\\[var:${variableId}\\]`, "g"), value);
|
|
49
49
|
});
|
|
50
50
|
this.evaluation = operation;
|
|
51
51
|
}
|
|
@@ -76,8 +76,9 @@ export class EvalVariable extends EvalFunctions {
|
|
|
76
76
|
const regex = /([a-z_]+)\(([^()]*)\)/gi;
|
|
77
77
|
let formulas = this.evaluation.match(regex);
|
|
78
78
|
while (formulas && this.doNotEvaluate === false) {
|
|
79
|
-
formulas.
|
|
80
|
-
const
|
|
79
|
+
for (let i = 0; i < formulas.length; i += 1) {
|
|
80
|
+
const formula = formulas[i];
|
|
81
|
+
const reg = new RegExp(regex, "gi");
|
|
81
82
|
const extract = reg.exec(formula);
|
|
82
83
|
if (extract === null)
|
|
83
84
|
return;
|
|
@@ -85,31 +86,31 @@ export class EvalVariable extends EvalFunctions {
|
|
|
85
86
|
return;
|
|
86
87
|
const functionName = extract[1];
|
|
87
88
|
const args = extract[2]
|
|
88
|
-
.split(extract[2].indexOf(
|
|
89
|
+
.split(extract[2].indexOf(";") > -1 ? ";" : ",")
|
|
89
90
|
.map((v) => v.trim());
|
|
90
|
-
let result =
|
|
91
|
+
let result = "";
|
|
91
92
|
if (Object.keys(functionsList).includes(functionName)) {
|
|
92
93
|
result = functionsList[functionName].apply(this, args).toString();
|
|
93
94
|
this.hasFunctions = true;
|
|
94
95
|
}
|
|
95
96
|
else {
|
|
96
|
-
console.error(`Erreur de modélisation: la fonction %c"${functionName}" %cest inconnue dans la formule: ${this.rawEvaluation}`,
|
|
97
|
+
console.error(`Erreur de modélisation: la fonction %c"${functionName}" %cest inconnue dans la formule: ${this.rawEvaluation}`, "font-weight: bold;", "font-weight: initial");
|
|
97
98
|
this.doNotEvaluate = true;
|
|
98
99
|
}
|
|
99
100
|
this.evaluation = this.evaluation.replace(formula, result);
|
|
100
|
-
}
|
|
101
|
+
}
|
|
101
102
|
formulas = this.evaluation.match(regex);
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
evaluate() {
|
|
105
106
|
if (this.doNotEvaluate === true) {
|
|
106
|
-
this.result =
|
|
107
|
-
return
|
|
107
|
+
this.result = "";
|
|
108
|
+
return "";
|
|
108
109
|
}
|
|
109
|
-
if (typeof this.evaluation !==
|
|
110
|
+
if (typeof this.evaluation !== "string" ||
|
|
110
111
|
this.evaluation.trim().length === 0) {
|
|
111
|
-
this.result =
|
|
112
|
-
return
|
|
112
|
+
this.result = "";
|
|
113
|
+
return "";
|
|
113
114
|
}
|
|
114
115
|
let result;
|
|
115
116
|
try {
|
|
@@ -117,38 +118,38 @@ export class EvalVariable extends EvalFunctions {
|
|
|
117
118
|
result = this.evaluation;
|
|
118
119
|
}
|
|
119
120
|
else if (/^D=(.*)/i.test(this.evaluation)) {
|
|
120
|
-
result = this.setEmpty(this.evaluation.replace(/^D=/i,
|
|
121
|
+
result = this.setEmpty(this.evaluation.replace(/^D=/i, ""), "");
|
|
121
122
|
}
|
|
122
123
|
else if (this.abortEvaluation === true) {
|
|
123
|
-
result =
|
|
124
|
+
result = "";
|
|
124
125
|
}
|
|
125
126
|
else {
|
|
126
127
|
const cleanEvaluation = this.setEmpty(this.evaluation, 0);
|
|
127
|
-
result = eval(typeof cleanEvaluation ===
|
|
128
|
+
result = eval(typeof cleanEvaluation === "string"
|
|
128
129
|
? cleanEvaluation
|
|
129
130
|
: cleanEvaluation.toString());
|
|
130
131
|
if (result === Infinity || Number.isNaN(result)) {
|
|
131
|
-
result = this.hasFunctions === true ?
|
|
132
|
+
result = this.hasFunctions === true ? "" : 0;
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
135
|
}
|
|
135
136
|
catch (e) {
|
|
136
137
|
result =
|
|
137
|
-
this.hasFunctions === true || this.abortEvaluation === true ?
|
|
138
|
+
this.hasFunctions === true || this.abortEvaluation === true ? "" : 0;
|
|
138
139
|
}
|
|
139
|
-
if (typeof result ===
|
|
140
|
+
if (typeof result === "number") {
|
|
140
141
|
const variableReference = selectVariableReference(this.id);
|
|
141
142
|
if ((variableReference === null || variableReference === void 0 ? void 0 : variableReference.eval) === undefined)
|
|
142
143
|
throw new Error(`Variable ${this.id} does not exist`);
|
|
143
144
|
const { decimals, round } = variableReference.eval;
|
|
144
|
-
const evalDecimal = (typeof decimals ===
|
|
145
|
-
typeof decimals ===
|
|
145
|
+
const evalDecimal = (typeof decimals === "number" && !Number.isNaN(decimals)) ||
|
|
146
|
+
typeof decimals === "string"
|
|
146
147
|
? decimals
|
|
147
148
|
: undefined;
|
|
148
149
|
let numberOfDecimals = 0;
|
|
149
150
|
if (evalDecimal !== undefined) {
|
|
150
151
|
numberOfDecimals =
|
|
151
|
-
typeof evalDecimal ===
|
|
152
|
+
typeof evalDecimal === "string"
|
|
152
153
|
? parseInt(evalDecimal, 10)
|
|
153
154
|
: evalDecimal;
|
|
154
155
|
}
|
|
@@ -173,8 +174,8 @@ export class EvalVariable extends EvalFunctions {
|
|
|
173
174
|
}
|
|
174
175
|
}
|
|
175
176
|
if (result === undefined) {
|
|
176
|
-
this.result =
|
|
177
|
-
return
|
|
177
|
+
this.result = "";
|
|
178
|
+
return "";
|
|
178
179
|
}
|
|
179
180
|
this.result = result.toString();
|
|
180
181
|
return result;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Cookies from
|
|
2
|
-
import Globals from
|
|
1
|
+
import Cookies from "universal-cookie";
|
|
2
|
+
import Globals from "../Globals";
|
|
3
3
|
const cookie = new Cookies();
|
|
4
4
|
class _EventsTracking {
|
|
5
5
|
constructor() {
|
|
@@ -28,14 +28,14 @@ class _EventsTracking {
|
|
|
28
28
|
}
|
|
29
29
|
init() {
|
|
30
30
|
this.initiated = true;
|
|
31
|
-
this.register(Object.assign({
|
|
32
|
-
this.trigger(
|
|
31
|
+
this.register(Object.assign({ "WizardX Build Commit": process.env.REACT_APP_COMMIT || "Unkown build commit", Environement: Globals.appEnv, "Powered By": "WizardX" }, this.getXSource()));
|
|
32
|
+
this.trigger("wizardx");
|
|
33
33
|
}
|
|
34
34
|
getXSource() {
|
|
35
|
-
const xSource = cookie.get(
|
|
36
|
-
return typeof xSource ===
|
|
35
|
+
const xSource = cookie.get("X-Source");
|
|
36
|
+
return typeof xSource === "string" && xSource.trim().length > 0
|
|
37
37
|
? {
|
|
38
|
-
|
|
38
|
+
"X-Source": xSource,
|
|
39
39
|
}
|
|
40
40
|
: {};
|
|
41
41
|
}
|
|
@@ -50,25 +50,25 @@ class _EventsTracking {
|
|
|
50
50
|
args.push(true);
|
|
51
51
|
let fn;
|
|
52
52
|
switch (fnName) {
|
|
53
|
-
case
|
|
53
|
+
case "trackMix":
|
|
54
54
|
fn = this.trackMix.bind(this);
|
|
55
55
|
break;
|
|
56
|
-
case
|
|
56
|
+
case "trackFB":
|
|
57
57
|
fn = this.trackFB.bind(this);
|
|
58
58
|
break;
|
|
59
|
-
case
|
|
59
|
+
case "trackGA":
|
|
60
60
|
fn = this.trackGA.bind(this);
|
|
61
61
|
break;
|
|
62
|
-
case
|
|
62
|
+
case "trackSIB":
|
|
63
63
|
fn = this.trackSIB.bind(this);
|
|
64
64
|
break;
|
|
65
|
-
case
|
|
65
|
+
case "registerMix":
|
|
66
66
|
fn = this.registerMix.bind(this);
|
|
67
67
|
break;
|
|
68
|
-
case
|
|
68
|
+
case "registerFB":
|
|
69
69
|
fn = this.registerFB.bind(this);
|
|
70
70
|
break;
|
|
71
|
-
case
|
|
71
|
+
case "triggerHj":
|
|
72
72
|
fn = this.triggerHj.bind(this);
|
|
73
73
|
break;
|
|
74
74
|
default:
|
|
@@ -91,88 +91,88 @@ class _EventsTracking {
|
|
|
91
91
|
trackMix(eventName, eventProps, doNotPushToQueue = false) {
|
|
92
92
|
if (!this.initiated)
|
|
93
93
|
this.init();
|
|
94
|
-
if (typeof window.mixpanel !==
|
|
94
|
+
if (typeof window.mixpanel !== "undefined") {
|
|
95
95
|
if (this.queue.length > 0 && !doNotPushToQueue)
|
|
96
96
|
this.executeQueue();
|
|
97
97
|
window.mixpanel.track(eventName, eventProps);
|
|
98
98
|
return true;
|
|
99
99
|
}
|
|
100
100
|
if (doNotPushToQueue === false)
|
|
101
|
-
this.queue.push([
|
|
101
|
+
this.queue.push(["trackMix", [eventName, eventProps]]);
|
|
102
102
|
this.queueTimeout();
|
|
103
103
|
return false;
|
|
104
104
|
}
|
|
105
105
|
trackSIB(eventName, eventProps, doNotPushToQueue = false) {
|
|
106
106
|
if (!this.initiated)
|
|
107
107
|
this.init();
|
|
108
|
-
if (typeof window.sendinblue !==
|
|
108
|
+
if (typeof window.sendinblue !== "undefined") {
|
|
109
109
|
if (this.queue.length > 0 && !doNotPushToQueue)
|
|
110
110
|
this.executeQueue();
|
|
111
111
|
window.sendinblue.track(eventName, eventProps);
|
|
112
112
|
return true;
|
|
113
113
|
}
|
|
114
114
|
if (doNotPushToQueue === false)
|
|
115
|
-
this.queue.push([
|
|
115
|
+
this.queue.push(["trackSIB", [eventName, eventProps]]);
|
|
116
116
|
this.queueTimeout();
|
|
117
117
|
return false;
|
|
118
118
|
}
|
|
119
119
|
trackFB(eventName, eventProps, doNotPushToQueue = false) {
|
|
120
|
-
if (typeof window.fbq !==
|
|
120
|
+
if (typeof window.fbq !== "undefined") {
|
|
121
121
|
if (this.queue.length > 0 && !doNotPushToQueue)
|
|
122
122
|
this.executeQueue();
|
|
123
|
-
window.fbq(
|
|
123
|
+
window.fbq("trackCustom", eventName, eventProps);
|
|
124
124
|
return true;
|
|
125
125
|
}
|
|
126
126
|
if (doNotPushToQueue === false)
|
|
127
|
-
this.queue.push([
|
|
127
|
+
this.queue.push(["trackFB", [eventName, eventProps]]);
|
|
128
128
|
this.queueTimeout();
|
|
129
129
|
return false;
|
|
130
130
|
}
|
|
131
131
|
trackGA(eventName, eventProps, doNotPushToQueue = false) {
|
|
132
|
-
if (typeof window.ga !==
|
|
132
|
+
if (typeof window.ga !== "undefined") {
|
|
133
133
|
if (this.queue.length > 0 && !doNotPushToQueue)
|
|
134
134
|
this.executeQueue();
|
|
135
|
-
window.ga(
|
|
135
|
+
window.ga("send", "event", "lpTracking", "track", eventName, 1, eventProps);
|
|
136
136
|
return true;
|
|
137
137
|
}
|
|
138
138
|
if (doNotPushToQueue === false)
|
|
139
|
-
this.queue.push([
|
|
139
|
+
this.queue.push(["trackGA", [eventName, eventProps]]);
|
|
140
140
|
this.queueTimeout();
|
|
141
141
|
return false;
|
|
142
142
|
}
|
|
143
143
|
registerMix(props, doNotPushToQueue = false) {
|
|
144
|
-
if (typeof window.mixpanel !==
|
|
144
|
+
if (typeof window.mixpanel !== "undefined") {
|
|
145
145
|
if (this.queue.length > 0 && !doNotPushToQueue)
|
|
146
146
|
this.executeQueue();
|
|
147
147
|
window.mixpanel.register(props);
|
|
148
148
|
return true;
|
|
149
149
|
}
|
|
150
150
|
if (doNotPushToQueue === false)
|
|
151
|
-
this.queue.push([
|
|
151
|
+
this.queue.push(["registerMix", [props]]);
|
|
152
152
|
this.queueTimeout();
|
|
153
153
|
return false;
|
|
154
154
|
}
|
|
155
155
|
registerFB(props, doNotPushToQueue = false) {
|
|
156
|
-
if (typeof window.fbq !==
|
|
156
|
+
if (typeof window.fbq !== "undefined") {
|
|
157
157
|
if (this.queue.length > 0 && !doNotPushToQueue)
|
|
158
158
|
this.executeQueue();
|
|
159
|
-
window.fbq(
|
|
159
|
+
window.fbq("trackCustom", "GeneralProps", props);
|
|
160
160
|
return true;
|
|
161
161
|
}
|
|
162
162
|
if (doNotPushToQueue === false)
|
|
163
|
-
this.queue.push([
|
|
163
|
+
this.queue.push(["registerFB", [props]]);
|
|
164
164
|
this.queueTimeout();
|
|
165
165
|
return false;
|
|
166
166
|
}
|
|
167
167
|
triggerHj(name, doNotPushToQueue = false) {
|
|
168
|
-
if (typeof window.hj !==
|
|
168
|
+
if (typeof window.hj !== "undefined") {
|
|
169
169
|
if (this.queue.length > 0 && !doNotPushToQueue)
|
|
170
170
|
this.executeQueue();
|
|
171
|
-
window.hj(
|
|
171
|
+
window.hj("trigger", name);
|
|
172
172
|
return true;
|
|
173
173
|
}
|
|
174
174
|
if (doNotPushToQueue === false)
|
|
175
|
-
this.queue.push([
|
|
175
|
+
this.queue.push(["triggerHj", [name]]);
|
|
176
176
|
this.queueTimeout();
|
|
177
177
|
return false;
|
|
178
178
|
}
|
package/dist/libs/Extracts.js
CHANGED
|
@@ -7,11 +7,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { selectCustomizationMeta } from
|
|
11
|
-
import { selectUserEmail } from
|
|
12
|
-
import { selectOptionInput, selectVariableInput, } from
|
|
13
|
-
import { selectOptionReference, selectVariableReference, } from
|
|
14
|
-
import { EventsTracking } from
|
|
10
|
+
import { selectCustomizationMeta } from "../redux/selectors/app";
|
|
11
|
+
import { selectUserEmail } from "../redux/selectors/user";
|
|
12
|
+
import { selectOptionInput, selectVariableInput, } from "../redux/selectors/inputs";
|
|
13
|
+
import { selectOptionReference, selectVariableReference, } from "../redux/selectors/references";
|
|
14
|
+
import { EventsTracking } from "./EventsTracking";
|
|
15
15
|
class Extracts {
|
|
16
16
|
constructor() {
|
|
17
17
|
this.extracts = [];
|
|
@@ -21,7 +21,7 @@ class Extracts {
|
|
|
21
21
|
}
|
|
22
22
|
extractData() {
|
|
23
23
|
const customizationMeta = selectCustomizationMeta();
|
|
24
|
-
if (!(typeof customizationMeta ===
|
|
24
|
+
if (!(typeof customizationMeta === "object" &&
|
|
25
25
|
Array.isArray(customizationMeta.extracts) &&
|
|
26
26
|
customizationMeta.extracts.length > 0))
|
|
27
27
|
return;
|
|
@@ -38,11 +38,11 @@ class Extracts {
|
|
|
38
38
|
const { id, type, destination } = extract;
|
|
39
39
|
let inputs;
|
|
40
40
|
let defaultName;
|
|
41
|
-
if (type ===
|
|
42
|
-
inputs = selectOptionInput(id).map((value) => value === true ?
|
|
41
|
+
if (type === "option") {
|
|
42
|
+
inputs = selectOptionInput(id).map((value) => value === true ? "True" : "False");
|
|
43
43
|
defaultName = selectOptionReference(id).meta.label;
|
|
44
44
|
}
|
|
45
|
-
else if (type ===
|
|
45
|
+
else if (type === "variable") {
|
|
46
46
|
inputs = selectVariableInput(id).map((value) => value.toString());
|
|
47
47
|
defaultName = selectVariableReference(id, true).label;
|
|
48
48
|
}
|
|
@@ -51,9 +51,9 @@ class Extracts {
|
|
|
51
51
|
}
|
|
52
52
|
defaultName =
|
|
53
53
|
defaultName.trim().length > 0 ? defaultName : `${type} ${id}`;
|
|
54
|
-
const value = inputs.length > 1 ? inputs.join(
|
|
55
|
-
if (typeof destination.slack ===
|
|
56
|
-
typeof destination.slack.channel ===
|
|
54
|
+
const value = inputs.length > 1 ? inputs.join(", ").slice(0, -2) : inputs[0];
|
|
55
|
+
if (typeof destination.slack === "object" &&
|
|
56
|
+
typeof destination.slack.channel === "string" &&
|
|
57
57
|
destination.slack.channel.trim().length > 0) {
|
|
58
58
|
const { name, channel } = destination.slack;
|
|
59
59
|
if (this.slackExtracts[channel] === undefined)
|
|
@@ -63,11 +63,11 @@ class Extracts {
|
|
|
63
63
|
value,
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
-
if (typeof destination.sendinblue ===
|
|
66
|
+
if (typeof destination.sendinblue === "object" && value && value.trim()) {
|
|
67
67
|
const name = destination.sendinblue.name || defaultName;
|
|
68
68
|
this.sendinblueExtracts = Object.assign(Object.assign({}, this.sendinblueExtracts), { [name]: value });
|
|
69
69
|
}
|
|
70
|
-
if (typeof destination.mixpanel ===
|
|
70
|
+
if (typeof destination.mixpanel === "object") {
|
|
71
71
|
const name = destination.mixpanel.name || defaultName;
|
|
72
72
|
this.mixpanelExtracts = Object.assign(Object.assign({}, this.mixpanelExtracts), { [name]: value });
|
|
73
73
|
}
|
|
@@ -78,8 +78,8 @@ class Extracts {
|
|
|
78
78
|
channels.forEach((currentChannel) => {
|
|
79
79
|
const text = this.formatSlackMessage(currentChannel);
|
|
80
80
|
const json = {
|
|
81
|
-
username:
|
|
82
|
-
icon_emoji:
|
|
81
|
+
username: "WizardX Extract Bot",
|
|
82
|
+
icon_emoji: ":robot_face:",
|
|
83
83
|
channel: currentChannel,
|
|
84
84
|
attachments: [
|
|
85
85
|
{
|
|
@@ -87,16 +87,16 @@ class Extracts {
|
|
|
87
87
|
},
|
|
88
88
|
],
|
|
89
89
|
};
|
|
90
|
-
fetch(
|
|
90
|
+
fetch("https://hooks.slack.com/services/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", {
|
|
91
91
|
body: JSON.stringify(json),
|
|
92
|
-
method:
|
|
92
|
+
method: "POST",
|
|
93
93
|
}).catch((err) => __awaiter(this, void 0, void 0, function* () {
|
|
94
94
|
throw new Error(err);
|
|
95
95
|
}));
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
sendMixpanel() {
|
|
99
|
-
EventsTracking.trackMix(
|
|
99
|
+
EventsTracking.trackMix("Variable Extraction", this.mixpanelExtracts);
|
|
100
100
|
}
|
|
101
101
|
formatSlackMessage(channel) {
|
|
102
102
|
const lines = [`Email: ${selectUserEmail()}`];
|
|
@@ -104,7 +104,7 @@ class Extracts {
|
|
|
104
104
|
const { name, value } = extract;
|
|
105
105
|
lines.push(`*${name}:* ${value}`);
|
|
106
106
|
});
|
|
107
|
-
return lines.join(
|
|
107
|
+
return lines.join("\n");
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
export default new Extracts();
|
|
@@ -25,7 +25,7 @@ export class IntputsInitiator {
|
|
|
25
25
|
const rootOptionId = parentsTree.length > 0 ? parentsTree[parentsTree.length - 1] : id;
|
|
26
26
|
if (!this.ovc.options[rootOptionId]) {
|
|
27
27
|
const rootReference = this.references.options[rootOptionId];
|
|
28
|
-
if (rootReference.meta.type ===
|
|
28
|
+
if (rootReference.meta.type === "static") {
|
|
29
29
|
this.ovc.options[rootOptionId] = new Array(inputs.length).fill(true);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -41,12 +41,12 @@ export class IntputsInitiator {
|
|
|
41
41
|
if (this.ovc &&
|
|
42
42
|
Object.prototype.hasOwnProperty.call(this.ovc.options, optionId)) {
|
|
43
43
|
if ([
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
"static",
|
|
45
|
+
"hidden",
|
|
46
|
+
"brut-text",
|
|
47
|
+
"repeated",
|
|
48
|
+
"box",
|
|
49
|
+
"separator",
|
|
50
50
|
].includes(option.meta.type)) {
|
|
51
51
|
values = new Array(this.ovc.options[optionId].length).fill(true);
|
|
52
52
|
}
|
|
@@ -55,12 +55,12 @@ export class IntputsInitiator {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
else if ([
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
"static",
|
|
59
|
+
"hidden",
|
|
60
|
+
"brut-text",
|
|
61
|
+
"repeated",
|
|
62
|
+
"box",
|
|
63
|
+
"separator",
|
|
64
64
|
].includes(option.meta.type)) {
|
|
65
65
|
values = [true];
|
|
66
66
|
}
|
|
@@ -71,13 +71,13 @@ export class IntputsInitiator {
|
|
|
71
71
|
const variablesIds = Object.keys(this.references.variables);
|
|
72
72
|
for (let i = 0; i < variablesIds.length; i += 1) {
|
|
73
73
|
const variableId = variablesIds[i];
|
|
74
|
-
let values = [
|
|
74
|
+
let values = [""];
|
|
75
75
|
if (this.ovc &&
|
|
76
76
|
Object.prototype.hasOwnProperty.call(this.ovc.variables, variableId)) {
|
|
77
77
|
values = this.ovc.variables[variableId];
|
|
78
78
|
}
|
|
79
79
|
else {
|
|
80
|
-
const defaultValue =
|
|
80
|
+
const defaultValue = "";
|
|
81
81
|
values = [defaultValue];
|
|
82
82
|
}
|
|
83
83
|
this.inputs.variables[variableId] = values;
|
package/dist/libs/NumAuto.js
CHANGED