@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
|
@@ -55,7 +55,7 @@ var persistAsyncConfig = {
|
|
|
55
55
|
method: 'POST',
|
|
56
56
|
url: '/persist-async',
|
|
57
57
|
param: 'param',
|
|
58
|
-
idProperty: 'token'
|
|
58
|
+
idProperty: 'token',
|
|
59
59
|
};
|
|
60
60
|
var uploadConfig = {
|
|
61
61
|
title: 'Upload label',
|
|
@@ -63,8 +63,8 @@ var uploadConfig = {
|
|
|
63
63
|
accepts: ['image/png', 'image/jpg', 'application/pdf'],
|
|
64
64
|
maxSize: 5242000,
|
|
65
65
|
validationMessages: {
|
|
66
|
-
maxSize: 'Your file is too large'
|
|
67
|
-
}
|
|
66
|
+
maxSize: 'Your file is too large',
|
|
67
|
+
},
|
|
68
68
|
};
|
|
69
69
|
var multiFileConfig = {
|
|
70
70
|
title: 'Upload label',
|
|
@@ -75,8 +75,8 @@ var multiFileConfig = {
|
|
|
75
75
|
summary: {
|
|
76
76
|
defaultTitle: 'File',
|
|
77
77
|
defaultDescription: 'Click to edit or remove',
|
|
78
|
-
defaultIcon: { name: 'document', type: 'icon' }
|
|
79
|
-
}
|
|
78
|
+
defaultIcon: { name: 'document', type: 'icon' },
|
|
79
|
+
},
|
|
80
80
|
};
|
|
81
81
|
var logPersistAsync = function (input, init) {
|
|
82
82
|
if (init && init.body instanceof FormData) {
|
|
@@ -103,7 +103,7 @@ var getHttpClient = function (persistAsync) {
|
|
|
103
103
|
return [2 /*return*/, Promise.reject(new Error('Failed to persist async'))];
|
|
104
104
|
case 'failValidation':
|
|
105
105
|
return [2 /*return*/, Promise.resolve(new Response(JSON.stringify({ validation: { param: 'This field is invalid' } }), {
|
|
106
|
-
status: 422
|
|
106
|
+
status: 422,
|
|
107
107
|
}))];
|
|
108
108
|
case 'succeed':
|
|
109
109
|
default:
|
|
@@ -111,22 +111,22 @@ var getHttpClient = function (persistAsync) {
|
|
|
111
111
|
}
|
|
112
112
|
return [2 /*return*/];
|
|
113
113
|
});
|
|
114
|
-
}); }
|
|
114
|
+
}); },
|
|
115
115
|
});
|
|
116
116
|
};
|
|
117
117
|
export default {
|
|
118
118
|
component: DynamicFlow,
|
|
119
119
|
title: 'Dev Tools/Features/Upload',
|
|
120
120
|
parameters: {
|
|
121
|
-
chromatic: { disableSnapshot: true }
|
|
121
|
+
chromatic: { disableSnapshot: true },
|
|
122
122
|
},
|
|
123
123
|
argTypes: {
|
|
124
124
|
persistAsync: {
|
|
125
125
|
options: ['succeed', 'failGenerically', 'failValidation'],
|
|
126
126
|
type: 'select',
|
|
127
|
-
defaultValue: 'succeed'
|
|
128
|
-
}
|
|
129
|
-
}
|
|
127
|
+
defaultValue: 'succeed',
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
130
|
};
|
|
131
131
|
export function Base64Upload() {
|
|
132
132
|
return renderWithStep(getBase64UploadStep());
|
|
@@ -161,14 +161,14 @@ var getBase64UploadWithPersistAsync = function () {
|
|
|
161
161
|
return getStep('Base64 Upload (Persist Async)', {
|
|
162
162
|
$id: '#id',
|
|
163
163
|
type: 'string',
|
|
164
|
-
persistAsync: __assign(__assign({}, persistAsyncConfig), { schema: __assign({ type: 'string', format: 'base64url' }, uploadConfig) })
|
|
164
|
+
persistAsync: __assign(__assign({}, persistAsyncConfig), { schema: __assign({ type: 'string', format: 'base64url' }, uploadConfig) }),
|
|
165
165
|
});
|
|
166
166
|
};
|
|
167
167
|
var getBlobUploadWithPersistAsync = function () {
|
|
168
168
|
return getStep('Blob Upload (Persist Async)', {
|
|
169
169
|
$id: '#id',
|
|
170
170
|
type: 'string',
|
|
171
|
-
persistAsync: __assign(__assign({}, persistAsyncConfig), { schema: __assign({ type: 'blob', source: 'file' }, uploadConfig) })
|
|
171
|
+
persistAsync: __assign(__assign({}, persistAsyncConfig), { schema: __assign({ type: 'blob', source: 'file' }, uploadConfig) }),
|
|
172
172
|
});
|
|
173
173
|
};
|
|
174
174
|
var getMultiBase64Upload = function () {
|
|
@@ -178,14 +178,14 @@ var getMultiBase64UploadWithPersistAsync = function () {
|
|
|
178
178
|
return getStep('Base64 Upload (Multiple, Persist Async)', __assign(__assign({ type: 'array' }, multiFileConfig), { items: {
|
|
179
179
|
$id: '#id',
|
|
180
180
|
type: 'string',
|
|
181
|
-
persistAsync: __assign(__assign({}, persistAsyncConfig), { schema: __assign({ type: 'string', format: 'base64url' }, uploadConfig) })
|
|
181
|
+
persistAsync: __assign(__assign({}, persistAsyncConfig), { schema: __assign({ type: 'string', format: 'base64url' }, uploadConfig) }),
|
|
182
182
|
} }));
|
|
183
183
|
};
|
|
184
184
|
var getMultiBlobUploadWithPersistAsync = function () {
|
|
185
185
|
return getStep('Blob Upload (Multiple, Persist Async)', __assign(__assign({ type: 'array' }, multiFileConfig), { items: {
|
|
186
186
|
$id: '#id',
|
|
187
187
|
type: 'string',
|
|
188
|
-
persistAsync: __assign(__assign({}, persistAsyncConfig), { schema: __assign({ type: 'blob', source: 'file' }, uploadConfig) })
|
|
188
|
+
persistAsync: __assign(__assign({}, persistAsyncConfig), { schema: __assign({ type: 'blob', source: 'file' }, uploadConfig) }),
|
|
189
189
|
} }));
|
|
190
190
|
};
|
|
191
191
|
var getStep = function (title, schema) { return ({
|
|
@@ -196,9 +196,9 @@ var getStep = function (title, schema) { return ({
|
|
|
196
196
|
$id: '#schema',
|
|
197
197
|
type: 'object',
|
|
198
198
|
properties: {
|
|
199
|
-
schema: schema
|
|
199
|
+
schema: schema,
|
|
200
200
|
},
|
|
201
|
-
displayOrder: ['schema']
|
|
201
|
+
displayOrder: ['schema'],
|
|
202
202
|
},
|
|
203
203
|
],
|
|
204
204
|
layout: [
|
|
@@ -206,7 +206,7 @@ var getStep = function (title, schema) { return ({
|
|
|
206
206
|
{
|
|
207
207
|
type: 'button',
|
|
208
208
|
title: 'Submit',
|
|
209
|
-
action: { url: '/submit', method: 'POST' }
|
|
209
|
+
action: { url: '/submit', method: 'POST' },
|
|
210
210
|
},
|
|
211
|
-
]
|
|
211
|
+
],
|
|
212
212
|
}); };
|
|
@@ -42,7 +42,7 @@ import { getMockHttpClient, respondWith, respondWithEmptyOk } from '../../../../
|
|
|
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' })];
|
|
@@ -77,22 +77,22 @@ var getHttpClient = function (validateAsync) {
|
|
|
77
77
|
}); },
|
|
78
78
|
'/persist-async': function (input, init) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
79
79
|
return [2 /*return*/, respondWith({ token: '123' })];
|
|
80
|
-
}); }); }
|
|
80
|
+
}); }); },
|
|
81
81
|
});
|
|
82
82
|
};
|
|
83
83
|
export default {
|
|
84
84
|
component: DynamicFlow,
|
|
85
85
|
title: 'Dev Tools/Features/Validation Async',
|
|
86
86
|
parameters: {
|
|
87
|
-
chromatic: { disableSnapshot: true }
|
|
87
|
+
chromatic: { disableSnapshot: true },
|
|
88
88
|
},
|
|
89
89
|
argTypes: {
|
|
90
90
|
validateAsync: {
|
|
91
91
|
options: ['succeed', 'succeedWithMessage', 'failGenerically', 'failValidation'],
|
|
92
92
|
type: 'select',
|
|
93
|
-
defaultValue: 'failValidation'
|
|
94
|
-
}
|
|
95
|
-
}
|
|
93
|
+
defaultValue: 'failValidation',
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
96
|
};
|
|
97
97
|
export function BasicTypes(_a) {
|
|
98
98
|
var validateAsync = _a.validateAsync;
|
|
@@ -112,24 +112,24 @@ var getBasicTypesStep = function () {
|
|
|
112
112
|
name: {
|
|
113
113
|
type: 'string',
|
|
114
114
|
title: 'Name',
|
|
115
|
-
validationAsync: validationAsyncConfig
|
|
115
|
+
validationAsync: validationAsyncConfig,
|
|
116
116
|
},
|
|
117
117
|
boolean: {
|
|
118
118
|
type: 'boolean',
|
|
119
119
|
title: 'I accept the terms and conditions',
|
|
120
|
-
validationAsync: validationAsyncConfig
|
|
120
|
+
validationAsync: validationAsyncConfig,
|
|
121
121
|
},
|
|
122
122
|
rate: {
|
|
123
123
|
title: 'Conversion rate',
|
|
124
124
|
type: 'number',
|
|
125
|
-
validationAsync: validationAsyncConfig
|
|
125
|
+
validationAsync: validationAsyncConfig,
|
|
126
126
|
},
|
|
127
127
|
age: {
|
|
128
128
|
title: 'Age',
|
|
129
129
|
type: 'integer',
|
|
130
|
-
validationAsync: validationAsyncConfig
|
|
131
|
-
}
|
|
132
|
-
}
|
|
130
|
+
validationAsync: validationAsyncConfig,
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
133
|
});
|
|
134
134
|
};
|
|
135
135
|
var getStep = function (title, schema) { return ({
|
|
@@ -140,9 +140,9 @@ var getStep = function (title, schema) { return ({
|
|
|
140
140
|
$id: '#schema',
|
|
141
141
|
type: 'object',
|
|
142
142
|
properties: {
|
|
143
|
-
schema: schema
|
|
143
|
+
schema: schema,
|
|
144
144
|
},
|
|
145
|
-
displayOrder: ['schema']
|
|
145
|
+
displayOrder: ['schema'],
|
|
146
146
|
},
|
|
147
147
|
],
|
|
148
148
|
layout: [
|
|
@@ -150,7 +150,7 @@ var getStep = function (title, schema) { return ({
|
|
|
150
150
|
{
|
|
151
151
|
type: 'button',
|
|
152
152
|
title: 'Submit',
|
|
153
|
-
action: { url: '/submit', method: 'POST' }
|
|
153
|
+
action: { url: '/submit', method: 'POST' },
|
|
154
154
|
},
|
|
155
|
-
]
|
|
155
|
+
],
|
|
156
156
|
}); };
|
|
@@ -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: DynamicFlow,
|
|
65
65
|
title: 'Dev Tools/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());
|
|
@@ -82,57 +82,57 @@ var getBasicStep = function () {
|
|
|
82
82
|
recurrence: {
|
|
83
83
|
oneOf: [
|
|
84
84
|
{
|
|
85
|
-
|
|
85
|
+
const: {
|
|
86
86
|
interval: 0,
|
|
87
|
-
frequency: 'ONCE'
|
|
87
|
+
frequency: 'ONCE',
|
|
88
88
|
},
|
|
89
89
|
title: 'Never',
|
|
90
|
-
description: 'On some date only'
|
|
90
|
+
description: 'On some date only',
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
|
-
|
|
93
|
+
const: {
|
|
94
94
|
interval: 1,
|
|
95
|
-
frequency: 'WEEKLY'
|
|
95
|
+
frequency: 'WEEKLY',
|
|
96
96
|
},
|
|
97
97
|
title: 'Weekly',
|
|
98
|
-
description: 'On some date every week'
|
|
98
|
+
description: 'On some date every week',
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
|
-
|
|
101
|
+
const: {
|
|
102
102
|
interval: 2,
|
|
103
|
-
frequency: 'WEEKLY'
|
|
103
|
+
frequency: 'WEEKLY',
|
|
104
104
|
},
|
|
105
105
|
title: 'Biweekly',
|
|
106
|
-
description: 'On some date every two weeks'
|
|
106
|
+
description: 'On some date every two weeks',
|
|
107
107
|
},
|
|
108
108
|
{
|
|
109
|
-
|
|
109
|
+
const: {
|
|
110
110
|
interval: 1,
|
|
111
|
-
frequency: 'MONTHLY'
|
|
111
|
+
frequency: 'MONTHLY',
|
|
112
112
|
},
|
|
113
113
|
title: 'Monthly',
|
|
114
|
-
description: 'Monthly'
|
|
114
|
+
description: 'Monthly',
|
|
115
115
|
},
|
|
116
116
|
{
|
|
117
|
-
|
|
117
|
+
const: {
|
|
118
118
|
interval: 3,
|
|
119
|
-
frequency: 'MONTHLY'
|
|
119
|
+
frequency: 'MONTHLY',
|
|
120
120
|
},
|
|
121
121
|
title: 'Quarterly',
|
|
122
|
-
description: 'Every 3 months on X'
|
|
122
|
+
description: 'Every 3 months on X',
|
|
123
123
|
},
|
|
124
124
|
],
|
|
125
125
|
placeholder: 'Select a start date',
|
|
126
126
|
title: 'Repeats',
|
|
127
|
-
|
|
127
|
+
default: {
|
|
128
128
|
interval: 0,
|
|
129
|
-
frequency: 'ONCE'
|
|
129
|
+
frequency: 'ONCE',
|
|
130
130
|
},
|
|
131
|
-
refreshStepOnChange: true
|
|
132
|
-
}
|
|
131
|
+
refreshStepOnChange: true,
|
|
132
|
+
},
|
|
133
133
|
},
|
|
134
134
|
displayOrder: ['recurrence'],
|
|
135
|
-
type: 'object'
|
|
135
|
+
type: 'object',
|
|
136
136
|
});
|
|
137
137
|
};
|
|
138
138
|
var getStep = function (title, schema) { return ({
|
|
@@ -144,7 +144,7 @@ var getStep = function (title, schema) { return ({
|
|
|
144
144
|
{
|
|
145
145
|
type: 'button',
|
|
146
146
|
title: 'Submit',
|
|
147
|
-
action: { url: '/submit', method: 'POST' }
|
|
147
|
+
action: { url: '/submit', method: 'POST' },
|
|
148
148
|
},
|
|
149
|
-
]
|
|
149
|
+
],
|
|
150
150
|
}); };
|
|
@@ -55,7 +55,7 @@ describe('Actions', function () {
|
|
|
55
55
|
step = {
|
|
56
56
|
title: 'Step Title',
|
|
57
57
|
layout: [{ type: 'button', action: { url: '/submit', exit: true } }],
|
|
58
|
-
schemas: []
|
|
58
|
+
schemas: [],
|
|
59
59
|
};
|
|
60
60
|
renderWithProviders(_jsx(DynamicFlow, { flowId: "the-flow-id", initialStep: step, httpClient: httpClient, onCompletion: onCompletion, onError: onError }));
|
|
61
61
|
_b = (_a = userEvent).click;
|
|
@@ -82,7 +82,7 @@ describe('Actions', function () {
|
|
|
82
82
|
onCompletion = jest.fn();
|
|
83
83
|
httpClient = jest.fn(function () {
|
|
84
84
|
return Promise.resolve(new Response(JSON.stringify({ key: 'new value', extra_key: 'value' }), {
|
|
85
|
-
status: 200
|
|
85
|
+
status: 200,
|
|
86
86
|
}));
|
|
87
87
|
});
|
|
88
88
|
step = {
|
|
@@ -90,10 +90,10 @@ describe('Actions', function () {
|
|
|
90
90
|
layout: [
|
|
91
91
|
{
|
|
92
92
|
type: 'button',
|
|
93
|
-
action: { url: '/submit', exit: true, result: { key: 'old value' } }
|
|
93
|
+
action: { url: '/submit', exit: true, result: { key: 'old value' } },
|
|
94
94
|
},
|
|
95
95
|
],
|
|
96
|
-
schemas: []
|
|
96
|
+
schemas: [],
|
|
97
97
|
};
|
|
98
98
|
renderWithProviders(_jsx(DynamicFlow, { flowId: "the-flow-id", initialStep: step, httpClient: httpClient, onCompletion: onCompletion, onError: onError }));
|
|
99
99
|
_b = (_a = userEvent).click;
|
|
@@ -129,7 +129,7 @@ describe('Actions', function () {
|
|
|
129
129
|
layout: [
|
|
130
130
|
{ type: 'button', action: { url: '/submit', exit: true, result: { key: 'value' } } },
|
|
131
131
|
],
|
|
132
|
-
schemas: []
|
|
132
|
+
schemas: [],
|
|
133
133
|
};
|
|
134
134
|
renderWithProviders(_jsx(DynamicFlow, { flowId: "the-flow-id", initialStep: step, httpClient: httpClient, onCompletion: onCompletion, onError: onError }));
|
|
135
135
|
_b = (_a = userEvent).click;
|
|
@@ -162,7 +162,7 @@ describe('Actions', function () {
|
|
|
162
162
|
step = {
|
|
163
163
|
title: 'Step Title',
|
|
164
164
|
layout: [{ type: 'button', action: { url: '/submit', exit: true } }],
|
|
165
|
-
schemas: []
|
|
165
|
+
schemas: [],
|
|
166
166
|
};
|
|
167
167
|
renderWithProviders(_jsx(DynamicFlow, { flowId: "the-flow-id", initialStep: step, httpClient: httpClient, onCompletion: onCompletion, onError: onError }));
|
|
168
168
|
_b = (_a = userEvent).click;
|
|
@@ -56,8 +56,8 @@ var stringObjectSchema = {
|
|
|
56
56
|
title: 'String Object',
|
|
57
57
|
displayOrder: ['name'],
|
|
58
58
|
properties: {
|
|
59
|
-
name: { title: 'Name String Schema', type: 'string', $id: 'name' }
|
|
60
|
-
}
|
|
59
|
+
name: { title: 'Name String Schema', type: 'string', $id: 'name' },
|
|
60
|
+
},
|
|
61
61
|
};
|
|
62
62
|
var numberObjectSchema = {
|
|
63
63
|
$id: 'objectSchema2',
|
|
@@ -65,8 +65,8 @@ var numberObjectSchema = {
|
|
|
65
65
|
title: 'Number Object',
|
|
66
66
|
displayOrder: ['age'],
|
|
67
67
|
properties: {
|
|
68
|
-
age: { type: 'number', $id: 'age' }
|
|
69
|
-
}
|
|
68
|
+
age: { type: 'number', $id: 'age' },
|
|
69
|
+
},
|
|
70
70
|
};
|
|
71
71
|
var initialStep = function (schema) {
|
|
72
72
|
if (schema === void 0) { schema = { allOf: [stringObjectSchema, numberObjectSchema] }; }
|
|
@@ -78,12 +78,12 @@ var initialStep = function (schema) {
|
|
|
78
78
|
{
|
|
79
79
|
type: 'button',
|
|
80
80
|
title: 'Submit',
|
|
81
|
-
action: { url: '/submit', method: 'POST' }
|
|
81
|
+
action: { url: '/submit', method: 'POST' },
|
|
82
82
|
},
|
|
83
83
|
],
|
|
84
84
|
schemas: [
|
|
85
85
|
__assign(__assign({}, schema), { $id: '#schema' }),
|
|
86
|
-
]
|
|
86
|
+
],
|
|
87
87
|
});
|
|
88
88
|
};
|
|
89
89
|
var mockHttpClient = jest.fn();
|
|
@@ -97,7 +97,7 @@ describe('Given an allOf schema', function () {
|
|
|
97
97
|
it('should render the schema title in a label', function () {
|
|
98
98
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, getProps({
|
|
99
99
|
title: 'My title',
|
|
100
|
-
allOf: [stringObjectSchema, numberObjectSchema]
|
|
100
|
+
allOf: [stringObjectSchema, numberObjectSchema],
|
|
101
101
|
}))));
|
|
102
102
|
var title = screen.getByRole('heading', { name: 'My title' });
|
|
103
103
|
expect(title).toBeInTheDocument();
|
|
@@ -105,13 +105,13 @@ describe('Given an allOf schema', function () {
|
|
|
105
105
|
it('should render the schema description', function () {
|
|
106
106
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, getProps({
|
|
107
107
|
description: 'This is the schema description',
|
|
108
|
-
allOf: [stringObjectSchema, numberObjectSchema]
|
|
108
|
+
allOf: [stringObjectSchema, numberObjectSchema],
|
|
109
109
|
}))));
|
|
110
110
|
expect(screen.getByText('This is the schema description')).toBeInTheDocument();
|
|
111
111
|
});
|
|
112
112
|
it('should render one aria-group for each allOf', function () {
|
|
113
113
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, getProps({
|
|
114
|
-
allOf: [stringObjectSchema, numberObjectSchema]
|
|
114
|
+
allOf: [stringObjectSchema, numberObjectSchema],
|
|
115
115
|
}))));
|
|
116
116
|
expect(screen.getAllByRole('group')).toHaveLength(2);
|
|
117
117
|
});
|
|
@@ -120,8 +120,8 @@ describe('Given an allOf schema', function () {
|
|
|
120
120
|
initialStep: __assign(__assign({}, initialStep()), { model: {
|
|
121
121
|
name: 'Colin Robinson',
|
|
122
122
|
age: 999,
|
|
123
|
-
city: 'New York'
|
|
124
|
-
} })
|
|
123
|
+
city: 'New York',
|
|
124
|
+
} }),
|
|
125
125
|
}))));
|
|
126
126
|
expect(screen.getByDisplayValue('Colin Robinson')).toBeInTheDocument();
|
|
127
127
|
expect(screen.getByDisplayValue('999')).toBeInTheDocument();
|
|
@@ -132,14 +132,14 @@ describe('Given an allOf schema', function () {
|
|
|
132
132
|
initialStep: __assign(__assign({}, initialStep()), { model: {
|
|
133
133
|
name: 'Colin Robinson',
|
|
134
134
|
age: 999,
|
|
135
|
-
city: 'New York'
|
|
135
|
+
city: 'New York',
|
|
136
136
|
}, errors: {
|
|
137
137
|
validation: {
|
|
138
138
|
name: 'Vampire names are not accepted',
|
|
139
139
|
age: 'That is too old',
|
|
140
|
-
city: 'There are no vampires in New York'
|
|
141
|
-
}
|
|
142
|
-
} })
|
|
140
|
+
city: 'There are no vampires in New York',
|
|
141
|
+
},
|
|
142
|
+
} }),
|
|
143
143
|
}))));
|
|
144
144
|
expect(screen.getByText('Vampire names are not accepted')).toBeInTheDocument();
|
|
145
145
|
expect(screen.getByText('That is too old')).toBeInTheDocument();
|
|
@@ -174,8 +174,8 @@ describe('Given an allOf schema', function () {
|
|
|
174
174
|
initialStep: __assign(__assign({}, initialStep()), { model: {
|
|
175
175
|
name: 'Colin',
|
|
176
176
|
age: 999,
|
|
177
|
-
city: 'New York'
|
|
178
|
-
} })
|
|
177
|
+
city: 'New York',
|
|
178
|
+
} }),
|
|
179
179
|
}))));
|
|
180
180
|
return [4 /*yield*/, userEvent.type(screen.getByLabelText('Name String Schema'), ' Robinson')];
|
|
181
181
|
case 1:
|
|
@@ -22,7 +22,7 @@ describe('AutocompleteHints', function () {
|
|
|
22
22
|
{
|
|
23
23
|
type: 'button',
|
|
24
24
|
title: 'Submit',
|
|
25
|
-
action: { url: '/submit', method: 'POST' }
|
|
25
|
+
action: { url: '/submit', method: 'POST' },
|
|
26
26
|
},
|
|
27
27
|
],
|
|
28
28
|
schemas: [
|
|
@@ -31,10 +31,10 @@ describe('AutocompleteHints', function () {
|
|
|
31
31
|
type: 'object',
|
|
32
32
|
displayOrder: ['child'],
|
|
33
33
|
properties: {
|
|
34
|
-
child: childSchema
|
|
35
|
-
}
|
|
34
|
+
child: childSchema,
|
|
35
|
+
},
|
|
36
36
|
},
|
|
37
|
-
]
|
|
37
|
+
],
|
|
38
38
|
}); };
|
|
39
39
|
var mockHttpClient = jest.fn();
|
|
40
40
|
beforeEach(function () { return mockHttpClient.mockClear(); });
|
|
@@ -45,13 +45,13 @@ describe('AutocompleteHints', function () {
|
|
|
45
45
|
onCompletion: jest.fn(),
|
|
46
46
|
onError: jest.fn(),
|
|
47
47
|
onEvent: jest.fn(),
|
|
48
|
-
onLog: jest.fn()
|
|
48
|
+
onLog: jest.fn(),
|
|
49
49
|
}); };
|
|
50
50
|
it('should render autocomplete hint', function () {
|
|
51
51
|
var props = getProps({
|
|
52
52
|
title: 'Full name',
|
|
53
53
|
autocompleteHint: ['name', 'shipping'],
|
|
54
|
-
type: 'string'
|
|
54
|
+
type: 'string',
|
|
55
55
|
});
|
|
56
56
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, props)));
|
|
57
57
|
expect(screen.getByLabelText('Full name')).toHaveAttribute('autocomplete', 'name shipping');
|
|
@@ -55,12 +55,12 @@ var getStepWithBack = function (navigation) { return ({
|
|
|
55
55
|
properties: {
|
|
56
56
|
name: {
|
|
57
57
|
title: 'Full name',
|
|
58
|
-
type: 'string'
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
58
|
+
type: 'string',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
62
|
},
|
|
63
|
-
]
|
|
63
|
+
],
|
|
64
64
|
}); };
|
|
65
65
|
describe('DynamicFlow / Back Button', function () {
|
|
66
66
|
var onCompletion = jest.fn();
|
|
@@ -74,7 +74,7 @@ describe('DynamicFlow / Back Button', function () {
|
|
|
74
74
|
var backLabel = 'Back to payment methods';
|
|
75
75
|
var backAction = {
|
|
76
76
|
method: 'GET',
|
|
77
|
-
url: '/back'
|
|
77
|
+
url: '/back',
|
|
78
78
|
};
|
|
79
79
|
renderWithProviders(_jsx(DynamicFlow, { flowId: "the-flow-id", httpClient: httpClient, initialStep: getStepWithBack({ back: { title: backLabel, action: backAction } }), onCompletion: onCompletion, onError: onError }));
|
|
80
80
|
expect(screen.getByRole('link', { name: backLabel })).toBeInTheDocument();
|
|
@@ -85,7 +85,7 @@ describe('DynamicFlow / Back Button', function () {
|
|
|
85
85
|
var backLabel = 'Back to payment methods';
|
|
86
86
|
var backAction = {
|
|
87
87
|
method: 'GET',
|
|
88
|
-
url: '/back'
|
|
88
|
+
url: '/back',
|
|
89
89
|
};
|
|
90
90
|
renderWithProviders(_jsx(DynamicFlow, { flowId: "the-flow-id", httpClient: httpClient, initialStep: getStepWithBack({ backButton: { title: backLabel, action: backAction } }), onCompletion: onCompletion, onError: onError }));
|
|
91
91
|
expect(screen.getByRole('link', { name: backLabel })).toBeInTheDocument();
|
|
@@ -99,14 +99,14 @@ describe('DynamicFlow / Back Button', function () {
|
|
|
99
99
|
backLabel = 'Back to payment methods';
|
|
100
100
|
backAction = {
|
|
101
101
|
method: 'GET',
|
|
102
|
-
url: '/back'
|
|
102
|
+
url: '/back',
|
|
103
103
|
};
|
|
104
104
|
mockHttpClient = jest.fn();
|
|
105
105
|
mockHttpClient.mockImplementationOnce(function () {
|
|
106
106
|
return respondWith({
|
|
107
107
|
title: 'Next step',
|
|
108
108
|
schemas: [],
|
|
109
|
-
layout: []
|
|
109
|
+
layout: [],
|
|
110
110
|
});
|
|
111
111
|
});
|
|
112
112
|
renderWithProviders(_jsx(DynamicFlow, { flowId: "the-flow-id", httpClient: mockHttpClient, initialStep: getStepWithBack({ back: { title: backLabel, action: backAction } }), onCompletion: onCompletion, onError: onError }));
|
|
@@ -126,7 +126,7 @@ describe('DynamicFlow / Back Button', function () {
|
|
|
126
126
|
var backLabel = 'Back to payment methods';
|
|
127
127
|
var backAction = {
|
|
128
128
|
method: 'POST',
|
|
129
|
-
url: '/back'
|
|
129
|
+
url: '/back',
|
|
130
130
|
};
|
|
131
131
|
var mockHttpClient = jest.fn();
|
|
132
132
|
beforeEach(function () {
|
|
@@ -134,7 +134,7 @@ describe('DynamicFlow / Back Button', function () {
|
|
|
134
134
|
return respondWith({
|
|
135
135
|
title: 'Next step',
|
|
136
136
|
schemas: [],
|
|
137
|
-
layout: []
|
|
137
|
+
layout: [],
|
|
138
138
|
});
|
|
139
139
|
});
|
|
140
140
|
});
|