@legalplace/wizardx-core 2.3.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/dist/App.d.ts +5 -5
- package/dist/App.js +22 -35
- package/dist/App.test.js +2 -2
- package/dist/Globals.d.ts +4 -0
- package/dist/Globals.js +9 -6
- package/dist/Loader.d.ts +1 -0
- package/dist/Loader.js +2 -0
- package/dist/PluginLoader.d.ts +3 -3
- package/dist/PluginLoader.js +22 -26
- package/dist/PluginLoader.test.js +6 -6
- package/dist/Shimmer.d.ts +1 -1
- package/dist/Shimmer.js +45 -47
- package/dist/ThemeLoader.d.ts +6 -5
- package/dist/ThemeLoader.js +21 -25
- package/dist/ThemeLoader.test.js +4 -3
- package/dist/components/PluginRoute.d.ts +3 -3
- package/dist/components/PluginRoute.js +8 -7
- package/dist/components/SmartScript.d.ts +7 -8
- package/dist/components/SmartScript.js +22 -21
- package/dist/components/UserLocked/UserLockedComponent.d.ts +1 -1
- package/dist/components/UserLocked/UserLockedComponent.js +5 -6
- package/dist/components/View.d.ts +8 -4
- package/dist/components/View.js +46 -55
- package/dist/components/View.test.js +6 -5
- package/dist/componentsConnectors/connectBox.d.ts +2 -3
- package/dist/componentsConnectors/connectBox.js +4 -4
- package/dist/componentsConnectors/connectBox.test.js +7 -7
- package/dist/componentsConnectors/connectDocument.d.ts +0 -1
- package/dist/componentsConnectors/connectDocument.js +6 -6
- package/dist/componentsConnectors/connectDocument.test.js +5 -5
- package/dist/componentsConnectors/connectHeader.d.ts +0 -1
- package/dist/componentsConnectors/connectHeader.js +2 -2
- package/dist/componentsConnectors/connectMetaTitle.d.ts +0 -1
- package/dist/componentsConnectors/connectMetaTitle.js +2 -2
- package/dist/componentsConnectors/connectMetaTitle.test.js +3 -3
- package/dist/componentsConnectors/connectOption.d.ts +2 -3
- package/dist/componentsConnectors/connectOption.js +9 -9
- package/dist/componentsConnectors/connectPagination.d.ts +0 -1
- package/dist/componentsConnectors/connectPagination.js +3 -3
- package/dist/componentsConnectors/connectPreview.d.ts +0 -1
- package/dist/componentsConnectors/connectPreview.js +2 -2
- package/dist/componentsConnectors/connectProgress.d.ts +0 -1
- package/dist/componentsConnectors/connectProgress.js +3 -3
- package/dist/componentsConnectors/connectRootOption.d.ts +2 -3
- package/dist/componentsConnectors/connectRootOption.js +2 -2
- package/dist/componentsConnectors/connectSection.d.ts +0 -1
- package/dist/componentsConnectors/connectSection.js +4 -4
- package/dist/componentsConnectors/connectSummary.d.ts +0 -1
- package/dist/componentsConnectors/connectSummary.js +2 -2
- package/dist/componentsConnectors/connectSummaryItem.d.ts +0 -1
- package/dist/componentsConnectors/connectSummaryItem.js +6 -6
- package/dist/componentsConnectors/connectTermsheet.d.ts +2 -2
- package/dist/componentsConnectors/connectTermsheet.js +43 -46
- package/dist/componentsConnectors/connectVariable.d.ts +1 -2
- package/dist/componentsConnectors/connectVariable.js +10 -10
- package/dist/componentsConnectors/connectWizardWrapper.d.ts +0 -1
- package/dist/componentsConnectors/connectWizardWrapper.js +4 -4
- package/dist/componentsConnectors/connector/componentConnector.d.ts +8 -8
- package/dist/componentsConnectors/connector/componentConnector.js +16 -19
- package/dist/componentsConnectors/library.d.ts +61 -0
- package/dist/componentsConnectors/library.js +34 -0
- package/dist/config.d.ts +1 -1
- package/dist/constants/phoneValidation.d.ts +3 -0
- package/dist/constants/phoneValidation.js +3 -0
- package/dist/helpers/outputsParsing.d.ts +1 -1
- package/dist/helpers/outputsParsing.js +25 -25
- package/dist/helpers/preloadTheme.js +1 -1
- package/dist/helpers/scriptsLoader.d.ts +1 -0
- package/dist/helpers/scriptsLoader.js +24 -0
- package/dist/helpers/sendinblueHelper.d.ts +3 -3
- package/dist/helpers/sendinblueHelper.js +29 -18
- package/dist/hooks/usePrevious.js +1 -1
- package/dist/libs/ConditionsInitiator.d.ts +1 -1
- package/dist/libs/ConditionsInitiator.js +2 -2
- package/dist/libs/ConditionsRunner/DataPopulator.js +7 -7
- package/dist/libs/ConditionsRunner.d.ts +3 -3
- package/dist/libs/ConditionsRunner.js +43 -43
- package/dist/libs/DocumentsOutputs.d.ts +2 -2
- package/dist/libs/DocumentsOutputs.js +5 -5
- package/dist/libs/Eval/EvalBase.js +17 -17
- package/dist/libs/Eval/EvalFunctions.d.ts +1 -1
- package/dist/libs/Eval/EvalFunctions.js +100 -100
- package/dist/libs/Eval/NumbersToLetters.js +46 -46
- package/dist/libs/EvalVariable.d.ts +2 -2
- package/dist/libs/EvalVariable.js +30 -29
- package/dist/libs/EventsTracking.js +32 -32
- package/dist/libs/Extracts.js +20 -20
- package/dist/libs/InputsInitiator.d.ts +1 -1
- package/dist/libs/InputsInitiator.js +15 -15
- package/dist/libs/NumAuto.js +1 -1
- package/dist/libs/OvcConverter.d.ts +1 -1
- package/dist/libs/OvcConverter.js +23 -23
- package/dist/libs/PathReader.d.ts +1 -1
- package/dist/libs/PathReader.js +22 -22
- package/dist/libs/SectionValidity.js +3 -3
- package/dist/libs/SmartScriptStore.d.ts +6 -6
- package/dist/libs/SmartScriptStore.js +33 -33
- package/dist/misc/test_model.d.ts +2 -2
- package/dist/misc/test_model.js +3807 -3807
- package/dist/polyfills/index.d.ts +5 -0
- package/dist/polyfills/index.js +5 -0
- package/dist/polyfills/prepend.js +2 -2
- package/dist/polyfills/stringRepeat.js +4 -4
- package/dist/redux/actions/app.d.ts +12 -12
- package/dist/redux/actions/app.js +1 -1
- package/dist/redux/actions/conditions.d.ts +2 -2
- package/dist/redux/actions/conditions.js +1 -1
- package/dist/redux/actions/inputs.d.ts +3 -1
- package/dist/redux/actions/inputs.js +6 -1
- package/dist/redux/actions/library.d.ts +74 -0
- package/dist/redux/actions/library.js +11 -0
- package/dist/redux/actions/mandatories.d.ts +1 -1
- package/dist/redux/actions/mandatories.js +1 -1
- package/dist/redux/actions/references.d.ts +4 -4
- package/dist/redux/actions/references.js +1 -1
- package/dist/redux/actions/sagas/data.d.ts +1 -1
- package/dist/redux/actions/sagas/data.js +1 -1
- package/dist/redux/actions/sagas/model.d.ts +3 -3
- package/dist/redux/actions/sagas/model.js +3 -3
- package/dist/redux/actions/sagas/user.d.ts +1 -1
- package/dist/redux/actions/sagas/user.js +1 -1
- package/dist/redux/actions/smartscript.d.ts +3 -3
- package/dist/redux/actions/smartscript.js +1 -1
- package/dist/redux/actions/user.d.ts +4 -4
- package/dist/redux/actions/user.js +1 -1
- package/dist/redux/constants/app.js +22 -22
- package/dist/redux/constants/conditions.js +8 -8
- package/dist/redux/constants/inputs.d.ts +1 -0
- package/dist/redux/constants/inputs.js +7 -6
- package/dist/redux/constants/mandatories.js +6 -6
- package/dist/redux/constants/references.js +3 -3
- package/dist/redux/constants/sagas/data.js +1 -1
- package/dist/redux/constants/sagas/model.js +2 -2
- package/dist/redux/constants/sagas/user.js +2 -2
- package/dist/redux/constants/smartscript.js +4 -4
- package/dist/redux/constants/user.js +3 -3
- package/dist/redux/listeners/subscriber.d.ts +2 -2
- package/dist/redux/middlewares/conditionsWatcherMiddleware.d.ts +2 -2
- package/dist/redux/middlewares/conditionsWatcherMiddleware.js +28 -28
- package/dist/redux/middlewares/evaluationsWatcherMiddleware.d.ts +4 -2
- package/dist/redux/middlewares/evaluationsWatcherMiddleware.js +10 -10
- package/dist/redux/middlewares/mandatoriesWatcherMiddleware.d.ts +2 -2
- package/dist/redux/middlewares/mandatoriesWatcherMiddleware.js +13 -13
- package/dist/redux/middlewares/multiplesActionsMiddleware.d.ts +2 -2
- package/dist/redux/middlewares/multiplesActionsMiddleware.js +2 -2
- package/dist/redux/middlewares/paginationWatcherMiddleware.d.ts +3 -3
- package/dist/redux/middlewares/paginationWatcherMiddleware.js +24 -24
- package/dist/redux/middlewares/pluginsHookMiddleware.d.ts +1 -1
- package/dist/redux/middlewares/pluginsHookMiddleware.js +1 -1
- package/dist/redux/middlewares/prefillerWatcherMiddleware.d.ts +2 -2
- package/dist/redux/middlewares/prefillerWatcherMiddleware.js +28 -28
- package/dist/redux/middlewares/smartscriptMiddleware.d.ts +2 -2
- package/dist/redux/middlewares/smartscriptMiddleware.js +33 -15
- package/dist/redux/middlewares/thirdpartyScriptsMiddleware.d.ts +5 -0
- package/dist/redux/middlewares/thirdpartyScriptsMiddleware.js +16 -0
- package/dist/redux/reducers/app/customizations/initCustomizationAutoDefault.d.ts +2 -2
- package/dist/redux/reducers/app/customizations/initCustomizationMeta.d.ts +2 -2
- package/dist/redux/reducers/app/instance/initInstance.d.ts +2 -2
- package/dist/redux/reducers/app/instance/setDataStatus.d.ts +2 -2
- package/dist/redux/reducers/app/instance/updateInstance.d.ts +2 -2
- package/dist/redux/reducers/app/instance/updateInstancePaid.d.ts +2 -2
- package/dist/redux/reducers/app/meta/fetchModelFailed.d.ts +1 -1
- package/dist/redux/reducers/app/meta/fetchModelFailed.js +1 -1
- package/dist/redux/reducers/app/meta/fetchModelNonBlocking.d.ts +1 -1
- package/dist/redux/reducers/app/meta/fetchModelNonBlocking.js +1 -1
- package/dist/redux/reducers/app/meta/fetchModelSucceeded.d.ts +1 -1
- package/dist/redux/reducers/app/meta/fetchModelSucceeded.js +1 -1
- package/dist/redux/reducers/app/meta/fetchModelUnhealthy.d.ts +2 -2
- package/dist/redux/reducers/app/meta/fetchModelUnhealthy.js +1 -1
- package/dist/redux/reducers/app/meta/fetchModelUserLocked.d.ts +1 -1
- package/dist/redux/reducers/app/meta/fetchModelUserLocked.js +1 -1
- package/dist/redux/reducers/app/meta/initMeta.d.ts +2 -2
- package/dist/redux/reducers/app/meta/setModelUuid.d.ts +2 -2
- package/dist/redux/reducers/app/pagination/goNextPage.d.ts +1 -1
- package/dist/redux/reducers/app/pagination/goNextPage.js +1 -1
- package/dist/redux/reducers/app/pagination/goPage.d.ts +2 -2
- package/dist/redux/reducers/app/pagination/goPage.js +2 -2
- package/dist/redux/reducers/app/pagination/goPreviousPage.d.ts +1 -1
- package/dist/redux/reducers/app/pagination/goPreviousPage.js +1 -1
- package/dist/redux/reducers/app/pagination/initPagination.d.ts +2 -2
- package/dist/redux/reducers/app/pagination/initPagination.js +1 -1
- package/dist/redux/reducers/app/pagination/updateAvailableAppStates.d.ts +2 -2
- package/dist/redux/reducers/app/pagination/updateAvailableAppStates.js +5 -5
- package/dist/redux/reducers/app/wizard/updateAvailableSections.d.ts +2 -2
- package/dist/redux/reducers/app/wizard/updateAvailableSections.js +2 -2
- package/dist/redux/reducers/app.d.ts +2 -2
- package/dist/redux/reducers/app.js +30 -30
- package/dist/redux/reducers/conditions/addMultipleOccurency.d.ts +2 -2
- package/dist/redux/reducers/conditions/addMultipleOccurency.js +3 -3
- package/dist/redux/reducers/conditions/deleteMultipleOccurency.d.ts +2 -2
- package/dist/redux/reducers/conditions/deleteMultipleOccurency.js +2 -2
- package/dist/redux/reducers/conditions/initConditions.d.ts +2 -2
- package/dist/redux/reducers/conditions/updateDocumentConditions.d.ts +2 -2
- package/dist/redux/reducers/conditions/updateOptionConditions.d.ts +2 -2
- package/dist/redux/reducers/conditions/updateOptionValidatorCondition.d.ts +2 -2
- package/dist/redux/reducers/conditions/updatePrefillerConditions.d.ts +2 -2
- package/dist/redux/reducers/conditions/updatePrefillerConditions.js +2 -2
- package/dist/redux/reducers/conditions/updateSectionConditions.d.ts +2 -2
- package/dist/redux/reducers/conditions/updateVariableConditions.d.ts +2 -2
- package/dist/redux/reducers/conditions/updateVariableValidatorCondition.d.ts +2 -2
- package/dist/redux/reducers/conditions.d.ts +2 -2
- package/dist/redux/reducers/conditions.js +13 -13
- package/dist/redux/reducers/inputs/addMultipleOccurency.d.ts +2 -2
- package/dist/redux/reducers/inputs/addMultipleOccurency.js +4 -4
- package/dist/redux/reducers/inputs/deleteMultipleOccurency.d.ts +2 -2
- package/dist/redux/reducers/inputs/deleteMultipleOccurency.js +2 -2
- package/dist/redux/reducers/inputs/initOption.d.ts +2 -2
- package/dist/redux/reducers/inputs/initVariable.d.ts +2 -2
- package/dist/redux/reducers/inputs/updateOptionInput.d.ts +2 -2
- package/dist/redux/reducers/inputs/updateVariableInput.d.ts +2 -2
- package/dist/redux/reducers/inputs.d.ts +2 -2
- package/dist/redux/reducers/inputs.js +8 -8
- package/dist/redux/reducers/mandatories/addMultipleOccurency.d.ts +2 -2
- package/dist/redux/reducers/mandatories/addMultipleOccurency.js +2 -2
- package/dist/redux/reducers/mandatories/deleteMultipleOccurency.d.ts +2 -2
- package/dist/redux/reducers/mandatories/deleteMultipleOccurency.js +2 -2
- package/dist/redux/reducers/mandatories/initMandatoryOption.d.ts +2 -2
- package/dist/redux/reducers/mandatories/initMandatoryVariable.d.ts +2 -2
- package/dist/redux/reducers/mandatories/setMandatoryIgnore.d.ts +2 -2
- package/dist/redux/reducers/mandatories/setMandatoryOption.d.ts +2 -2
- package/dist/redux/reducers/mandatories/setMandatorySection.d.ts +2 -2
- package/dist/redux/reducers/mandatories/setMandatoryVariable.d.ts +2 -2
- package/dist/redux/reducers/mandatories.d.ts +2 -2
- package/dist/redux/reducers/mandatories.js +11 -11
- package/dist/redux/reducers/references/initReferences.d.ts +2 -2
- package/dist/redux/reducers/references/updateOptionMeta.d.ts +2 -2
- package/dist/redux/reducers/references/updateOptionMeta.js +2 -2
- package/dist/redux/reducers/references/updateVariableMeta.d.ts +2 -2
- package/dist/redux/reducers/references/updateVariableMeta.js +2 -2
- package/dist/redux/reducers/references.d.ts +2 -2
- package/dist/redux/reducers/references.js +5 -5
- package/dist/redux/reducers/smartscript/enableSmartScript.d.ts +1 -1
- package/dist/redux/reducers/smartscript/initSmartScriptTriggers.d.ts +2 -2
- package/dist/redux/reducers/smartscript/updateSmartscriptOptionHidden.d.ts +2 -2
- package/dist/redux/reducers/smartscript/updateSmartscriptVariableHidden.d.ts +2 -2
- package/dist/redux/reducers/smartscript.d.ts +2 -2
- package/dist/redux/reducers/smartscript.js +6 -6
- package/dist/redux/reducers/user/initUser.d.ts +2 -2
- package/dist/redux/reducers/user/setUserStatus.d.ts +2 -2
- package/dist/redux/reducers/user/setUserValidToken.d.ts +2 -2
- package/dist/redux/reducers/user.d.ts +2 -2
- package/dist/redux/reducers/user.js +9 -9
- package/dist/redux/routerHistory.d.ts +2 -2
- package/dist/redux/routerHistory.js +5 -5
- package/dist/redux/sagas/fetchModel.d.ts +4 -4
- package/dist/redux/sagas/fetchModel.js +79 -131
- package/dist/redux/sagas/fetchModel.test.js +2 -3
- package/dist/redux/sagas/homogeneousRadioInputsSaga.js +5 -5
- package/dist/redux/sagas/initInputs.d.ts +5 -0
- package/dist/redux/sagas/initInputs.js +63 -0
- package/dist/redux/sagas/runner.d.ts +1 -1
- package/dist/redux/sagas/runner.js +7 -5
- package/dist/redux/sagas/saveData.js +34 -25
- package/dist/redux/sagas/setDefaults.js +8 -8
- package/dist/redux/sagas/setUserEmail.js +43 -43
- package/dist/redux/selectors/app.d.ts +1 -0
- package/dist/redux/selectors/app.js +26 -25
- package/dist/redux/selectors/conditions.js +34 -34
- package/dist/redux/selectors/inputs.d.ts +1 -1
- package/dist/redux/selectors/inputs.js +8 -8
- package/dist/{componentsConnectors/connector/connectorSelectors.d.ts → redux/selectors/library.d.ts} +17 -16
- package/dist/redux/selectors/library.js +8 -0
- package/dist/redux/selectors/mandatories.js +10 -10
- package/dist/redux/selectors/references.d.ts +1 -0
- package/dist/redux/selectors/references.js +20 -19
- package/dist/redux/selectors/selectors.d.ts +2 -2
- package/dist/redux/selectors/selectors.js +2 -2
- package/dist/redux/selectors/smartscript.js +5 -5
- package/dist/redux/selectors/user.js +5 -5
- package/dist/redux/store.d.ts +6 -2
- package/dist/redux/store.js +31 -31
- package/dist/service/api.manager.d.ts +2 -2
- package/dist/service/api.manager.js +46 -46
- package/dist/service/auth.service.js +2 -2
- package/dist/service/pardot.service.js +2 -2
- package/dist/tests-misc/plugins/jestTestPlugin/after.d.ts +1 -1
- package/dist/tests-misc/plugins/jestTestPlugin/after.js +2 -2
- package/dist/tests-misc/plugins/jestTestPlugin/before.d.ts +1 -1
- package/dist/tests-misc/plugins/jestTestPlugin/before.js +2 -5
- package/dist/tests-misc/plugins/jestTestPlugin/index.js +4 -4
- package/dist/tests-misc/plugins/jestTestPlugin/title.d.ts +1 -1
- package/dist/tests-misc/plugins/jestTestPlugin/title.js +2 -2
- package/dist/tests-misc/themes/jestTestTheme/components/EmailComponent.d.ts +0 -1
- package/dist/tests-misc/themes/jestTestTheme/components/EmailComponent.js +2 -2
- package/dist/tests-misc/themes/jestTestTheme/components/TermsheetComponent.d.ts +0 -1
- package/dist/tests-misc/themes/jestTestTheme/components/TermsheetComponent.js +2 -2
- package/dist/tests-misc/themes/jestTestTheme/components/WizardComponent.d.ts +0 -1
- package/dist/tests-misc/themes/jestTestTheme/components/WizardComponent.js +2 -2
- package/dist/tests-misc/themes/jestTestTheme/faltyIndex.js +1 -1
- package/dist/tests-misc/themes/jestTestTheme/faltyIndexLoader.js +1 -1
- package/dist/tests-misc/themes/jestTestTheme/index.js +4 -4
- package/dist/types/Actions.type.d.ts +42 -37
- package/dist/types/Components.type.d.ts +4 -5
- package/dist/types/State.type.d.ts +9 -9
- package/dist/types/Termsheet.type.d.ts +4 -4
- package/dist/types/api.type.d.ts +4 -4
- package/dist/types/config.type.d.ts +2 -3
- package/dist/types/getActions.type.d.ts +2 -2
- package/dist/types/getConnectors.type.d.ts +2 -3
- package/dist/types/getSelectors.type.d.ts +2 -2
- package/dist/wizard-params.d.ts +1 -1
- package/dist/wizard-params.js +16 -16
- package/jest.config.ts +1 -1
- package/package.json +16 -8
- package/setupJest.ts +8 -0
- package/src/App.tsx +22 -25
- package/src/Globals.ts +12 -8
- package/src/Loader.tsx +8 -0
- package/src/PluginLoader.tsx +20 -37
- package/src/Shimmer.tsx +58 -45
- package/src/ThemeLoader.test.tsx +1 -0
- package/src/ThemeLoader.tsx +27 -42
- package/src/components/PluginRoute.tsx +8 -6
- package/src/components/SmartScript.tsx +29 -28
- package/src/components/UserLocked/UserLockedComponent.tsx +3 -3
- package/src/components/View.test.tsx +3 -0
- package/src/components/View.tsx +52 -54
- package/src/componentsConnectors/connectBox.tsx +6 -6
- package/src/componentsConnectors/connectDocument.tsx +6 -6
- package/src/componentsConnectors/connectHeader.tsx +2 -2
- package/src/componentsConnectors/connectMetaTitle.tsx +2 -2
- package/src/componentsConnectors/connectOption.tsx +11 -11
- package/src/componentsConnectors/connectPagination.tsx +3 -3
- package/src/componentsConnectors/connectPreview.tsx +2 -2
- package/src/componentsConnectors/connectProgress.tsx +3 -3
- package/src/componentsConnectors/connectRootOption.tsx +4 -4
- package/src/componentsConnectors/connectSection.tsx +4 -4
- package/src/componentsConnectors/connectSummary.tsx +2 -2
- package/src/componentsConnectors/connectSummaryItem.tsx +6 -6
- package/src/componentsConnectors/connectTermsheet.tsx +46 -46
- package/src/componentsConnectors/connectVariable.tsx +11 -11
- package/src/componentsConnectors/connectWizardWrapper.tsx +4 -4
- package/src/componentsConnectors/connector/componentConnector.tsx +22 -20
- package/src/componentsConnectors/library.ts +35 -0
- package/src/config.test.ts +2 -1
- package/src/config.ts +1 -1
- package/src/constants/phoneValidation.ts +6 -0
- package/src/definitions/path.join.d.ts +1 -1
- package/src/helpers/outputsParsing.ts +26 -26
- package/src/helpers/preloadTheme.ts +2 -2
- package/src/helpers/scriptsLoader.ts +20 -0
- package/src/helpers/sendinblueHelper.ts +23 -17
- package/src/hooks/usePrevious.ts +1 -1
- package/src/libs/ConditionsInitiator.ts +3 -3
- package/src/libs/ConditionsRunner/DataPopulator.ts +7 -7
- package/src/libs/ConditionsRunner.ts +53 -53
- package/src/libs/DocumentsOutputs.ts +7 -7
- package/src/libs/Eval/EvalBase.ts +17 -17
- package/src/libs/Eval/EvalFunctions.ts +100 -100
- package/src/libs/Eval/NumbersToLetters.ts +48 -48
- package/src/libs/EvalVariable.ts +34 -31
- package/src/libs/EventsTracking.ts +38 -38
- package/src/libs/Extracts.ts +21 -21
- package/src/libs/InputsInitiator.ts +16 -16
- package/src/libs/NumAuto.ts +1 -1
- package/src/libs/OvcConverter.ts +25 -25
- package/src/libs/PathReader.ts +23 -23
- package/src/libs/SectionValidity.ts +3 -3
- package/src/libs/SmartScriptStore.ts +40 -40
- package/src/misc/test_model.ts +3809 -3809
- package/src/polyfills/index.ts +5 -0
- package/src/polyfills/prepend.ts +2 -2
- package/src/polyfills/stringRepeat.ts +4 -4
- package/src/redux/actions/app.ts +13 -13
- package/src/redux/actions/conditions.ts +3 -3
- package/src/redux/actions/inputs.ts +18 -2
- package/src/redux/actions/library.ts +23 -0
- package/src/redux/actions/mandatories.ts +2 -2
- package/src/redux/actions/references.ts +5 -5
- package/src/redux/actions/sagas/data.ts +2 -2
- package/src/redux/actions/sagas/model.ts +6 -6
- package/src/redux/actions/sagas/user.ts +2 -2
- package/src/redux/actions/smartscript.ts +4 -4
- package/src/redux/actions/user.ts +5 -5
- package/src/redux/constants/app.ts +22 -22
- package/src/redux/constants/conditions.ts +8 -8
- package/src/redux/constants/inputs.ts +8 -6
- package/src/redux/constants/mandatories.ts +6 -6
- package/src/redux/constants/references.ts +3 -3
- package/src/redux/constants/sagas/data.ts +1 -1
- package/src/redux/constants/sagas/model.ts +2 -2
- package/src/redux/constants/sagas/user.ts +2 -2
- package/src/redux/constants/smartscript.ts +4 -4
- package/src/redux/constants/user.ts +3 -3
- package/src/redux/listeners/subscriber.ts +2 -2
- package/src/redux/middlewares/conditionsWatcherMiddleware.ts +31 -31
- package/src/redux/middlewares/evaluationsWatcherMiddleware.test.ts +1 -1
- package/src/redux/middlewares/evaluationsWatcherMiddleware.ts +13 -13
- package/src/redux/middlewares/mandatoriesWatcherMiddleware.ts +16 -16
- package/src/redux/middlewares/multiplesActionsMiddleware.ts +6 -6
- package/src/redux/middlewares/paginationWatcherMiddleware.ts +27 -27
- package/src/redux/middlewares/pluginsHookMiddleware.ts +2 -2
- package/src/redux/middlewares/prefillerWatcherMiddleware.ts +31 -31
- package/src/redux/middlewares/smartscriptMiddleware.ts +61 -20
- package/src/redux/middlewares/thirdpartyScriptsMiddleware.ts +41 -0
- package/src/redux/reducers/app/customizations/initCustomizationAutoDefault.ts +2 -2
- package/src/redux/reducers/app/customizations/initCustomizationMeta.ts +2 -2
- package/src/redux/reducers/app/instance/initInstance.ts +2 -2
- package/src/redux/reducers/app/instance/setDataStatus.ts +2 -2
- package/src/redux/reducers/app/instance/updateInstance.ts +2 -2
- package/src/redux/reducers/app/instance/updateInstancePaid.ts +2 -2
- package/src/redux/reducers/app/meta/fetchModelFailed.ts +2 -2
- package/src/redux/reducers/app/meta/fetchModelNonBlocking.ts +2 -2
- package/src/redux/reducers/app/meta/fetchModelSucceeded.ts +2 -2
- package/src/redux/reducers/app/meta/fetchModelUnhealthy.ts +3 -3
- package/src/redux/reducers/app/meta/fetchModelUserLocked.ts +2 -2
- package/src/redux/reducers/app/meta/initMeta.ts +2 -2
- package/src/redux/reducers/app/meta/setModelUuid.ts +2 -2
- package/src/redux/reducers/app/pagination/goNextPage.ts +2 -2
- package/src/redux/reducers/app/pagination/goPage.ts +4 -4
- package/src/redux/reducers/app/pagination/goPreviousPage.ts +2 -2
- package/src/redux/reducers/app/pagination/initPagination.ts +3 -3
- package/src/redux/reducers/app/pagination/updateAvailableAppStates.ts +7 -7
- package/src/redux/reducers/app/wizard/updateAvailableSections.ts +4 -4
- package/src/redux/reducers/app.ts +32 -32
- package/src/redux/reducers/conditions/addMultipleOccurency.ts +5 -5
- package/src/redux/reducers/conditions/deleteMultipleOccurency.ts +4 -4
- package/src/redux/reducers/conditions/initConditions.ts +2 -2
- package/src/redux/reducers/conditions/updateDocumentConditions.ts +2 -2
- package/src/redux/reducers/conditions/updateOptionConditions.ts +2 -2
- package/src/redux/reducers/conditions/updateOptionValidatorCondition.ts +2 -2
- package/src/redux/reducers/conditions/updatePrefillerConditions.ts +4 -4
- package/src/redux/reducers/conditions/updateSectionConditions.ts +2 -2
- package/src/redux/reducers/conditions/updateVariableConditions.ts +2 -2
- package/src/redux/reducers/conditions/updateVariableValidatorCondition.ts +2 -2
- package/src/redux/reducers/conditions.ts +15 -15
- package/src/redux/reducers/inputs/addMultipleOccurency.ts +6 -6
- package/src/redux/reducers/inputs/deleteMultipleOccurency.ts +4 -4
- package/src/redux/reducers/inputs/initOption.ts +2 -2
- package/src/redux/reducers/inputs/initVariable.ts +2 -2
- package/src/redux/reducers/inputs/updateOptionInput.ts +2 -2
- package/src/redux/reducers/inputs/updateVariableInput.ts +2 -2
- package/src/redux/reducers/inputs.ts +10 -10
- package/src/redux/reducers/mandatories/addMultipleOccurency.ts +4 -4
- package/src/redux/reducers/mandatories/deleteMultipleOccurency.ts +4 -4
- package/src/redux/reducers/mandatories/initMandatoryOption.ts +2 -2
- package/src/redux/reducers/mandatories/initMandatoryVariable.ts +2 -2
- package/src/redux/reducers/mandatories/setMandatoryIgnore.ts +2 -2
- package/src/redux/reducers/mandatories/setMandatoryOption.ts +2 -2
- package/src/redux/reducers/mandatories/setMandatorySection.ts +2 -2
- package/src/redux/reducers/mandatories/setMandatoryVariable.ts +2 -2
- package/src/redux/reducers/mandatories.ts +13 -13
- package/src/redux/reducers/references/initReferences.ts +2 -2
- package/src/redux/reducers/references/updateOptionMeta.ts +4 -4
- package/src/redux/reducers/references/updateVariableMeta.ts +4 -4
- package/src/redux/reducers/references.ts +7 -7
- package/src/redux/reducers/smartscript/enableSmartScript.ts +1 -1
- package/src/redux/reducers/smartscript/initSmartScriptTriggers.ts +2 -2
- package/src/redux/reducers/smartscript/updateSmartscriptOptionHidden.ts +2 -2
- package/src/redux/reducers/smartscript/updateSmartscriptVariableHidden.ts +2 -2
- package/src/redux/reducers/smartscript.ts +8 -8
- package/src/redux/reducers/user/initUser.ts +2 -2
- package/src/redux/reducers/user/setUserStatus.ts +2 -2
- package/src/redux/reducers/user/setUserValidToken.ts +2 -2
- package/src/redux/reducers/user.ts +11 -11
- package/src/redux/routerHistory.ts +6 -6
- package/src/redux/sagas/fetchModel.test.ts +2 -5
- package/src/redux/sagas/fetchModel.ts +86 -187
- package/src/redux/sagas/homogeneousRadioInputsSaga.ts +6 -6
- package/src/redux/sagas/initInputs.ts +110 -0
- package/src/redux/sagas/runner.ts +8 -6
- package/src/redux/sagas/saveData.ts +32 -28
- package/src/redux/sagas/setDefaults.ts +8 -8
- package/src/redux/sagas/setUserEmail.ts +46 -45
- package/src/redux/selectors/app.ts +34 -28
- package/src/redux/selectors/conditions.ts +41 -41
- package/src/redux/selectors/inputs.ts +10 -10
- package/src/redux/selectors/library.ts +17 -0
- package/src/redux/selectors/mandatories.ts +10 -10
- package/src/redux/selectors/references.ts +25 -21
- package/src/redux/selectors/selectors.ts +4 -4
- package/src/redux/selectors/smartscript.ts +6 -6
- package/src/redux/selectors/user.ts +8 -8
- package/src/redux/store.ts +42 -32
- package/src/service/api.manager.ts +53 -53
- package/src/service/auth.service.ts +2 -2
- package/src/service/pardot.service.ts +2 -2
- package/src/tests-misc/plugins/jestTestPlugin/after.tsx +1 -1
- package/src/tests-misc/plugins/jestTestPlugin/before.tsx +1 -1
- package/src/tests-misc/plugins/jestTestPlugin/index.ts +4 -4
- package/src/tests-misc/plugins/jestTestPlugin/title.tsx +2 -2
- package/src/tests-misc/themes/jestTestTheme/components/EmailComponent.tsx +1 -1
- package/src/tests-misc/themes/jestTestTheme/components/TermsheetComponent.tsx +1 -1
- package/src/tests-misc/themes/jestTestTheme/components/WizardComponent.tsx +1 -1
- package/src/tests-misc/themes/jestTestTheme/faltyIndex.ts +1 -1
- package/src/tests-misc/themes/jestTestTheme/faltyIndexLoader.ts +1 -1
- package/src/tests-misc/themes/jestTestTheme/index.ts +4 -4
- package/src/types/Actions.type.ts +63 -55
- package/src/types/Components.type.ts +4 -4
- package/src/types/State.type.ts +14 -14
- package/src/types/Termsheet.type.ts +4 -4
- package/src/types/api.type.ts +4 -4
- package/src/types/config.type.ts +3 -3
- package/src/types/getActions.type.ts +2 -2
- package/src/types/getConnectors.type.ts +2 -2
- package/src/types/getSelectors.type.ts +2 -2
- package/src/wizard-params.ts +17 -17
- package/tsconfig.json +1 -1
- package/dist/componentsConnectors/connector/connectorSelectors.js +0 -9
- package/dist/componentsConnectors/index.d.ts +0 -16
- package/dist/componentsConnectors/index.js +0 -16
- package/dist/constants/index.d.ts +0 -1
- package/dist/constants/index.js +0 -1
- package/dist/helpers/index.d.ts +0 -2
- package/dist/helpers/index.js +0 -2
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.js +0 -1
- package/dist/index.d.ts +0 -23
- package/dist/index.js +0 -23
- package/dist/libs/index.d.ts +0 -12
- package/dist/libs/index.js +0 -12
- package/dist/redux/actions/index.d.ts +0 -8
- package/dist/redux/actions/index.js +0 -8
- package/dist/redux/actions/sagas/index.d.ts +0 -3
- package/dist/redux/actions/sagas/index.js +0 -3
- package/dist/redux/constants/index.d.ts +0 -8
- package/dist/redux/constants/index.js +0 -8
- package/dist/redux/constants/sagas/index.d.ts +0 -3
- package/dist/redux/constants/sagas/index.js +0 -3
- package/dist/redux/index.d.ts +0 -4
- package/dist/redux/index.js +0 -4
- package/dist/redux/selectors/index.d.ts +0 -7
- package/dist/redux/selectors/index.js +0 -7
- package/dist/service/index.d.ts +0 -3
- package/dist/service/index.js +0 -3
- package/dist/types/index.d.ts +0 -10
- package/dist/types/index.js +0 -10
- package/src/componentsConnectors/connector/connectorSelectors.ts +0 -19
- package/src/componentsConnectors/index.ts +0 -16
- package/src/constants/index.ts +0 -1
- package/src/helpers/index.ts +0 -2
- package/src/hooks/index.ts +0 -1
- package/src/index.ts +0 -47
- package/src/libs/index.ts +0 -12
- package/src/redux/actions/index.ts +0 -8
- package/src/redux/actions/sagas/index.ts +0 -3
- package/src/redux/constants/index.ts +0 -8
- package/src/redux/constants/sagas/index.ts +0 -3
- package/src/redux/index.ts +0 -4
- package/src/redux/selectors/index.ts +0 -7
- package/src/service/index.ts +0 -3
- package/src/types/index.ts +0 -10
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import type { ModelV3, OptionV3, VariableV3 } from
|
|
2
|
-
import { StateType } from
|
|
3
|
-
import { UPDATE_AVAILABLE_SECTIONS, UPDATE_AVAILABLE_APPSTATES, GO_PREVIOUS_PAGE, GO_NEXT_PAGE, GO_PAGE, INIT_PAGINATION, UPDATE_INSTANCE_PAID, INIT_INSTANCE, UPDATE_INSTANCE, INIT_META, UPDATE_CURRENT_APPSTATE, UPDATE_CURRENT_SECTION_ID, FETCH_MODEL_SUCCEEDED, FETCH_MODEL_FAILED, SET_DATA_STATUS, SET_FETCH_STATUS, INIT_CUSTOMIZATION_META, FETCH_MODEL_UNHEALTHY, FETCH_MODEL_USER_LOCKED, INIT_CUSTOMIZATION_AUTO_DEFAULT, FETCH_MODEL_NONBLOCKING, SET_MODEL_UUID } from
|
|
4
|
-
import { INIT_USER, SET_USER_STATUS, SET_USER_VALID_TOKEN } from
|
|
5
|
-
import { INIT_REFERENCES, UPDATE_VARIABLE_META, UPDATE_OPTION_META } from
|
|
6
|
-
import { INIT_OPTION, UPDATE_OPTION_INPUT, INIT_VARIABLE, UPDATE_VARIABLE_INPUT, ADD_MULTIPLE_OCCURENCY, DELETE_MULTIPLE_OCCURENCY } from
|
|
7
|
-
import { INIT_CONDITIONS, UPDATE_OPTION_CONDITION, UPDATE_VARIABLE_CONDITION, UPDATE_SECTION_CONDITION, UPDATE_PREFILLER_CONDITION, UPDATE_OPTION_VALIDATOR_CONDITION, UPDATE_VARIABLE_VALIDATOR_CONDITION, UPDATE_DOCUMENT_CONDITION } from
|
|
8
|
-
import { FETCH_MODEL, FETCH_MODEL_PREREQUISITES } from
|
|
9
|
-
import { SAVE_DATA } from
|
|
10
|
-
import { SET_USER_EMAIL, SET_USER_EMAIL_SUCCEEDED } from
|
|
11
|
-
import { SET_MANDATORY_IGNORE, SET_MANDATORY_SECTION, SET_MANDATORY_OPTION, SET_MANDATORY_VARIABLE, INIT_MANDATORY_OPTION, INIT_MANDATORY_VARIABLE } from
|
|
12
|
-
import { ENABLE_SMARTSCRIPT, INIT_SMARTSCRIPT_TRIGGERS, UPDATE_SMARTSCRIPT_OPTION_HIDDEN, UPDATE_SMARTSCRIPT_VARIABLE_HIDDEN } from
|
|
13
|
-
import { PathReader } from
|
|
14
|
-
import { WizardConfigResponse } from
|
|
1
|
+
import type { ModelV3, OptionV3, VariableV3 } from "@legalplace/models-v3-types";
|
|
2
|
+
import { StateType } from "./State.type";
|
|
3
|
+
import { UPDATE_AVAILABLE_SECTIONS, UPDATE_AVAILABLE_APPSTATES, GO_PREVIOUS_PAGE, GO_NEXT_PAGE, GO_PAGE, INIT_PAGINATION, UPDATE_INSTANCE_PAID, INIT_INSTANCE, UPDATE_INSTANCE, INIT_META, UPDATE_CURRENT_APPSTATE, UPDATE_CURRENT_SECTION_ID, FETCH_MODEL_SUCCEEDED, FETCH_MODEL_FAILED, SET_DATA_STATUS, SET_FETCH_STATUS, INIT_CUSTOMIZATION_META, FETCH_MODEL_UNHEALTHY, FETCH_MODEL_USER_LOCKED, INIT_CUSTOMIZATION_AUTO_DEFAULT, FETCH_MODEL_NONBLOCKING, SET_MODEL_UUID } from "../redux/constants/app";
|
|
4
|
+
import { INIT_USER, SET_USER_STATUS, SET_USER_VALID_TOKEN } from "../redux/constants/user";
|
|
5
|
+
import { INIT_REFERENCES, UPDATE_VARIABLE_META, UPDATE_OPTION_META } from "../redux/constants/references";
|
|
6
|
+
import { INIT_INPUTS, INIT_OPTION, UPDATE_OPTION_INPUT, INIT_VARIABLE, UPDATE_VARIABLE_INPUT, ADD_MULTIPLE_OCCURENCY, DELETE_MULTIPLE_OCCURENCY } from "../redux/constants/inputs";
|
|
7
|
+
import { INIT_CONDITIONS, UPDATE_OPTION_CONDITION, UPDATE_VARIABLE_CONDITION, UPDATE_SECTION_CONDITION, UPDATE_PREFILLER_CONDITION, UPDATE_OPTION_VALIDATOR_CONDITION, UPDATE_VARIABLE_VALIDATOR_CONDITION, UPDATE_DOCUMENT_CONDITION } from "../redux/constants/conditions";
|
|
8
|
+
import { FETCH_MODEL, FETCH_MODEL_PREREQUISITES } from "../redux/constants/sagas/model";
|
|
9
|
+
import { SAVE_DATA } from "../redux/constants/sagas/data";
|
|
10
|
+
import { SET_USER_EMAIL, SET_USER_EMAIL_SUCCEEDED } from "../redux/constants/sagas/user";
|
|
11
|
+
import { SET_MANDATORY_IGNORE, SET_MANDATORY_SECTION, SET_MANDATORY_OPTION, SET_MANDATORY_VARIABLE, INIT_MANDATORY_OPTION, INIT_MANDATORY_VARIABLE } from "../redux/constants/mandatories";
|
|
12
|
+
import { ENABLE_SMARTSCRIPT, INIT_SMARTSCRIPT_TRIGGERS, UPDATE_SMARTSCRIPT_OPTION_HIDDEN, UPDATE_SMARTSCRIPT_VARIABLE_HIDDEN } from "../redux/constants/smartscript";
|
|
13
|
+
import { PathReader } from "../libs/PathReader";
|
|
14
|
+
import { WizardConfigResponse } from "./api.type";
|
|
15
15
|
export declare namespace ActionsType {
|
|
16
16
|
namespace App {
|
|
17
|
-
interface initMeta extends Omit<StateType.App.Meta,
|
|
17
|
+
interface initMeta extends Omit<StateType.App.Meta, "fetchStatus"> {
|
|
18
18
|
type: typeof INIT_META;
|
|
19
19
|
}
|
|
20
|
-
interface setModelUuid extends Pick<StateType.App.Meta,
|
|
20
|
+
interface setModelUuid extends Pick<StateType.App.Meta, "modelUuid"> {
|
|
21
21
|
type: typeof SET_MODEL_UUID;
|
|
22
22
|
}
|
|
23
23
|
interface fetchModelSucceeded {
|
|
@@ -26,10 +26,10 @@ export declare namespace ActionsType {
|
|
|
26
26
|
interface fetchModelNonBlocking {
|
|
27
27
|
type: typeof FETCH_MODEL_NONBLOCKING;
|
|
28
28
|
}
|
|
29
|
-
interface fetchModelUnhealthy extends Pick<StateType.App.Meta,
|
|
29
|
+
interface fetchModelUnhealthy extends Pick<StateType.App.Meta, "report"> {
|
|
30
30
|
type: typeof FETCH_MODEL_UNHEALTHY;
|
|
31
31
|
}
|
|
32
|
-
interface fetchModelUserLocked extends Pick<StateType.App.Meta,
|
|
32
|
+
interface fetchModelUserLocked extends Pick<StateType.App.Meta, "report"> {
|
|
33
33
|
type: typeof FETCH_MODEL_USER_LOCKED;
|
|
34
34
|
}
|
|
35
35
|
interface fetchModelFailed {
|
|
@@ -47,15 +47,15 @@ export declare namespace ActionsType {
|
|
|
47
47
|
}
|
|
48
48
|
interface setDataStatus {
|
|
49
49
|
type: typeof SET_DATA_STATUS;
|
|
50
|
-
dataStatus:
|
|
50
|
+
dataStatus: "saved" | "unsaved" | "saving" | "failed";
|
|
51
51
|
}
|
|
52
52
|
interface setFetchStatus {
|
|
53
53
|
type: typeof SET_FETCH_STATUS;
|
|
54
|
-
fetchStatus:
|
|
54
|
+
fetchStatus: "waiting" | "succeeded" | "failed" | "unhealthy" | "userLocked";
|
|
55
55
|
}
|
|
56
|
-
type AppPaginationWithoutIsFirstPage = Omit<StateType.App.Pagination,
|
|
57
|
-
type AppPaginationWithoutIsLastPage = Omit<AppPaginationWithoutIsFirstPage,
|
|
58
|
-
type AppPaginationWithoutTotalPages = Omit<AppPaginationWithoutIsLastPage,
|
|
56
|
+
type AppPaginationWithoutIsFirstPage = Omit<StateType.App.Pagination, "isFirstPage">;
|
|
57
|
+
type AppPaginationWithoutIsLastPage = Omit<AppPaginationWithoutIsFirstPage, "isLastPage">;
|
|
58
|
+
type AppPaginationWithoutTotalPages = Omit<AppPaginationWithoutIsLastPage, "totalPages">;
|
|
59
59
|
interface initPagination extends AppPaginationWithoutTotalPages, StateType.App.Wizard {
|
|
60
60
|
type: typeof INIT_PAGINATION;
|
|
61
61
|
}
|
|
@@ -72,11 +72,11 @@ export declare namespace ActionsType {
|
|
|
72
72
|
}
|
|
73
73
|
interface updateAvailableSections {
|
|
74
74
|
type: typeof UPDATE_AVAILABLE_SECTIONS;
|
|
75
|
-
availableSections: StateType.App.Wizard[
|
|
75
|
+
availableSections: StateType.App.Wizard["availableSections"];
|
|
76
76
|
}
|
|
77
77
|
interface updateAvailableAppStates {
|
|
78
78
|
type: typeof UPDATE_AVAILABLE_APPSTATES;
|
|
79
|
-
availableAppStates: StateType.App.Pagination[
|
|
79
|
+
availableAppStates: StateType.App.Pagination["availableAppStates"];
|
|
80
80
|
ingorePluginAppStateReset: boolean;
|
|
81
81
|
}
|
|
82
82
|
interface updateCurrentAppState {
|
|
@@ -89,28 +89,28 @@ export declare namespace ActionsType {
|
|
|
89
89
|
}
|
|
90
90
|
interface initCustomizationMeta {
|
|
91
91
|
type: typeof INIT_CUSTOMIZATION_META;
|
|
92
|
-
meta: Exclude<ModelV3[
|
|
92
|
+
meta: Exclude<ModelV3["customization"]["meta"], undefined>;
|
|
93
93
|
}
|
|
94
94
|
interface initCustomizationAutoDefault {
|
|
95
95
|
type: typeof INIT_CUSTOMIZATION_AUTO_DEFAULT;
|
|
96
|
-
disableAutoDefault: StateType.App.Customization[
|
|
96
|
+
disableAutoDefault: StateType.App.Customization["disableAutoDefault"];
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
namespace User {
|
|
100
|
-
interface initUser extends Omit<StateType.User,
|
|
100
|
+
interface initUser extends Omit<StateType.User, "status"> {
|
|
101
101
|
type: typeof INIT_USER;
|
|
102
102
|
}
|
|
103
103
|
interface setUserStatus {
|
|
104
104
|
type: typeof SET_USER_STATUS;
|
|
105
|
-
status: StateType.User[
|
|
105
|
+
status: StateType.User["status"];
|
|
106
106
|
}
|
|
107
107
|
interface setUserValidToken {
|
|
108
108
|
type: typeof SET_USER_VALID_TOKEN;
|
|
109
|
-
validToken: StateType.User[
|
|
109
|
+
validToken: StateType.User["validToken"];
|
|
110
110
|
}
|
|
111
111
|
interface setUserEmail {
|
|
112
112
|
type: typeof SET_USER_EMAIL;
|
|
113
|
-
email: StateType.User[
|
|
113
|
+
email: StateType.User["email"];
|
|
114
114
|
disableRedirect?: boolean;
|
|
115
115
|
tags?: Record<string, string>;
|
|
116
116
|
inBackground?: boolean;
|
|
@@ -123,9 +123,9 @@ export declare namespace ActionsType {
|
|
|
123
123
|
interface initReferences extends StateType.References {
|
|
124
124
|
type: typeof INIT_REFERENCES;
|
|
125
125
|
}
|
|
126
|
-
interface VariableUpdatableMeta extends Omit<VariableV3,
|
|
126
|
+
interface VariableUpdatableMeta extends Omit<VariableV3, "id" | "label" | "step" | "type" | "prefillings" | "conditions" | "validator"> {
|
|
127
127
|
label?: string;
|
|
128
|
-
step?:
|
|
128
|
+
step?: "*" | number[];
|
|
129
129
|
validator?: {
|
|
130
130
|
message?: string;
|
|
131
131
|
};
|
|
@@ -135,9 +135,9 @@ export declare namespace ActionsType {
|
|
|
135
135
|
id: number;
|
|
136
136
|
meta: VariableUpdatableMeta;
|
|
137
137
|
}
|
|
138
|
-
interface OptionUpdatableMeta extends Omit<OptionV3[
|
|
138
|
+
interface OptionUpdatableMeta extends Omit<OptionV3["meta"], "id" | "label" | "step" | "type" | "conditions" | "repeatOption" | "validator" | "multiple"> {
|
|
139
139
|
label?: string;
|
|
140
|
-
step?:
|
|
140
|
+
step?: "*" | number[];
|
|
141
141
|
validator?: {
|
|
142
142
|
message?: string;
|
|
143
143
|
};
|
|
@@ -154,6 +154,11 @@ export declare namespace ActionsType {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
namespace Inputs {
|
|
157
|
+
interface initInputs {
|
|
158
|
+
type: typeof INIT_INPUTS;
|
|
159
|
+
references?: StateType.References;
|
|
160
|
+
inputs: StateType.Inputs;
|
|
161
|
+
}
|
|
157
162
|
interface initOption {
|
|
158
163
|
type: typeof INIT_OPTION;
|
|
159
164
|
id: number;
|
|
@@ -181,7 +186,7 @@ export declare namespace ActionsType {
|
|
|
181
186
|
id: number;
|
|
182
187
|
optionRelations?: StateType.References.Relations.Options;
|
|
183
188
|
optionsReferences?: Record<string, StateType.References.Options.Option>;
|
|
184
|
-
prefillersVariables?: Record<string, StateType.References.Variables.Variable[
|
|
189
|
+
prefillersVariables?: Record<string, StateType.References.Variables.Variable["prefillings"]>;
|
|
185
190
|
}
|
|
186
191
|
interface deleteMultipleOccurency {
|
|
187
192
|
type: typeof DELETE_MULTIPLE_OCCURENCY;
|
|
@@ -310,7 +315,7 @@ export declare namespace ActionsType {
|
|
|
310
315
|
}
|
|
311
316
|
interface initSmartscriptTriggers {
|
|
312
317
|
type: typeof INIT_SMARTSCRIPT_TRIGGERS;
|
|
313
|
-
triggers: StateType.SmartScript[
|
|
318
|
+
triggers: StateType.SmartScript["triggers"];
|
|
314
319
|
}
|
|
315
320
|
interface updateSmartscriptOptionHidden {
|
|
316
321
|
type: typeof UPDATE_SMARTSCRIPT_OPTION_HIDDEN;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import { TermsheetRow } from './Termsheet.type';
|
|
1
|
+
import type { OptionV3, VariableV3 } from "@legalplace/models-v3-types";
|
|
2
|
+
import { TermsheetRow } from "./Termsheet.type";
|
|
4
3
|
export interface ProgressPropsType {
|
|
5
4
|
currentSectionTitle: string;
|
|
6
5
|
currentSectionId: number;
|
|
@@ -34,7 +33,7 @@ export interface RootOptionPropsFromState {
|
|
|
34
33
|
id: number;
|
|
35
34
|
multiple: boolean;
|
|
36
35
|
values: boolean[];
|
|
37
|
-
meta: OptionV3[
|
|
36
|
+
meta: OptionV3["meta"];
|
|
38
37
|
}
|
|
39
38
|
export interface RootOptionPropsFromDispatch {
|
|
40
39
|
addMultipleOccurency: () => void;
|
|
@@ -51,7 +50,7 @@ export interface OptionPropsFromState {
|
|
|
51
50
|
condition?: boolean;
|
|
52
51
|
validator?: boolean;
|
|
53
52
|
display: boolean;
|
|
54
|
-
meta: OptionV3[
|
|
53
|
+
meta: OptionV3["meta"];
|
|
55
54
|
selectedRadioChild: number;
|
|
56
55
|
childOptions: number[];
|
|
57
56
|
childVariables: number[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { OptionV3, VariableV3, SectionV3, ConditionV3, ModelV3 } from
|
|
2
|
-
import type { Types } from
|
|
3
|
-
import type { HealthCheckReport } from
|
|
1
|
+
import type { OptionV3, VariableV3, SectionV3, ConditionV3, ModelV3 } from "@legalplace/models-v3-types";
|
|
2
|
+
import type { Types } from "@legalplace/referencesparser";
|
|
3
|
+
import type { HealthCheckReport } from "@legalplace/model-healthcheck/dist/libs/HealthCheck.type";
|
|
4
4
|
export declare type MAPPED_CONDITIONS = {
|
|
5
5
|
dataMap: {
|
|
6
6
|
o: number[];
|
|
@@ -156,21 +156,21 @@ export interface AppCustomizationType {
|
|
|
156
156
|
disableAutoDefault?: boolean;
|
|
157
157
|
meta?: AppCustomizationMetaType;
|
|
158
158
|
}
|
|
159
|
-
export declare type ModelV3CustomizationMeta = Exclude<ModelV3[
|
|
159
|
+
export declare type ModelV3CustomizationMeta = Exclude<ModelV3["customization"]["meta"], undefined>;
|
|
160
160
|
export interface AppCustomizationMetaType extends ModelV3CustomizationMeta {
|
|
161
161
|
}
|
|
162
162
|
export interface AppInstanceType {
|
|
163
|
-
dataStatus:
|
|
163
|
+
dataStatus: "saved" | "unsaved" | "saving" | "failed";
|
|
164
164
|
uniqid: string;
|
|
165
165
|
companyId?: number;
|
|
166
166
|
employeeId?: number;
|
|
167
167
|
isPaid?: boolean;
|
|
168
168
|
isOrderHandled?: boolean;
|
|
169
169
|
draft?: boolean;
|
|
170
|
-
steps:
|
|
170
|
+
steps: "*" | number[];
|
|
171
171
|
}
|
|
172
172
|
export interface AppMetaType {
|
|
173
|
-
fetchStatus:
|
|
173
|
+
fetchStatus: "waiting" | "succeeded" | "failed" | "unhealthy" | "userLocked" | "nonBlocking";
|
|
174
174
|
id: number;
|
|
175
175
|
permalink: string;
|
|
176
176
|
prefix: string;
|
|
@@ -185,10 +185,10 @@ export interface AppMetaType {
|
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
187
|
export interface UserType {
|
|
188
|
-
status:
|
|
188
|
+
status: "authenticated" | "unauthenticated" | "inprogress" | "failed";
|
|
189
189
|
email: string;
|
|
190
190
|
displayName: string;
|
|
191
|
-
level:
|
|
191
|
+
level: "ADMIN" | "MANAGER" | "USER" | "GUEST" | "SUPER";
|
|
192
192
|
validToken?: boolean;
|
|
193
193
|
}
|
|
194
194
|
export interface InputsType {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export interface TermsheetSection {
|
|
2
2
|
number: string;
|
|
3
3
|
label: string;
|
|
4
|
-
type:
|
|
4
|
+
type: "section";
|
|
5
5
|
}
|
|
6
6
|
export interface TermsheetOption {
|
|
7
7
|
label: string;
|
|
8
8
|
value: string;
|
|
9
|
-
type:
|
|
9
|
+
type: "option";
|
|
10
10
|
}
|
|
11
11
|
export interface TermsheetVariable {
|
|
12
12
|
label: string;
|
|
13
13
|
value: string | number;
|
|
14
|
-
type:
|
|
14
|
+
type: "variable";
|
|
15
15
|
}
|
|
16
16
|
export interface TermsheetRow {
|
|
17
17
|
pageNumber: number;
|
|
@@ -20,6 +20,6 @@ export interface TermsheetRow {
|
|
|
20
20
|
valid?: boolean;
|
|
21
21
|
label: string;
|
|
22
22
|
value: string;
|
|
23
|
-
type:
|
|
23
|
+
type: "variable" | "section" | "option" | "multiplelabel";
|
|
24
24
|
allowUpdate: boolean;
|
|
25
25
|
}
|
package/dist/types/api.type.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export interface IInstanceCreationResponse {
|
|
2
2
|
uniqid: string;
|
|
3
|
-
status:
|
|
3
|
+
status: "SUCCESS" | "FAIL" | "ERR";
|
|
4
4
|
redirect_to?: string;
|
|
5
5
|
isPaid?: boolean;
|
|
6
6
|
user?: {
|
|
7
7
|
email: string;
|
|
8
8
|
displayName: string;
|
|
9
|
-
level:
|
|
10
|
-
role?:
|
|
9
|
+
level: "MANAGER" | "USER" | "ADMIN" | "SUPER" | "GUEST";
|
|
10
|
+
role?: "MANAGER" | "USER" | "ADMIN" | "SUPER" | "GUEST";
|
|
11
11
|
};
|
|
12
12
|
instanceToken?: string;
|
|
13
13
|
}
|
|
@@ -29,5 +29,5 @@ export interface CreateInstanceResponse {
|
|
|
29
29
|
uniqid: string;
|
|
30
30
|
isPaid: boolean;
|
|
31
31
|
isOrderHandled: boolean;
|
|
32
|
-
steps:
|
|
32
|
+
steps: "*" | number[];
|
|
33
33
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export declare type SideBarType = 'preview' | 'summary' | undefined;
|
|
1
|
+
export declare type SideBarType = "preview" | "summary" | undefined;
|
|
3
2
|
export interface IWizardParamsTheme {
|
|
4
3
|
name: string;
|
|
5
4
|
shimmer?: boolean;
|
|
@@ -20,7 +19,7 @@ export interface IWizardParamsTheme {
|
|
|
20
19
|
};
|
|
21
20
|
[key: string]: any;
|
|
22
21
|
};
|
|
23
|
-
fonts?:
|
|
22
|
+
fonts?: any;
|
|
24
23
|
style?: Record<string, any>;
|
|
25
24
|
[key: string]: any;
|
|
26
25
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare type
|
|
1
|
+
import { actionsLibrary } from "../redux/actions/library";
|
|
2
|
+
export declare type ActionsLibraryType = typeof actionsLibrary;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import * as connectors from '../componentsConnectors';
|
|
1
|
+
import { connectorsLibrary } from "../componentsConnectors/library";
|
|
3
2
|
export declare type ConnectorProps<T extends (c: React.ComponentType<any>) => any> = T extends (c: React.ComponentType<infer P>) => any ? P : {};
|
|
4
|
-
export declare type ComponentsConnectors = typeof
|
|
3
|
+
export declare type ComponentsConnectors = typeof connectorsLibrary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare type
|
|
1
|
+
import { selectorsLibrary } from "../redux/selectors/library";
|
|
2
|
+
export declare type SelectorsLibraryType = typeof selectorsLibrary;
|
package/dist/wizard-params.d.ts
CHANGED
package/dist/wizard-params.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
const config = {
|
|
2
|
-
apiEndpoint: process.env.REACT_APP_API_ENDPOINT ||
|
|
2
|
+
apiEndpoint: process.env.REACT_APP_API_ENDPOINT || "",
|
|
3
3
|
enableShadowInstance: false,
|
|
4
4
|
router: {
|
|
5
|
-
wizardPath:
|
|
6
|
-
wizardInstancePath:
|
|
7
|
-
notFoundPath:
|
|
5
|
+
wizardPath: "/contrats/:prefix?/:permalink/creer/:page?",
|
|
6
|
+
wizardInstancePath: "/contrats/:prefix?/:permalink/continuer/:uniqid([0-9a-zA-Z]+)/:page?",
|
|
7
|
+
notFoundPath: "/contrats/conditions-generales-de-vente/creer",
|
|
8
8
|
appStatesPages: {
|
|
9
|
-
termsheet:
|
|
10
|
-
email:
|
|
9
|
+
termsheet: "resume",
|
|
10
|
+
email: "email",
|
|
11
11
|
},
|
|
12
|
-
smartscriptPath:
|
|
12
|
+
smartscriptPath: "/contrats/:permalink/smartscript/:uniqid?",
|
|
13
13
|
},
|
|
14
14
|
plugins: {
|
|
15
|
-
b2c_actions:
|
|
16
|
-
datalayer:
|
|
17
|
-
checkoutX:
|
|
18
|
-
authentication:
|
|
15
|
+
b2c_actions: "1.0.0",
|
|
16
|
+
datalayer: "1.0.0",
|
|
17
|
+
checkoutX: "1.0.0",
|
|
18
|
+
authentication: "1.0.0",
|
|
19
19
|
},
|
|
20
20
|
theme: {
|
|
21
|
-
name:
|
|
21
|
+
name: "legacy",
|
|
22
22
|
params: {
|
|
23
23
|
ui: {
|
|
24
24
|
topbar: {
|
|
@@ -26,14 +26,14 @@ const config = {
|
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
sidebar: {
|
|
29
|
-
default:
|
|
29
|
+
default: "preview",
|
|
30
30
|
states: {
|
|
31
|
-
wizard:
|
|
32
|
-
email:
|
|
31
|
+
wizard: "summary",
|
|
32
|
+
email: "summary",
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
|
-
appStates: [
|
|
37
|
+
appStates: ["wizard", "email"],
|
|
38
38
|
};
|
|
39
39
|
export default config;
|
package/jest.config.ts
CHANGED
|
@@ -120,7 +120,7 @@ const jestConfig = {
|
|
|
120
120
|
// runner: "jest-runner",
|
|
121
121
|
|
|
122
122
|
// The paths to modules that run some code to configure or set up the testing environment before each test
|
|
123
|
-
|
|
123
|
+
setupFiles: ['./setupJest.ts'],
|
|
124
124
|
|
|
125
125
|
// A list of paths to modules that run some code to configure or set up the testing framework before each test
|
|
126
126
|
// setupFilesAfterEnv: [],
|
package/package.json
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legalplace/wizardx-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"author": "Moncef Hammou (moncef@legalplace.fr)",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./dist",
|
|
8
|
+
"./redux": "./dist/redux",
|
|
9
|
+
"./redux/selectors": "./dist/selectors",
|
|
10
|
+
"./componentsConnectors": "./dist/componentsConnectors"
|
|
11
|
+
},
|
|
7
12
|
"scripts": {
|
|
8
13
|
"build": "npx rimraf dist && npx tsc",
|
|
9
14
|
"start": "npx tsc-watch --noClear -p ./tsconfig.json",
|
|
10
15
|
"lint": "tsc --noEmit && eslint 'src/**/*.{js,jsx,ts,tsx}' --quiet",
|
|
11
16
|
"lint:fix": "tsc --noEmit && eslint 'src/**/*.{js,jsx,ts,tsx}' --fix",
|
|
12
|
-
"test": "npx jest",
|
|
17
|
+
"test": "npx jest --watch",
|
|
13
18
|
"test:ci": "npx jest --config ./jest.config.ts --collectCoverage --coverageDirectory=\"./coverage\" --ci --reporters=default --reporters=jest-junit --watchAll=false",
|
|
14
19
|
"test:coverage": "npx jest test --coverage --watchAll=false ",
|
|
15
20
|
"precommit": "test && lint:fix"
|
|
@@ -19,7 +24,7 @@
|
|
|
19
24
|
"@legalplace/lplogic": "^2.1.6",
|
|
20
25
|
"@legalplace/model-healthcheck": "^1.1.5",
|
|
21
26
|
"@legalplace/referencesparser": "^1.7.0",
|
|
22
|
-
"@legalplace/
|
|
27
|
+
"@legalplace/sb-experiment": "^0.1.0-alpha.2",
|
|
23
28
|
"@loadable/component": "^5.15.0",
|
|
24
29
|
"@redux-saga/core": "^1.1.3",
|
|
25
30
|
"awesome-phonenumber": "^2.62.1",
|
|
@@ -46,9 +51,9 @@
|
|
|
46
51
|
"xss": "^1.0.9"
|
|
47
52
|
},
|
|
48
53
|
"devDependencies": {
|
|
49
|
-
"@legalplace/eslint-config": "^2.
|
|
54
|
+
"@legalplace/eslint-config": "^2.1.1",
|
|
50
55
|
"@legalplace/models-v3-types": "^3.6.0",
|
|
51
|
-
"@legalplace/prettier-config": "^2.
|
|
56
|
+
"@legalplace/prettier-config": "^2.1.1",
|
|
52
57
|
"@swc-node/jest": "^1.3.2",
|
|
53
58
|
"@swc/core": "^1.2.93",
|
|
54
59
|
"@swc/jest": "^0.2.4",
|
|
@@ -60,7 +65,9 @@
|
|
|
60
65
|
"@types/loadable__component": "^5.13.4",
|
|
61
66
|
"@types/lodash": "^4.14.175",
|
|
62
67
|
"@types/mousetrap": "^1.6.8",
|
|
63
|
-
"@types/react
|
|
68
|
+
"@types/react": "^17.0.37",
|
|
69
|
+
"@types/react-dom": "17.0.11",
|
|
70
|
+
"@types/react-router-dom": "^5.1.6",
|
|
64
71
|
"@types/react-test-renderer": "^17.0.1",
|
|
65
72
|
"@types/redux-mock-store": "^1.0.3",
|
|
66
73
|
"@types/route-parser": "^0.1.3",
|
|
@@ -72,6 +79,7 @@
|
|
|
72
79
|
"jest-junit": "^13.0.0",
|
|
73
80
|
"lodash": "^4.17.21",
|
|
74
81
|
"react-async-ssr": "^0.7.2",
|
|
82
|
+
"react-router": "5.2.1",
|
|
75
83
|
"redux-mock-store": "^1.5.4",
|
|
76
84
|
"regenerator-runtime": "^0.13.9",
|
|
77
85
|
"rimraf": "^3.0.2",
|
|
@@ -84,5 +92,5 @@
|
|
|
84
92
|
"*.test.ts",
|
|
85
93
|
"*.test.tsx"
|
|
86
94
|
],
|
|
87
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "f3097ba70f4f85a78efee7fb6d0de511eb6eae46"
|
|
88
96
|
}
|
package/setupJest.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
+
import { GlobalWithFetchMock } from 'jest-fetch-mock';
|
|
3
|
+
|
|
4
|
+
const customGlobal: GlobalWithFetchMock =
|
|
5
|
+
global as unknown as GlobalWithFetchMock;
|
|
6
|
+
customGlobal.fetch = require('jest-fetch-mock');
|
|
7
|
+
|
|
8
|
+
customGlobal.fetchMock = customGlobal.fetch;
|
package/src/App.tsx
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Route, Switch, Redirect, generatePath } from
|
|
3
|
-
import { Provider } from
|
|
4
|
-
import { ConnectedRouter } from
|
|
5
|
-
import type { ModelV3 } from
|
|
6
|
-
import { getStore, createAppStore } from
|
|
7
|
-
import { getHistory } from
|
|
8
|
-
import { StateType } from
|
|
9
|
-
import { setGlobals, IGlobalParams } from
|
|
10
|
-
import { getConfig, updateConfig } from
|
|
11
|
-
import { fetchModelPrerequisitesAction } from
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Route, Switch, Redirect, generatePath } from "react-router-dom";
|
|
3
|
+
import { Provider } from "react-redux";
|
|
4
|
+
import { ConnectedRouter } from "connected-react-router";
|
|
5
|
+
import type { ModelV3 } from "@legalplace/models-v3-types";
|
|
6
|
+
import { getStore, createAppStore } from "./redux/store";
|
|
7
|
+
import { getHistory } from "./redux/routerHistory";
|
|
8
|
+
import type { StateType } from "./types/State.type";
|
|
9
|
+
import Globals, { setGlobals, IGlobalParams } from "./Globals";
|
|
10
|
+
import { getConfig, updateConfig } from "./config";
|
|
11
|
+
import { fetchModelPrerequisitesAction } from "./redux/actions/sagas/model";
|
|
12
|
+
import type { IWizardParams } from "./types/config.type";
|
|
13
|
+
import { preloadTheme } from "./helpers/preloadTheme";
|
|
14
|
+
import ViewComponent from "./components/View";
|
|
15
|
+
import PluginRoute from "./components/PluginRoute";
|
|
16
|
+
import SmartScriptComponent from "./components/SmartScript";
|
|
17
|
+
import { clearPlugins } from "./PluginLoader";
|
|
18
18
|
|
|
19
19
|
// App components props interface
|
|
20
20
|
export interface AppProps {
|
|
21
|
-
historyType:
|
|
21
|
+
historyType: "browser" | "memory";
|
|
22
22
|
model?: ModelV3;
|
|
23
23
|
meta?: StateType.App.Meta;
|
|
24
24
|
instance?: StateType.App.Instance;
|
|
@@ -38,13 +38,10 @@ class WizardXCore extends React.Component<AppProps, { loaded: boolean }> {
|
|
|
38
38
|
|
|
39
39
|
// Creating the history
|
|
40
40
|
const historyType =
|
|
41
|
-
typeof props.historyType ===
|
|
41
|
+
typeof props.historyType === "string" ? props.historyType : "browser";
|
|
42
42
|
|
|
43
43
|
const params: IGlobalParams = {
|
|
44
|
-
|
|
45
|
-
meta: null,
|
|
46
|
-
instance: null,
|
|
47
|
-
user: null,
|
|
44
|
+
...Globals,
|
|
48
45
|
loadTheme: props.loadTheme,
|
|
49
46
|
loadPlugin: props.loadPlugin,
|
|
50
47
|
};
|
|
@@ -110,7 +107,7 @@ class WizardXCore extends React.Component<AppProps, { loaded: boolean }> {
|
|
|
110
107
|
dispatch(
|
|
111
108
|
fetchModelPrerequisitesAction(
|
|
112
109
|
getConfig().permalink || state.app.meta.permalink,
|
|
113
|
-
getConfig().prefix || state.app.meta.prefix ||
|
|
110
|
+
getConfig().prefix || state.app.meta.prefix || ""
|
|
114
111
|
)
|
|
115
112
|
);
|
|
116
113
|
}
|
|
@@ -135,7 +132,7 @@ class WizardXCore extends React.Component<AppProps, { loaded: boolean }> {
|
|
|
135
132
|
<Route
|
|
136
133
|
path={
|
|
137
134
|
getConfig().router.smartscriptPath ||
|
|
138
|
-
|
|
135
|
+
"/contrats/:permalink/smartscript/:uniqid?"
|
|
139
136
|
}
|
|
140
137
|
component={SmartScriptComponent}
|
|
141
138
|
/>
|
package/src/Globals.ts
CHANGED
|
@@ -9,12 +9,14 @@ declare global {
|
|
|
9
9
|
sendinblue: any;
|
|
10
10
|
ga: any;
|
|
11
11
|
hj: any;
|
|
12
|
+
wizardxLoadAfterLcp: ({ src: string } | Function)[];
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export interface IGlobalParams {
|
|
16
17
|
[key: string]: any;
|
|
17
18
|
metadata?: Record<string, any>;
|
|
19
|
+
appEnv: string;
|
|
18
20
|
loadPlugin: (plugin: string) => Promise<any>;
|
|
19
21
|
loadTheme: (theme: string) => Promise<any>;
|
|
20
22
|
}
|
|
@@ -24,7 +26,7 @@ const globalParams: IGlobalParams = {
|
|
|
24
26
|
instance: null,
|
|
25
27
|
meta: null,
|
|
26
28
|
user: null,
|
|
27
|
-
|
|
29
|
+
appEnv: "production",
|
|
28
30
|
version: null,
|
|
29
31
|
loadPlugin: async () => {},
|
|
30
32
|
loadTheme: async () => {},
|
|
@@ -36,21 +38,23 @@ export const setGlobals = (params: typeof globalParams) => {
|
|
|
36
38
|
});
|
|
37
39
|
|
|
38
40
|
// Setting env
|
|
39
|
-
globalParams.
|
|
40
|
-
process.env.REACT_APP_ENV ||
|
|
41
|
+
globalParams.appEnv =
|
|
42
|
+
process.env.REACT_APP_ENV?.toString() ||
|
|
43
|
+
process.env.NODE_ENV?.toString() ||
|
|
44
|
+
"production";
|
|
41
45
|
|
|
42
46
|
// Setting version
|
|
43
|
-
globalParams.version = process.env.REACT_APP_VERSION ||
|
|
47
|
+
globalParams.version = process.env.REACT_APP_VERSION || "0.0.0";
|
|
44
48
|
|
|
45
49
|
if (
|
|
46
|
-
globalParams.
|
|
50
|
+
globalParams.appEnv !== "production" &&
|
|
47
51
|
process.env.JEST_WORKER_ID === undefined
|
|
48
52
|
) {
|
|
49
53
|
// eslint-disable-next-line no-console
|
|
50
54
|
console.log(
|
|
51
|
-
`%c[WZIARDX]: Current Environment: %c${globalParams.
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
`%c[WZIARDX]: Current Environment: %c${globalParams.appEnv} (${globalParams.version})`,
|
|
56
|
+
"font-weight:bold",
|
|
57
|
+
"font-weight: bold; color: red"
|
|
54
58
|
);
|
|
55
59
|
}
|
|
56
60
|
};
|