@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,27 +1,27 @@
|
|
|
1
|
-
import { selectOptionParents, selectOptionReference, selectVariableParents, } from
|
|
2
|
-
import { selectOptionInput } from
|
|
1
|
+
import { selectOptionParents, selectOptionReference, selectVariableParents, } from "../redux/selectors/references";
|
|
2
|
+
import { selectOptionInput } from "../redux/selectors/inputs";
|
|
3
3
|
class _OvcConverter {
|
|
4
4
|
convertToOptionsVariables(ovc, references) {
|
|
5
5
|
const inputs = {
|
|
6
6
|
options: {},
|
|
7
7
|
variables: {},
|
|
8
8
|
};
|
|
9
|
-
if (typeof ovc !==
|
|
9
|
+
if (typeof ovc !== "object")
|
|
10
10
|
return inputs;
|
|
11
|
-
if (typeof ovc.o ===
|
|
11
|
+
if (typeof ovc.o === "object") {
|
|
12
12
|
Object.keys(ovc.o).forEach((id) => {
|
|
13
13
|
const currentOption = ovc.o[id];
|
|
14
14
|
if (Array.isArray(currentOption)) {
|
|
15
15
|
const occurences = currentOption.length;
|
|
16
16
|
inputs.options = Object.assign(Object.assign({}, inputs.options), this.pushStaticChildren(inputs.options, id, occurences, references));
|
|
17
17
|
currentOption.forEach((childId, index) => {
|
|
18
|
-
const sanitizedId = typeof childId ===
|
|
19
|
-
? childId.split(
|
|
18
|
+
const sanitizedId = typeof childId === "string" && childId.split("_").length > 0
|
|
19
|
+
? childId.split("_")[0]
|
|
20
20
|
: childId;
|
|
21
21
|
if (!Object.prototype.hasOwnProperty.call(inputs.options, id)) {
|
|
22
22
|
inputs.options[id] = new Array(occurences).fill(false);
|
|
23
23
|
}
|
|
24
|
-
if (typeof sanitizedId ===
|
|
24
|
+
if (typeof sanitizedId === "string" &&
|
|
25
25
|
sanitizedId.trim().length === 0) {
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
@@ -33,17 +33,17 @@ class _OvcConverter {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
36
|
-
if (typeof currentOption ===
|
|
36
|
+
if (typeof currentOption === "string" &&
|
|
37
37
|
currentOption.trim().length === 0)
|
|
38
38
|
return;
|
|
39
39
|
inputs.options[currentOption] = [true];
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
if (typeof ovc.c ===
|
|
43
|
+
if (typeof ovc.c === "object") {
|
|
44
44
|
Object.keys(ovc.c).forEach((id) => {
|
|
45
45
|
const currentCheckbox = ovc.c[id];
|
|
46
|
-
if (typeof id ===
|
|
46
|
+
if (typeof id === "string" && id.trim().length === 0)
|
|
47
47
|
return;
|
|
48
48
|
if (Array.isArray(currentCheckbox)) {
|
|
49
49
|
inputs.options[id] = currentCheckbox;
|
|
@@ -53,7 +53,7 @@ class _OvcConverter {
|
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
if (typeof ovc.v ===
|
|
56
|
+
if (typeof ovc.v === "object") {
|
|
57
57
|
Object.keys(ovc.v).forEach((id) => {
|
|
58
58
|
const currentVariable = ovc.v[id];
|
|
59
59
|
if (Array.isArray(currentVariable)) {
|
|
@@ -65,7 +65,7 @@ class _OvcConverter {
|
|
|
65
65
|
if (currentVariable.length < occurences) {
|
|
66
66
|
inputs.variables[id] = [
|
|
67
67
|
...currentVariable,
|
|
68
|
-
...Array(occurences - currentVariable.length).fill(
|
|
68
|
+
...Array(occurences - currentVariable.length).fill(""),
|
|
69
69
|
];
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -94,16 +94,16 @@ class _OvcConverter {
|
|
|
94
94
|
const isMultiple = parentsTree.length > 0 &&
|
|
95
95
|
((_a = selectOptionReference(rootOptionId).meta.multiple) === null || _a === void 0 ? void 0 : _a.enabled) === true;
|
|
96
96
|
const occurences = selectOptionInput(rootOptionId).length;
|
|
97
|
-
if (![
|
|
97
|
+
if (!["radio", "checkbox"].includes(optionReference.meta.type)) {
|
|
98
98
|
if (values.length > 1 && rootOptionId === id) {
|
|
99
|
-
ovc.o[id] = new Array(values.length).fill(
|
|
99
|
+
ovc.o[id] = new Array(values.length).fill("");
|
|
100
100
|
}
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
103
|
const trueIndexes = values
|
|
104
104
|
.map((value, index) => (value === true ? index : null))
|
|
105
105
|
.filter((value) => value !== null);
|
|
106
|
-
const isCheckbox = optionReference.meta.type ===
|
|
106
|
+
const isCheckbox = optionReference.meta.type === "checkbox";
|
|
107
107
|
if (isCheckbox === true) {
|
|
108
108
|
if (isMultiple === true) {
|
|
109
109
|
ovc.c[id] = values;
|
|
@@ -114,7 +114,7 @@ class _OvcConverter {
|
|
|
114
114
|
}
|
|
115
115
|
else if (isMultiple === true) {
|
|
116
116
|
if (!Object.prototype.hasOwnProperty.call(ovc.o, parentId)) {
|
|
117
|
-
ovc.o[parentId] = new Array(occurences).fill(
|
|
117
|
+
ovc.o[parentId] = new Array(occurences).fill("");
|
|
118
118
|
}
|
|
119
119
|
trueIndexes.forEach((index) => {
|
|
120
120
|
const currentOption = ovc.o[parentId];
|
|
@@ -136,7 +136,7 @@ class _OvcConverter {
|
|
|
136
136
|
const occurences = selectOptionInput(parentsTree[parentsTree.length - 1]).length;
|
|
137
137
|
if (isMultiple === true) {
|
|
138
138
|
if (!Object.prototype.hasOwnProperty.call(ovc.o, id)) {
|
|
139
|
-
ovc.v[id] = new Array(occurences).fill(
|
|
139
|
+
ovc.v[id] = new Array(occurences).fill("");
|
|
140
140
|
}
|
|
141
141
|
ovc.v[id] = values;
|
|
142
142
|
}
|
|
@@ -147,18 +147,18 @@ class _OvcConverter {
|
|
|
147
147
|
return ovc;
|
|
148
148
|
}
|
|
149
149
|
isOvc(_obj) {
|
|
150
|
-
if (typeof _obj !==
|
|
150
|
+
if (typeof _obj !== "object" || _obj === null)
|
|
151
151
|
return false;
|
|
152
|
-
const ovcKeys = [
|
|
152
|
+
const ovcKeys = ["o", "v", "c"];
|
|
153
153
|
const foundKeys = Object.keys(_obj)
|
|
154
154
|
.map((key) => (ovcKeys.includes(key) ? 1 : 0))
|
|
155
155
|
.reduce((a, b) => a + b, 0);
|
|
156
156
|
return foundKeys > 1;
|
|
157
157
|
}
|
|
158
158
|
isOptionsVariables(_obj) {
|
|
159
|
-
if (typeof _obj !==
|
|
159
|
+
if (typeof _obj !== "object" || _obj === null)
|
|
160
160
|
return false;
|
|
161
|
-
const optionsVariablesKeys = [
|
|
161
|
+
const optionsVariablesKeys = ["options", "variables"];
|
|
162
162
|
const foundKeys = Object.keys(_obj)
|
|
163
163
|
.map((key) => (optionsVariablesKeys.includes(key) ? 1 : 0))
|
|
164
164
|
.reduce((a, b) => a + b, 0);
|
|
@@ -166,9 +166,9 @@ class _OvcConverter {
|
|
|
166
166
|
}
|
|
167
167
|
pushStaticChildren(inputOptions, id, occurences, references) {
|
|
168
168
|
const result = Object.assign({}, inputOptions);
|
|
169
|
-
const intId = typeof id ===
|
|
169
|
+
const intId = typeof id === "number" ? id : parseInt(id, 10);
|
|
170
170
|
const { options } = references.relations.options[intId].children;
|
|
171
|
-
const staticOptions = options.filter((childId) => references.options[childId].meta.type ===
|
|
171
|
+
const staticOptions = options.filter((childId) => references.options[childId].meta.type === "static");
|
|
172
172
|
staticOptions.forEach((childId) => {
|
|
173
173
|
if (!Object.prototype.hasOwnProperty.call(result, childId)) {
|
|
174
174
|
result[childId] = new Array(occurences).fill(false);
|
package/dist/libs/PathReader.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { createMatchSelector } from
|
|
2
|
-
import queryString from
|
|
3
|
-
import { getConfig } from
|
|
4
|
-
import { getPluginsPageAppStates } from
|
|
5
|
-
import { selectAvailableSections, selectAvailableAppStates, } from
|
|
6
|
-
import Globals from
|
|
1
|
+
import { createMatchSelector } from "connected-react-router";
|
|
2
|
+
import queryString from "query-string";
|
|
3
|
+
import { getConfig } from "../config";
|
|
4
|
+
import { getPluginsPageAppStates } from "../PluginLoader";
|
|
5
|
+
import { selectAvailableSections, selectAvailableAppStates, } from "../redux/selectors/app";
|
|
6
|
+
import Globals from "../Globals";
|
|
7
7
|
export class PathReader {
|
|
8
8
|
constructor(state) {
|
|
9
9
|
this.currentPage = 1;
|
|
10
10
|
this.currentSectionId = 1;
|
|
11
|
-
this.currentAppState =
|
|
12
|
-
this.currentPermalink =
|
|
13
|
-
this.currentView =
|
|
14
|
-
this.prefix =
|
|
11
|
+
this.currentAppState = "";
|
|
12
|
+
this.currentPermalink = "";
|
|
13
|
+
this.currentView = "";
|
|
14
|
+
this.prefix = "";
|
|
15
15
|
this.currentUniqid = undefined;
|
|
16
16
|
this.modelVersion = undefined;
|
|
17
17
|
this.matchWithUniqId(state);
|
|
18
18
|
this.matchWithoutUniqId(state);
|
|
19
|
-
if (state.app.instance.uniqid !==
|
|
19
|
+
if (state.app.instance.uniqid !== "") {
|
|
20
20
|
this.currentUniqid = state.app.instance.uniqid;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -26,14 +26,14 @@ export class PathReader {
|
|
|
26
26
|
if (match) {
|
|
27
27
|
const { permalink, page, view, prefix } = match.params;
|
|
28
28
|
const modelVersion = queryString.parse(window.location.search).version;
|
|
29
|
-
this.prefix = prefix ||
|
|
29
|
+
this.prefix = prefix || "";
|
|
30
30
|
this.currentPermalink = Globals.permalink || permalink;
|
|
31
31
|
this.currentPage = this.getPageNumber(page);
|
|
32
32
|
this.currentSectionId = this.getSectionId();
|
|
33
33
|
this.currentAppState = this.getAppState(page);
|
|
34
34
|
this.currentView = view;
|
|
35
35
|
this.modelVersion =
|
|
36
|
-
typeof modelVersion ===
|
|
36
|
+
typeof modelVersion === "string" ? modelVersion : undefined;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
matchWithUniqId(state) {
|
|
@@ -43,19 +43,19 @@ export class PathReader {
|
|
|
43
43
|
const { permalink, page, uniqid, view, prefix } = match.params;
|
|
44
44
|
const modelVersion = queryString.parse(window.location.search).version;
|
|
45
45
|
this.currentPermalink = Globals.permalink || permalink;
|
|
46
|
-
this.prefix = prefix ||
|
|
46
|
+
this.prefix = prefix || "";
|
|
47
47
|
this.currentPage = this.getPageNumber(page);
|
|
48
48
|
this.currentSectionId = this.getSectionId();
|
|
49
49
|
this.currentUniqid = uniqid;
|
|
50
50
|
this.currentAppState = this.getAppState(page);
|
|
51
51
|
this.currentView = view;
|
|
52
52
|
this.modelVersion =
|
|
53
|
-
typeof modelVersion ===
|
|
53
|
+
typeof modelVersion === "string" ? modelVersion : undefined;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
getAppState(page) {
|
|
57
57
|
const appStatesPages = this.getAppStatesPages();
|
|
58
|
-
let currentAppState =
|
|
58
|
+
let currentAppState = "wizard";
|
|
59
59
|
Object.keys(appStatesPages).forEach((appState) => {
|
|
60
60
|
if (appStatesPages[appState] === page)
|
|
61
61
|
currentAppState = appState;
|
|
@@ -80,8 +80,8 @@ export class PathReader {
|
|
|
80
80
|
const { appStates } = this.getPagination();
|
|
81
81
|
const pageIndex = page - 1;
|
|
82
82
|
let availableSectionsIndex = 0;
|
|
83
|
-
if (appStates[pageIndex] ===
|
|
84
|
-
availableSectionsIndex = pageIndex - appStates.indexOf(
|
|
83
|
+
if (appStates[pageIndex] === "wizard")
|
|
84
|
+
availableSectionsIndex = pageIndex - appStates.indexOf("wizard");
|
|
85
85
|
return availableSections[availableSectionsIndex];
|
|
86
86
|
}
|
|
87
87
|
getPagination() {
|
|
@@ -89,10 +89,10 @@ export class PathReader {
|
|
|
89
89
|
let pages = [];
|
|
90
90
|
let appStates = [];
|
|
91
91
|
availableAppStates.forEach((currentAppState) => {
|
|
92
|
-
if (currentAppState ===
|
|
92
|
+
if (currentAppState === "wizard")
|
|
93
93
|
selectAvailableSections().forEach(() => {
|
|
94
94
|
pages = [...pages, pages.length + 1];
|
|
95
|
-
appStates = [...appStates,
|
|
95
|
+
appStates = [...appStates, "wizard"];
|
|
96
96
|
});
|
|
97
97
|
else if (Object.prototype.hasOwnProperty.call(this.getAppStatesPages(), currentAppState)) {
|
|
98
98
|
pages = [...pages, this.getAppStatesPages()[currentAppState]];
|
|
@@ -121,7 +121,7 @@ export class PathReader {
|
|
|
121
121
|
if (this.prefix)
|
|
122
122
|
path = path.replace(/:prefix\?(\(([^/]*)\))?/gi, this.prefix);
|
|
123
123
|
else
|
|
124
|
-
path = path.replace(/\/:prefix\?(\(([^/]*)\))?/gi,
|
|
124
|
+
path = path.replace(/\/:prefix\?(\(([^/]*)\))?/gi, "");
|
|
125
125
|
path = path.replace(/:page(\(([^/]*)\))?\??/gi, this.getPageUrlName(page));
|
|
126
126
|
if (uniqid !== undefined) {
|
|
127
127
|
path = path.replace(/:uniqid(\(([^/]*)\))?/gi, uniqid);
|
|
@@ -135,7 +135,7 @@ export class PathReader {
|
|
|
135
135
|
delete queryParams.version;
|
|
136
136
|
const cleanQueryString = queryString.stringify(queryParams);
|
|
137
137
|
if (cleanQueryString.length > 0) {
|
|
138
|
-
path += modelVersion === undefined ?
|
|
138
|
+
path += modelVersion === undefined ? "?" : "&";
|
|
139
139
|
path += cleanQueryString;
|
|
140
140
|
}
|
|
141
141
|
return path;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { selectSectionReference, selectOptionReference, } from
|
|
2
|
-
import { selectOptionConditionValue, selectOptionValidatorConditionValue, selectVariableConditionValue, selectVariableValidatorConditionValue, } from
|
|
3
|
-
import { selectOptionInput, selectOptionInputByIndex, } from
|
|
1
|
+
import { selectSectionReference, selectOptionReference, } from "../redux/selectors/references";
|
|
2
|
+
import { selectOptionConditionValue, selectOptionValidatorConditionValue, selectVariableConditionValue, selectVariableValidatorConditionValue, } from "../redux/selectors/conditions";
|
|
3
|
+
import { selectOptionInput, selectOptionInputByIndex, } from "../redux/selectors/inputs";
|
|
4
4
|
export class SectionValidity {
|
|
5
5
|
constructor(sectionId) {
|
|
6
6
|
this.validity = true;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Action } from
|
|
2
|
-
import { ActionsType } from
|
|
3
|
-
import { StateType } from
|
|
1
|
+
import { Action } from "redux";
|
|
2
|
+
import { ActionsType } from "../types/Actions.type";
|
|
3
|
+
import { StateType } from "../types/State.type";
|
|
4
4
|
export declare type CallbackType = () => void;
|
|
5
5
|
export declare class SmartScriptStore {
|
|
6
6
|
static hooks: {
|
|
@@ -20,7 +20,7 @@ export declare class SmartScriptStore {
|
|
|
20
20
|
static getOptionAllInput(id: number): boolean[];
|
|
21
21
|
static getVariableInput(id: number, index?: number): string | number;
|
|
22
22
|
static getVariableAllInput(id: number): (string | number)[];
|
|
23
|
-
static onChange(inputType:
|
|
23
|
+
static onChange(inputType: "option" | "variable", id: number | number[], callback: CallbackType): void;
|
|
24
24
|
static onInit(callback: CallbackType): void;
|
|
25
25
|
static execOnInit(): void;
|
|
26
26
|
static onLoad(callback: CallbackType): void;
|
|
@@ -29,8 +29,8 @@ export declare class SmartScriptStore {
|
|
|
29
29
|
static onVariableChange(id: number | number[], callback: CallbackType): void;
|
|
30
30
|
static updateVariableInput: (id: number, value: string | number, index?: number) => void;
|
|
31
31
|
static updateOptionInput: (id: number, value: boolean, index?: number) => void;
|
|
32
|
-
static updateVariableMeta: (id: number, _meta: ActionsType.References.updateVariableMeta[
|
|
33
|
-
static updateOptionMeta: (id: number, _meta: ActionsType.References.updateOptionMeta[
|
|
32
|
+
static updateVariableMeta: (id: number, _meta: ActionsType.References.updateVariableMeta["meta"]) => void;
|
|
33
|
+
static updateOptionMeta: (id: number, _meta: ActionsType.References.updateOptionMeta["meta"]) => void;
|
|
34
34
|
static hideOption: (id: number, index?: number | undefined) => void;
|
|
35
35
|
static displayOption: (id: number, index?: number | undefined) => void;
|
|
36
36
|
static hideVariable: (id: number, index?: number | undefined) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { updateOptionAction, updateVariableAction, } from
|
|
2
|
-
import { updateOptionMetaAction, updateVariableMetaAction, } from
|
|
3
|
-
import { updateSmartscriptOptionHiddenAction, updateSmartscriptVariableHiddenAction, } from
|
|
1
|
+
import { updateOptionAction, updateVariableAction, } from "../redux/actions/inputs";
|
|
2
|
+
import { updateOptionMetaAction, updateVariableMetaAction, } from "../redux/actions/references";
|
|
3
|
+
import { updateSmartscriptOptionHiddenAction, updateSmartscriptVariableHiddenAction, } from "../redux/actions/smartscript";
|
|
4
4
|
export class SmartScriptStore {
|
|
5
5
|
static grabActions() {
|
|
6
6
|
const actions = [...SmartScriptStore.actionsQueue];
|
|
@@ -30,10 +30,10 @@ export class SmartScriptStore {
|
|
|
30
30
|
}
|
|
31
31
|
static getVariableInput(id, index = 0) {
|
|
32
32
|
const value = SmartScriptStore.inputs.variables[id][index];
|
|
33
|
-
if (typeof value ===
|
|
34
|
-
!isNaN(value.replace(
|
|
33
|
+
if (typeof value === "string" &&
|
|
34
|
+
!isNaN(value.replace(",", ".")) &&
|
|
35
35
|
value.trim().length > 0) {
|
|
36
|
-
const result = value.replace(
|
|
36
|
+
const result = value.replace(",", ".").indexOf(".") > -1
|
|
37
37
|
? parseFloat(value)
|
|
38
38
|
: parseInt(value, 10);
|
|
39
39
|
return result;
|
|
@@ -44,10 +44,10 @@ export class SmartScriptStore {
|
|
|
44
44
|
let values = [];
|
|
45
45
|
if (Array.isArray(SmartScriptStore.inputs.variables[id])) {
|
|
46
46
|
values = SmartScriptStore.inputs.variables[id].map((value) => {
|
|
47
|
-
if (typeof value ===
|
|
48
|
-
!isNaN(value.replace(
|
|
47
|
+
if (typeof value === "string" &&
|
|
48
|
+
!isNaN(value.replace(",", ".")) &&
|
|
49
49
|
value.trim().length > 0) {
|
|
50
|
-
const result = value.replace(
|
|
50
|
+
const result = value.replace(",", ".").indexOf(".") > -1
|
|
51
51
|
? parseFloat(value)
|
|
52
52
|
: parseInt(value, 10);
|
|
53
53
|
return result;
|
|
@@ -58,7 +58,7 @@ export class SmartScriptStore {
|
|
|
58
58
|
return values;
|
|
59
59
|
}
|
|
60
60
|
static onChange(inputType, id, callback) {
|
|
61
|
-
const hooks = SmartScriptStore.hooks[inputType ===
|
|
61
|
+
const hooks = SmartScriptStore.hooks[inputType === "option" ? "options" : "variables"];
|
|
62
62
|
if (Array.isArray(id)) {
|
|
63
63
|
id.forEach((_id) => {
|
|
64
64
|
hooks[_id] = [...(hooks[_id] || []), callback];
|
|
@@ -69,7 +69,7 @@ export class SmartScriptStore {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
static onInit(callback) {
|
|
72
|
-
if (typeof SmartScriptStore.hooks.init ===
|
|
72
|
+
if (typeof SmartScriptStore.hooks.init === "undefined")
|
|
73
73
|
SmartScriptStore.hooks.init = [];
|
|
74
74
|
SmartScriptStore.hooks.init.push(callback);
|
|
75
75
|
}
|
|
@@ -82,17 +82,17 @@ export class SmartScriptStore {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
catch (e) {
|
|
85
|
-
console.error(
|
|
85
|
+
console.error("SmartScript (onInit) error: ", e.message);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
static onLoad(callback) {
|
|
89
89
|
try {
|
|
90
|
-
if (typeof SmartScriptStore.hooks.load ===
|
|
90
|
+
if (typeof SmartScriptStore.hooks.load === "undefined")
|
|
91
91
|
SmartScriptStore.hooks.load = [];
|
|
92
92
|
SmartScriptStore.hooks.load.push(callback);
|
|
93
93
|
}
|
|
94
94
|
catch (e) {
|
|
95
|
-
console.error(
|
|
95
|
+
console.error("SmartScript (onLoad) error: ", e.message);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
static execOnLoad() {
|
|
@@ -103,10 +103,10 @@ export class SmartScriptStore {
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
static onOptionChange(id, callback) {
|
|
106
|
-
return SmartScriptStore.onChange(
|
|
106
|
+
return SmartScriptStore.onChange("option", id, callback);
|
|
107
107
|
}
|
|
108
108
|
static onVariableChange(id, callback) {
|
|
109
|
-
return SmartScriptStore.onChange(
|
|
109
|
+
return SmartScriptStore.onChange("variable", id, callback);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
SmartScriptStore.hooks = {
|
|
@@ -125,7 +125,7 @@ SmartScriptStore.updateVariableInput = (id, value, index = 0) => {
|
|
|
125
125
|
return;
|
|
126
126
|
}
|
|
127
127
|
if (((_a = SmartScriptStore.inputs.variables[id]) === null || _a === void 0 ? void 0 : _a[index]) !== value) {
|
|
128
|
-
if (typeof SmartScriptStore.inputs.variables[id] ===
|
|
128
|
+
if (typeof SmartScriptStore.inputs.variables[id] === "undefined")
|
|
129
129
|
SmartScriptStore.inputs.variables[id] = [];
|
|
130
130
|
SmartScriptStore.inputs.variables[id][index] = value;
|
|
131
131
|
SmartScriptStore.actionsQueue.push(updateVariableAction(id, value, index));
|
|
@@ -138,7 +138,7 @@ SmartScriptStore.updateOptionInput = (id, value, index = 0) => {
|
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
140
140
|
if (((_b = (_a = SmartScriptStore.inputs) === null || _a === void 0 ? void 0 : _a.options[id]) === null || _b === void 0 ? void 0 : _b[index]) !== value) {
|
|
141
|
-
if (typeof SmartScriptStore.inputs.options[id] ===
|
|
141
|
+
if (typeof SmartScriptStore.inputs.options[id] === "undefined")
|
|
142
142
|
SmartScriptStore.inputs.options[id] = [];
|
|
143
143
|
SmartScriptStore.inputs.options[id][index] = value;
|
|
144
144
|
SmartScriptStore.actionsQueue.push(updateOptionAction(id, value, index));
|
|
@@ -151,15 +151,15 @@ SmartScriptStore.updateVariableMeta = (id, _meta) => {
|
|
|
151
151
|
return;
|
|
152
152
|
}
|
|
153
153
|
const meta = Object.assign({}, _meta);
|
|
154
|
-
if (typeof meta.id !==
|
|
154
|
+
if (typeof meta.id !== "undefined")
|
|
155
155
|
delete meta.id;
|
|
156
|
-
if (typeof meta.type !==
|
|
156
|
+
if (typeof meta.type !== "undefined")
|
|
157
157
|
delete meta.type;
|
|
158
|
-
if (typeof meta.conditions !==
|
|
158
|
+
if (typeof meta.conditions !== "undefined")
|
|
159
159
|
delete meta.conditions;
|
|
160
|
-
if (typeof meta.prefillings !==
|
|
160
|
+
if (typeof meta.prefillings !== "undefined")
|
|
161
161
|
delete meta.prefillings;
|
|
162
|
-
if (typeof ((_a = meta.validator) === null || _a === void 0 ? void 0 : _a.conditions) !==
|
|
162
|
+
if (typeof ((_a = meta.validator) === null || _a === void 0 ? void 0 : _a.conditions) !== "undefined")
|
|
163
163
|
delete meta.validator.conditions;
|
|
164
164
|
SmartScriptStore.actionsQueue.push(updateVariableMetaAction(id, meta));
|
|
165
165
|
};
|
|
@@ -170,17 +170,17 @@ SmartScriptStore.updateOptionMeta = (id, _meta) => {
|
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
172
|
const meta = Object.assign({}, _meta);
|
|
173
|
-
if (typeof meta.id !==
|
|
173
|
+
if (typeof meta.id !== "undefined")
|
|
174
174
|
delete meta.id;
|
|
175
|
-
if (typeof meta.type !==
|
|
175
|
+
if (typeof meta.type !== "undefined")
|
|
176
176
|
delete meta.type;
|
|
177
|
-
if (typeof meta.conditions !==
|
|
177
|
+
if (typeof meta.conditions !== "undefined")
|
|
178
178
|
delete meta.conditions;
|
|
179
|
-
if (typeof meta.repeatOption !==
|
|
179
|
+
if (typeof meta.repeatOption !== "undefined")
|
|
180
180
|
delete meta.repeatOption;
|
|
181
|
-
if (typeof ((_a = meta.validator) === null || _a === void 0 ? void 0 : _a.conditions) !==
|
|
181
|
+
if (typeof ((_a = meta.validator) === null || _a === void 0 ? void 0 : _a.conditions) !== "undefined")
|
|
182
182
|
delete meta.validator.conditions;
|
|
183
|
-
if (typeof ((_b = meta.multiple) === null || _b === void 0 ? void 0 : _b.enabled) !==
|
|
183
|
+
if (typeof ((_b = meta.multiple) === null || _b === void 0 ? void 0 : _b.enabled) !== "undefined")
|
|
184
184
|
delete meta.multiple.enabled;
|
|
185
185
|
SmartScriptStore.actionsQueue.push(updateOptionMetaAction(id, meta));
|
|
186
186
|
};
|
|
@@ -189,7 +189,7 @@ SmartScriptStore.hideOption = (id, index) => {
|
|
|
189
189
|
console.error(`SmartScript error: trying to hide undefined option ${id}`);
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
|
-
if (typeof index ===
|
|
192
|
+
if (typeof index === "undefined") {
|
|
193
193
|
SmartScriptStore.updateOptionMeta(id, { hidden: true });
|
|
194
194
|
SmartScriptStore.inputs.options[id].forEach((_, _index) => {
|
|
195
195
|
SmartScriptStore.actionsQueue.push(updateSmartscriptOptionHiddenAction(id, _index, true));
|
|
@@ -204,7 +204,7 @@ SmartScriptStore.displayOption = (id, index) => {
|
|
|
204
204
|
console.error(`SmartScript error: trying to display undefined option ${id}`);
|
|
205
205
|
return;
|
|
206
206
|
}
|
|
207
|
-
if (typeof index ===
|
|
207
|
+
if (typeof index === "undefined") {
|
|
208
208
|
SmartScriptStore.updateOptionMeta(id, { hidden: false });
|
|
209
209
|
SmartScriptStore.inputs.options[id].forEach((_, _index) => {
|
|
210
210
|
SmartScriptStore.actionsQueue.push(updateSmartscriptOptionHiddenAction(id, _index, false));
|
|
@@ -219,7 +219,7 @@ SmartScriptStore.hideVariable = (id, index) => {
|
|
|
219
219
|
console.error(`SmartScript error: trying to hide undefined variable ${id}`);
|
|
220
220
|
return;
|
|
221
221
|
}
|
|
222
|
-
if (typeof index ===
|
|
222
|
+
if (typeof index === "undefined") {
|
|
223
223
|
SmartScriptStore.updateVariableMeta(id, { hidden: true });
|
|
224
224
|
SmartScriptStore.inputs.variables[id].forEach((_, _index) => {
|
|
225
225
|
SmartScriptStore.actionsQueue.push(updateSmartscriptVariableHiddenAction(id, _index, true));
|
|
@@ -234,7 +234,7 @@ SmartScriptStore.displayVariable = (id, index) => {
|
|
|
234
234
|
console.error(`SmartScript error: trying to display undefined variable ${id}`);
|
|
235
235
|
return;
|
|
236
236
|
}
|
|
237
|
-
if (typeof index ===
|
|
237
|
+
if (typeof index === "undefined") {
|
|
238
238
|
SmartScriptStore.updateVariableMeta(id, { hidden: false });
|
|
239
239
|
SmartScriptStore.inputs.variables[id].forEach((_, _index) => {
|
|
240
240
|
SmartScriptStore.actionsQueue.push(updateSmartscriptVariableHiddenAction(id, _index, false));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ModelV3 } from
|
|
1
|
+
import type { ModelV3 } from "@legalplace/models-v3-types";
|
|
2
2
|
export declare const testModel: {
|
|
3
3
|
meta: {
|
|
4
|
-
fetchStatus:
|
|
4
|
+
fetchStatus: "succeeded" | "waiting" | "failed";
|
|
5
5
|
id: number;
|
|
6
6
|
permalink: string;
|
|
7
7
|
prefix: string;
|