@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
|
@@ -62,15 +62,15 @@ export default {
|
|
|
62
62
|
component: DynamicFlowWise,
|
|
63
63
|
title: 'Revamp/Examples/Server Test',
|
|
64
64
|
parameters: {
|
|
65
|
-
chromatic: { disableSnapshot: true }
|
|
65
|
+
chromatic: { disableSnapshot: true },
|
|
66
66
|
},
|
|
67
67
|
argTypes: {
|
|
68
68
|
persistAsync: {
|
|
69
69
|
options: ['succeed', 'failGenerically', 'failValidation'],
|
|
70
70
|
type: 'select',
|
|
71
|
-
defaultValue: 'succeed'
|
|
72
|
-
}
|
|
73
|
-
}
|
|
71
|
+
defaultValue: 'succeed',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
74
|
};
|
|
75
75
|
export function Basic() {
|
|
76
76
|
var initialAction = { method: 'GET', url: 'http://localhost:8888' };
|
|
@@ -54,7 +54,7 @@ var persistAsyncConfig = {
|
|
|
54
54
|
method: 'POST',
|
|
55
55
|
url: '/persist-async',
|
|
56
56
|
param: 'param',
|
|
57
|
-
idProperty: 'token'
|
|
57
|
+
idProperty: 'token',
|
|
58
58
|
};
|
|
59
59
|
var uploadConfig = {
|
|
60
60
|
title: 'Upload label',
|
|
@@ -62,8 +62,8 @@ var uploadConfig = {
|
|
|
62
62
|
accepts: ['image/png', 'image/jpg', 'application/pdf'],
|
|
63
63
|
maxSize: 5242000,
|
|
64
64
|
validationMessages: {
|
|
65
|
-
maxSize: 'Your file is too large'
|
|
66
|
-
}
|
|
65
|
+
maxSize: 'Your file is too large',
|
|
66
|
+
},
|
|
67
67
|
};
|
|
68
68
|
var multiFileConfig = {
|
|
69
69
|
title: 'Upload label',
|
|
@@ -73,8 +73,8 @@ var multiFileConfig = {
|
|
|
73
73
|
summary: {
|
|
74
74
|
defaultTitle: 'File',
|
|
75
75
|
defaultDescription: 'Click to edit or remove',
|
|
76
|
-
defaultIcon: { name: 'document', type: 'icon' }
|
|
77
|
-
}
|
|
76
|
+
defaultIcon: { name: 'document', type: 'icon' },
|
|
77
|
+
},
|
|
78
78
|
};
|
|
79
79
|
var logPersistAsync = function (input, init) {
|
|
80
80
|
if (init && init.body instanceof FormData) {
|
|
@@ -101,7 +101,7 @@ var getHttpClient = function (persistAsync) {
|
|
|
101
101
|
return [2 /*return*/, Promise.reject(new Error('Failed to persist async'))];
|
|
102
102
|
case 'failValidation':
|
|
103
103
|
return [2 /*return*/, Promise.resolve(new Response(JSON.stringify({ validation: { param: 'This field is invalid' } }), {
|
|
104
|
-
status: 422
|
|
104
|
+
status: 422,
|
|
105
105
|
}))];
|
|
106
106
|
case 'succeed':
|
|
107
107
|
default:
|
|
@@ -109,22 +109,22 @@ var getHttpClient = function (persistAsync) {
|
|
|
109
109
|
}
|
|
110
110
|
return [2 /*return*/];
|
|
111
111
|
});
|
|
112
|
-
}); }
|
|
112
|
+
}); },
|
|
113
113
|
});
|
|
114
114
|
};
|
|
115
115
|
export default {
|
|
116
116
|
component: DynamicFlowWise,
|
|
117
117
|
title: 'Revamp/Features/Upload',
|
|
118
118
|
parameters: {
|
|
119
|
-
chromatic: { disableSnapshot: true }
|
|
119
|
+
chromatic: { disableSnapshot: true },
|
|
120
120
|
},
|
|
121
121
|
argTypes: {
|
|
122
122
|
persistAsync: {
|
|
123
123
|
options: ['succeed', 'failGenerically', 'failValidation'],
|
|
124
124
|
type: 'select',
|
|
125
|
-
defaultValue: 'succeed'
|
|
126
|
-
}
|
|
127
|
-
}
|
|
125
|
+
defaultValue: 'succeed',
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
128
|
};
|
|
129
129
|
export function Base64Upload() {
|
|
130
130
|
return renderWithStep(getBase64UploadStep());
|
|
@@ -172,21 +172,21 @@ var getBase64UploadWithPersistAsync = function () {
|
|
|
172
172
|
return getStep('Base64 Upload (Persist Async)', {
|
|
173
173
|
$id: '#schema',
|
|
174
174
|
type: 'string',
|
|
175
|
-
persistAsync: __assign(__assign({}, persistAsyncConfig), { schema: __assign({ type: 'string', format: 'base64url' }, uploadConfig) })
|
|
175
|
+
persistAsync: __assign(__assign({}, persistAsyncConfig), { schema: __assign({ type: 'string', format: 'base64url' }, uploadConfig) }),
|
|
176
176
|
});
|
|
177
177
|
};
|
|
178
178
|
var getBlobUploadWithPersistAsync = function () {
|
|
179
179
|
return getStep('Blob Upload (Persist Async)', {
|
|
180
180
|
$id: '#schema',
|
|
181
181
|
type: 'string',
|
|
182
|
-
persistAsync: __assign(__assign({}, persistAsyncConfig), { schema: __assign({ type: 'blob', source: 'file' }, uploadConfig) })
|
|
182
|
+
persistAsync: __assign(__assign({}, persistAsyncConfig), { schema: __assign({ type: 'blob', source: 'file' }, uploadConfig) }),
|
|
183
183
|
});
|
|
184
184
|
};
|
|
185
185
|
var getBlobUploadWithPersistAsyncLarge = function () {
|
|
186
186
|
return getStep('Blob Upload (Persist Async, Large)', {
|
|
187
187
|
$id: '#schema',
|
|
188
188
|
type: 'string',
|
|
189
|
-
persistAsync: __assign(__assign({}, persistAsyncConfig), { schema: __assign({ type: 'blob', control: 'large-upload', source: 'file' }, uploadConfig) })
|
|
189
|
+
persistAsync: __assign(__assign({}, persistAsyncConfig), { schema: __assign({ type: 'blob', control: 'large-upload', source: 'file' }, uploadConfig) }),
|
|
190
190
|
});
|
|
191
191
|
};
|
|
192
192
|
var getMultiBase64Upload = function () {
|
|
@@ -196,14 +196,14 @@ var getMultiBase64UploadWithPersistAsync = function () {
|
|
|
196
196
|
return getStep('Base64 Upload (Multiple, Persist Async)', __assign(__assign({ type: 'array' }, multiFileConfig), { items: {
|
|
197
197
|
$id: '#id',
|
|
198
198
|
type: 'string',
|
|
199
|
-
persistAsync: __assign(__assign({}, persistAsyncConfig), { schema: __assign({ type: 'string', format: 'base64url' }, uploadConfig) })
|
|
199
|
+
persistAsync: __assign(__assign({}, persistAsyncConfig), { schema: __assign({ type: 'string', format: 'base64url' }, uploadConfig) }),
|
|
200
200
|
} }));
|
|
201
201
|
};
|
|
202
202
|
var getMultiBlobUploadWithPersistAsync = function () {
|
|
203
203
|
return getStep('Blob Upload (Multiple, Persist Async)', __assign(__assign({ type: 'array' }, multiFileConfig), { items: {
|
|
204
204
|
$id: '#id',
|
|
205
205
|
type: 'string',
|
|
206
|
-
persistAsync: __assign(__assign({}, persistAsyncConfig), { schema: __assign({ type: 'blob', source: 'file' }, uploadConfig) })
|
|
206
|
+
persistAsync: __assign(__assign({}, persistAsyncConfig), { schema: __assign({ type: 'blob', source: 'file' }, uploadConfig) }),
|
|
207
207
|
} }));
|
|
208
208
|
};
|
|
209
209
|
var getStep = function (title, schema) { return ({
|
|
@@ -215,7 +215,7 @@ var getStep = function (title, schema) { return ({
|
|
|
215
215
|
{
|
|
216
216
|
type: 'button',
|
|
217
217
|
title: 'Submit',
|
|
218
|
-
action: { url: '/submit', method: 'POST' }
|
|
218
|
+
action: { url: '/submit', method: 'POST' },
|
|
219
219
|
},
|
|
220
|
-
]
|
|
220
|
+
],
|
|
221
221
|
}); };
|
|
@@ -42,7 +42,7 @@ import DynamicFlowWise from '../../DynamicFlowWise';
|
|
|
42
42
|
var validationAsyncConfig = {
|
|
43
43
|
method: 'POST',
|
|
44
44
|
url: '/validate',
|
|
45
|
-
param: 'param'
|
|
45
|
+
param: 'param',
|
|
46
46
|
};
|
|
47
47
|
var getHttpClient = function (validateAsync) {
|
|
48
48
|
if (validateAsync === void 0) { validateAsync = 'failValidation'; }
|
|
@@ -53,7 +53,7 @@ var getHttpClient = function (validateAsync) {
|
|
|
53
53
|
return [2 /*return*/, respondWith({
|
|
54
54
|
title: 'Success',
|
|
55
55
|
schemas: [],
|
|
56
|
-
layout: [{ type: 'heading', title: 'Success' }]
|
|
56
|
+
layout: [{ type: 'heading', title: 'Success' }],
|
|
57
57
|
})];
|
|
58
58
|
});
|
|
59
59
|
}); },
|
|
@@ -64,7 +64,7 @@ var getHttpClient = function (validateAsync) {
|
|
|
64
64
|
return [2 /*return*/, Promise.reject(new Error('Failed to validate'))];
|
|
65
65
|
case 'failValidation':
|
|
66
66
|
return [2 /*return*/, Promise.resolve(new Response(JSON.stringify({ message: 'This field is invalid' }), {
|
|
67
|
-
status: 422
|
|
67
|
+
status: 422,
|
|
68
68
|
}))];
|
|
69
69
|
case 'succeedWithMessage':
|
|
70
70
|
return [2 /*return*/, respondWith({ message: 'This field is super valid' })];
|
|
@@ -79,22 +79,22 @@ var getHttpClient = function (validateAsync) {
|
|
|
79
79
|
return __generator(this, function (_a) {
|
|
80
80
|
return [2 /*return*/, respondWith({ token: '123' })];
|
|
81
81
|
});
|
|
82
|
-
}); }
|
|
82
|
+
}); },
|
|
83
83
|
});
|
|
84
84
|
};
|
|
85
85
|
export default {
|
|
86
86
|
component: DynamicFlowWise,
|
|
87
87
|
title: 'Revamp/Features/Validation Async',
|
|
88
88
|
parameters: {
|
|
89
|
-
chromatic: { disableSnapshot: true }
|
|
89
|
+
chromatic: { disableSnapshot: true },
|
|
90
90
|
},
|
|
91
91
|
argTypes: {
|
|
92
92
|
validateAsync: {
|
|
93
93
|
options: ['succeed', 'succeedWithMessage', 'failGenerically', 'failValidation'],
|
|
94
94
|
type: 'select',
|
|
95
|
-
defaultValue: 'failValidation'
|
|
96
|
-
}
|
|
97
|
-
}
|
|
95
|
+
defaultValue: 'failValidation',
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
98
|
};
|
|
99
99
|
export function BasicTypes(_a) {
|
|
100
100
|
var validateAsync = _a.validateAsync;
|
|
@@ -117,24 +117,24 @@ var getBasicTypesStep = function () {
|
|
|
117
117
|
name: {
|
|
118
118
|
type: 'string',
|
|
119
119
|
title: 'Name',
|
|
120
|
-
validationAsync: validationAsyncConfig
|
|
120
|
+
validationAsync: validationAsyncConfig,
|
|
121
121
|
},
|
|
122
122
|
boolean: {
|
|
123
123
|
type: 'boolean',
|
|
124
124
|
title: 'I accept the terms and conditions',
|
|
125
|
-
validationAsync: validationAsyncConfig
|
|
125
|
+
validationAsync: validationAsyncConfig,
|
|
126
126
|
},
|
|
127
127
|
rate: {
|
|
128
128
|
title: 'Conversion rate',
|
|
129
129
|
type: 'number',
|
|
130
|
-
validationAsync: validationAsyncConfig
|
|
130
|
+
validationAsync: validationAsyncConfig,
|
|
131
131
|
},
|
|
132
132
|
age: {
|
|
133
133
|
title: 'Age',
|
|
134
134
|
type: 'integer',
|
|
135
|
-
validationAsync: validationAsyncConfig
|
|
136
|
-
}
|
|
137
|
-
}
|
|
135
|
+
validationAsync: validationAsyncConfig,
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
138
|
});
|
|
139
139
|
};
|
|
140
140
|
var getStep = function (title, schema) { return ({
|
|
@@ -145,9 +145,9 @@ var getStep = function (title, schema) { return ({
|
|
|
145
145
|
$id: '#schema',
|
|
146
146
|
type: 'object',
|
|
147
147
|
properties: {
|
|
148
|
-
schema: schema
|
|
148
|
+
schema: schema,
|
|
149
149
|
},
|
|
150
|
-
displayOrder: ['schema']
|
|
150
|
+
displayOrder: ['schema'],
|
|
151
151
|
},
|
|
152
152
|
],
|
|
153
153
|
layout: [
|
|
@@ -155,7 +155,7 @@ var getStep = function (title, schema) { return ({
|
|
|
155
155
|
{
|
|
156
156
|
type: 'button',
|
|
157
157
|
title: 'Submit',
|
|
158
|
-
action: { url: '/submit', method: 'POST' }
|
|
158
|
+
action: { url: '/submit', method: 'POST' },
|
|
159
159
|
},
|
|
160
|
-
]
|
|
160
|
+
],
|
|
161
161
|
}); };
|
|
@@ -57,15 +57,15 @@ var getHttpClient = function () {
|
|
|
57
57
|
console.log(input, init && JSON.parse(init.body));
|
|
58
58
|
return [2 /*return*/, respondWith({})];
|
|
59
59
|
});
|
|
60
|
-
}); }
|
|
60
|
+
}); },
|
|
61
61
|
});
|
|
62
62
|
};
|
|
63
63
|
export default {
|
|
64
64
|
component: DynamicFlowWise,
|
|
65
65
|
title: 'Revamp/Examples/Object Const',
|
|
66
66
|
parameters: {
|
|
67
|
-
chromatic: { disableSnapshot: true }
|
|
68
|
-
}
|
|
67
|
+
chromatic: { disableSnapshot: true },
|
|
68
|
+
},
|
|
69
69
|
};
|
|
70
70
|
export function ObjectConstWithDefault() {
|
|
71
71
|
return renderWithStep(getBasicStep());
|
|
@@ -85,57 +85,57 @@ var getBasicStep = function () {
|
|
|
85
85
|
recurrence: {
|
|
86
86
|
oneOf: [
|
|
87
87
|
{
|
|
88
|
-
|
|
88
|
+
const: {
|
|
89
89
|
interval: 0,
|
|
90
|
-
frequency: 'ONCE'
|
|
90
|
+
frequency: 'ONCE',
|
|
91
91
|
},
|
|
92
92
|
title: 'Never',
|
|
93
|
-
description: 'On some date only'
|
|
93
|
+
description: 'On some date only',
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
|
-
|
|
96
|
+
const: {
|
|
97
97
|
interval: 1,
|
|
98
|
-
frequency: 'WEEKLY'
|
|
98
|
+
frequency: 'WEEKLY',
|
|
99
99
|
},
|
|
100
100
|
title: 'Weekly',
|
|
101
|
-
description: 'On some date every week'
|
|
101
|
+
description: 'On some date every week',
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
|
-
|
|
104
|
+
const: {
|
|
105
105
|
interval: 2,
|
|
106
|
-
frequency: 'WEEKLY'
|
|
106
|
+
frequency: 'WEEKLY',
|
|
107
107
|
},
|
|
108
108
|
title: 'Biweekly',
|
|
109
|
-
description: 'On some date every two weeks'
|
|
109
|
+
description: 'On some date every two weeks',
|
|
110
110
|
},
|
|
111
111
|
{
|
|
112
|
-
|
|
112
|
+
const: {
|
|
113
113
|
interval: 1,
|
|
114
|
-
frequency: 'MONTHLY'
|
|
114
|
+
frequency: 'MONTHLY',
|
|
115
115
|
},
|
|
116
116
|
title: 'Monthly',
|
|
117
|
-
description: 'Monthly'
|
|
117
|
+
description: 'Monthly',
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
|
-
|
|
120
|
+
const: {
|
|
121
121
|
interval: 3,
|
|
122
|
-
frequency: 'MONTHLY'
|
|
122
|
+
frequency: 'MONTHLY',
|
|
123
123
|
},
|
|
124
124
|
title: 'Quarterly',
|
|
125
|
-
description: 'Every 3 months on X'
|
|
125
|
+
description: 'Every 3 months on X',
|
|
126
126
|
},
|
|
127
127
|
],
|
|
128
128
|
placeholder: 'Select a start date',
|
|
129
129
|
title: 'Repeats',
|
|
130
|
-
|
|
130
|
+
default: {
|
|
131
131
|
interval: 0,
|
|
132
|
-
frequency: 'ONCE'
|
|
132
|
+
frequency: 'ONCE',
|
|
133
133
|
},
|
|
134
|
-
refreshStepOnChange: true
|
|
135
|
-
}
|
|
134
|
+
refreshStepOnChange: true,
|
|
135
|
+
},
|
|
136
136
|
},
|
|
137
137
|
displayOrder: ['recurrence'],
|
|
138
|
-
type: 'object'
|
|
138
|
+
type: 'object',
|
|
139
139
|
});
|
|
140
140
|
};
|
|
141
141
|
var getStep = function (title, schema) { return ({
|
|
@@ -147,7 +147,7 @@ var getStep = function (title, schema) { return ({
|
|
|
147
147
|
{
|
|
148
148
|
type: 'button',
|
|
149
149
|
title: 'Submit',
|
|
150
|
-
action: { url: '/submit', method: 'POST' }
|
|
150
|
+
action: { url: '/submit', method: 'POST' },
|
|
151
151
|
},
|
|
152
|
-
]
|
|
152
|
+
],
|
|
153
153
|
}); };
|
|
@@ -42,8 +42,8 @@ export default {
|
|
|
42
42
|
component: DynamicFlowWise,
|
|
43
43
|
title: 'Revamp/Examples/OneOfInitialisation',
|
|
44
44
|
parameters: {
|
|
45
|
-
chromatic: { disableSnapshot: true }
|
|
46
|
-
}
|
|
45
|
+
chromatic: { disableSnapshot: true },
|
|
46
|
+
},
|
|
47
47
|
};
|
|
48
48
|
var step = {
|
|
49
49
|
id: 'step-id',
|
|
@@ -55,7 +55,7 @@ var step = {
|
|
|
55
55
|
{
|
|
56
56
|
type: 'object',
|
|
57
57
|
displayOrder: ['email'],
|
|
58
|
-
properties: { email: { type: 'string', title: 'Email' } }
|
|
58
|
+
properties: { email: { type: 'string', title: 'Email' } },
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
control: 'radio',
|
|
@@ -64,29 +64,29 @@ var step = {
|
|
|
64
64
|
title: 'Iban',
|
|
65
65
|
type: 'object',
|
|
66
66
|
displayOrder: ['iban', 'type'],
|
|
67
|
-
properties: { iban: { type: 'string', title: 'IBAN' }, type: {
|
|
67
|
+
properties: { iban: { type: 'string', title: 'IBAN' }, type: { const: 'IBAN' } },
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
title: 'Bic',
|
|
71
71
|
type: 'object',
|
|
72
72
|
displayOrder: ['bic', 'type'],
|
|
73
|
-
properties: { bic: { type: 'string', title: 'BIC' }, type: {
|
|
73
|
+
properties: { bic: { type: 'string', title: 'BIC' }, type: { const: 'BIC' } },
|
|
74
74
|
},
|
|
75
|
-
]
|
|
75
|
+
],
|
|
76
76
|
},
|
|
77
|
-
]
|
|
77
|
+
],
|
|
78
78
|
},
|
|
79
79
|
],
|
|
80
80
|
layout: [
|
|
81
81
|
{
|
|
82
82
|
type: 'form',
|
|
83
|
-
schemaId: '#root'
|
|
83
|
+
schemaId: '#root',
|
|
84
84
|
},
|
|
85
85
|
],
|
|
86
86
|
model: {
|
|
87
87
|
email: 'marty.mcfly@wise.com',
|
|
88
|
-
type: 'IBAN'
|
|
89
|
-
}
|
|
88
|
+
type: 'IBAN',
|
|
89
|
+
},
|
|
90
90
|
};
|
|
91
91
|
export function AllOfAndOneOf() {
|
|
92
92
|
var _this = this;
|
|
@@ -121,7 +121,7 @@ var respondWithFixture = function (fixtureList, url, init) { return __awaiter(vo
|
|
|
121
121
|
}
|
|
122
122
|
if (url.pathname.includes('exit')) {
|
|
123
123
|
return [2 /*return*/, new Response(JSON.stringify(fixture), {
|
|
124
|
-
headers: { 'X-DF-Exit': 'true' }
|
|
124
|
+
headers: { 'X-DF-Exit': 'true' },
|
|
125
125
|
})];
|
|
126
126
|
}
|
|
127
127
|
return [2 /*return*/, new Response(JSON.stringify(fixture))];
|
|
@@ -83,8 +83,8 @@ var getFakeSearchResults = function (query) { return __spreadArray(__spreadArray
|
|
|
83
83
|
icon: { name: 'building' },
|
|
84
84
|
value: {
|
|
85
85
|
url: "/next-step?result=".concat(index + 1),
|
|
86
|
-
method: 'GET'
|
|
87
|
-
}
|
|
86
|
+
method: 'GET',
|
|
87
|
+
},
|
|
88
88
|
}); }), true), [
|
|
89
89
|
{
|
|
90
90
|
type: 'search',
|
|
@@ -95,8 +95,8 @@ var getFakeSearchResults = function (query) { return __spreadArray(__spreadArray
|
|
|
95
95
|
url: '/more-search',
|
|
96
96
|
method: 'GET',
|
|
97
97
|
param: 'query',
|
|
98
|
-
query: "get more ".concat(decodeURIComponent(query))
|
|
99
|
-
}
|
|
98
|
+
query: "get more ".concat(decodeURIComponent(query)),
|
|
99
|
+
},
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
type: 'search',
|
|
@@ -107,8 +107,8 @@ var getFakeSearchResults = function (query) { return __spreadArray(__spreadArray
|
|
|
107
107
|
url: '/more-search',
|
|
108
108
|
method: 'POST',
|
|
109
109
|
param: 'query',
|
|
110
|
-
query: "post more ".concat(decodeURIComponent(query))
|
|
111
|
-
}
|
|
110
|
+
query: "post more ".concat(decodeURIComponent(query)),
|
|
111
|
+
},
|
|
112
112
|
},
|
|
113
113
|
], false); };
|
|
114
114
|
var getMoreFakeSearchResults = function (query) {
|
|
@@ -119,7 +119,7 @@ var getMoreFakeSearchResults = function (query) {
|
|
|
119
119
|
icon: { name: 'cog' },
|
|
120
120
|
value: {
|
|
121
121
|
url: "/next-step?result=".concat(index + 1),
|
|
122
|
-
method: 'GET'
|
|
123
|
-
}
|
|
122
|
+
method: 'GET',
|
|
123
|
+
},
|
|
124
124
|
}); });
|
|
125
125
|
};
|
|
@@ -56,7 +56,7 @@ describe('ImageRenderer', function () {
|
|
|
56
56
|
onCompletion: jest.fn(),
|
|
57
57
|
onError: jest.fn(),
|
|
58
58
|
onEvent: jest.fn(),
|
|
59
|
-
onLog: jest.fn()
|
|
59
|
+
onLog: jest.fn(),
|
|
60
60
|
}); };
|
|
61
61
|
describe('Given a layout with an image with a relative path', function () {
|
|
62
62
|
it('should fetch the image using the provided httpClient', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -68,7 +68,7 @@ describe('ImageRenderer', function () {
|
|
|
68
68
|
id: 'step-id',
|
|
69
69
|
title: 'Step with image',
|
|
70
70
|
layout: [{ type: 'image', url: '/image.png' }],
|
|
71
|
-
schemas: []
|
|
71
|
+
schemas: [],
|
|
72
72
|
} });
|
|
73
73
|
renderWithProviders(_jsx(DynamicFlowWise, __assign({}, props)));
|
|
74
74
|
return [4 /*yield*/, waitFor(function () {
|
|
@@ -91,7 +91,7 @@ describe('ImageRenderer', function () {
|
|
|
91
91
|
id: 'step-id',
|
|
92
92
|
title: 'Step with image',
|
|
93
93
|
layout: [{ type: 'image', url: 'https://example.com/image.png' }],
|
|
94
|
-
schemas: []
|
|
94
|
+
schemas: [],
|
|
95
95
|
} });
|
|
96
96
|
renderWithProviders(_jsx(DynamicFlowWise, __assign({}, props)));
|
|
97
97
|
return [4 /*yield*/, waitFor(function () {
|
|
@@ -57,7 +57,7 @@ var getDefaultProps = function () { return ({
|
|
|
57
57
|
onCompletion: jest.fn(),
|
|
58
58
|
onError: jest.fn(),
|
|
59
59
|
onEvent: jest.fn(),
|
|
60
|
-
onLog: jest.fn()
|
|
60
|
+
onLog: jest.fn(),
|
|
61
61
|
}); };
|
|
62
62
|
var getStep = function () { return ({
|
|
63
63
|
id: 'step-id',
|
|
@@ -68,11 +68,11 @@ var getStep = function () { return ({
|
|
|
68
68
|
{
|
|
69
69
|
type: 'button',
|
|
70
70
|
title: 'Submit',
|
|
71
|
-
action: { id: 'action-id', url: '/submit', method: 'POST' }
|
|
71
|
+
action: { id: 'action-id', url: '/submit', method: 'POST' },
|
|
72
72
|
},
|
|
73
73
|
],
|
|
74
74
|
schemas: [],
|
|
75
|
-
model: null
|
|
75
|
+
model: null,
|
|
76
76
|
}); };
|
|
77
77
|
describe('Initial action', function () {
|
|
78
78
|
describe('Given a DynamicFlow component with a "initialAction" prop', function () {
|
|
@@ -99,7 +99,7 @@ describe('Initial action', function () {
|
|
|
99
99
|
renderWithProviders(_jsx(DynamicFlowWise, __assign({}, props)));
|
|
100
100
|
return [4 /*yield*/, waitFor(function () {
|
|
101
101
|
expect(props.onEvent).toHaveBeenCalledWith('Dynamic Flow - Initiated', {
|
|
102
|
-
flowId: 'flow-id'
|
|
102
|
+
flowId: 'flow-id',
|
|
103
103
|
});
|
|
104
104
|
})];
|
|
105
105
|
case 1:
|
|
@@ -138,7 +138,7 @@ describe('Initial action', function () {
|
|
|
138
138
|
flowId: 'flow-id',
|
|
139
139
|
stepId: 'step-id',
|
|
140
140
|
custom: 'analytics',
|
|
141
|
-
isFirstStep: true
|
|
141
|
+
isFirstStep: true,
|
|
142
142
|
});
|
|
143
143
|
})];
|
|
144
144
|
case 1:
|
|
@@ -174,7 +174,7 @@ describe('Initial action', function () {
|
|
|
174
174
|
props = __assign(__assign({}, getDefaultProps()), { initialAction: {
|
|
175
175
|
url: '/initial',
|
|
176
176
|
method: 'POST',
|
|
177
|
-
data: { custom: 'data' }
|
|
177
|
+
data: { custom: 'data' },
|
|
178
178
|
} });
|
|
179
179
|
renderWithProviders(_jsx(DynamicFlowWise, __assign({}, props)));
|
|
180
180
|
return [4 /*yield*/, waitFor(function () {
|
|
@@ -228,7 +228,7 @@ describe('Initial action', function () {
|
|
|
228
228
|
httpClient = jest.fn().mockResolvedValue({
|
|
229
229
|
title: 'Step without id nor key',
|
|
230
230
|
layout: [],
|
|
231
|
-
schemas: []
|
|
231
|
+
schemas: [],
|
|
232
232
|
});
|
|
233
233
|
props = __assign(__assign({}, getDefaultProps()), { httpClient: httpClient, initialAction: { url: '/initial' } });
|
|
234
234
|
renderWithProviders(_jsx(DynamicFlowWise, __assign({}, props)));
|
|
@@ -250,9 +250,9 @@ describe('Initial action', function () {
|
|
|
250
250
|
var newProps = __assign(__assign({}, props), { initialAction: {
|
|
251
251
|
url: '/initial',
|
|
252
252
|
method: 'POST',
|
|
253
|
-
data: { custom: 'data' }
|
|
253
|
+
data: { custom: 'data' },
|
|
254
254
|
} });
|
|
255
|
-
return (_jsxs(_Fragment, { children: [_jsx("button",
|
|
255
|
+
return (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: function () { return rerender(); }, children: "rerender" }), _jsx(DynamicFlowWise, __assign({}, newProps))] }));
|
|
256
256
|
}
|
|
257
257
|
it('makes the initial request only once to fetch the first step', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
258
258
|
var props;
|
|
@@ -55,7 +55,7 @@ var getDefaultProps = function () { return ({
|
|
|
55
55
|
onCompletion: jest.fn(),
|
|
56
56
|
onError: jest.fn(),
|
|
57
57
|
onEvent: jest.fn(),
|
|
58
|
-
onLog: jest.fn()
|
|
58
|
+
onLog: jest.fn(),
|
|
59
59
|
}); };
|
|
60
60
|
describe('InitialStep', function () {
|
|
61
61
|
describe('when an initialStep is a valid Step', function () {
|
|
@@ -66,7 +66,7 @@ describe('InitialStep', function () {
|
|
|
66
66
|
id: 'step-id',
|
|
67
67
|
title: 'Step with id',
|
|
68
68
|
layout: [],
|
|
69
|
-
schemas: []
|
|
69
|
+
schemas: [],
|
|
70
70
|
} });
|
|
71
71
|
renderWithProviders(_jsx(DynamicFlowWise, __assign({}, props)));
|
|
72
72
|
expect(screen.getByText('Step with id')).toBeInTheDocument();
|
|
@@ -86,7 +86,7 @@ describe('InitialStep', function () {
|
|
|
86
86
|
props = __assign(__assign({}, getDefaultProps()), { initialStep: {
|
|
87
87
|
title: 'Step without id nor key',
|
|
88
88
|
layout: [],
|
|
89
|
-
schemas: []
|
|
89
|
+
schemas: [],
|
|
90
90
|
} });
|
|
91
91
|
renderWithProviders(_jsx(DynamicFlowWise, __assign({}, props)));
|
|
92
92
|
return [4 /*yield*/, waitFor(function () {
|
|
@@ -56,7 +56,7 @@ var getDefaultProps = function () { return ({
|
|
|
56
56
|
onCompletion: jest.fn(),
|
|
57
57
|
onError: jest.fn(),
|
|
58
58
|
onEvent: jest.fn(),
|
|
59
|
-
onLog: jest.fn()
|
|
59
|
+
onLog: jest.fn(),
|
|
60
60
|
}); };
|
|
61
61
|
describe('Logging Events', function () {
|
|
62
62
|
describe('when initialStep is missing an "id" property', function () {
|
|
@@ -67,14 +67,14 @@ describe('Logging Events', function () {
|
|
|
67
67
|
key: 'step-key',
|
|
68
68
|
title: 'Step with key',
|
|
69
69
|
layout: [],
|
|
70
|
-
schemas: []
|
|
70
|
+
schemas: [],
|
|
71
71
|
} });
|
|
72
72
|
renderWithProviders(_jsx(DynamicFlowWise, __assign({}, props)));
|
|
73
73
|
expect(screen.getByText('Step with key')).toBeInTheDocument();
|
|
74
74
|
expect(props.onLog).toHaveBeenCalledWith('warning', 'Invalid step.', expect.objectContaining({
|
|
75
75
|
flowId: 'flow-id',
|
|
76
76
|
stepId: 'step-key',
|
|
77
|
-
errors: expect.any(String)
|
|
77
|
+
errors: expect.any(String),
|
|
78
78
|
}));
|
|
79
79
|
return [2 /*return*/];
|
|
80
80
|
});
|
|
@@ -90,7 +90,7 @@ describe('Logging Events', function () {
|
|
|
90
90
|
key: 'step-key',
|
|
91
91
|
title: 'Step with key',
|
|
92
92
|
layout: [],
|
|
93
|
-
schemas: []
|
|
93
|
+
schemas: [],
|
|
94
94
|
}), { status: 200 }));
|
|
95
95
|
props = getDefaultProps();
|
|
96
96
|
renderWithProviders(_jsx(DynamicFlowWise, __assign({}, props, { httpClient: httpClient, initialAction: { url: '/' } })));
|
|
@@ -102,7 +102,7 @@ describe('Logging Events', function () {
|
|
|
102
102
|
expect(props.onLog).toHaveBeenCalledWith('warning', 'Invalid step.', expect.objectContaining({
|
|
103
103
|
flowId: 'flow-id',
|
|
104
104
|
stepId: 'step-key',
|
|
105
|
-
errors: expect.any(String)
|
|
105
|
+
errors: expect.any(String),
|
|
106
106
|
}));
|
|
107
107
|
return [2 /*return*/];
|
|
108
108
|
}
|