@legalplace/wizardx-core 2.6.4 → 2.7.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 +35 -0
- package/dist/App.js +13 -4
- package/dist/PluginLoader.d.ts +3 -1
- package/dist/PluginLoader.js +12 -0
- package/dist/ThemeLoader.d.ts +2 -2
- package/dist/componentsConnectors/connectBox.d.ts +3 -1
- package/dist/componentsConnectors/connectDocument.d.ts +3 -1
- package/dist/componentsConnectors/connectHeader.d.ts +3 -1
- package/dist/componentsConnectors/connectMetaTitle.d.ts +3 -1
- package/dist/componentsConnectors/connectOption.d.ts +6 -2
- package/dist/componentsConnectors/connectOption.js +1 -1
- package/dist/componentsConnectors/connectPagination.d.ts +3 -1
- package/dist/componentsConnectors/connectPreview.d.ts +3 -1
- package/dist/componentsConnectors/connectProgress.d.ts +3 -1
- package/dist/componentsConnectors/connectRootOption.d.ts +3 -1
- package/dist/componentsConnectors/connectSection.d.ts +3 -1
- package/dist/componentsConnectors/connectSection.js +7 -10
- package/dist/componentsConnectors/connectSummary.d.ts +3 -1
- package/dist/componentsConnectors/connectSummaryItem.d.ts +3 -1
- package/dist/componentsConnectors/connectVariable.d.ts +6 -2
- package/dist/componentsConnectors/connectVariable.js +1 -1
- package/dist/componentsConnectors/connectWizardWrapper.d.ts +3 -1
- package/dist/componentsConnectors/connector/componentConnector.d.ts +5 -1
- package/dist/componentsConnectors/connector/componentConnector.js +44 -4
- package/dist/componentsConnectors/connector/index.d.ts +1 -0
- package/dist/componentsConnectors/connector/index.js +1 -0
- package/dist/componentsConnectors/index.d.ts +17 -0
- package/dist/componentsConnectors/index.js +17 -0
- package/dist/componentsConnectors/library.d.ts +43 -15
- package/dist/helpers/apiEndpoint.d.ts +1 -0
- package/dist/helpers/apiEndpoint.js +4 -0
- package/dist/helpers/index.d.ts +4 -0
- package/dist/helpers/index.js +4 -0
- package/dist/helpers/propsEqualityCheck.d.ts +1 -0
- package/dist/helpers/propsEqualityCheck.js +9 -0
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/useActions.d.ts +2 -0
- package/dist/hooks/useActions.js +4 -0
- package/dist/hooks/useDispatch.d.ts +1 -0
- package/dist/hooks/useDispatch.js +4 -0
- package/dist/hooks/useSelectors.d.ts +2 -0
- package/dist/hooks/useSelectors.js +4 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +13 -0
- package/dist/libs/PathReader.d.ts +10 -6
- package/dist/libs/PathReader.js +47 -28
- package/dist/libs/index.d.ts +5 -0
- package/dist/libs/index.js +5 -0
- package/dist/redux/actions/index.d.ts +9 -0
- package/dist/redux/actions/index.js +9 -0
- package/dist/redux/actions/library.d.ts +59 -63
- package/dist/redux/actions/sagas/index.d.ts +3 -0
- package/dist/redux/actions/sagas/index.js +3 -0
- package/dist/redux/actions/sagas/model.d.ts +1 -5
- package/dist/redux/constants/app.d.ts +2 -0
- package/dist/redux/constants/app.js +2 -0
- package/dist/redux/constants/index.d.ts +8 -0
- package/dist/redux/constants/index.js +8 -0
- package/dist/redux/constants/sagas/index.d.ts +3 -0
- package/dist/redux/constants/sagas/index.js +3 -0
- package/dist/redux/index.d.ts +5 -0
- package/dist/redux/index.js +5 -0
- package/dist/redux/middlewares/conditionsWatcherMiddleware.js +11 -5
- package/dist/redux/middlewares/conditionsWatcherMiddleware.test.js +120 -113
- package/dist/redux/middlewares/paginationWatcherMiddleware.js +2 -2
- package/dist/redux/middlewares/smartscriptMiddleware.js +8 -0
- package/dist/redux/reducers/pluginsStore.d.ts +3 -0
- package/dist/redux/reducers/pluginsStore.js +12 -0
- package/dist/redux/routerHistory.js +2 -2
- package/dist/redux/sagas/fetchModel.js +22 -6
- package/dist/redux/sagas/initInputs.js +6 -7
- package/dist/redux/sagas/saveData.js +2 -0
- package/dist/redux/selectors/app.js +13 -18
- package/dist/redux/selectors/cache.d.ts +17 -0
- package/dist/redux/selectors/cache.js +35 -0
- package/dist/redux/selectors/conditions.js +7 -7
- package/dist/redux/selectors/index.d.ts +8 -0
- package/dist/redux/selectors/index.js +8 -0
- package/dist/redux/selectors/inputs.js +3 -3
- package/dist/redux/selectors/library.d.ts +2 -2
- package/dist/redux/selectors/references.js +26 -26
- package/dist/redux/selectors/selectors.d.ts +2 -2
- package/dist/redux/selectors/selectors.js +19 -8
- package/dist/redux/selectors/selectors.test.js +6 -6
- package/dist/redux/selectors/user.js +5 -5
- package/dist/redux/store.d.ts +1 -1
- package/dist/redux/store.js +12 -4
- package/dist/service/api.manager.d.ts +1 -6
- package/dist/service/index.d.ts +3 -0
- package/dist/service/index.js +3 -0
- package/dist/types/PluginConfig.type.d.ts +57 -0
- package/dist/types/PluginConfig.type.js +1 -0
- package/dist/types/State.type.d.ts +6 -0
- package/dist/types/config.type.d.ts +3 -1
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.js +11 -0
- package/package.json +11 -11
- package/.depcheckrc +0 -1
- package/.eslintignore +0 -2
- package/.eslintrc +0 -5
- package/__mocks__/fileMock.js +0 -1
- package/babel.config.json +0 -3
- package/jest.config.ts +0 -193
- package/setupJest.ts +0 -8
- package/src/App.test.tsx +0 -41
- package/src/App.tsx +0 -152
- package/src/Globals.ts +0 -69
- package/src/Loader.tsx +0 -8
- package/src/PluginLoader.test.tsx +0 -70
- package/src/PluginLoader.tsx +0 -407
- package/src/Shimmer.tsx +0 -108
- package/src/ThemeLoader.test.tsx +0 -82
- package/src/ThemeLoader.tsx +0 -95
- package/src/components/PluginRoute.tsx +0 -48
- package/src/components/SmartScript.tsx +0 -166
- package/src/components/UserLocked/UserLockedComponent.tsx +0 -33
- package/src/components/View.test.tsx +0 -110
- package/src/components/View.tsx +0 -114
- package/src/componentsConnectors/connectBox.test.tsx +0 -226
- package/src/componentsConnectors/connectBox.tsx +0 -70
- package/src/componentsConnectors/connectDocument.test.tsx +0 -108
- package/src/componentsConnectors/connectDocument.tsx +0 -64
- package/src/componentsConnectors/connectHeader.tsx +0 -21
- package/src/componentsConnectors/connectMetaTitle.test.tsx +0 -40
- package/src/componentsConnectors/connectMetaTitle.tsx +0 -8
- package/src/componentsConnectors/connectOption.tsx +0 -222
- package/src/componentsConnectors/connectPagination.tsx +0 -102
- package/src/componentsConnectors/connectPreview.tsx +0 -5
- package/src/componentsConnectors/connectProgress.tsx +0 -59
- package/src/componentsConnectors/connectRootOption.tsx +0 -95
- package/src/componentsConnectors/connectSection.tsx +0 -79
- package/src/componentsConnectors/connectSummary.tsx +0 -21
- package/src/componentsConnectors/connectSummaryItem.tsx +0 -102
- package/src/componentsConnectors/connectTermsheet.tsx +0 -359
- package/src/componentsConnectors/connectVariable.tsx +0 -191
- package/src/componentsConnectors/connectWizardWrapper.tsx +0 -30
- package/src/componentsConnectors/connector/componentConnector.tsx +0 -219
- package/src/componentsConnectors/library.ts +0 -35
- package/src/config.test.ts +0 -63
- package/src/config.ts +0 -11
- package/src/constants/emailValidation.ts +0 -2
- package/src/constants/phoneValidation.ts +0 -4
- package/src/definitions/path.join.d.ts +0 -4
- package/src/helpers/outputsParsing.ts +0 -412
- package/src/helpers/preloadTheme.ts +0 -17
- package/src/helpers/scriptsLoader.ts +0 -20
- package/src/hooks/usePrevious.ts +0 -9
- package/src/libs/ConditionsInitiator.ts +0 -164
- package/src/libs/ConditionsRunner/DataPopulator.ts +0 -266
- package/src/libs/ConditionsRunner.ts +0 -454
- package/src/libs/DocumentsOutputs.ts +0 -171
- package/src/libs/Eval/EvalBase.ts +0 -116
- package/src/libs/Eval/EvalFunctions.ts +0 -724
- package/src/libs/Eval/NumbersToLetters.ts +0 -185
- package/src/libs/EvalVariable.ts +0 -265
- package/src/libs/EventsTracking.ts +0 -250
- package/src/libs/InputsInitiator.ts +0 -136
- package/src/libs/NumAuto.test.ts +0 -55
- package/src/libs/NumAuto.ts +0 -56
- package/src/libs/OvcConverter.ts +0 -285
- package/src/libs/PathReader.ts +0 -272
- package/src/libs/SectionValidity.test.ts +0 -146
- package/src/libs/SectionValidity.ts +0 -110
- package/src/libs/SmartScriptStore.ts +0 -492
- package/src/misc/test_model.ts +0 -14603
- package/src/misc/test_models/connectDocumen.testmodel.json +0 -178
- package/src/misc/test_models/setDefaults.testmodel.json +0 -279
- package/src/misc/test_models/testmodel.json +0 -1
- package/src/polyfills/index.ts +0 -5
- package/src/polyfills/objectValues.ts +0 -4
- package/src/polyfills/prepend.ts +0 -31
- package/src/polyfills/stringRepeat.ts +0 -44
- package/src/redux/actions/app.test.ts +0 -123
- package/src/redux/actions/app.ts +0 -249
- package/src/redux/actions/conditions.test.ts +0 -84
- package/src/redux/actions/conditions.ts +0 -135
- package/src/redux/actions/inputs.test.ts +0 -85
- package/src/redux/actions/inputs.ts +0 -111
- package/src/redux/actions/library.ts +0 -23
- package/src/redux/actions/mandatories.ts +0 -98
- package/src/redux/actions/references.test.ts +0 -48
- package/src/redux/actions/references.ts +0 -37
- package/src/redux/actions/sagas/data.test.ts +0 -11
- package/src/redux/actions/sagas/data.ts +0 -18
- package/src/redux/actions/sagas/model.test.ts +0 -14
- package/src/redux/actions/sagas/model.ts +0 -48
- package/src/redux/actions/sagas/user.ts +0 -25
- package/src/redux/actions/smartscript.ts +0 -55
- package/src/redux/actions/user.test.ts +0 -18
- package/src/redux/actions/user.ts +0 -41
- package/src/redux/constants/app.ts +0 -36
- package/src/redux/constants/conditions.ts +0 -25
- package/src/redux/constants/inputs.ts +0 -15
- package/src/redux/constants/mandatories.ts +0 -11
- package/src/redux/constants/references.ts +0 -7
- package/src/redux/constants/sagas/data.ts +0 -1
- package/src/redux/constants/sagas/model.ts +0 -2
- package/src/redux/constants/sagas/user.ts +0 -2
- package/src/redux/constants/smartscript.ts +0 -9
- package/src/redux/constants/user.ts +0 -6
- package/src/redux/listeners/subscriber.test.ts +0 -45
- package/src/redux/listeners/subscriber.ts +0 -29
- package/src/redux/middlewares/conditionsWatcherMiddleware.test.ts +0 -370
- package/src/redux/middlewares/conditionsWatcherMiddleware.ts +0 -321
- package/src/redux/middlewares/evaluationsWatcherMiddleware.test.ts +0 -323
- package/src/redux/middlewares/evaluationsWatcherMiddleware.ts +0 -250
- package/src/redux/middlewares/mandatoriesWatcherMiddleware.ts +0 -473
- package/src/redux/middlewares/multiplesActionsMiddleware.test.ts +0 -230
- package/src/redux/middlewares/multiplesActionsMiddleware.ts +0 -121
- package/src/redux/middlewares/paginationWatcherMiddleware.ts +0 -251
- package/src/redux/middlewares/pluginsHookMiddleware.ts +0 -24
- package/src/redux/middlewares/prefillerWatcherMiddleware.test.ts +0 -118
- package/src/redux/middlewares/prefillerWatcherMiddleware.ts +0 -462
- package/src/redux/middlewares/smartscriptMiddleware.ts +0 -228
- package/src/redux/middlewares/thirdpartyScriptsMiddleware.ts +0 -41
- package/src/redux/reducers/app/customizations/initCustomizationAutoDefault.ts +0 -16
- package/src/redux/reducers/app/customizations/initCustomizationMeta.ts +0 -16
- package/src/redux/reducers/app/instance/initInstance.ts +0 -29
- package/src/redux/reducers/app/instance/setDataStatus.ts +0 -16
- package/src/redux/reducers/app/instance/updateInstance.ts +0 -30
- package/src/redux/reducers/app/instance/updateInstancePaid.ts +0 -20
- package/src/redux/reducers/app/instance.test.ts +0 -106
- package/src/redux/reducers/app/meta/fetchModelFailed.ts +0 -11
- package/src/redux/reducers/app/meta/fetchModelNonBlocking.ts +0 -11
- package/src/redux/reducers/app/meta/fetchModelSucceeded.ts +0 -11
- package/src/redux/reducers/app/meta/fetchModelUnhealthy.ts +0 -18
- package/src/redux/reducers/app/meta/fetchModelUserLocked.ts +0 -11
- package/src/redux/reducers/app/meta/initMeta.ts +0 -22
- package/src/redux/reducers/app/meta/setModelUuid.ts +0 -17
- package/src/redux/reducers/app/meta.test.ts +0 -90
- package/src/redux/reducers/app/pagination/goNextPage.ts +0 -69
- package/src/redux/reducers/app/pagination/goPage.ts +0 -81
- package/src/redux/reducers/app/pagination/goPreviousPage.ts +0 -60
- package/src/redux/reducers/app/pagination/initPagination.ts +0 -46
- package/src/redux/reducers/app/pagination/updateAvailableAppStates.ts +0 -77
- package/src/redux/reducers/app/pagination.test.ts +0 -363
- package/src/redux/reducers/app/wizard/updateAvailableSections.ts +0 -40
- package/src/redux/reducers/app/wizard.test.ts +0 -84
- package/src/redux/reducers/app.test.ts +0 -336
- package/src/redux/reducers/app.ts +0 -150
- package/src/redux/reducers/conditions/addMultipleOccurency.test.ts +0 -131
- package/src/redux/reducers/conditions/addMultipleOccurency.ts +0 -155
- package/src/redux/reducers/conditions/deleteMultipleOccurency.test.ts +0 -95
- package/src/redux/reducers/conditions/deleteMultipleOccurency.ts +0 -141
- package/src/redux/reducers/conditions/initConditions.ts +0 -18
- package/src/redux/reducers/conditions/updateDocumentConditions.test.ts +0 -47
- package/src/redux/reducers/conditions/updateDocumentConditions.ts +0 -21
- package/src/redux/reducers/conditions/updateOptionConditions.ts +0 -24
- package/src/redux/reducers/conditions/updateOptionValidatorCondition.test.ts +0 -50
- package/src/redux/reducers/conditions/updateOptionValidatorCondition.ts +0 -28
- package/src/redux/reducers/conditions/updatePrefillerConditions.ts +0 -29
- package/src/redux/reducers/conditions/updateSectionConditions.ts +0 -28
- package/src/redux/reducers/conditions/updateVariableConditions.ts +0 -25
- package/src/redux/reducers/conditions/updateVariableValidatorCondition.test.ts +0 -50
- package/src/redux/reducers/conditions/updateVariableValidatorCondition.ts +0 -28
- package/src/redux/reducers/conditions.test.ts +0 -241
- package/src/redux/reducers/conditions.ts +0 -68
- package/src/redux/reducers/inputs/addMultipleOccurency.test.ts +0 -117
- package/src/redux/reducers/inputs/addMultipleOccurency.ts +0 -50
- package/src/redux/reducers/inputs/deleteMultipleOccurency.test.ts +0 -70
- package/src/redux/reducers/inputs/deleteMultipleOccurency.ts +0 -50
- package/src/redux/reducers/inputs/initOption.ts +0 -16
- package/src/redux/reducers/inputs/initVariable.ts +0 -16
- package/src/redux/reducers/inputs/updateOptionInput.ts +0 -24
- package/src/redux/reducers/inputs/updateVariableInput.ts +0 -24
- package/src/redux/reducers/inputs.test.ts +0 -221
- package/src/redux/reducers/inputs.ts +0 -51
- package/src/redux/reducers/mandatories/addMultipleOccurency.ts +0 -52
- package/src/redux/reducers/mandatories/deleteMultipleOccurency.ts +0 -55
- package/src/redux/reducers/mandatories/initMandatoryOption.ts +0 -17
- package/src/redux/reducers/mandatories/initMandatoryVariable.ts +0 -17
- package/src/redux/reducers/mandatories/setMandatoryIgnore.ts +0 -17
- package/src/redux/reducers/mandatories/setMandatoryOption.ts +0 -25
- package/src/redux/reducers/mandatories/setMandatorySection.ts +0 -20
- package/src/redux/reducers/mandatories/setMandatoryVariable.ts +0 -24
- package/src/redux/reducers/mandatories.ts +0 -56
- package/src/redux/reducers/references/initReferences.ts +0 -37
- package/src/redux/reducers/references/updateOptionMeta.ts +0 -73
- package/src/redux/reducers/references/updateVariableMeta.ts +0 -72
- package/src/redux/reducers/references.ts +0 -59
- package/src/redux/reducers/smartscript/enableSmartScript.ts +0 -13
- package/src/redux/reducers/smartscript/initSmartScriptTriggers.ts +0 -14
- package/src/redux/reducers/smartscript/updateSmartscriptOptionHidden.ts +0 -30
- package/src/redux/reducers/smartscript/updateSmartscriptVariableHidden.ts +0 -30
- package/src/redux/reducers/smartscript.ts +0 -47
- package/src/redux/reducers/user/initUser.ts +0 -15
- package/src/redux/reducers/user/setUserStatus.ts +0 -13
- package/src/redux/reducers/user/setUserValidToken.ts +0 -13
- package/src/redux/reducers/user.test.ts +0 -51
- package/src/redux/reducers/user.ts +0 -40
- package/src/redux/routerHistore.test.ts +0 -19
- package/src/redux/routerHistory.ts +0 -26
- package/src/redux/sagas/fetchModel.test.ts +0 -76
- package/src/redux/sagas/fetchModel.ts +0 -683
- package/src/redux/sagas/homogeneousRadioInputsSaga.ts +0 -42
- package/src/redux/sagas/initInputs.ts +0 -110
- package/src/redux/sagas/runner.test.ts +0 -12
- package/src/redux/sagas/runner.ts +0 -26
- package/src/redux/sagas/saveData.test.ts +0 -125
- package/src/redux/sagas/saveData.ts +0 -55
- package/src/redux/sagas/setDefaults.test.ts +0 -100
- package/src/redux/sagas/setDefaults.ts +0 -167
- package/src/redux/sagas/setUserEmail.ts +0 -175
- package/src/redux/selectors/app.test.ts +0 -162
- package/src/redux/selectors/app.ts +0 -331
- package/src/redux/selectors/conditions.test.ts +0 -92
- package/src/redux/selectors/conditions.ts +0 -293
- package/src/redux/selectors/inputs.test.ts +0 -72
- package/src/redux/selectors/inputs.ts +0 -76
- package/src/redux/selectors/library.ts +0 -17
- package/src/redux/selectors/mandatories.ts +0 -83
- package/src/redux/selectors/references.test.ts +0 -660
- package/src/redux/selectors/references.ts +0 -413
- package/src/redux/selectors/selectors.test.ts +0 -21
- package/src/redux/selectors/selectors.ts +0 -87
- package/src/redux/selectors/smartscript.ts +0 -30
- package/src/redux/selectors/user.test.ts +0 -39
- package/src/redux/selectors/user.ts +0 -45
- package/src/redux/store.test.ts +0 -22
- package/src/redux/store.ts +0 -100
- package/src/service/api.manager.ts +0 -261
- package/src/service/auth.service.ts +0 -5
- package/src/service/pardot.service.ts +0 -10
- package/src/tests-misc/plugins/jestTestPlugin/after.tsx +0 -5
- package/src/tests-misc/plugins/jestTestPlugin/before.tsx +0 -11
- package/src/tests-misc/plugins/jestTestPlugin/index.ts +0 -11
- package/src/tests-misc/plugins/jestTestPlugin/title.tsx +0 -8
- package/src/tests-misc/themes/jestTestTheme/components/EmailComponent.tsx +0 -5
- package/src/tests-misc/themes/jestTestTheme/components/TermsheetComponent.tsx +0 -5
- package/src/tests-misc/themes/jestTestTheme/components/WizardComponent.tsx +0 -5
- package/src/tests-misc/themes/jestTestTheme/faltyIndex.ts +0 -3
- package/src/tests-misc/themes/jestTestTheme/faltyIndexLoader.ts +0 -1
- package/src/tests-misc/themes/jestTestTheme/index.ts +0 -13
- package/src/types/Actions.type.ts +0 -612
- package/src/types/Components.type.ts +0 -181
- package/src/types/State.type.ts +0 -323
- package/src/types/Termsheet.type.ts +0 -28
- package/src/types/api.type.ts +0 -37
- package/src/types/config.type.ts +0 -55
- package/src/types/env.type.ts +0 -5
- package/src/types/getActions.type.ts +0 -3
- package/src/types/getConnectors.type.ts +0 -5
- package/src/types/getSelectors.type.ts +0 -3
- package/src/wizard-params.ts +0 -56
- package/tsconfig.json +0 -43
|
@@ -1,359 +0,0 @@
|
|
|
1
|
-
import { compose } from "redux";
|
|
2
|
-
import { connect } from "react-redux";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import type { SectionV3 } from "@legalplace/models-v3-types";
|
|
5
|
-
import { StateType } from "../types/State.type";
|
|
6
|
-
import { TermsheetRow } from "../types/Termsheet.type";
|
|
7
|
-
import { TermsheetPropsType } from "../types/Components.type";
|
|
8
|
-
import { PluginLoader, ReplaceComponent } from "../PluginLoader";
|
|
9
|
-
import { selectAvailableSections } from "../redux/selectors/app";
|
|
10
|
-
import {
|
|
11
|
-
selectSectionReference,
|
|
12
|
-
selectOptionReference,
|
|
13
|
-
selectVariableReference,
|
|
14
|
-
} from "../redux/selectors/references";
|
|
15
|
-
import {
|
|
16
|
-
selectOptionInput,
|
|
17
|
-
selectVariableInputByIndex,
|
|
18
|
-
selectOptionInputByIndex,
|
|
19
|
-
} from "../redux/selectors/inputs";
|
|
20
|
-
import {
|
|
21
|
-
selectOptionConditionValue,
|
|
22
|
-
selectSectionConditionValue,
|
|
23
|
-
selectVariableConditionValue,
|
|
24
|
-
selectOptionValidatorConditionValue,
|
|
25
|
-
selectVariableValidatorConditionValue,
|
|
26
|
-
} from "../redux/selectors/conditions";
|
|
27
|
-
import { PathReader } from "../libs/PathReader";
|
|
28
|
-
import { isLevelAccessibleForUser } from "../redux/selectors/user";
|
|
29
|
-
import { parseOptionLabel } from "../helpers/outputsParsing";
|
|
30
|
-
|
|
31
|
-
const pushMultipleLabelForOption = (
|
|
32
|
-
optionId: number,
|
|
33
|
-
index: number,
|
|
34
|
-
termsheet: TermsheetRow[],
|
|
35
|
-
pageNumber: number
|
|
36
|
-
) => {
|
|
37
|
-
const optionReference = selectOptionReference(optionId);
|
|
38
|
-
if (optionReference === undefined)
|
|
39
|
-
throw new Error(`Option ${optionId} does not exist`);
|
|
40
|
-
|
|
41
|
-
if (optionReference.meta.termsheet?.hide === true) return;
|
|
42
|
-
|
|
43
|
-
// Defining occurency id
|
|
44
|
-
let occurencyId = index + 1;
|
|
45
|
-
|
|
46
|
-
// Current Multiple label
|
|
47
|
-
const label =
|
|
48
|
-
optionReference.meta?.multiple?.label ||
|
|
49
|
-
optionReference.meta?.multiple?.cta ||
|
|
50
|
-
""; // TODO: Should we add default string?
|
|
51
|
-
|
|
52
|
-
// Incrementation step
|
|
53
|
-
if (optionReference.meta.multiple?.incrementationStart) {
|
|
54
|
-
const { incrementationStart } = optionReference.meta.multiple;
|
|
55
|
-
occurencyId += incrementationStart - 1;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
termsheet.push({
|
|
59
|
-
label: `${label} ${occurencyId}`,
|
|
60
|
-
type: "multiplelabel",
|
|
61
|
-
pageNumber,
|
|
62
|
-
hash: "",
|
|
63
|
-
value: "",
|
|
64
|
-
allowUpdate: false,
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Adds a variable to the termsheet
|
|
70
|
-
* @param variableId Variable's id
|
|
71
|
-
* @param index Occurency index
|
|
72
|
-
* @param termsheet termsheet
|
|
73
|
-
* @param pageNumber page number
|
|
74
|
-
*/
|
|
75
|
-
const rolldownTermsheetForVariable = (
|
|
76
|
-
variableId: number,
|
|
77
|
-
index: number,
|
|
78
|
-
termsheet: TermsheetRow[],
|
|
79
|
-
pageNumber: number
|
|
80
|
-
) => {
|
|
81
|
-
const variableReference = selectVariableReference(variableId);
|
|
82
|
-
if (variableReference === undefined)
|
|
83
|
-
throw new Error(`Variable ${variableId} does not exist`);
|
|
84
|
-
|
|
85
|
-
// Making sure variable isn't hidden from termsheet
|
|
86
|
-
if (variableReference.termsheet?.hide === true) return;
|
|
87
|
-
|
|
88
|
-
// Getting variable's value
|
|
89
|
-
let value = selectVariableInputByIndex(variableId, index);
|
|
90
|
-
value = value || "";
|
|
91
|
-
|
|
92
|
-
// Checking variable's condition
|
|
93
|
-
const variableCondition = selectVariableConditionValue(variableId, index);
|
|
94
|
-
const variableValidator = selectVariableValidatorConditionValue(
|
|
95
|
-
variableId,
|
|
96
|
-
index
|
|
97
|
-
);
|
|
98
|
-
|
|
99
|
-
// Making sure variable is accessible for current user
|
|
100
|
-
const { grantLevel } = variableReference;
|
|
101
|
-
if (!isLevelAccessibleForUser(grantLevel || "GUEST")) return;
|
|
102
|
-
|
|
103
|
-
let { label } = variableReference;
|
|
104
|
-
if (
|
|
105
|
-
typeof variableReference.termsheet?.label === "string" &&
|
|
106
|
-
variableReference.termsheet?.label.trim().length > 0
|
|
107
|
-
) {
|
|
108
|
-
label = variableReference.termsheet?.label;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const variableTermsheet: TermsheetRow = {
|
|
112
|
-
type: "variable",
|
|
113
|
-
label,
|
|
114
|
-
valid: variableValidator !== false,
|
|
115
|
-
value: typeof value === "number" ? value.toString() : value,
|
|
116
|
-
pageNumber,
|
|
117
|
-
hash: `variable-${variableId}-${index}`,
|
|
118
|
-
allowUpdate: variableReference.type !== "eval",
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
if (variableCondition !== false && variableReference.hidden !== false)
|
|
122
|
-
termsheet.push(variableTermsheet);
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Adds an option to the termsheet
|
|
127
|
-
* @param optionId Option's id
|
|
128
|
-
* @param index Occurency index
|
|
129
|
-
* @param termsheet termsheet
|
|
130
|
-
* @param pageNumber page number
|
|
131
|
-
*/
|
|
132
|
-
const rolldownTermsheetForOption = (
|
|
133
|
-
optionId: number,
|
|
134
|
-
index: number,
|
|
135
|
-
termsheet: TermsheetRow[],
|
|
136
|
-
pageNumber: number
|
|
137
|
-
) => {
|
|
138
|
-
const optionReference = selectOptionReference(optionId);
|
|
139
|
-
if (optionReference === undefined)
|
|
140
|
-
throw new Error(`Option ${optionId} does not exist`);
|
|
141
|
-
|
|
142
|
-
const optionInput = selectOptionInputByIndex(optionId, index);
|
|
143
|
-
const optionCondition = selectOptionConditionValue(optionId, index);
|
|
144
|
-
const optionValidator = selectOptionValidatorConditionValue(optionId, index);
|
|
145
|
-
|
|
146
|
-
if (
|
|
147
|
-
(optionReference.meta.type !== "checkbox" && optionInput === false) ||
|
|
148
|
-
optionCondition === false ||
|
|
149
|
-
["hidden", "repeated", "box", "separator", "brut-text"].includes(
|
|
150
|
-
optionReference.meta.type
|
|
151
|
-
)
|
|
152
|
-
) {
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Getting termsheet value
|
|
158
|
-
*/
|
|
159
|
-
const radioChilds = optionReference.options.filter((childId) => {
|
|
160
|
-
const childReference = selectOptionReference(childId);
|
|
161
|
-
if (childReference === undefined)
|
|
162
|
-
throw new Error(`Option ${childId} does not exist`);
|
|
163
|
-
|
|
164
|
-
return childReference.meta.type === "radio";
|
|
165
|
-
});
|
|
166
|
-
const selectedChild = radioChilds.filter((childId) =>
|
|
167
|
-
selectOptionInputByIndex(childId, index)
|
|
168
|
-
);
|
|
169
|
-
let value = selectedChild
|
|
170
|
-
.map((childId) => {
|
|
171
|
-
const childReference = selectOptionReference(childId);
|
|
172
|
-
if (childReference === undefined)
|
|
173
|
-
throw new Error(`Option ${childId} does not exist`);
|
|
174
|
-
const label = parseOptionLabel(childId, index);
|
|
175
|
-
return label;
|
|
176
|
-
})
|
|
177
|
-
.join("");
|
|
178
|
-
|
|
179
|
-
// Checkbox
|
|
180
|
-
if (optionReference.meta.type === "checkbox") {
|
|
181
|
-
value = optionInput === true ? "Oui" : "Non";
|
|
182
|
-
} else if (
|
|
183
|
-
optionReference.meta.type === "static" &&
|
|
184
|
-
radioChilds.length === 0
|
|
185
|
-
) {
|
|
186
|
-
value = "null-value";
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
let { label } = optionReference.meta;
|
|
190
|
-
if (
|
|
191
|
-
typeof optionReference.meta.termsheet?.label === "string" &&
|
|
192
|
-
optionReference.meta.termsheet?.label.trim().length > 0
|
|
193
|
-
) {
|
|
194
|
-
label = optionReference.meta.termsheet?.label;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
if (/\[var:([0-9]+)\]/gi.test(label))
|
|
198
|
-
label = parseOptionLabel(optionId, index);
|
|
199
|
-
|
|
200
|
-
// If option has radio child or a value oui push it to the termsheet
|
|
201
|
-
if (optionReference.meta.termsheet?.hide !== true) {
|
|
202
|
-
termsheet.push({
|
|
203
|
-
pageNumber,
|
|
204
|
-
hash: `option-${optionId}-${index}`,
|
|
205
|
-
valid: optionValidator !== false,
|
|
206
|
-
label,
|
|
207
|
-
value,
|
|
208
|
-
type: "option",
|
|
209
|
-
allowUpdate: true,
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Getting children options termsheets
|
|
215
|
-
*/
|
|
216
|
-
if (optionInput === true) {
|
|
217
|
-
optionReference.options.forEach((childrenId) => {
|
|
218
|
-
rolldownTermsheetForOption(childrenId, index, termsheet, pageNumber);
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Getting variables termsheets
|
|
224
|
-
*/
|
|
225
|
-
if (optionInput === true) {
|
|
226
|
-
optionReference.variables.forEach((variableId) => {
|
|
227
|
-
rolldownTermsheetForVariable(variableId, index, termsheet, pageNumber);
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
/**
|
|
232
|
-
* Fills the termsheet array with the section's data & children
|
|
233
|
-
* @param section Section
|
|
234
|
-
* @param sectionIndex Section's index
|
|
235
|
-
* @param termsheet Termsheet array
|
|
236
|
-
*/
|
|
237
|
-
const rolldownTermsheetForSection = (
|
|
238
|
-
section: SectionV3,
|
|
239
|
-
sectionIndex = 0,
|
|
240
|
-
termsheet: TermsheetRow[]
|
|
241
|
-
) => {
|
|
242
|
-
const pageNumber = sectionIndex + 1;
|
|
243
|
-
const sectionTermsheetRow: TermsheetRow = {
|
|
244
|
-
label: section.label,
|
|
245
|
-
preLabel: pageNumber < 10 ? `0${pageNumber}` : pageNumber.toString(),
|
|
246
|
-
type: "section",
|
|
247
|
-
pageNumber,
|
|
248
|
-
hash: "",
|
|
249
|
-
value: "",
|
|
250
|
-
allowUpdate: false,
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
// Filling current section
|
|
254
|
-
termsheet.push(sectionTermsheetRow);
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* Reading root options
|
|
258
|
-
*/
|
|
259
|
-
section.options.forEach((optionId) => {
|
|
260
|
-
const inputs = selectOptionInput(optionId);
|
|
261
|
-
const optionReference = selectOptionReference(optionId);
|
|
262
|
-
if (optionReference === undefined)
|
|
263
|
-
throw new Error(`Option ${optionId} does not exist`);
|
|
264
|
-
|
|
265
|
-
const { grantLevel } = optionReference.meta;
|
|
266
|
-
if (!isLevelAccessibleForUser(grantLevel || "GUEST")) return;
|
|
267
|
-
|
|
268
|
-
// Adding multiples termsheet pointer
|
|
269
|
-
inputs.forEach((value, index) => {
|
|
270
|
-
// Multiple label
|
|
271
|
-
if (inputs.length > 1) {
|
|
272
|
-
pushMultipleLabelForOption(optionId, index, termsheet, pageNumber);
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
// Rolling down option
|
|
276
|
-
rolldownTermsheetForOption(optionId, index, termsheet, pageNumber);
|
|
277
|
-
});
|
|
278
|
-
|
|
279
|
-
// Adding an empty multiple label to act as a separator
|
|
280
|
-
if (inputs.length > 1 && optionReference.meta.termsheet?.hide !== true) {
|
|
281
|
-
termsheet.push({
|
|
282
|
-
label: "",
|
|
283
|
-
type: "multiplelabel",
|
|
284
|
-
pageNumber,
|
|
285
|
-
hash: "",
|
|
286
|
-
value: "",
|
|
287
|
-
allowUpdate: false,
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
});
|
|
291
|
-
|
|
292
|
-
if (termsheet[termsheet.length - 1] === sectionTermsheetRow) {
|
|
293
|
-
termsheet.splice(termsheet.indexOf(sectionTermsheetRow), 1);
|
|
294
|
-
}
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* Termsheet Higher-Order-Component
|
|
299
|
-
* @param Component UI Component
|
|
300
|
-
*/
|
|
301
|
-
const TermsheetHooc =
|
|
302
|
-
(
|
|
303
|
-
Component: React.ComponentType<TermsheetPropsType>
|
|
304
|
-
): React.FC<TermsheetPropsType> =>
|
|
305
|
-
// eslint-disable-next-line react/display-name
|
|
306
|
-
(props) => {
|
|
307
|
-
// Before tags anchor
|
|
308
|
-
const beforeAnchors = ["beforeTermsheet"];
|
|
309
|
-
|
|
310
|
-
// After tags anchor
|
|
311
|
-
const afterAnchors = ["afterTermsheet"];
|
|
312
|
-
|
|
313
|
-
// Component replace
|
|
314
|
-
const replaceAnchors = ["Termsheet"];
|
|
315
|
-
const FinalComponent = ReplaceComponent(replaceAnchors, Component);
|
|
316
|
-
|
|
317
|
-
return (
|
|
318
|
-
<>
|
|
319
|
-
<PluginLoader anchor={beforeAnchors} props={props} />
|
|
320
|
-
<FinalComponent {...props} />
|
|
321
|
-
<PluginLoader anchor={afterAnchors} props={props} />
|
|
322
|
-
</>
|
|
323
|
-
);
|
|
324
|
-
};
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* Mapping redux to props
|
|
328
|
-
* @param state Redux State
|
|
329
|
-
*/
|
|
330
|
-
const mapStateToProps = (state: StateType): TermsheetPropsType => {
|
|
331
|
-
const pathReader = new PathReader(state);
|
|
332
|
-
|
|
333
|
-
// Getting list of sections
|
|
334
|
-
const sectionsIds = selectAvailableSections();
|
|
335
|
-
const termsheet: TermsheetRow[] = [];
|
|
336
|
-
|
|
337
|
-
// Looping through sections
|
|
338
|
-
sectionsIds.forEach((sectionId, sectionIndex) => {
|
|
339
|
-
const sectionReference = selectSectionReference(sectionId);
|
|
340
|
-
if (sectionReference === undefined)
|
|
341
|
-
throw new Error(`Section ${sectionId} does not exist`);
|
|
342
|
-
const sectionCondition = selectSectionConditionValue(sectionId);
|
|
343
|
-
if (sectionCondition === false) return;
|
|
344
|
-
rolldownTermsheetForSection(sectionReference, sectionIndex, termsheet);
|
|
345
|
-
});
|
|
346
|
-
|
|
347
|
-
return {
|
|
348
|
-
termsheet,
|
|
349
|
-
parseLink: (page: number): string => pathReader.parsePath(page),
|
|
350
|
-
};
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* Composing the UI component connector
|
|
355
|
-
*/
|
|
356
|
-
export const connectTermsheet = compose(
|
|
357
|
-
connect(mapStateToProps),
|
|
358
|
-
TermsheetHooc
|
|
359
|
-
);
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
import type { VariableV3 } from "@legalplace/models-v3-types";
|
|
2
|
-
import {
|
|
3
|
-
componentConnector,
|
|
4
|
-
ConnectorStateToProps,
|
|
5
|
-
ConnectorDispatchProps,
|
|
6
|
-
ConnectorMapSelectors,
|
|
7
|
-
} from "./connector/componentConnector";
|
|
8
|
-
import { isStepAvailable } from "../redux/selectors/app";
|
|
9
|
-
import {
|
|
10
|
-
parseRawWithVariables,
|
|
11
|
-
parseVariableLabel,
|
|
12
|
-
} from "../helpers/outputsParsing";
|
|
13
|
-
|
|
14
|
-
export type ConnectVariableOwnProps = {
|
|
15
|
-
id: number;
|
|
16
|
-
index: number;
|
|
17
|
-
};
|
|
18
|
-
export type ConnectVariableMapProps = {
|
|
19
|
-
id: number;
|
|
20
|
-
index: number;
|
|
21
|
-
label: string;
|
|
22
|
-
type: string;
|
|
23
|
-
value: string | number;
|
|
24
|
-
condition?: boolean;
|
|
25
|
-
validator?: boolean;
|
|
26
|
-
validatorMessage: string;
|
|
27
|
-
mandatoryValidated: boolean;
|
|
28
|
-
mandatoryIgnore: boolean;
|
|
29
|
-
display: boolean;
|
|
30
|
-
meta: VariableV3;
|
|
31
|
-
};
|
|
32
|
-
export type ConnectVariableDispatchProps = {
|
|
33
|
-
updateVariable: (value: string | number) => void;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* canVariableDisplay
|
|
38
|
-
* ----------------
|
|
39
|
-
* This helper function checks whether an option
|
|
40
|
-
* can be displayed. It currently handle this cases:
|
|
41
|
-
* - Checks stepTwo options
|
|
42
|
-
* - Checks special grants options
|
|
43
|
-
* @param id Option's ID
|
|
44
|
-
* @param selectors StateToProps selectors
|
|
45
|
-
* @returns (boolean)
|
|
46
|
-
*/
|
|
47
|
-
const canVariableDisplay = (
|
|
48
|
-
id: number,
|
|
49
|
-
index: number,
|
|
50
|
-
selectors: ConnectorMapSelectors
|
|
51
|
-
) => {
|
|
52
|
-
// Getting selectors
|
|
53
|
-
const { selectVariableReference, isLevelAccessibleForUser } = selectors;
|
|
54
|
-
const variable = selectVariableReference(id);
|
|
55
|
-
|
|
56
|
-
// Variable diplay
|
|
57
|
-
let display = isStepAvailable(variable.step);
|
|
58
|
-
|
|
59
|
-
// Checking if variable is hidden by model or smartscript on all indexes
|
|
60
|
-
display = display && !(variable.hidden === true);
|
|
61
|
-
|
|
62
|
-
// Checking if variable's index is hidden by smartscript
|
|
63
|
-
display =
|
|
64
|
-
display && !selectors.selectIsSmartscriptVariableIndexHidden(id, index);
|
|
65
|
-
|
|
66
|
-
// Grant
|
|
67
|
-
display = display && isLevelAccessibleForUser(variable.grantLevel || "GUEST");
|
|
68
|
-
|
|
69
|
-
// Returning result
|
|
70
|
-
return display;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* stateToProps
|
|
75
|
-
* ------------
|
|
76
|
-
* State to props function maps state to connected
|
|
77
|
-
* component's props
|
|
78
|
-
* @param selectors StateToProps selectors
|
|
79
|
-
*/
|
|
80
|
-
const stateToProps: ConnectorStateToProps<
|
|
81
|
-
ConnectVariableOwnProps,
|
|
82
|
-
ConnectVariableMapProps
|
|
83
|
-
> = (selectors) => (state, ownProps) => {
|
|
84
|
-
// Getting selectors
|
|
85
|
-
const {
|
|
86
|
-
selectVariableReference,
|
|
87
|
-
selectVariableInputByIndex,
|
|
88
|
-
selectVariableConditionValue,
|
|
89
|
-
selectVariableValidatorConditionValue,
|
|
90
|
-
selectMandatoryVariableByIndex,
|
|
91
|
-
} = selectors;
|
|
92
|
-
|
|
93
|
-
// Extracting id & index from ownProps
|
|
94
|
-
const { id, index } = ownProps;
|
|
95
|
-
|
|
96
|
-
// Getting variable's reference
|
|
97
|
-
const variable = selectVariableReference(id);
|
|
98
|
-
|
|
99
|
-
// Getting & parsing label (if needed)
|
|
100
|
-
const label = parseVariableLabel(id, index);
|
|
101
|
-
|
|
102
|
-
// Variable diplay
|
|
103
|
-
const display = canVariableDisplay(id, index, selectors);
|
|
104
|
-
|
|
105
|
-
// Getting variable's value
|
|
106
|
-
const value = selectVariableInputByIndex(id, index) || "";
|
|
107
|
-
|
|
108
|
-
// Getting condition
|
|
109
|
-
const condition = selectVariableConditionValue(id, index);
|
|
110
|
-
|
|
111
|
-
// Getting validator
|
|
112
|
-
const validator = selectVariableValidatorConditionValue(id, index);
|
|
113
|
-
|
|
114
|
-
// Extracting label & type from reference
|
|
115
|
-
const { type } = variable;
|
|
116
|
-
|
|
117
|
-
// Getting mandatory validator
|
|
118
|
-
const mandatoryValidated = selectMandatoryVariableByIndex(id, index);
|
|
119
|
-
|
|
120
|
-
// Getting MandartoryIgnore
|
|
121
|
-
const mandatoryIgnore = selectors.selectMandatoryIgnore();
|
|
122
|
-
|
|
123
|
-
// Injecting variables into validator message
|
|
124
|
-
const validatorMessage =
|
|
125
|
-
typeof variable.validator?.message === "string"
|
|
126
|
-
? parseRawWithVariables(variable.validator.message)
|
|
127
|
-
: "";
|
|
128
|
-
|
|
129
|
-
// Parsing helper's variables
|
|
130
|
-
const helper = variable.helper
|
|
131
|
-
? parseRawWithVariables(variable.helper, undefined, "________________")
|
|
132
|
-
: undefined;
|
|
133
|
-
|
|
134
|
-
// Parsing warning's variables
|
|
135
|
-
const warning = variable.warning
|
|
136
|
-
? parseRawWithVariables(variable.warning, undefined, "________________")
|
|
137
|
-
: undefined;
|
|
138
|
-
|
|
139
|
-
return {
|
|
140
|
-
id,
|
|
141
|
-
index,
|
|
142
|
-
label,
|
|
143
|
-
type,
|
|
144
|
-
meta: {
|
|
145
|
-
...variable,
|
|
146
|
-
helper,
|
|
147
|
-
warning,
|
|
148
|
-
},
|
|
149
|
-
value,
|
|
150
|
-
condition,
|
|
151
|
-
validator,
|
|
152
|
-
validatorMessage,
|
|
153
|
-
mandatoryValidated,
|
|
154
|
-
mandatoryIgnore,
|
|
155
|
-
display,
|
|
156
|
-
};
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* dispatchToProps
|
|
161
|
-
* ------------
|
|
162
|
-
* Dispatch to props function maps dispatch to connected
|
|
163
|
-
* component's props
|
|
164
|
-
* @param actions DispatchToProps actions
|
|
165
|
-
*/
|
|
166
|
-
const dispatchToProps: ConnectorDispatchProps<
|
|
167
|
-
ConnectVariableOwnProps,
|
|
168
|
-
ConnectVariableDispatchProps
|
|
169
|
-
> = (actions) => (dispatch, ownProps) => ({
|
|
170
|
-
updateVariable: (value: string | number) =>
|
|
171
|
-
dispatch(actions.updateVariableAction(ownProps.id, value, ownProps.index)),
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Creating our component connector
|
|
176
|
-
*/
|
|
177
|
-
export const connectVariable = componentConnector({
|
|
178
|
-
componentName: "Variable",
|
|
179
|
-
stateToProps,
|
|
180
|
-
dispatchToProps,
|
|
181
|
-
additionnalHooks: (props, hookType) => {
|
|
182
|
-
const { tags, type } = props.meta;
|
|
183
|
-
const hooks: string[] = [`${hookType}VariableOfType(${type})`];
|
|
184
|
-
if (Array.isArray(tags)) {
|
|
185
|
-
tags.forEach((currentTag) => {
|
|
186
|
-
hooks.push(`${hookType}Tag{${currentTag}}`);
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
return hooks;
|
|
190
|
-
},
|
|
191
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
componentConnector,
|
|
3
|
-
ConnectorDispatchProps,
|
|
4
|
-
} from "./connector/componentConnector";
|
|
5
|
-
|
|
6
|
-
export type ConnectWizardWrapperDispatchProps = {
|
|
7
|
-
openPreview: () => void;
|
|
8
|
-
closePreview: () => void;
|
|
9
|
-
};
|
|
10
|
-
export type ConnectWizardWrapperOwnProps = {};
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* dispatchToProps
|
|
14
|
-
* ------------
|
|
15
|
-
* Dispatch to props function maps dispatch to connected
|
|
16
|
-
* component's props
|
|
17
|
-
* @param actions DispatchToProps actions
|
|
18
|
-
*/
|
|
19
|
-
const dispatchToProps: ConnectorDispatchProps<
|
|
20
|
-
ConnectWizardWrapperOwnProps,
|
|
21
|
-
ConnectWizardWrapperDispatchProps
|
|
22
|
-
> = () => (dispatch) => ({
|
|
23
|
-
openPreview: () => dispatch({ type: "OPEN_PREVIEW" }),
|
|
24
|
-
closePreview: () => dispatch({ type: "CLOSE_PREVIEW" }),
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export const connectWizardWrapper = componentConnector({
|
|
28
|
-
componentName: "WizardWrapper",
|
|
29
|
-
dispatchToProps,
|
|
30
|
-
});
|