@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,4 +1,4 @@
|
|
|
1
|
-
import { StateType } from
|
|
1
|
+
import { StateType } from "../types/State.type";
|
|
2
2
|
|
|
3
3
|
export type OVC_TYPE = {
|
|
4
4
|
options: {
|
|
@@ -55,7 +55,7 @@ export class IntputsInitiator {
|
|
|
55
55
|
if (!this.ovc.options[rootOptionId]) {
|
|
56
56
|
// root Option reference
|
|
57
57
|
const rootReference = this.references.options[rootOptionId];
|
|
58
|
-
if (rootReference.meta.type ===
|
|
58
|
+
if (rootReference.meta.type === "static") {
|
|
59
59
|
this.ovc.options[rootOptionId] = new Array(inputs.length).fill(
|
|
60
60
|
true
|
|
61
61
|
);
|
|
@@ -82,12 +82,12 @@ export class IntputsInitiator {
|
|
|
82
82
|
) {
|
|
83
83
|
if (
|
|
84
84
|
[
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
"static",
|
|
86
|
+
"hidden",
|
|
87
|
+
"brut-text",
|
|
88
|
+
"repeated",
|
|
89
|
+
"box",
|
|
90
|
+
"separator",
|
|
91
91
|
].includes(option.meta.type)
|
|
92
92
|
) {
|
|
93
93
|
values = new Array(this.ovc.options[optionId].length).fill(true);
|
|
@@ -96,12 +96,12 @@ export class IntputsInitiator {
|
|
|
96
96
|
}
|
|
97
97
|
} else if (
|
|
98
98
|
[
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
99
|
+
"static",
|
|
100
|
+
"hidden",
|
|
101
|
+
"brut-text",
|
|
102
|
+
"repeated",
|
|
103
|
+
"box",
|
|
104
|
+
"separator",
|
|
105
105
|
].includes(option.meta.type)
|
|
106
106
|
) {
|
|
107
107
|
values = [true];
|
|
@@ -119,14 +119,14 @@ export class IntputsInitiator {
|
|
|
119
119
|
for (let i = 0; i < variablesIds.length; i += 1) {
|
|
120
120
|
const variableId = variablesIds[i];
|
|
121
121
|
|
|
122
|
-
let values: (string | number)[] = [
|
|
122
|
+
let values: (string | number)[] = [""];
|
|
123
123
|
if (
|
|
124
124
|
this.ovc &&
|
|
125
125
|
Object.prototype.hasOwnProperty.call(this.ovc.variables, variableId)
|
|
126
126
|
) {
|
|
127
127
|
values = this.ovc.variables[variableId];
|
|
128
128
|
} else {
|
|
129
|
-
const defaultValue =
|
|
129
|
+
const defaultValue = "";
|
|
130
130
|
values = [defaultValue];
|
|
131
131
|
}
|
|
132
132
|
|
package/src/libs/NumAuto.ts
CHANGED
package/src/libs/OvcConverter.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { StateType } from
|
|
1
|
+
import { StateType } from "../types/State.type";
|
|
2
2
|
import {
|
|
3
3
|
selectOptionParents,
|
|
4
4
|
selectOptionReference,
|
|
5
5
|
selectVariableParents,
|
|
6
|
-
} from
|
|
7
|
-
import { selectOptionInput } from
|
|
6
|
+
} from "../redux/selectors/references";
|
|
7
|
+
import { selectOptionInput } from "../redux/selectors/inputs";
|
|
8
8
|
|
|
9
9
|
export interface OvcType {
|
|
10
10
|
o: {
|
|
@@ -28,10 +28,10 @@ class _OvcConverter {
|
|
|
28
28
|
variables: {},
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
if (typeof ovc !==
|
|
31
|
+
if (typeof ovc !== "object") return inputs;
|
|
32
32
|
|
|
33
33
|
// Reading options
|
|
34
|
-
if (typeof ovc.o ===
|
|
34
|
+
if (typeof ovc.o === "object") {
|
|
35
35
|
Object.keys(ovc.o).forEach((id) => {
|
|
36
36
|
const currentOption = ovc.o[id];
|
|
37
37
|
|
|
@@ -50,8 +50,8 @@ class _OvcConverter {
|
|
|
50
50
|
};
|
|
51
51
|
currentOption.forEach((childId, index) => {
|
|
52
52
|
const sanitizedId =
|
|
53
|
-
typeof childId ===
|
|
54
|
-
? childId.split(
|
|
53
|
+
typeof childId === "string" && childId.split("_").length > 0
|
|
54
|
+
? childId.split("_")[0]
|
|
55
55
|
: childId;
|
|
56
56
|
|
|
57
57
|
// Making sure the input exist
|
|
@@ -61,7 +61,7 @@ class _OvcConverter {
|
|
|
61
61
|
|
|
62
62
|
// Making sure the childId is not empty
|
|
63
63
|
if (
|
|
64
|
-
typeof sanitizedId ===
|
|
64
|
+
typeof sanitizedId === "string" &&
|
|
65
65
|
sanitizedId.trim().length === 0
|
|
66
66
|
) {
|
|
67
67
|
return;
|
|
@@ -90,7 +90,7 @@ class _OvcConverter {
|
|
|
90
90
|
});
|
|
91
91
|
} else {
|
|
92
92
|
if (
|
|
93
|
-
typeof currentOption ===
|
|
93
|
+
typeof currentOption === "string" &&
|
|
94
94
|
currentOption.trim().length === 0
|
|
95
95
|
)
|
|
96
96
|
return;
|
|
@@ -100,10 +100,10 @@ class _OvcConverter {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
// Reading checkboxes
|
|
103
|
-
if (typeof ovc.c ===
|
|
103
|
+
if (typeof ovc.c === "object") {
|
|
104
104
|
Object.keys(ovc.c).forEach((id) => {
|
|
105
105
|
const currentCheckbox = ovc.c[id];
|
|
106
|
-
if (typeof id ===
|
|
106
|
+
if (typeof id === "string" && id.trim().length === 0) return;
|
|
107
107
|
// If it's a multiple
|
|
108
108
|
if (Array.isArray(currentCheckbox)) {
|
|
109
109
|
inputs.options[id] = currentCheckbox;
|
|
@@ -114,7 +114,7 @@ class _OvcConverter {
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
// Reading variables
|
|
117
|
-
if (typeof ovc.v ===
|
|
117
|
+
if (typeof ovc.v === "object") {
|
|
118
118
|
Object.keys(ovc.v).forEach((id) => {
|
|
119
119
|
const currentVariable = ovc.v[id];
|
|
120
120
|
|
|
@@ -130,7 +130,7 @@ class _OvcConverter {
|
|
|
130
130
|
if (currentVariable.length < occurences) {
|
|
131
131
|
inputs.variables[id] = [
|
|
132
132
|
...currentVariable,
|
|
133
|
-
...Array(occurences - currentVariable.length).fill(
|
|
133
|
+
...Array(occurences - currentVariable.length).fill(""),
|
|
134
134
|
];
|
|
135
135
|
}
|
|
136
136
|
}
|
|
@@ -170,9 +170,9 @@ class _OvcConverter {
|
|
|
170
170
|
const occurences = selectOptionInput(rootOptionId).length;
|
|
171
171
|
|
|
172
172
|
// If it's not a radio nor a checkbox we stop here
|
|
173
|
-
if (![
|
|
173
|
+
if (!["radio", "checkbox"].includes(optionReference.meta.type)) {
|
|
174
174
|
if (values.length > 1 && rootOptionId === id) {
|
|
175
|
-
ovc.o[id] = new Array(values.length).fill(
|
|
175
|
+
ovc.o[id] = new Array(values.length).fill("");
|
|
176
176
|
}
|
|
177
177
|
return;
|
|
178
178
|
}
|
|
@@ -183,7 +183,7 @@ class _OvcConverter {
|
|
|
183
183
|
.filter(<T>(value: T | null): value is T => value !== null);
|
|
184
184
|
|
|
185
185
|
// Checking whether it's a radio or a checkbox
|
|
186
|
-
const isCheckbox = optionReference.meta.type ===
|
|
186
|
+
const isCheckbox = optionReference.meta.type === "checkbox";
|
|
187
187
|
|
|
188
188
|
if (isCheckbox === true) {
|
|
189
189
|
if (isMultiple === true) {
|
|
@@ -193,7 +193,7 @@ class _OvcConverter {
|
|
|
193
193
|
}
|
|
194
194
|
} else if (isMultiple === true) {
|
|
195
195
|
if (!Object.prototype.hasOwnProperty.call(ovc.o, parentId)) {
|
|
196
|
-
ovc.o[parentId] = new Array(occurences).fill(
|
|
196
|
+
ovc.o[parentId] = new Array(occurences).fill("");
|
|
197
197
|
}
|
|
198
198
|
trueIndexes.forEach((index) => {
|
|
199
199
|
const currentOption = ovc.o[parentId];
|
|
@@ -224,7 +224,7 @@ class _OvcConverter {
|
|
|
224
224
|
|
|
225
225
|
if (isMultiple === true) {
|
|
226
226
|
if (!Object.prototype.hasOwnProperty.call(ovc.o, id)) {
|
|
227
|
-
ovc.v[id] = new Array(occurences).fill(
|
|
227
|
+
ovc.v[id] = new Array(occurences).fill("");
|
|
228
228
|
}
|
|
229
229
|
ovc.v[id] = values;
|
|
230
230
|
} else {
|
|
@@ -236,8 +236,8 @@ class _OvcConverter {
|
|
|
236
236
|
}
|
|
237
237
|
|
|
238
238
|
public isOvc(_obj: StateType.Inputs | OvcType) {
|
|
239
|
-
if (typeof _obj !==
|
|
240
|
-
const ovcKeys = [
|
|
239
|
+
if (typeof _obj !== "object" || _obj === null) return false;
|
|
240
|
+
const ovcKeys = ["o", "v", "c"];
|
|
241
241
|
const foundKeys = Object.keys(_obj)
|
|
242
242
|
.map((key): number => (ovcKeys.includes(key) ? 1 : 0))
|
|
243
243
|
.reduce((a, b) => a + b, 0);
|
|
@@ -246,8 +246,8 @@ class _OvcConverter {
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
public isOptionsVariables(_obj: StateType.Inputs | OvcType) {
|
|
249
|
-
if (typeof _obj !==
|
|
250
|
-
const optionsVariablesKeys = [
|
|
249
|
+
if (typeof _obj !== "object" || _obj === null) return false;
|
|
250
|
+
const optionsVariablesKeys = ["options", "variables"];
|
|
251
251
|
const foundKeys = Object.keys(_obj)
|
|
252
252
|
.map((key): number => (optionsVariablesKeys.includes(key) ? 1 : 0))
|
|
253
253
|
.reduce((a, b) => a + b, 0);
|
|
@@ -255,20 +255,20 @@ class _OvcConverter {
|
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
private pushStaticChildren(
|
|
258
|
-
inputOptions: StateType.Inputs[
|
|
258
|
+
inputOptions: StateType.Inputs["options"],
|
|
259
259
|
id: number | string,
|
|
260
260
|
occurences: number,
|
|
261
261
|
references: StateType.References
|
|
262
262
|
) {
|
|
263
263
|
const result = { ...inputOptions };
|
|
264
|
-
const intId = typeof id ===
|
|
264
|
+
const intId = typeof id === "number" ? id : parseInt(id, 10);
|
|
265
265
|
|
|
266
266
|
// Getting children options and variables
|
|
267
267
|
const { options } = references.relations.options[intId].children;
|
|
268
268
|
|
|
269
269
|
// Getting static children
|
|
270
270
|
const staticOptions = options.filter(
|
|
271
|
-
(childId) => references.options[childId].meta.type ===
|
|
271
|
+
(childId) => references.options[childId].meta.type === "static"
|
|
272
272
|
);
|
|
273
273
|
|
|
274
274
|
staticOptions.forEach((childId) => {
|
package/src/libs/PathReader.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { createMatchSelector, RouterState } from
|
|
2
|
-
import queryString from
|
|
3
|
-
import { getConfig } from
|
|
4
|
-
import { StateType } from
|
|
5
|
-
import { getPluginsPageAppStates } from
|
|
1
|
+
import { createMatchSelector, RouterState } from "connected-react-router";
|
|
2
|
+
import queryString from "query-string";
|
|
3
|
+
import { getConfig } from "../config";
|
|
4
|
+
import { StateType } from "../types/State.type";
|
|
5
|
+
import { getPluginsPageAppStates } from "../PluginLoader";
|
|
6
6
|
import {
|
|
7
7
|
selectAvailableSections,
|
|
8
8
|
selectAvailableAppStates,
|
|
9
|
-
} from
|
|
10
|
-
import Globals from
|
|
9
|
+
} from "../redux/selectors/app";
|
|
10
|
+
import Globals from "../Globals";
|
|
11
11
|
|
|
12
12
|
export class PathReader {
|
|
13
13
|
currentPage = 1;
|
|
14
14
|
|
|
15
15
|
currentSectionId = 1;
|
|
16
16
|
|
|
17
|
-
currentAppState =
|
|
17
|
+
currentAppState = "";
|
|
18
18
|
|
|
19
|
-
currentPermalink =
|
|
19
|
+
currentPermalink = "";
|
|
20
20
|
|
|
21
|
-
currentView =
|
|
21
|
+
currentView = "";
|
|
22
22
|
|
|
23
|
-
prefix =
|
|
23
|
+
prefix = "";
|
|
24
24
|
|
|
25
25
|
currentUniqid: string | undefined = undefined;
|
|
26
26
|
|
|
@@ -31,7 +31,7 @@ export class PathReader {
|
|
|
31
31
|
this.matchWithoutUniqId(state);
|
|
32
32
|
|
|
33
33
|
// Setting current id from state
|
|
34
|
-
if (state.app.instance.uniqid !==
|
|
34
|
+
if (state.app.instance.uniqid !== "") {
|
|
35
35
|
this.currentUniqid = state.app.instance.uniqid;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -58,14 +58,14 @@ export class PathReader {
|
|
|
58
58
|
if (match) {
|
|
59
59
|
const { permalink, page, view, prefix } = match.params;
|
|
60
60
|
const modelVersion = queryString.parse(window.location.search).version;
|
|
61
|
-
this.prefix = prefix ||
|
|
61
|
+
this.prefix = prefix || "";
|
|
62
62
|
this.currentPermalink = Globals.permalink || permalink;
|
|
63
63
|
this.currentPage = this.getPageNumber(page);
|
|
64
64
|
this.currentSectionId = this.getSectionId();
|
|
65
65
|
this.currentAppState = this.getAppState(page);
|
|
66
66
|
this.currentView = view;
|
|
67
67
|
this.modelVersion =
|
|
68
|
-
typeof modelVersion ===
|
|
68
|
+
typeof modelVersion === "string" ? modelVersion : undefined;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -93,14 +93,14 @@ export class PathReader {
|
|
|
93
93
|
const { permalink, page, uniqid, view, prefix } = match.params;
|
|
94
94
|
const modelVersion = queryString.parse(window.location.search).version;
|
|
95
95
|
this.currentPermalink = Globals.permalink || permalink;
|
|
96
|
-
this.prefix = prefix ||
|
|
96
|
+
this.prefix = prefix || "";
|
|
97
97
|
this.currentPage = this.getPageNumber(page);
|
|
98
98
|
this.currentSectionId = this.getSectionId();
|
|
99
99
|
this.currentUniqid = uniqid;
|
|
100
100
|
this.currentAppState = this.getAppState(page);
|
|
101
101
|
this.currentView = view;
|
|
102
102
|
this.modelVersion =
|
|
103
|
-
typeof modelVersion ===
|
|
103
|
+
typeof modelVersion === "string" ? modelVersion : undefined;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
|
@@ -114,7 +114,7 @@ export class PathReader {
|
|
|
114
114
|
// Initiating current app State with wizard
|
|
115
115
|
// so that we always fall back to it in case
|
|
116
116
|
// we don't find the app state
|
|
117
|
-
let currentAppState =
|
|
117
|
+
let currentAppState = "wizard";
|
|
118
118
|
|
|
119
119
|
// Looking for the app state
|
|
120
120
|
Object.keys(appStatesPages).forEach((appState) => {
|
|
@@ -159,8 +159,8 @@ export class PathReader {
|
|
|
159
159
|
|
|
160
160
|
let availableSectionsIndex = 0;
|
|
161
161
|
|
|
162
|
-
if (appStates[pageIndex] ===
|
|
163
|
-
availableSectionsIndex = pageIndex - appStates.indexOf(
|
|
162
|
+
if (appStates[pageIndex] === "wizard")
|
|
163
|
+
availableSectionsIndex = pageIndex - appStates.indexOf("wizard");
|
|
164
164
|
|
|
165
165
|
return availableSections[availableSectionsIndex];
|
|
166
166
|
}
|
|
@@ -175,10 +175,10 @@ export class PathReader {
|
|
|
175
175
|
let pages: (string | number)[] = [];
|
|
176
176
|
let appStates: string[] = [];
|
|
177
177
|
availableAppStates.forEach((currentAppState) => {
|
|
178
|
-
if (currentAppState ===
|
|
178
|
+
if (currentAppState === "wizard")
|
|
179
179
|
selectAvailableSections().forEach(() => {
|
|
180
180
|
pages = [...pages, pages.length + 1];
|
|
181
|
-
appStates = [...appStates,
|
|
181
|
+
appStates = [...appStates, "wizard"];
|
|
182
182
|
});
|
|
183
183
|
else if (
|
|
184
184
|
Object.prototype.hasOwnProperty.call(
|
|
@@ -241,7 +241,7 @@ export class PathReader {
|
|
|
241
241
|
// Replacing Permalink
|
|
242
242
|
if (this.prefix)
|
|
243
243
|
path = path.replace(/:prefix\?(\(([^/]*)\))?/gi, this.prefix);
|
|
244
|
-
else path = path.replace(/\/:prefix\?(\(([^/]*)\))?/gi,
|
|
244
|
+
else path = path.replace(/\/:prefix\?(\(([^/]*)\))?/gi, "");
|
|
245
245
|
// Replacing page
|
|
246
246
|
path = path.replace(/:page(\(([^/]*)\))?\??/gi, this.getPageUrlName(page));
|
|
247
247
|
|
|
@@ -263,7 +263,7 @@ export class PathReader {
|
|
|
263
263
|
if (queryParams.version !== undefined) delete queryParams.version;
|
|
264
264
|
const cleanQueryString = queryString.stringify(queryParams);
|
|
265
265
|
if (cleanQueryString.length > 0) {
|
|
266
|
-
path += modelVersion === undefined ?
|
|
266
|
+
path += modelVersion === undefined ? "?" : "&";
|
|
267
267
|
path += cleanQueryString;
|
|
268
268
|
}
|
|
269
269
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
selectSectionReference,
|
|
3
3
|
selectOptionReference,
|
|
4
|
-
} from
|
|
4
|
+
} from "../redux/selectors/references";
|
|
5
5
|
import {
|
|
6
6
|
selectOptionConditionValue,
|
|
7
7
|
selectOptionValidatorConditionValue,
|
|
8
8
|
selectVariableConditionValue,
|
|
9
9
|
selectVariableValidatorConditionValue,
|
|
10
|
-
} from
|
|
10
|
+
} from "../redux/selectors/conditions";
|
|
11
11
|
import {
|
|
12
12
|
selectOptionInput,
|
|
13
13
|
selectOptionInputByIndex,
|
|
14
|
-
} from
|
|
14
|
+
} from "../redux/selectors/inputs";
|
|
15
15
|
|
|
16
16
|
export class SectionValidity {
|
|
17
17
|
validity = true;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Action } from
|
|
1
|
+
import { Action } from "redux";
|
|
2
2
|
import {
|
|
3
3
|
updateOptionAction,
|
|
4
4
|
updateVariableAction,
|
|
5
|
-
} from
|
|
5
|
+
} from "../redux/actions/inputs";
|
|
6
6
|
import {
|
|
7
7
|
updateOptionMetaAction,
|
|
8
8
|
updateVariableMetaAction,
|
|
9
|
-
} from
|
|
9
|
+
} from "../redux/actions/references";
|
|
10
10
|
import {
|
|
11
11
|
updateSmartscriptOptionHiddenAction,
|
|
12
12
|
updateSmartscriptVariableHiddenAction,
|
|
13
|
-
} from
|
|
14
|
-
import { ActionsType } from
|
|
15
|
-
import { StateType } from
|
|
13
|
+
} from "../redux/actions/smartscript";
|
|
14
|
+
import { ActionsType } from "../types/Actions.type";
|
|
15
|
+
import { StateType } from "../types/State.type";
|
|
16
16
|
|
|
17
17
|
export type CallbackType = () => void;
|
|
18
18
|
|
|
@@ -44,7 +44,7 @@ export class SmartScriptStore {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
static get triggers() {
|
|
47
|
-
const triggers: StateType.SmartScript[
|
|
47
|
+
const triggers: StateType.SmartScript["triggers"] = {
|
|
48
48
|
options: [],
|
|
49
49
|
variables: [],
|
|
50
50
|
};
|
|
@@ -89,13 +89,13 @@ export class SmartScriptStore {
|
|
|
89
89
|
|
|
90
90
|
// If value is a string but contains a number we parse it
|
|
91
91
|
if (
|
|
92
|
-
typeof value ===
|
|
92
|
+
typeof value === "string" &&
|
|
93
93
|
// eslint-disable-next-line no-restricted-globals
|
|
94
|
-
!isNaN(value.replace(
|
|
94
|
+
!isNaN(value.replace(",", ".") as any) &&
|
|
95
95
|
value.trim().length > 0
|
|
96
96
|
) {
|
|
97
97
|
const result =
|
|
98
|
-
value.replace(
|
|
98
|
+
value.replace(",", ".").indexOf(".") > -1
|
|
99
99
|
? parseFloat(value)
|
|
100
100
|
: parseInt(value, 10);
|
|
101
101
|
return result;
|
|
@@ -115,13 +115,13 @@ export class SmartScriptStore {
|
|
|
115
115
|
values = SmartScriptStore.inputs.variables[id].map((value) => {
|
|
116
116
|
// If value is a string but contains a number we parse it
|
|
117
117
|
if (
|
|
118
|
-
typeof value ===
|
|
118
|
+
typeof value === "string" &&
|
|
119
119
|
// eslint-disable-next-line no-restricted-globals
|
|
120
|
-
!isNaN(value.replace(
|
|
120
|
+
!isNaN(value.replace(",", ".") as any) &&
|
|
121
121
|
value.trim().length > 0
|
|
122
122
|
) {
|
|
123
123
|
const result =
|
|
124
|
-
value.replace(
|
|
124
|
+
value.replace(",", ".").indexOf(".") > -1
|
|
125
125
|
? parseFloat(value)
|
|
126
126
|
: parseInt(value, 10);
|
|
127
127
|
return result;
|
|
@@ -141,12 +141,12 @@ export class SmartScriptStore {
|
|
|
141
141
|
* @param callback
|
|
142
142
|
*/
|
|
143
143
|
static onChange(
|
|
144
|
-
inputType:
|
|
144
|
+
inputType: "option" | "variable",
|
|
145
145
|
id: number | number[],
|
|
146
146
|
callback: CallbackType
|
|
147
147
|
) {
|
|
148
148
|
const hooks =
|
|
149
|
-
SmartScriptStore.hooks[inputType ===
|
|
149
|
+
SmartScriptStore.hooks[inputType === "option" ? "options" : "variables"];
|
|
150
150
|
|
|
151
151
|
if (Array.isArray(id)) {
|
|
152
152
|
id.forEach((_id) => {
|
|
@@ -162,7 +162,7 @@ export class SmartScriptStore {
|
|
|
162
162
|
* @param callback
|
|
163
163
|
*/
|
|
164
164
|
static onInit(callback: CallbackType) {
|
|
165
|
-
if (typeof SmartScriptStore.hooks.init ===
|
|
165
|
+
if (typeof SmartScriptStore.hooks.init === "undefined")
|
|
166
166
|
SmartScriptStore.hooks.init = [];
|
|
167
167
|
SmartScriptStore.hooks.init.push(callback);
|
|
168
168
|
}
|
|
@@ -180,7 +180,7 @@ export class SmartScriptStore {
|
|
|
180
180
|
}
|
|
181
181
|
} catch (e) {
|
|
182
182
|
// eslint-disable-next-line no-console
|
|
183
|
-
console.error(
|
|
183
|
+
console.error("SmartScript (onInit) error: ", e.message);
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
|
|
@@ -190,12 +190,12 @@ export class SmartScriptStore {
|
|
|
190
190
|
*/
|
|
191
191
|
static onLoad(callback: CallbackType) {
|
|
192
192
|
try {
|
|
193
|
-
if (typeof SmartScriptStore.hooks.load ===
|
|
193
|
+
if (typeof SmartScriptStore.hooks.load === "undefined")
|
|
194
194
|
SmartScriptStore.hooks.load = [];
|
|
195
195
|
SmartScriptStore.hooks.load.push(callback);
|
|
196
196
|
} catch (e) {
|
|
197
197
|
// eslint-disable-next-line no-console
|
|
198
|
-
console.error(
|
|
198
|
+
console.error("SmartScript (onLoad) error: ", e.message);
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
|
|
@@ -217,7 +217,7 @@ export class SmartScriptStore {
|
|
|
217
217
|
* @param callback
|
|
218
218
|
*/
|
|
219
219
|
static onOptionChange(id: number | number[], callback: CallbackType) {
|
|
220
|
-
return SmartScriptStore.onChange(
|
|
220
|
+
return SmartScriptStore.onChange("option", id, callback);
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
/**
|
|
@@ -226,7 +226,7 @@ export class SmartScriptStore {
|
|
|
226
226
|
* @param callback
|
|
227
227
|
*/
|
|
228
228
|
static onVariableChange(id: number | number[], callback: CallbackType) {
|
|
229
|
-
return SmartScriptStore.onChange(
|
|
229
|
+
return SmartScriptStore.onChange("variable", id, callback);
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
static updateVariableInput = (
|
|
@@ -249,7 +249,7 @@ export class SmartScriptStore {
|
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
if (SmartScriptStore.inputs.variables[id]?.[index] !== value) {
|
|
252
|
-
if (typeof SmartScriptStore.inputs.variables[id] ===
|
|
252
|
+
if (typeof SmartScriptStore.inputs.variables[id] === "undefined")
|
|
253
253
|
SmartScriptStore.inputs.variables[id] = [];
|
|
254
254
|
SmartScriptStore.inputs.variables[id][index] = value;
|
|
255
255
|
SmartScriptStore.actionsQueue.push(
|
|
@@ -271,7 +271,7 @@ export class SmartScriptStore {
|
|
|
271
271
|
}
|
|
272
272
|
|
|
273
273
|
if (SmartScriptStore.inputs?.options[id]?.[index] !== value) {
|
|
274
|
-
if (typeof SmartScriptStore.inputs.options[id] ===
|
|
274
|
+
if (typeof SmartScriptStore.inputs.options[id] === "undefined")
|
|
275
275
|
SmartScriptStore.inputs.options[id] = [];
|
|
276
276
|
SmartScriptStore.inputs.options[id][index] = value;
|
|
277
277
|
SmartScriptStore.actionsQueue.push(updateOptionAction(id, value, index));
|
|
@@ -285,7 +285,7 @@ export class SmartScriptStore {
|
|
|
285
285
|
*/
|
|
286
286
|
static updateVariableMeta = (
|
|
287
287
|
id: number,
|
|
288
|
-
_meta: ActionsType.References.updateVariableMeta[
|
|
288
|
+
_meta: ActionsType.References.updateVariableMeta["meta"]
|
|
289
289
|
) => {
|
|
290
290
|
// Making sure variable exists
|
|
291
291
|
if (
|
|
@@ -305,15 +305,15 @@ export class SmartScriptStore {
|
|
|
305
305
|
|
|
306
306
|
// Deleting all banned meta params
|
|
307
307
|
// @ts-expect-error: Meta should not have banned prop
|
|
308
|
-
if (typeof meta.id !==
|
|
308
|
+
if (typeof meta.id !== "undefined") delete meta.id;
|
|
309
309
|
// @ts-expect-error: Meta should not have banned prop
|
|
310
|
-
if (typeof meta.type !==
|
|
310
|
+
if (typeof meta.type !== "undefined") delete meta.type;
|
|
311
311
|
// @ts-expect-error: Meta should not have banned prop
|
|
312
|
-
if (typeof meta.conditions !==
|
|
312
|
+
if (typeof meta.conditions !== "undefined") delete meta.conditions;
|
|
313
313
|
// @ts-expect-error: Meta should not have banned prop
|
|
314
|
-
if (typeof meta.prefillings !==
|
|
314
|
+
if (typeof meta.prefillings !== "undefined") delete meta.prefillings;
|
|
315
315
|
// @ts-expect-error: Meta should not have banned prop
|
|
316
|
-
if (typeof meta.validator?.conditions !==
|
|
316
|
+
if (typeof meta.validator?.conditions !== "undefined")
|
|
317
317
|
// @ts-expect-error: Meta should not have banned prop
|
|
318
318
|
delete meta.validator.conditions;
|
|
319
319
|
|
|
@@ -327,7 +327,7 @@ export class SmartScriptStore {
|
|
|
327
327
|
*/
|
|
328
328
|
static updateOptionMeta = (
|
|
329
329
|
id: number,
|
|
330
|
-
_meta: ActionsType.References.updateOptionMeta[
|
|
330
|
+
_meta: ActionsType.References.updateOptionMeta["meta"]
|
|
331
331
|
) => {
|
|
332
332
|
// Making sure option exists
|
|
333
333
|
if (
|
|
@@ -344,19 +344,19 @@ export class SmartScriptStore {
|
|
|
344
344
|
|
|
345
345
|
// Deleting all banned meta params
|
|
346
346
|
// @ts-expect-error: Meta should not have banned prop
|
|
347
|
-
if (typeof meta.id !==
|
|
347
|
+
if (typeof meta.id !== "undefined") delete meta.id;
|
|
348
348
|
// @ts-expect-error: Meta should not have banned prop
|
|
349
|
-
if (typeof meta.type !==
|
|
349
|
+
if (typeof meta.type !== "undefined") delete meta.type;
|
|
350
350
|
// @ts-expect-error: Meta should not have banned prop
|
|
351
|
-
if (typeof meta.conditions !==
|
|
351
|
+
if (typeof meta.conditions !== "undefined") delete meta.conditions;
|
|
352
352
|
// @ts-expect-error: Meta should not have banned prop
|
|
353
|
-
if (typeof meta.repeatOption !==
|
|
353
|
+
if (typeof meta.repeatOption !== "undefined") delete meta.repeatOption;
|
|
354
354
|
// @ts-expect-error: Meta should not have banned prop
|
|
355
|
-
if (typeof meta.validator?.conditions !==
|
|
355
|
+
if (typeof meta.validator?.conditions !== "undefined")
|
|
356
356
|
// @ts-expect-error: Meta should not have banned prop
|
|
357
357
|
delete meta.validator.conditions;
|
|
358
358
|
// @ts-expect-error: Meta should not have banned prop
|
|
359
|
-
if (typeof meta.multiple?.enabled !==
|
|
359
|
+
if (typeof meta.multiple?.enabled !== "undefined")
|
|
360
360
|
// @ts-expect-error: Meta should not have banned prop
|
|
361
361
|
delete meta.multiple.enabled;
|
|
362
362
|
|
|
@@ -378,7 +378,7 @@ export class SmartScriptStore {
|
|
|
378
378
|
return;
|
|
379
379
|
}
|
|
380
380
|
|
|
381
|
-
if (typeof index ===
|
|
381
|
+
if (typeof index === "undefined") {
|
|
382
382
|
SmartScriptStore.updateOptionMeta(id, { hidden: true });
|
|
383
383
|
SmartScriptStore.inputs.options[id].forEach((_, _index) => {
|
|
384
384
|
SmartScriptStore.actionsQueue.push(
|
|
@@ -408,7 +408,7 @@ export class SmartScriptStore {
|
|
|
408
408
|
);
|
|
409
409
|
return;
|
|
410
410
|
}
|
|
411
|
-
if (typeof index ===
|
|
411
|
+
if (typeof index === "undefined") {
|
|
412
412
|
SmartScriptStore.updateOptionMeta(id, { hidden: false });
|
|
413
413
|
SmartScriptStore.inputs.options[id].forEach((_, _index) => {
|
|
414
414
|
SmartScriptStore.actionsQueue.push(
|
|
@@ -442,7 +442,7 @@ export class SmartScriptStore {
|
|
|
442
442
|
return;
|
|
443
443
|
}
|
|
444
444
|
|
|
445
|
-
if (typeof index ===
|
|
445
|
+
if (typeof index === "undefined") {
|
|
446
446
|
SmartScriptStore.updateVariableMeta(id, { hidden: true });
|
|
447
447
|
SmartScriptStore.inputs.variables[id].forEach((_, _index) => {
|
|
448
448
|
SmartScriptStore.actionsQueue.push(
|
|
@@ -476,7 +476,7 @@ export class SmartScriptStore {
|
|
|
476
476
|
return;
|
|
477
477
|
}
|
|
478
478
|
|
|
479
|
-
if (typeof index ===
|
|
479
|
+
if (typeof index === "undefined") {
|
|
480
480
|
SmartScriptStore.updateVariableMeta(id, { hidden: false });
|
|
481
481
|
SmartScriptStore.inputs.variables[id].forEach((_, _index) => {
|
|
482
482
|
SmartScriptStore.actionsQueue.push(
|