@wise/dynamic-flow-client 3.5.0-experimental-63c768d → 3.5.1-experimental-ccbce45
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/build/common/errorBoundary/ErrorBoundaryAlert.js +1 -1
- package/build/common/httpClientContext/HttpClientContext.js +2 -13
- package/build/common/makeHttpClient/makeHttpClient.spec.js +10 -10
- package/build/common/messages/external-confirmation.messages.js +5 -5
- package/build/common/messages/generic-error.messages.js +4 -4
- package/build/common/messages/help.messages.js +2 -2
- package/build/common/messages/multi-file-upload.messages.js +4 -4
- package/build/common/messages/multi-select.messages.js +2 -2
- package/build/common/messages/paragraph.messages.js +3 -3
- package/build/common/messages/repeatable.messages.js +5 -5
- package/build/common/messages/validation.array.messages.js +3 -3
- package/build/common/messages/validation.messages.js +11 -11
- package/build/i18n/index.js +1 -1
- package/build/legacy/common/constants/DateMode.js +1 -1
- package/build/legacy/common/constants/FormControlType.js +1 -1
- package/build/legacy/common/constants/MonthFormat.js +1 -1
- package/build/legacy/common/constants/Size.js +1 -1
- package/build/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +3 -14
- package/build/legacy/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +3 -1
- package/build/legacy/common/contexts/eventsContext/EventsContext.js +2 -2
- package/build/legacy/common/contexts/eventsContext/EventsContext.spec.js +1 -12
- package/build/legacy/common/contexts/featureContext/FeatureContext.js +1 -12
- package/build/legacy/common/contexts/featureContext/FeatureContext.spec.js +4 -15
- package/build/legacy/common/contexts/logContext/LogContext.js +2 -2
- package/build/legacy/common/contexts/logContext/LogContext.spec.js +1 -12
- package/build/legacy/common/hooks/useExternal/useExternal.spec.js +6 -6
- package/build/legacy/common/hooks/useExternalStepPolling/useExternalStepPolling.js +3 -2
- package/build/legacy/common/hooks/usePersistAsync/usePersistAsync.js +1 -1
- package/build/legacy/common/hooks/usePolling/usePolling.js +4 -2
- package/build/legacy/common/hooks/useStepPolling/useStepPolling.js +5 -3
- package/build/legacy/common/hooks/useStepPolling/useStepPolling.spec.js +4 -4
- package/build/legacy/common/messages.js +2 -2
- package/build/legacy/common/utils/file-utils.spec.js +4 -4
- package/build/legacy/common/utils/mobile-utils.spec.js +1 -1
- package/build/legacy/common/utils/schema-utils.js +2 -2
- package/build/legacy/common/validators/models/model-utils.spec.js +7 -7
- package/build/legacy/common/validators/models/model-validators.js +2 -2
- package/build/legacy/common/validators/models/model-validators.spec.js +54 -54
- package/build/legacy/common/validators/schemas/schema-validators.js +1 -1
- package/build/legacy/common/validators/schemas/schema-validators.spec.js +20 -20
- package/build/legacy/common/validators/validationFailures/validation-failures.js +2 -2
- package/build/legacy/common/validators/validationFailures/validation-failures.spec.js +11 -11
- package/build/legacy/dynamicFlow/BackButton.js +2 -2
- package/build/legacy/dynamicFlow/DynamicFlow.js +5 -5
- package/build/legacy/dynamicFlow/stories/dev-tools/DynamicFlow.story.js +7 -7
- package/build/legacy/dynamicFlow/stories/dev-tools/ErrorResponses.story.js +18 -18
- package/build/legacy/dynamicFlow/stories/dev-tools/Examples.story.js +1 -1
- package/build/legacy/dynamicFlow/stories/dev-tools/Features.story.js +1 -1
- package/build/legacy/dynamicFlow/stories/dev-tools/JsonSchemaForm.story.js +5 -5
- package/build/legacy/dynamicFlow/stories/dev-tools/RefreshOnChange.story.js +24 -24
- package/build/legacy/dynamicFlow/stories/dev-tools/SearchFeature.story.js +10 -21
- package/build/legacy/dynamicFlow/stories/dev-tools/ServerTest.story.js +4 -4
- package/build/legacy/dynamicFlow/stories/dev-tools/Upload.story.js +19 -19
- package/build/legacy/dynamicFlow/stories/dev-tools/ValidationAsync.story.js +18 -18
- package/build/legacy/dynamicFlow/stories/examples/ObjectConst.story.js +25 -25
- package/build/legacy/dynamicFlow/tests/Actions.spec.js +6 -6
- package/build/legacy/dynamicFlow/tests/AllOfSchema.spec.js +17 -17
- package/build/legacy/dynamicFlow/tests/AutocompleteHints.spec.js +6 -6
- package/build/legacy/dynamicFlow/tests/DynamicFlow.BackButton.spec.js +11 -11
- package/build/legacy/dynamicFlow/tests/DynamicFlow.search.spec.js +13 -13
- package/build/legacy/dynamicFlow/tests/DynamicFlow.spec.js +48 -48
- package/build/legacy/dynamicFlow/tests/DynamicImage.spec.js +4 -4
- package/build/legacy/dynamicFlow/tests/DynamicInstructions.spec.js +3 -3
- package/build/legacy/dynamicFlow/tests/HiddenSchemas.spec.js +24 -24
- package/build/legacy/dynamicFlow/tests/ModalLayout.spec.js +20 -20
- package/build/legacy/dynamicFlow/tests/MultiSelect.spec.js +21 -21
- package/build/legacy/dynamicFlow/tests/MultipleFileUploadSchema.spec.js +24 -24
- package/build/legacy/dynamicFlow/tests/ObjectSchema.spec.js +16 -16
- package/build/legacy/dynamicFlow/tests/OneOfSchema.spec.js +77 -77
- package/build/legacy/dynamicFlow/tests/PersistAsync.blob-schema.spec.js +19 -19
- package/build/legacy/dynamicFlow/tests/PersistAsync.string-schema.spec.js +10 -10
- package/build/legacy/dynamicFlow/tests/RefreshStepOnChange.debouncing.spec.js +19 -19
- package/build/legacy/dynamicFlow/tests/RefreshStepOnChange.spec.js +46 -46
- package/build/legacy/dynamicFlow/tests/RepeatableSchema.spec.js +62 -62
- package/build/legacy/dynamicFlow/tests/StepModel.spec.js +6 -6
- package/build/legacy/dynamicFlow/tests/ValidationAsync.spec.js +13 -13
- package/build/legacy/dynamicFlow/utils/responseParsers/response-parsers.spec.js +13 -13
- package/build/legacy/dynamicFlow/utils/useDynamicFlowState.js +4 -4
- package/build/legacy/formControl/FormControl.js +9 -9
- package/build/legacy/formControl/Select.spec.js +3 -3
- package/build/legacy/formControl/utils/getAutocompleteString.js +1 -1
- package/build/legacy/formControl/utils/value-utils.js +1 -1
- package/build/legacy/jsonSchemaForm/JsonSchemaForm.end-to-end.spec.js +66 -66
- package/build/legacy/jsonSchemaForm/JsonSchemaForm.js +1 -1
- package/build/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.js +5 -5
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +1 -1
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +1 -1
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.js +6 -17
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +3 -3
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +1 -1
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.js +7 -7
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.js +6 -6
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/utils/summary-utils.js +7 -7
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/utils/summary-utils.spec.js +190 -190
- package/build/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +8 -19
- package/build/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.js +14 -14
- package/build/legacy/jsonSchemaForm/genericSchema/GenericSchema.rtl.spec.js +2 -2
- package/build/legacy/jsonSchemaForm/help/Help.js +1 -12
- package/build/legacy/jsonSchemaForm/objectSchema/ObjectSchema.js +4 -4
- package/build/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.js +12 -12
- package/build/legacy/jsonSchemaForm/oneOfSchema/utils.js +6 -6
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +1 -1
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +2 -2
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +4 -4
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +2 -2
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +2 -2
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +1 -12
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +1 -1
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +3 -3
- package/build/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +1 -1
- package/build/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +3 -3
- package/build/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +6 -6
- package/build/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.spec.js +12 -12
- package/build/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +10 -10
- package/build/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.spec.js +23 -23
- package/build/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +2 -2
- package/build/legacy/layout/DynamicLayout.js +1 -1
- package/build/legacy/layout/box/DynamicBox.js +2 -13
- package/build/legacy/layout/button/DynamicButton.js +1 -12
- package/build/legacy/layout/button/DynamicButton.spec.js +13 -24
- package/build/legacy/layout/button/utils.js +3 -3
- package/build/legacy/layout/button/utils.spec.js +6 -6
- package/build/legacy/layout/columns/DynamicColumns.js +4 -15
- package/build/legacy/layout/decision/DynamicDecision.js +1 -12
- package/build/legacy/layout/external/DynamicExternal.js +1 -1
- package/build/legacy/layout/external/DynamicExternal.messages.js +2 -2
- package/build/legacy/layout/form/DynamicForm.js +2 -2
- package/build/legacy/layout/heading/DynamicHeading.js +8 -19
- package/build/legacy/layout/image/DynamicImage.js +5 -4
- package/build/legacy/layout/instructions/DynamicInstructions.js +1 -12
- package/build/legacy/layout/list/DynamicStatusList.js +3 -3
- package/build/legacy/layout/list/DynamicStatusList.spec.js +9 -9
- package/build/legacy/layout/loadingIndicator/DynamicLoadingIndicator.js +1 -1
- package/build/legacy/layout/markdown/DynamicMarkdown.js +2 -13
- package/build/legacy/layout/markdown/DynamicMarkdown.spec.js +4 -4
- package/build/legacy/layout/modal/DynamicModal.js +2 -2
- package/build/legacy/layout/paragraph/DynamicParagraph.js +5 -16
- package/build/legacy/layout/review/DynamicReview.js +3 -14
- package/build/legacy/layout/review/DynamicReview.spec.js +6 -6
- package/build/legacy/layout/search/DynamicSearch.js +2 -13
- package/build/legacy/layout/search/SearchInput.js +1 -12
- package/build/legacy/layout/search/SearchResults.js +3 -14
- package/build/legacy/layout/search/useSearch.js +4 -4
- package/build/legacy/layout/utils/getNavigationOptionMedia.js +2 -13
- package/build/legacy/step/cameraStep/CameraStep.js +1 -1
- package/build/legacy/step/cameraStep/cameraCapture/CameraCapture.js +6 -6
- package/build/legacy/step/cameraStep/cameraCapture/CameraCapture.messages.js +12 -12
- package/build/legacy/step/cameraStep/cameraCapture/CameraCapture.spec.js +13 -13
- package/build/legacy/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.js +3 -14
- package/build/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.js +1 -12
- package/build/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.js +2 -2
- package/build/legacy/step/cameraStep/cameraCapture/hooks/useFullScreenOrientationLock.js +6 -4
- package/build/legacy/step/cameraStep/cameraCapture/hooks/useVideoConstraints.js +1 -1
- package/build/legacy/step/cameraStep/cameraCapture/overlay/Overlay.js +6 -6
- package/build/legacy/step/cameraStep/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.js +1 -12
- package/build/legacy/step/cameraStep/cameraCapture/tracking/index.js +1 -1
- package/build/legacy/step/externalConfirmationStep/ExternalConfirmationStep.js +7 -7
- package/build/legacy/step/layoutStep/LayoutStep.js +1 -1
- package/build/legacy/step/layoutStep/utils/inline-reference-utils.js +3 -3
- package/build/legacy/step/layoutStep/utils/layout-utils.js +12 -12
- package/build/legacy/test-utils/DynamicFlowProviders.js +1 -12
- package/build/legacy/test-utils/legacy-utils.js +4 -4
- package/build/legacy/test-utils/log-utils.js +1 -1
- package/build/revamp/DynamicFlowCore.js +5 -5
- package/build/revamp/DynamicFlowWise.js +1 -1
- package/build/revamp/DynamicFlowWise.spec.js +11 -11
- package/build/revamp/domain/components/AllOfComponent.js +1 -1
- package/build/revamp/domain/components/BooleanInputComponent.js +2 -2
- package/build/revamp/domain/components/ConstComponent.js +1 -1
- package/build/revamp/domain/components/DateInputComponent.js +2 -2
- package/build/revamp/domain/components/IntegerInputComponent.js +2 -2
- package/build/revamp/domain/components/NumberInputComponent.js +2 -2
- package/build/revamp/domain/components/ObjectComponent.js +1 -1
- package/build/revamp/domain/components/SelectInputComponent.js +2 -2
- package/build/revamp/domain/components/StepDomainComponent.js +1 -1
- package/build/revamp/domain/components/TextInputComponent.js +2 -2
- package/build/revamp/domain/components/UploadInputComponent.js +1 -1
- package/build/revamp/domain/components/repeatableComponent/RepeatableComponent.js +1 -1
- package/build/revamp/domain/components/repeatableComponent/RepeatableComponent.spec.js +1 -1
- package/build/revamp/domain/components/searchComponent/SearchComponent.js +4 -3
- package/build/revamp/domain/components/searchComponent/SearchComponent.spec.js +13 -13
- package/build/revamp/domain/components/utils/isPartialLocalValueMatch.spec.js +7 -7
- package/build/revamp/domain/features/persistAsync/getComponentPersistAsync.js +4 -4
- package/build/revamp/domain/features/persistAsync/getComponentPersistAsync.spec.js +1 -1
- package/build/revamp/domain/features/persistAsync/getInitialPersistedState.js +1 -1
- package/build/revamp/domain/features/persistAsync/getPerformPersistAsync.spec.js +17 -17
- package/build/revamp/domain/features/search/getPerformSearchFunction.js +3 -3
- package/build/revamp/domain/features/search/getPerformSearchFunction.spec.js +18 -18
- package/build/revamp/domain/features/summary/summary-utils.js +2 -2
- package/build/revamp/domain/features/summary/summary-utils.spec.js +27 -27
- package/build/revamp/domain/features/utils/http-utils.js +1 -1
- package/build/revamp/domain/features/validation/spec-utils.js +1 -1
- package/build/revamp/domain/features/validation/validation-functions.spec.js +4 -4
- package/build/revamp/domain/features/validation/value-checks.spec.js +4 -4
- package/build/revamp/domain/features/validationAsync/getComponentValidationAsync.js +4 -3
- package/build/revamp/domain/features/validationAsync/getComponentValidationAsync.spec.js +1 -1
- package/build/revamp/domain/features/validationAsync/getInitialValidationState.js +1 -1
- package/build/revamp/domain/features/validationAsync/getPerformValidationAsync.js +1 -1
- package/build/revamp/domain/features/validationAsync/getPerformValidationAsync.spec.js +17 -17
- package/build/revamp/domain/mappers/layout/alertLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/boxLayoutToComponents.js +1 -1
- package/build/revamp/domain/mappers/layout/buttonLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/columnsLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/decisionLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/formLayoutToComponent.js +2 -2
- package/build/revamp/domain/mappers/layout/headingLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/imageLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/infoLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/instructionsLayoutToComponent.js +2 -2
- package/build/revamp/domain/mappers/layout/listLayoutToComponent.js +2 -2
- package/build/revamp/domain/mappers/layout/markdownLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/modalLayoutToComponent.js +2 -2
- package/build/revamp/domain/mappers/layout/paragraphLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/reviewLayoutToComponent.js +3 -3
- package/build/revamp/domain/mappers/layout/searchLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/statusListLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/mapSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/mapSchemaToComponent.spec.js +22 -22
- package/build/revamp/domain/mappers/mapStepToComponent.js +3 -3
- package/build/revamp/domain/mappers/mapStepToComponent.spec.js +12 -12
- package/build/revamp/domain/mappers/schema/allOfSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToRepeatableComponent.js +2 -2
- package/build/revamp/domain/mappers/schema/booleanSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/constSchemaToComponent.js +2 -2
- package/build/revamp/domain/mappers/schema/integerSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/numberSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/objectSchemaToComponent/objectSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/objectSchemaToComponent/objectSchemaToComponent.spec.js +21 -21
- package/build/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.js +4 -4
- package/build/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.spec.js +48 -48
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToComponent.spec.js +21 -21
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToDateInputComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToTextInputComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/utils/getPersistAsyncInitialState.js +1 -1
- package/build/revamp/domain/mappers/schema/utils/getValidationAsyncInitialState.js +1 -1
- package/build/revamp/domain/mappers/utils/getAutocompleteString.js +1 -1
- package/build/revamp/domain/mappers/utils/legacy-utils.js +2 -2
- package/build/revamp/flow/executeRefresh.js +2 -2
- package/build/revamp/flow/executeSubmission.js +1 -1
- package/build/revamp/renderers/CoreContainerRenderer.js +1 -1
- package/build/revamp/renderers/getRenderFunction.js +3 -3
- package/build/revamp/renderers/getSchemaErrorMessageFunction.js +12 -12
- package/build/revamp/renderers/mappers/allOfComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/buttonComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/containerComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/headingComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/hiddenComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/imageComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/instructionsComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/loadingIndicatorComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/markdownComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/modalComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/multiUploadInputComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/objectComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/paragraphComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/repeatableComponentToProps.js +2 -2
- package/build/revamp/renderers/mappers/reviewComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/searchComponentToProps.js +2 -2
- package/build/revamp/renderers/mappers/statusListComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/utils/inputComponentToProps.js +1 -1
- package/build/revamp/renderers/step/ExternalConfirmationDialog.js +2 -13
- package/build/revamp/renderers/step/StepRenderer.js +2 -13
- package/build/revamp/renderers/stepComponentToProps.js +1 -1
- package/build/revamp/stories/dev-tools/DynamicFlowRevamp.story.js +53 -53
- package/build/revamp/stories/dev-tools/EditableStep.story.js +7 -7
- package/build/revamp/stories/dev-tools/ErrorHandling.story.js +17 -17
- package/build/revamp/stories/dev-tools/External.story.js +6 -6
- package/build/revamp/stories/dev-tools/OneOf.Inititalisation.story.js +14 -14
- package/build/revamp/stories/dev-tools/PersistAsync.story.js +16 -16
- package/build/revamp/stories/dev-tools/RefreshOnChange.story.js +41 -41
- package/build/revamp/stories/dev-tools/RefreshOnChange.with.PersistAsync.story.js +210 -210
- package/build/revamp/stories/dev-tools/ServerTest.story.js +4 -4
- package/build/revamp/stories/dev-tools/Upload.story.js +18 -18
- package/build/revamp/stories/dev-tools/ValidationAsync.story.js +18 -18
- package/build/revamp/stories/examples/ObjectConst.story.js +25 -25
- package/build/revamp/stories/examples/OneOfInitialisation.story.js +10 -10
- package/build/revamp/stories/utils/fixtureHttpClient.js +1 -1
- package/build/revamp/stories/utils/mockSearchHandler.js +8 -8
- package/build/revamp/stories/visual-tests/VisualTests.story.js +1 -1
- package/build/revamp/test-utils/step-utils.js +1 -1
- package/build/revamp/tests/ImageRenderer.spec.js +3 -3
- package/build/revamp/tests/InitialAction.spec.js +9 -9
- package/build/revamp/tests/InitialStep.spec.js +3 -3
- package/build/revamp/tests/Logging.spec.js +5 -5
- package/build/revamp/tests/OneOfInitialisation.spec.js +73 -73
- package/build/revamp/tests/RefreshOnChange.ResponseHandling.spec.js +19 -19
- package/build/revamp/tests/RefreshOnChange.with.Tabs.spec.js +57 -57
- package/build/revamp/tests/RefreshOnChangePreserve.spec.js +13 -13
- package/build/revamp/tests/Submission.ResponseHandling.spec.js +38 -38
- package/build/revamp/tests/Submission.spec.js +23 -23
- package/build/revamp/tests/legacy/HiddenSchemas.spec.js +24 -24
- package/build/revamp/tests/legacy/MultipleFileUploadSchema.spec.js +27 -27
- package/build/revamp/tests/legacy/PersistAsync.blob-schema.spec.js +18 -18
- package/build/revamp/tests/legacy/PersistAsync.string-schema.spec.js +8 -8
- package/build/revamp/tests/legacy/RefreshStepOnChange.debouncing.spec.js +15 -14
- package/build/revamp/tests/legacy/RefreshStepOnChange.spec.js +50 -50
- package/build/revamp/tests/legacy/ValidationAsync.spec.js +14 -14
- package/build/revamp/tests/legacy/useExternal.spec.js +6 -6
- package/build/revamp/utils/component-utils.spec.js +43 -43
- package/build/revamp/utils/findComponent.spec.js +14 -14
- package/build/revamp/utils/type-utils.js +1 -1
- package/build/revamp/wise/renderers/AlertRenderer.js +1 -1
- package/build/revamp/wise/renderers/BooleanInputRenderer.js +2 -2
- package/build/revamp/wise/renderers/BoxRenderer.js +4 -15
- package/build/revamp/wise/renderers/ButtonRenderer.js +2 -13
- package/build/revamp/wise/renderers/ColumnsRenderer.js +4 -15
- package/build/revamp/wise/renderers/DateInputRenderer.js +2 -2
- package/build/revamp/wise/renderers/DecisionRenderer.js +3 -14
- package/build/revamp/wise/renderers/DividerRenderer.js +1 -1
- package/build/revamp/wise/renderers/FormRenderer.js +2 -13
- package/build/revamp/wise/renderers/FormSectionRenderer.js +1 -1
- package/build/revamp/wise/renderers/HeadingRenderer.js +7 -7
- package/build/revamp/wise/renderers/ImageRenderer.js +5 -4
- package/build/revamp/wise/renderers/InstructionsRenderer.js +2 -13
- package/build/revamp/wise/renderers/IntegerInputRenderer.js +3 -3
- package/build/revamp/wise/renderers/LoadingIndicatorRenderer.js +1 -1
- package/build/revamp/wise/renderers/MarkdownRenderer.js +2 -13
- package/build/revamp/wise/renderers/ModalRenderer.js +2 -2
- package/build/revamp/wise/renderers/MultiUploadInputRenderer.js +3 -14
- package/build/revamp/wise/renderers/NumberInputRenderer.js +3 -3
- package/build/revamp/wise/renderers/ParagraphRenderer.js +5 -4
- package/build/revamp/wise/renderers/RepeatableRenderer.js +5 -5
- package/build/revamp/wise/renderers/ReviewRenderer.js +5 -16
- package/build/revamp/wise/renderers/SearchRenderer.js +5 -5
- package/build/revamp/wise/renderers/SelectInputRenderer/OptionMedia.js +2 -13
- package/build/revamp/wise/renderers/SelectInputRenderer/RadioInputRendererComponent.js +3 -14
- package/build/revamp/wise/renderers/SelectInputRenderer/SelectInputRenderer.js +1 -1
- package/build/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.js +4 -4
- package/build/revamp/wise/renderers/SelectInputRenderer/SelectTriggerMedia.js +2 -13
- package/build/revamp/wise/renderers/SelectInputRenderer/TabInputRendererComponent.js +3 -14
- package/build/revamp/wise/renderers/StatusListRenderer.js +3 -14
- package/build/revamp/wise/renderers/TextInputRenderer.js +2 -2
- package/build/revamp/wise/renderers/UploadInputRenderer.js +6 -6
- package/build/revamp/wise/renderers/components/FieldInput.js +1 -12
- package/build/revamp/wise/renderers/components/Help.js +1 -12
- package/build/revamp/wise/renderers/components/UploadFieldInput.js +3 -14
- package/build/revamp/wise/renderers/components/icon/NavigationOptionMedia.js +2 -13
- package/build/test-utils/NeptuneProviders.js +1 -1
- package/build/types/common/messages/multi-file-upload.messages.d.ts +9 -9
- package/build/types/legacy/common/utils/mobile-utils.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.d.ts +6 -6
- package/build/types/legacy/layout/external/DynamicExternal.messages.d.ts +3 -3
- package/build/types/revamp/domain/components/MultiUploadInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/UploadInputComponent.d.ts +1 -1
- package/package.json +3 -3
|
@@ -57,7 +57,7 @@ var user = userEvent.setup();
|
|
|
57
57
|
var getUserMedia = jest.fn(function () {
|
|
58
58
|
return Promise.resolve({
|
|
59
59
|
start: jest.fn(),
|
|
60
|
-
stop: jest.fn()
|
|
60
|
+
stop: jest.fn(),
|
|
61
61
|
});
|
|
62
62
|
});
|
|
63
63
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -74,7 +74,7 @@ jest.mock('screenfull', function () { return ({
|
|
|
74
74
|
element: null,
|
|
75
75
|
isEnabled: true,
|
|
76
76
|
request: jest.fn(),
|
|
77
|
-
exit: jest.fn()
|
|
77
|
+
exit: jest.fn(),
|
|
78
78
|
}); });
|
|
79
79
|
jest.spyOn(HTMLMediaElement.prototype, 'pause').mockImplementation(jest.fn());
|
|
80
80
|
jest.spyOn(HTMLCanvasElement.prototype, 'getContext').mockImplementation(jest.fn());
|
|
@@ -85,36 +85,36 @@ var schemas = [
|
|
|
85
85
|
cameraConfig: {
|
|
86
86
|
assets: {
|
|
87
87
|
overlay: 'https://wise.com/public-resources/assets/camera-guidelines/v2/overlay_id.png',
|
|
88
|
-
outline: 'https://wise.com/public-resources/assets/camera-guidelines/v2/outline_id.png'
|
|
88
|
+
outline: 'https://wise.com/public-resources/assets/camera-guidelines/v2/outline_id.png',
|
|
89
89
|
},
|
|
90
90
|
direction: 'back',
|
|
91
|
-
instructions: 'step.idwl.front_side.instructions.driving_license'
|
|
91
|
+
instructions: 'step.idwl.front_side.instructions.driving_license',
|
|
92
92
|
},
|
|
93
93
|
image: {
|
|
94
94
|
type: 'image',
|
|
95
95
|
url: 'https://wise.com/public-resources/assets/camera-guidelines/id-icon.png',
|
|
96
|
-
text: ''
|
|
96
|
+
text: '',
|
|
97
97
|
},
|
|
98
98
|
source: 'camera',
|
|
99
|
-
type: 'string'
|
|
99
|
+
type: 'string',
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
format: 'base64url',
|
|
103
103
|
title: 'Front side of your driving license',
|
|
104
104
|
cameraConfig: {
|
|
105
105
|
assets: {
|
|
106
|
-
overlay: 'https://wise.com/public-resources/assets/camera-guidelines/v2/overlay_id.png'
|
|
106
|
+
overlay: 'https://wise.com/public-resources/assets/camera-guidelines/v2/overlay_id.png',
|
|
107
107
|
},
|
|
108
108
|
direction: 'front',
|
|
109
|
-
instructions: 'step.idwl.front_side.instructions.driving_license'
|
|
109
|
+
instructions: 'step.idwl.front_side.instructions.driving_license',
|
|
110
110
|
},
|
|
111
111
|
image: {
|
|
112
112
|
type: 'image',
|
|
113
113
|
url: 'https://wise.com/public-resources/assets/camera-guidelines/id-icon.png',
|
|
114
|
-
text: ''
|
|
114
|
+
text: '',
|
|
115
115
|
},
|
|
116
116
|
source: 'camera',
|
|
117
|
-
type: 'string'
|
|
117
|
+
type: 'string',
|
|
118
118
|
},
|
|
119
119
|
];
|
|
120
120
|
describe.each(schemas)('Given a component for rendering a camera capture experience', function (schema) {
|
|
@@ -138,7 +138,7 @@ describe.each(schemas)('Given a component for rendering a camera capture experie
|
|
|
138
138
|
Object.defineProperty(document.querySelector('video'), 'readyState', {
|
|
139
139
|
get: function () {
|
|
140
140
|
return 3;
|
|
141
|
-
}
|
|
141
|
+
},
|
|
142
142
|
});
|
|
143
143
|
// eslint-disable-next-line require-atomic-updates
|
|
144
144
|
unmount = view.unmount;
|
|
@@ -195,8 +195,8 @@ describe.each(schemas)('Given a component for rendering a camera capture experie
|
|
|
195
195
|
lock: orientationLock !== null && orientationLock !== void 0 ? orientationLock : undefined,
|
|
196
196
|
unlock: orientationUnlock !== null && orientationUnlock !== void 0 ? orientationUnlock : undefined,
|
|
197
197
|
addEventListener: jest.fn(),
|
|
198
|
-
removeEventListener: jest.fn()
|
|
199
|
-
}
|
|
198
|
+
removeEventListener: jest.fn(),
|
|
199
|
+
},
|
|
200
200
|
});
|
|
201
201
|
});
|
|
202
202
|
};
|
|
@@ -1,28 +1,17 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
2
|
import { Button, ControlType, Priority, Size } from '@transferwise/components';
|
|
14
3
|
import { useIntl } from 'react-intl';
|
|
15
4
|
import messages from '../../CameraCapture.messages';
|
|
16
5
|
export var CaptureBottomBar = function (_a) {
|
|
17
6
|
var onCapture = _a.onCapture;
|
|
18
|
-
return (_jsx("div",
|
|
7
|
+
return (_jsx("div", { className: "bottom-bar", children: _jsx(CaptureButton, { onClick: onCapture }) }));
|
|
19
8
|
};
|
|
20
9
|
export var ReviewBottomBar = function (_a) {
|
|
21
10
|
var onSubmit = _a.onSubmit, onRetry = _a.onRetry;
|
|
22
11
|
var intl = useIntl();
|
|
23
|
-
return (_jsx("div",
|
|
12
|
+
return (_jsx("div", { className: "bottom-bar p-x-2", children: _jsx("div", { className: "row", children: _jsxs("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [_jsx(Button, { className: "m-b-1", block: true, size: Size.MEDIUM, type: ControlType.ACCENT, onClick: onSubmit, children: intl.formatMessage(messages.reviewSubmit) }), _jsx(Button, { className: "m-b-2", block: true, size: Size.MEDIUM, type: ControlType.ACCENT, priority: Priority.SECONDARY, onClick: onRetry, children: intl.formatMessage(messages.reviewRetry) })] }) }) }));
|
|
24
13
|
};
|
|
25
14
|
var CaptureButton = function (_a) {
|
|
26
15
|
var onClick = _a.onClick;
|
|
27
|
-
return (_jsx("button",
|
|
16
|
+
return (_jsx("button", { type: "button", className: "camera-capture-btn m-b-2", "data-testid": "camera-capture-button", onClick: onClick, children: _jsx("span", { className: "camera-capture-btn-inner" }) }));
|
|
28
17
|
};
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
2
|
import { useIntl } from 'react-intl';
|
|
14
3
|
import messages from './OrientationLockOverlay.messages';
|
|
15
4
|
function OrientationLockOverlay() {
|
|
16
5
|
var intl = useIntl();
|
|
17
|
-
return (_jsxs("div",
|
|
6
|
+
return (_jsxs("div", { className: "orientation-lock-overlay", children: [_jsx("img", { className: "m-b-3", src: "https://wise.com/public-resources/assets/camera-guidelines/icon-rotate-phone.svg", width: "96", height: "96", alt: "" }), _jsx("p", { className: "text-center m-b-0", children: intl.formatMessage(messages.text) })] }));
|
|
18
7
|
}
|
|
19
8
|
export default OrientationLockOverlay;
|
|
@@ -3,6 +3,6 @@ export default defineMessages({
|
|
|
3
3
|
text: {
|
|
4
4
|
id: 'dynamicFlows.CameraCapture.rotatePhone.text',
|
|
5
5
|
defaultMessage: 'Rotate your phone to portrait view to take a photo',
|
|
6
|
-
description: 'Prompt the user to rotate their phone from landscape to portrait mode when attempting to take a photo'
|
|
7
|
-
}
|
|
6
|
+
description: 'Prompt the user to rotate their phone from landscape to portrait mode when attempting to take a photo',
|
|
7
|
+
},
|
|
8
8
|
});
|
|
@@ -8,7 +8,8 @@ export var useFullScreenOrientationLock = function (shouldLockOrientation, onEve
|
|
|
8
8
|
typeof window.screen.orientation.lock === 'function') {
|
|
9
9
|
window.screen.orientation
|
|
10
10
|
.lock('portrait')
|
|
11
|
-
.then(function () { return trackCameraOrientationLocked(onEvent); })
|
|
11
|
+
.then(function () { return trackCameraOrientationLocked(onEvent); })
|
|
12
|
+
.catch(noop);
|
|
12
13
|
}
|
|
13
14
|
}, [onEvent]);
|
|
14
15
|
var unlockOrientation = useCallback(function () { var _a, _b, _c; return (_c = (_b = (_a = window === null || window === void 0 ? void 0 : window.screen) === null || _a === void 0 ? void 0 : _a.orientation) === null || _b === void 0 ? void 0 : _b.unlock) === null || _c === void 0 ? void 0 : _c.call(_b); }, []);
|
|
@@ -19,13 +20,14 @@ export var useFullScreenOrientationLock = function (shouldLockOrientation, onEve
|
|
|
19
20
|
.request(document.documentElement, { navigationUI: 'show' })
|
|
20
21
|
.then(function () {
|
|
21
22
|
lockOrientation();
|
|
22
|
-
})
|
|
23
|
+
})
|
|
24
|
+
.catch(noop);
|
|
23
25
|
}
|
|
24
26
|
}, 100);
|
|
25
27
|
}, [shouldLockOrientation, lockOrientation]);
|
|
26
28
|
var exitFullScreen = useCallback(function () {
|
|
27
29
|
if (screenfull.isFullscreen) {
|
|
28
|
-
screenfull.exit()
|
|
30
|
+
screenfull.exit().catch(noop);
|
|
29
31
|
}
|
|
30
32
|
unlockOrientation();
|
|
31
33
|
}, [unlockOrientation]);
|
|
@@ -52,7 +54,7 @@ export var useFullScreenOrientationLock = function (shouldLockOrientation, onEve
|
|
|
52
54
|
}, [exitFullScreen, handleOrientationChange, shouldLockOrientation]);
|
|
53
55
|
return {
|
|
54
56
|
enterFullScreen: enterFullScreen,
|
|
55
|
-
exitFullScreen: exitFullScreen
|
|
57
|
+
exitFullScreen: exitFullScreen,
|
|
56
58
|
};
|
|
57
59
|
};
|
|
58
60
|
var noop = function () {
|
|
@@ -54,7 +54,7 @@ export var useVideoConstraints = function (direction) {
|
|
|
54
54
|
height: { min: 480, max: 1080, ideal: 720 },
|
|
55
55
|
width: { min: 640, max: 1920, ideal: 1280 },
|
|
56
56
|
frameRate: 30,
|
|
57
|
-
aspectRatio: 16 / 9
|
|
57
|
+
aspectRatio: 16 / 9,
|
|
58
58
|
};
|
|
59
59
|
useEffect(function () {
|
|
60
60
|
void getVideoConstraints(direction).then(setVideoConstraints);
|
|
@@ -40,7 +40,7 @@ function Overlay(_a) {
|
|
|
40
40
|
var helperBoxHeight = (imageUrl ? imageHeight : 0) +
|
|
41
41
|
(title ? titleHeight : 0) +
|
|
42
42
|
(instructions ? instructionsHeight : 0);
|
|
43
|
-
var helperBox = (_jsxs(_Fragment, { children: [imageUrl && _jsx("img", { className: "camera-capture-img", src: imageUrl, alt: "" }), title && _jsx("h4",
|
|
43
|
+
var helperBox = (_jsxs(_Fragment, { children: [imageUrl && _jsx("img", { className: "camera-capture-img", src: imageUrl, alt: "" }), title && _jsx("h4", { className: "camera-capture-title", children: title }), instructions && _jsx("small", { className: "camera-capture-instructions", children: instructions })] }));
|
|
44
44
|
var frameBottomMargin = captureButtonHeight + helperBoxHeight;
|
|
45
45
|
/*
|
|
46
46
|
frameBottomMargin needs to stay the same for the review page so that
|
|
@@ -51,7 +51,7 @@ function Overlay(_a) {
|
|
|
51
51
|
*/
|
|
52
52
|
if (reviewInstructions) {
|
|
53
53
|
helperBoxHeight = frameBottomMargin - reviewButtonsHeight;
|
|
54
|
-
helperBox = _jsx("small",
|
|
54
|
+
helperBox = _jsx("small", { className: "camera-capture-instructions", children: reviewInstructions });
|
|
55
55
|
var frameWithReviewInstructionsMinBottomMargin = reviewButtonsHeight + reviewInstructionsHeight;
|
|
56
56
|
if (frameBottomMargin < frameWithReviewInstructionsMinBottomMargin) {
|
|
57
57
|
helperBox = _jsx(_Fragment, {});
|
|
@@ -62,16 +62,16 @@ function Overlay(_a) {
|
|
|
62
62
|
y: '5%',
|
|
63
63
|
width: "min(90%, ".concat(overlayMaxWidth, "px)"),
|
|
64
64
|
height: "calc(90% - ".concat(frameBottomMargin, "px)"),
|
|
65
|
-
style: { transform: "translateX(max(-45%, -".concat(overlayMaxWidth / 2, "px))") }
|
|
65
|
+
style: { transform: "translateX(max(-45%, -".concat(overlayMaxWidth / 2, "px))") },
|
|
66
66
|
};
|
|
67
67
|
var helperBoxPosition = {
|
|
68
68
|
style: {
|
|
69
69
|
left: '5%',
|
|
70
70
|
top: "calc(100% - ".concat(frameBottomMargin, "px - 5%)"),
|
|
71
71
|
height: "calc(".concat(helperBoxHeight, "px + 5%)"),
|
|
72
|
-
width: '90%'
|
|
73
|
-
}
|
|
72
|
+
width: '90%',
|
|
73
|
+
},
|
|
74
74
|
};
|
|
75
|
-
return (_jsxs("svg",
|
|
75
|
+
return (_jsxs("svg", { ref: svgReference, xmlns: "http://www.w3.org/2000/svg", children: [_jsx("defs", { children: _jsxs("mask", { id: "mask", children: [_jsx("rect", { width: "100%", height: "100%", fill: "#fff" }), _jsx("image", __assign({ href: overlay }, framePosition))] }) }), overlay && _jsx("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }), outline && _jsx("image", __assign({ href: outline }, framePosition)), _jsx("foreignObject", { width: "100%", height: "100%", children: _jsx("div", __assign({ className: "camera-capture-text-and-image-container" }, helperBoxPosition, { children: helperBox })) })] }));
|
|
76
76
|
}
|
|
77
77
|
export default Overlay;
|
package/build/legacy/step/cameraStep/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.js
CHANGED
|
@@ -1,18 +1,7 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
2
|
import { Button } from '@transferwise/components';
|
|
14
3
|
function CameraErrorScreen(_a) {
|
|
15
4
|
var title = _a.title, description = _a.description, actionButton = _a.actionButton, onAction = _a.onAction;
|
|
16
|
-
return (_jsx("div",
|
|
5
|
+
return (_jsx("div", { className: "container p-t-5", children: _jsx("div", { className: "row", children: _jsxs("div", { className: "col-md-6 col-md-offset-3", children: [_jsx("h2", { className: "text-xs-center m-b-3", children: title }), _jsx("p", { className: "text-xs-center m-b-5", children: description }), onAction && actionButton && (_jsx(Button, { block: true, onClick: onAction, children: actionButton }))] }) }) }));
|
|
17
6
|
}
|
|
18
7
|
export default CameraErrorScreen;
|
|
@@ -51,7 +51,7 @@ var getSerializedError = function (error) {
|
|
|
51
51
|
return error instanceof DOMException
|
|
52
52
|
? JSON.stringify({
|
|
53
53
|
name: error === null || error === void 0 ? void 0 : error.name,
|
|
54
|
-
message: error === null || error === void 0 ? void 0 : error.message
|
|
54
|
+
message: error === null || error === void 0 ? void 0 : error.message,
|
|
55
55
|
})
|
|
56
56
|
: error;
|
|
57
57
|
};
|
|
@@ -17,13 +17,13 @@ function ExternalConfirmationStep(_a) {
|
|
|
17
17
|
text: formatMessage(messages.title),
|
|
18
18
|
size: 'lg',
|
|
19
19
|
align: 'center',
|
|
20
|
-
margin: 'xl'
|
|
20
|
+
margin: 'xl',
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
type: 'info',
|
|
24
24
|
markdown: formatMessage(messages.description, { origin: getOrigin(url) }),
|
|
25
25
|
align: 'center',
|
|
26
|
-
margin: 'xl'
|
|
26
|
+
margin: 'xl',
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
type: 'box',
|
|
@@ -31,7 +31,7 @@ function ExternalConfirmationStep(_a) {
|
|
|
31
31
|
components: [
|
|
32
32
|
{
|
|
33
33
|
type: 'button',
|
|
34
|
-
action: { title: formatMessage(messages.open), type: 'primary', url: url, exit: true }
|
|
34
|
+
action: { title: formatMessage(messages.open), type: 'primary', url: url, exit: true },
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
type: 'button',
|
|
@@ -39,12 +39,12 @@ function ExternalConfirmationStep(_a) {
|
|
|
39
39
|
title: formatMessage(messages.cancel),
|
|
40
40
|
type: 'link',
|
|
41
41
|
url: '',
|
|
42
|
-
exit: true
|
|
43
|
-
}
|
|
42
|
+
exit: true,
|
|
43
|
+
},
|
|
44
44
|
},
|
|
45
|
-
]
|
|
45
|
+
],
|
|
46
46
|
},
|
|
47
|
-
]
|
|
47
|
+
],
|
|
48
48
|
},
|
|
49
49
|
], submitted: false, onAction: function (action) {
|
|
50
50
|
if (action.url) {
|
|
@@ -14,7 +14,7 @@ var getComponents = function (step, options) {
|
|
|
14
14
|
layout: layout,
|
|
15
15
|
schemas: step.schemas || [],
|
|
16
16
|
actions: step.actions || [],
|
|
17
|
-
model: (_a = step.model) !== null && _a !== void 0 ? _a : null
|
|
17
|
+
model: (_a = step.model) !== null && _a !== void 0 ? _a : null,
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
var LayoutStep = function (props) {
|
|
@@ -36,7 +36,7 @@ export function inlineReferences(_a) {
|
|
|
36
36
|
layout: component.content.components,
|
|
37
37
|
schemas: schemas,
|
|
38
38
|
actions: actions,
|
|
39
|
-
model: model
|
|
39
|
+
model: model,
|
|
40
40
|
}) });
|
|
41
41
|
}
|
|
42
42
|
if (component.type === 'columns') {
|
|
@@ -51,14 +51,14 @@ function inlineFormSchema(_a) {
|
|
|
51
51
|
return {
|
|
52
52
|
type: 'form',
|
|
53
53
|
margin: formComponent.margin,
|
|
54
|
-
schema: getSchemaById(schemas, formComponent.schemaId)
|
|
54
|
+
schema: getSchemaById(schemas, formComponent.schemaId),
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
if (formComponent.schema && isReference(formComponent.schema) && formComponent.schema.$ref) {
|
|
58
58
|
return {
|
|
59
59
|
type: 'form',
|
|
60
60
|
margin: formComponent.margin,
|
|
61
|
-
schema: getSchemaById(schemas, formComponent.schema.$ref)
|
|
61
|
+
schema: getSchemaById(schemas, formComponent.schema.$ref),
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
if (formComponent.schema && !isReference(formComponent.schema)) {
|
|
@@ -58,7 +58,7 @@ function convertStepToExternalComponent(step) {
|
|
|
58
58
|
requestUrl: step.requestUrl,
|
|
59
59
|
polling: step.polling,
|
|
60
60
|
responseHandlers: step.responseHandlers,
|
|
61
|
-
retryTitle: step.retryTitle
|
|
61
|
+
retryTitle: step.retryTitle,
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
function convertFormStepToDynamicLayout(step) {
|
|
@@ -108,7 +108,7 @@ function dynamicBox(components, size) {
|
|
|
108
108
|
return {
|
|
109
109
|
type: 'box',
|
|
110
110
|
width: size || 'md',
|
|
111
|
-
components: components
|
|
111
|
+
components: components,
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
114
|
function convertStepTitleToDynamicHeading(title) {
|
|
@@ -117,14 +117,14 @@ function convertStepTitleToDynamicHeading(title) {
|
|
|
117
117
|
text: title,
|
|
118
118
|
size: 'lg',
|
|
119
119
|
margin: 'lg',
|
|
120
|
-
align: 'center'
|
|
120
|
+
align: 'center',
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
123
|
function convertStepDescriptionToDynamicParagraph(description) {
|
|
124
124
|
return {
|
|
125
125
|
type: 'paragraph',
|
|
126
126
|
text: description,
|
|
127
|
-
align: 'center'
|
|
127
|
+
align: 'center',
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
function convertStepSchemaToDynamicForm(schema) {
|
|
@@ -133,7 +133,7 @@ function convertStepSchemaToDynamicForm(schema) {
|
|
|
133
133
|
function convertStepDecisionToDynamicDecision(options) {
|
|
134
134
|
return {
|
|
135
135
|
type: 'decision',
|
|
136
|
-
options: options.map(convertStepDecisionOption)
|
|
136
|
+
options: options.map(convertStepDecisionOption),
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
139
|
function convertStepDecisionOption(option) {
|
|
@@ -144,8 +144,8 @@ function convertStepDecisionOption(option) {
|
|
|
144
144
|
title: option.title,
|
|
145
145
|
method: 'GET',
|
|
146
146
|
url: option.url,
|
|
147
|
-
disabled: option.disabled
|
|
148
|
-
}
|
|
147
|
+
disabled: option.disabled,
|
|
148
|
+
},
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
151
|
function convertStepImageToDynamicImage(image) {
|
|
@@ -154,7 +154,7 @@ function convertStepImageToDynamicImage(image) {
|
|
|
154
154
|
url: image.url,
|
|
155
155
|
text: image.text,
|
|
156
156
|
margin: image.margin || 'lg',
|
|
157
|
-
size: image.size || 'md'
|
|
157
|
+
size: image.size || 'md',
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
160
|
function convertFinalStepImageToDynamicImage(image) {
|
|
@@ -164,7 +164,7 @@ function convertFinalStepImageToDynamicImage(image) {
|
|
|
164
164
|
url: image,
|
|
165
165
|
text: undefined,
|
|
166
166
|
margin: 'lg',
|
|
167
|
-
size: 'md'
|
|
167
|
+
size: 'md',
|
|
168
168
|
}
|
|
169
169
|
: convertStepImageToDynamicImage(image);
|
|
170
170
|
}
|
|
@@ -172,20 +172,20 @@ export function convertStepActionToDynamicAction(action) {
|
|
|
172
172
|
var newAction = __assign(__assign({}, action), { title: action.title });
|
|
173
173
|
return {
|
|
174
174
|
type: 'button',
|
|
175
|
-
action: newAction
|
|
175
|
+
action: newAction,
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
178
|
function convertStepReviewToDynamicReview(reviewFields) {
|
|
179
179
|
return {
|
|
180
180
|
type: 'review',
|
|
181
181
|
title: reviewFields.title,
|
|
182
|
-
fields: reviewFields.fields.map(convertReviewFieldToDefinition)
|
|
182
|
+
fields: reviewFields.fields.map(convertReviewFieldToDefinition),
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
185
|
function convertReviewFieldToDefinition(reviewField) {
|
|
186
186
|
return {
|
|
187
187
|
label: reviewField.title,
|
|
188
|
-
value: reviewField.value
|
|
188
|
+
value: reviewField.value,
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
191
|
function getSchemaLayout(step) {
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
2
|
import { EventsContextProvider, LogProvider } from '../common/contexts';
|
|
14
3
|
var noop = function () { };
|
|
15
4
|
function DynamicFlowProviders(_a) {
|
|
16
5
|
var children = _a.children, _b = _a.onLog, onLog = _b === void 0 ? noop : _b, _c = _a.onEvent, onEvent = _c === void 0 ? noop : _c;
|
|
17
|
-
return (_jsx(LogProvider,
|
|
6
|
+
return (_jsx(LogProvider, { flowId: "", stepId: "", onLog: onLog, children: _jsx(EventsContextProvider, { onEvent: onEvent, children: children }) }));
|
|
18
7
|
}
|
|
19
8
|
export default DynamicFlowProviders;
|
|
@@ -21,7 +21,7 @@ var defaultTranslations = __assign(__assign({}, componentTranslations.en), dynam
|
|
|
21
21
|
var getMockFetchPromise = function (status, jsonFn, delay, signal) {
|
|
22
22
|
var response = {
|
|
23
23
|
status: status,
|
|
24
|
-
json: jsonFn
|
|
24
|
+
json: jsonFn,
|
|
25
25
|
};
|
|
26
26
|
return new Promise(function (resolve) {
|
|
27
27
|
var aborted = false;
|
|
@@ -47,7 +47,7 @@ function mountWithProviders(component, locale, messages, baseUrl, onEvent, onLog
|
|
|
47
47
|
if (onEvent === void 0) { onEvent = (function () { }); }
|
|
48
48
|
if (onLog === void 0) { onLog = (function () { }); }
|
|
49
49
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-return
|
|
50
|
-
return mount(_jsx(LogProvider,
|
|
50
|
+
return mount(_jsx(LogProvider, { flowId: "", stepId: "", onLog: onLog, children: _jsx(EventsContextProvider, { onEvent: onEvent, children: _jsx(Provider, { i18n: { locale: locale, messages: messages }, children: _jsx(HttpClientProviderFromBaseUrl, { baseUrl: baseUrl, children: component }) }) }) }));
|
|
51
51
|
}
|
|
52
52
|
function mountWithOptions(_a) {
|
|
53
53
|
var component = _a.component, _b = _a.locale, locale = _b === void 0 ? 'en-GB' : _b, _c = _a.messages, messages = _c === void 0 ? defaultTranslations : _c, _d = _a.baseUrl, baseUrl = _d === void 0 ? 'https://test-url' : _d, _e = _a.onEvent, onEvent = _e === void 0 ? function () { } : _e, _f = _a.onLog, onLog = _f === void 0 ? function () { } : _f;
|
|
@@ -60,10 +60,10 @@ function getI18n(locale, messages) {
|
|
|
60
60
|
}
|
|
61
61
|
var i18n = {
|
|
62
62
|
locale: 'en-GB',
|
|
63
|
-
messages: __assign({}, componentTranslations.en)
|
|
63
|
+
messages: __assign({}, componentTranslations.en),
|
|
64
64
|
};
|
|
65
65
|
function TestContextProviders(_a) {
|
|
66
66
|
var children = _a.children;
|
|
67
|
-
return (_jsx(LogProvider,
|
|
67
|
+
return (_jsx(LogProvider, { flowId: "", stepId: "", onLog: function () { }, children: _jsx(Provider, { i18n: i18n, children: children }) }));
|
|
68
68
|
}
|
|
69
69
|
export { mountWithProviders as mount, mountWithOptions, getMockFetchPromise, wait, getI18n, TestContextProviders, };
|
|
@@ -143,7 +143,7 @@ export function DynamicFlowCore(props) {
|
|
|
143
143
|
logEvent: logEvent,
|
|
144
144
|
httpClient: httpClient,
|
|
145
145
|
onAction: onAction,
|
|
146
|
-
onRefresh: onRefresh
|
|
146
|
+
onRefresh: onRefresh,
|
|
147
147
|
});
|
|
148
148
|
setStepComponent(function () {
|
|
149
149
|
stepComponentRef.current = newStepComponent_1;
|
|
@@ -200,7 +200,7 @@ export function DynamicFlowCore(props) {
|
|
|
200
200
|
model: payload,
|
|
201
201
|
isInitial: stepRef.current === null,
|
|
202
202
|
httpClient: httpClient,
|
|
203
|
-
trackEvent: trackEvent
|
|
203
|
+
trackEvent: trackEvent,
|
|
204
204
|
})];
|
|
205
205
|
case 2:
|
|
206
206
|
command = _h.sent();
|
|
@@ -262,7 +262,7 @@ export function DynamicFlowCore(props) {
|
|
|
262
262
|
schemaId: schemaId,
|
|
263
263
|
etag: etagRef.current,
|
|
264
264
|
httpClient: httpClient,
|
|
265
|
-
trackEvent: trackEvent
|
|
265
|
+
trackEvent: trackEvent,
|
|
266
266
|
})];
|
|
267
267
|
case 2:
|
|
268
268
|
command = _e.sent();
|
|
@@ -294,6 +294,6 @@ export function DynamicFlowCore(props) {
|
|
|
294
294
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
295
295
|
[]);
|
|
296
296
|
var render = useMemo(function () { return getRenderFunction(__spreadArray(__spreadArray([CoreContainerRenderer], renderers, true), [StepRenderer], false)); }, [renderers]);
|
|
297
|
-
return (_jsx(ErrorBoundary,
|
|
298
|
-
}))
|
|
297
|
+
return (_jsx(ErrorBoundary, { onError: closeWithError, children: stepComponent ? render(stepComponent) : null // TODO: render loader instead?
|
|
298
|
+
}));
|
|
299
299
|
}
|
|
@@ -57,7 +57,7 @@ function DynamicFlowWise(props) {
|
|
|
57
57
|
var httpClient = props.httpClient;
|
|
58
58
|
var locale = useIntl().locale;
|
|
59
59
|
var wiseHttpClient = useMemo(function () { return makeWiseHttpClient(httpClient, locale); }, [httpClient, locale]);
|
|
60
|
-
return (_jsx(HttpClientProvider,
|
|
60
|
+
return (_jsx(HttpClientProvider, { httpClient: wiseHttpClient, children: _jsx(DynamicFlowCore, __assign({}, props, { renderers: renderers })) }));
|
|
61
61
|
}
|
|
62
62
|
export default DynamicFlowWise;
|
|
63
63
|
var makeWiseHttpClient = function (httpClient, locale) {
|
|
@@ -19,7 +19,7 @@ describe('DynamicFlow', function () {
|
|
|
19
19
|
onCompletion: jest.fn(),
|
|
20
20
|
onError: jest.fn(),
|
|
21
21
|
onEvent: jest.fn(),
|
|
22
|
-
onLog: jest.fn()
|
|
22
|
+
onLog: jest.fn(),
|
|
23
23
|
}); };
|
|
24
24
|
beforeEach(function () {
|
|
25
25
|
jest.clearAllMocks();
|
|
@@ -33,7 +33,7 @@ describe('DynamicFlow', function () {
|
|
|
33
33
|
layout: [
|
|
34
34
|
{ type: 'alert', markdown: 'This is an alert.', context: 'positive' },
|
|
35
35
|
{ type: 'paragraph', text: 'Please fill in the form below.', align: 'center' },
|
|
36
|
-
]
|
|
36
|
+
],
|
|
37
37
|
};
|
|
38
38
|
renderWithProviders(_jsx(DynamicFlowWise, __assign({ flowId: "new-df-flow-id" }, makeDefaultProps(), { initialStep: step })));
|
|
39
39
|
expect(screen.getByText('Dynamic Flow')).toBeInTheDocument();
|
|
@@ -56,17 +56,17 @@ describe('DynamicFlow', function () {
|
|
|
56
56
|
properties: {
|
|
57
57
|
name: {
|
|
58
58
|
title: 'Full name',
|
|
59
|
-
type: 'string'
|
|
59
|
+
type: 'string',
|
|
60
60
|
},
|
|
61
61
|
occupation: {
|
|
62
62
|
title: 'Occupation',
|
|
63
|
-
type: 'string'
|
|
64
|
-
}
|
|
65
|
-
}
|
|
63
|
+
type: 'string',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
66
|
},
|
|
67
67
|
],
|
|
68
68
|
layout: [{ type: 'form', schemaId: '#schema' }],
|
|
69
|
-
model: { name: 'John Smith' }
|
|
69
|
+
model: { name: 'John Smith' },
|
|
70
70
|
};
|
|
71
71
|
renderWithProviders(_jsx(DynamicFlowWise, __assign({ flowId: "new-df-flow-id" }, makeDefaultProps(), { initialStep: step })));
|
|
72
72
|
expect(screen.getByDisplayValue('John Smith')).toBeInTheDocument();
|
|
@@ -79,12 +79,12 @@ describe('DynamicFlow', function () {
|
|
|
79
79
|
id: 'ny-initial-step-id',
|
|
80
80
|
title: 'Dynamic Flow',
|
|
81
81
|
schemas: [],
|
|
82
|
-
layout: []
|
|
82
|
+
layout: [],
|
|
83
83
|
} });
|
|
84
84
|
renderWithProviders(_jsx(DynamicFlowWise, __assign({ flowId: "my-flow-id" }, props)));
|
|
85
85
|
expect(props.onEvent).toHaveBeenCalledWith('Dynamic Flow - Initiated', expect.objectContaining({
|
|
86
86
|
flowId: 'my-flow-id',
|
|
87
|
-
stepId: 'ny-initial-step-id'
|
|
87
|
+
stepId: 'ny-initial-step-id',
|
|
88
88
|
}));
|
|
89
89
|
});
|
|
90
90
|
it('emits a step shown event containing those values', function () {
|
|
@@ -92,12 +92,12 @@ describe('DynamicFlow', function () {
|
|
|
92
92
|
id: 'ny-initial-step-id',
|
|
93
93
|
title: 'Dynamic Flow',
|
|
94
94
|
schemas: [],
|
|
95
|
-
layout: []
|
|
95
|
+
layout: [],
|
|
96
96
|
} });
|
|
97
97
|
renderWithProviders(_jsx(DynamicFlowWise, __assign({ flowId: "my-flow-id" }, props)));
|
|
98
98
|
expect(props.onEvent).toHaveBeenCalledWith('Dynamic Flow - Step Shown', expect.objectContaining({
|
|
99
99
|
flowId: 'my-flow-id',
|
|
100
|
-
stepId: 'ny-initial-step-id'
|
|
100
|
+
stepId: 'ny-initial-step-id',
|
|
101
101
|
}));
|
|
102
102
|
});
|
|
103
103
|
});
|