@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
|
@@ -41,7 +41,7 @@ describe('getSearchFunction returns a function which', function () {
|
|
|
41
41
|
var defaultConfig = {
|
|
42
42
|
url: '/testing',
|
|
43
43
|
method: 'GET',
|
|
44
|
-
param: 'query'
|
|
44
|
+
param: 'query',
|
|
45
45
|
};
|
|
46
46
|
it('should use the default config', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
47
47
|
var httpClient, searchFn, abortController;
|
|
@@ -55,7 +55,7 @@ describe('getSearchFunction returns a function which', function () {
|
|
|
55
55
|
abortController = new AbortController();
|
|
56
56
|
return [4 /*yield*/, searchFn({
|
|
57
57
|
query: 'query',
|
|
58
|
-
signal: abortController.signal
|
|
58
|
+
signal: abortController.signal,
|
|
59
59
|
})];
|
|
60
60
|
case 1:
|
|
61
61
|
_a.sent();
|
|
@@ -69,7 +69,7 @@ describe('getSearchFunction returns a function which', function () {
|
|
|
69
69
|
var defaultConfig = {
|
|
70
70
|
url: '/testing',
|
|
71
71
|
method: 'POST',
|
|
72
|
-
param: 'query'
|
|
72
|
+
param: 'query',
|
|
73
73
|
};
|
|
74
74
|
it('should use the default config', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
75
75
|
var httpClient, searchFn, abortController;
|
|
@@ -83,7 +83,7 @@ describe('getSearchFunction returns a function which', function () {
|
|
|
83
83
|
abortController = new AbortController();
|
|
84
84
|
return [4 /*yield*/, searchFn({
|
|
85
85
|
query: 'query',
|
|
86
|
-
signal: abortController.signal
|
|
86
|
+
signal: abortController.signal,
|
|
87
87
|
})];
|
|
88
88
|
case 1:
|
|
89
89
|
_a.sent();
|
|
@@ -103,7 +103,7 @@ describe('getSearchFunction returns a function which', function () {
|
|
|
103
103
|
defaultConfig = {
|
|
104
104
|
url: '/old-testing',
|
|
105
105
|
method: 'GET',
|
|
106
|
-
param: 'query'
|
|
106
|
+
param: 'query',
|
|
107
107
|
};
|
|
108
108
|
httpClient = jest.fn(function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
109
109
|
return [2 /*return*/, Promise.resolve(new Response(JSON.stringify({ results: [] })))];
|
|
@@ -113,7 +113,7 @@ describe('getSearchFunction returns a function which', function () {
|
|
|
113
113
|
return [4 /*yield*/, searchFn({
|
|
114
114
|
query: 'query',
|
|
115
115
|
config: { method: 'POST', param: 'term', url: '/new-testing' },
|
|
116
|
-
signal: abortController.signal
|
|
116
|
+
signal: abortController.signal,
|
|
117
117
|
})];
|
|
118
118
|
case 1:
|
|
119
119
|
_a.sent();
|
|
@@ -133,7 +133,7 @@ describe('getSearchFunction returns a function which', function () {
|
|
|
133
133
|
defaultConfig = {
|
|
134
134
|
url: '/testing',
|
|
135
135
|
method: 'GET',
|
|
136
|
-
param: 'query'
|
|
136
|
+
param: 'query',
|
|
137
137
|
};
|
|
138
138
|
httpClient = jest.fn(function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
139
139
|
return [2 /*return*/, Promise.resolve(new Response(JSON.stringify({ results: [] })))];
|
|
@@ -142,7 +142,7 @@ describe('getSearchFunction returns a function which', function () {
|
|
|
142
142
|
abortController = new AbortController();
|
|
143
143
|
return [4 /*yield*/, searchFn({
|
|
144
144
|
query: 'query',
|
|
145
|
-
signal: abortController.signal
|
|
145
|
+
signal: abortController.signal,
|
|
146
146
|
})];
|
|
147
147
|
case 1:
|
|
148
148
|
result = _a.sent();
|
|
@@ -161,7 +161,7 @@ describe('getSearchFunction returns a function which', function () {
|
|
|
161
161
|
defaultConfig = {
|
|
162
162
|
url: '/testing',
|
|
163
163
|
method: 'GET',
|
|
164
|
-
param: 'query'
|
|
164
|
+
param: 'query',
|
|
165
165
|
};
|
|
166
166
|
httpClient = jest.fn(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
167
167
|
return __generator(this, function (_a) {
|
|
@@ -171,9 +171,9 @@ describe('getSearchFunction returns a function which', function () {
|
|
|
171
171
|
{
|
|
172
172
|
type: 'search',
|
|
173
173
|
title: '',
|
|
174
|
-
value: { query: 'query', url: '/testing', method: 'GET', param: 'query' }
|
|
174
|
+
value: { query: 'query', url: '/testing', method: 'GET', param: 'query' },
|
|
175
175
|
},
|
|
176
|
-
]
|
|
176
|
+
],
|
|
177
177
|
})))];
|
|
178
178
|
});
|
|
179
179
|
}); });
|
|
@@ -181,7 +181,7 @@ describe('getSearchFunction returns a function which', function () {
|
|
|
181
181
|
abortController = new AbortController();
|
|
182
182
|
return [4 /*yield*/, searchFn({
|
|
183
183
|
query: 'query',
|
|
184
|
-
signal: abortController.signal
|
|
184
|
+
signal: abortController.signal,
|
|
185
185
|
})];
|
|
186
186
|
case 1:
|
|
187
187
|
result = _a.sent();
|
|
@@ -189,12 +189,12 @@ describe('getSearchFunction returns a function which', function () {
|
|
|
189
189
|
expect.objectContaining({
|
|
190
190
|
type: 'action',
|
|
191
191
|
title: '',
|
|
192
|
-
value: {}
|
|
192
|
+
value: {},
|
|
193
193
|
}),
|
|
194
194
|
expect.objectContaining({
|
|
195
195
|
type: 'search',
|
|
196
196
|
title: '',
|
|
197
|
-
value: { query: 'query', url: '/testing', method: 'GET', param: 'query' }
|
|
197
|
+
value: { query: 'query', url: '/testing', method: 'GET', param: 'query' },
|
|
198
198
|
}),
|
|
199
199
|
]));
|
|
200
200
|
return [2 /*return*/];
|
|
@@ -212,7 +212,7 @@ describe('getSearchFunction returns a function which', function () {
|
|
|
212
212
|
defaultConfig = {
|
|
213
213
|
url: '/testing',
|
|
214
214
|
method: 'GET',
|
|
215
|
-
param: 'query'
|
|
215
|
+
param: 'query',
|
|
216
216
|
};
|
|
217
217
|
httpClient = jest.fn(function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
218
218
|
return [2 /*return*/, Promise.resolve(new Response('invalid body'))];
|
|
@@ -221,7 +221,7 @@ describe('getSearchFunction returns a function which', function () {
|
|
|
221
221
|
abortController = new AbortController();
|
|
222
222
|
return [4 /*yield*/, expect(searchFn({
|
|
223
223
|
query: 'query',
|
|
224
|
-
signal: abortController.signal
|
|
224
|
+
signal: abortController.signal,
|
|
225
225
|
})).rejects.toThrow()];
|
|
226
226
|
case 1:
|
|
227
227
|
_a.sent();
|
|
@@ -239,7 +239,7 @@ describe('getSearchFunction returns a function which', function () {
|
|
|
239
239
|
defaultConfig = {
|
|
240
240
|
url: '/testing',
|
|
241
241
|
method: 'GET',
|
|
242
|
-
param: 'query'
|
|
242
|
+
param: 'query',
|
|
243
243
|
};
|
|
244
244
|
httpClient = jest.fn(function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
245
245
|
return [2 /*return*/, Promise.resolve(new Response(JSON.stringify({ results: [] }), { status: 400 }))];
|
|
@@ -248,7 +248,7 @@ describe('getSearchFunction returns a function which', function () {
|
|
|
248
248
|
abortController = new AbortController();
|
|
249
249
|
return [4 /*yield*/, expect(searchFn({
|
|
250
250
|
query: 'query',
|
|
251
|
-
signal: abortController.signal
|
|
251
|
+
signal: abortController.signal,
|
|
252
252
|
})).rejects.toThrow()];
|
|
253
253
|
case 1:
|
|
254
254
|
_a.sent();
|
|
@@ -22,7 +22,7 @@ export var mergeSummaries = function (summaryA, summaryB) {
|
|
|
22
22
|
title: (_a = summaryA.title) !== null && _a !== void 0 ? _a : summaryB.title,
|
|
23
23
|
description: (_b = summaryA.description) !== null && _b !== void 0 ? _b : summaryB.description,
|
|
24
24
|
icon: (_c = summaryA.icon) !== null && _c !== void 0 ? _c : summaryB.icon,
|
|
25
|
-
image: (_d = summaryA.image) !== null && _d !== void 0 ? _d : summaryB.image
|
|
25
|
+
image: (_d = summaryA.image) !== null && _d !== void 0 ? _d : summaryB.image,
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
28
|
var summaryIfProvides = function (summary, _a) {
|
|
@@ -34,6 +34,6 @@ var summaryIfProvides = function (summary, _a) {
|
|
|
34
34
|
title: (summary.providesTitle && value) || undefined,
|
|
35
35
|
description: (summary.providesDescription && value) || undefined,
|
|
36
36
|
icon: (summary.providesIcon && icon) || undefined,
|
|
37
|
-
image: (summary.providesImage && image) || undefined
|
|
37
|
+
image: (summary.providesImage && image) || undefined,
|
|
38
38
|
};
|
|
39
39
|
};
|
|
@@ -8,19 +8,19 @@ describe('summary-utils', function () {
|
|
|
8
8
|
type: 'string',
|
|
9
9
|
summary: {
|
|
10
10
|
providesTitle: true,
|
|
11
|
-
providesIcon: true
|
|
11
|
+
providesIcon: true,
|
|
12
12
|
},
|
|
13
13
|
icon: {
|
|
14
|
-
name: 'email'
|
|
15
|
-
}
|
|
14
|
+
name: 'email',
|
|
15
|
+
},
|
|
16
16
|
};
|
|
17
17
|
var summariser = getSummariser(stringSchema);
|
|
18
18
|
var summary = summariser('test value');
|
|
19
19
|
expect(summary).toEqual({
|
|
20
20
|
title: 'test value',
|
|
21
21
|
icon: {
|
|
22
|
-
name: 'email'
|
|
23
|
-
}
|
|
22
|
+
name: 'email',
|
|
23
|
+
},
|
|
24
24
|
});
|
|
25
25
|
});
|
|
26
26
|
});
|
|
@@ -28,40 +28,40 @@ describe('summary-utils', function () {
|
|
|
28
28
|
it('returns a function that constructs a summary based on the schema', function () {
|
|
29
29
|
var schema = {
|
|
30
30
|
type: 'string',
|
|
31
|
-
|
|
31
|
+
const: 'const value',
|
|
32
32
|
summary: {
|
|
33
33
|
providesTitle: true,
|
|
34
|
-
providesIcon: true
|
|
34
|
+
providesIcon: true,
|
|
35
35
|
},
|
|
36
36
|
icon: {
|
|
37
|
-
name: 'email'
|
|
38
|
-
}
|
|
37
|
+
name: 'email',
|
|
38
|
+
},
|
|
39
39
|
};
|
|
40
40
|
var summary = getConstSummary(schema, 'const value');
|
|
41
41
|
expect(summary).toEqual({
|
|
42
42
|
title: 'const value',
|
|
43
43
|
icon: {
|
|
44
|
-
name: 'email'
|
|
45
|
-
}
|
|
44
|
+
name: 'email',
|
|
45
|
+
},
|
|
46
46
|
});
|
|
47
47
|
});
|
|
48
48
|
it('prefers ignores non-string values', function () {
|
|
49
49
|
var schema = {
|
|
50
50
|
type: 'array',
|
|
51
|
-
|
|
51
|
+
const: [],
|
|
52
52
|
summary: {
|
|
53
53
|
providesTitle: true,
|
|
54
|
-
providesIcon: true
|
|
54
|
+
providesIcon: true,
|
|
55
55
|
},
|
|
56
56
|
icon: {
|
|
57
|
-
name: 'email'
|
|
58
|
-
}
|
|
57
|
+
name: 'email',
|
|
58
|
+
},
|
|
59
59
|
};
|
|
60
60
|
var summary = getConstSummary(schema, []);
|
|
61
61
|
expect(summary).toEqual({
|
|
62
62
|
icon: {
|
|
63
|
-
name: 'email'
|
|
64
|
-
}
|
|
63
|
+
name: 'email',
|
|
64
|
+
},
|
|
65
65
|
});
|
|
66
66
|
});
|
|
67
67
|
});
|
|
@@ -70,19 +70,19 @@ describe('summary-utils', function () {
|
|
|
70
70
|
var components = [
|
|
71
71
|
createMockTextInputComponent({
|
|
72
72
|
summariser: function () { return ({
|
|
73
|
-
title: 'title one'
|
|
74
|
-
}); }
|
|
73
|
+
title: 'title one',
|
|
74
|
+
}); },
|
|
75
75
|
}),
|
|
76
76
|
createMockTextInputComponent({
|
|
77
77
|
summariser: function () { return ({
|
|
78
78
|
title: 'title two',
|
|
79
|
-
description: 'description'
|
|
80
|
-
}); }
|
|
79
|
+
description: 'description',
|
|
80
|
+
}); },
|
|
81
81
|
}),
|
|
82
82
|
];
|
|
83
83
|
expect(summariseFromChildren(components)).toEqual({
|
|
84
84
|
title: 'title one',
|
|
85
|
-
description: 'description'
|
|
85
|
+
description: 'description',
|
|
86
86
|
});
|
|
87
87
|
});
|
|
88
88
|
});
|
|
@@ -90,20 +90,20 @@ describe('summary-utils', function () {
|
|
|
90
90
|
it('should merge two summaries, prefering earlier props if there are duplicates', function () {
|
|
91
91
|
var summaryOne = {
|
|
92
92
|
title: 'title one',
|
|
93
|
-
description: 'description'
|
|
93
|
+
description: 'description',
|
|
94
94
|
};
|
|
95
95
|
var summaryTwo = {
|
|
96
96
|
title: 'title two',
|
|
97
97
|
icon: {
|
|
98
|
-
name: 'email'
|
|
99
|
-
}
|
|
98
|
+
name: 'email',
|
|
99
|
+
},
|
|
100
100
|
};
|
|
101
101
|
expect(mergeSummaries(summaryOne, summaryTwo)).toEqual({
|
|
102
102
|
title: 'title one',
|
|
103
103
|
description: 'description',
|
|
104
104
|
icon: {
|
|
105
|
-
name: 'email'
|
|
106
|
-
}
|
|
105
|
+
name: 'email',
|
|
106
|
+
},
|
|
107
107
|
});
|
|
108
108
|
});
|
|
109
109
|
});
|
|
@@ -12,5 +12,5 @@ export var mockErrorMessageFunctions = {
|
|
|
12
12
|
pattern: jest.fn().mockReturnValue('pattern'),
|
|
13
13
|
required: jest.fn().mockReturnValue('required'),
|
|
14
14
|
genericError: jest.fn().mockReturnValue('genericError'),
|
|
15
|
-
genericErrorWithRetry: jest.fn().mockReturnValue('genericErrorWithRetry')
|
|
15
|
+
genericErrorWithRetry: jest.fn().mockReturnValue('genericErrorWithRetry'),
|
|
16
16
|
};
|
|
@@ -49,7 +49,7 @@ describe('getLocalValueValidator', function () {
|
|
|
49
49
|
var schema = {
|
|
50
50
|
type: 'integer',
|
|
51
51
|
minimum: 1,
|
|
52
|
-
maximum: 90
|
|
52
|
+
maximum: 90,
|
|
53
53
|
};
|
|
54
54
|
var checks = [
|
|
55
55
|
getRequiredCheck(false, mockErrorMessageFunctions),
|
|
@@ -64,7 +64,7 @@ describe('getLocalValueValidator', function () {
|
|
|
64
64
|
type: 'string',
|
|
65
65
|
minLength: 3,
|
|
66
66
|
maxLength: 10,
|
|
67
|
-
pattern: 'foo'
|
|
67
|
+
pattern: 'foo',
|
|
68
68
|
};
|
|
69
69
|
var checks = [
|
|
70
70
|
getRequiredCheck(false, mockErrorMessageFunctions),
|
|
@@ -80,7 +80,7 @@ describe('getLocalValueValidator', function () {
|
|
|
80
80
|
type: 'string',
|
|
81
81
|
minLength: 3,
|
|
82
82
|
maxLength: 10,
|
|
83
|
-
pattern: 'foo'
|
|
83
|
+
pattern: 'foo',
|
|
84
84
|
};
|
|
85
85
|
var checks = [
|
|
86
86
|
getRequiredCheck(true, mockErrorMessageFunctions),
|
|
@@ -96,7 +96,7 @@ describe('getLocalValueValidator', function () {
|
|
|
96
96
|
type: 'string',
|
|
97
97
|
minLength: 3,
|
|
98
98
|
maxLength: 10,
|
|
99
|
-
pattern: 'foo'
|
|
99
|
+
pattern: 'foo',
|
|
100
100
|
};
|
|
101
101
|
var checks = [
|
|
102
102
|
getRequiredCheck(false, mockErrorMessageFunctions),
|
|
@@ -109,7 +109,7 @@ describe('value checks', function () {
|
|
|
109
109
|
items: { type: 'string' },
|
|
110
110
|
addItemTitle: '',
|
|
111
111
|
editItemTitle: '',
|
|
112
|
-
maxItems: 5
|
|
112
|
+
maxItems: 5,
|
|
113
113
|
};
|
|
114
114
|
it('should return null if the array length is below or equal to the maxItems', function () {
|
|
115
115
|
var check = getAboveMaxItemsCheck(arraySchema, mockErrorMessageFunctions);
|
|
@@ -129,7 +129,7 @@ describe('value checks', function () {
|
|
|
129
129
|
items: { type: 'string' },
|
|
130
130
|
addItemTitle: '',
|
|
131
131
|
editItemTitle: '',
|
|
132
|
-
minItems: 3
|
|
132
|
+
minItems: 3,
|
|
133
133
|
};
|
|
134
134
|
it('should return null if the array length is above or equal to the minItems', function () {
|
|
135
135
|
var check = getBelowMinItemsCheck(arraySchema, mockErrorMessageFunctions);
|
|
@@ -154,7 +154,7 @@ describe('value checks', function () {
|
|
|
154
154
|
items: { type: 'string' },
|
|
155
155
|
addItemTitle: '',
|
|
156
156
|
editItemTitle: '',
|
|
157
|
-
maxItems: 2
|
|
157
|
+
maxItems: 2,
|
|
158
158
|
};
|
|
159
159
|
it('should return null if the array length is below or equal to the maxItems', function () {
|
|
160
160
|
var check = getAboveMaxFilesCheck(arraySchema, mockErrorMessageFunctions);
|
|
@@ -178,7 +178,7 @@ describe('value checks', function () {
|
|
|
178
178
|
items: { type: 'string' },
|
|
179
179
|
addItemTitle: '',
|
|
180
180
|
editItemTitle: '',
|
|
181
|
-
minItems: 2
|
|
181
|
+
minItems: 2,
|
|
182
182
|
};
|
|
183
183
|
it('should return null if the array length is above or equal to the minItems', function () {
|
|
184
184
|
var check = getBelowMinFilesCheck(arraySchema, mockErrorMessageFunctions);
|
|
@@ -58,7 +58,7 @@ export var getComponentValidationAsync = function (update, performValidationAsyn
|
|
|
58
58
|
draft.validationState = {
|
|
59
59
|
abortController: newAbortController,
|
|
60
60
|
lastSubmitted: currentValue,
|
|
61
|
-
messages: {}
|
|
61
|
+
messages: {},
|
|
62
62
|
};
|
|
63
63
|
});
|
|
64
64
|
return [2 /*return*/];
|
|
@@ -72,7 +72,8 @@ export var getComponentValidationAsync = function (update, performValidationAsyn
|
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
return message;
|
|
75
|
-
})
|
|
75
|
+
})
|
|
76
|
+
.catch(function (error) {
|
|
76
77
|
if (error instanceof DOMException && error.name === 'AbortError') {
|
|
77
78
|
// No op, the request was aborted
|
|
78
79
|
return null;
|
|
@@ -85,7 +86,7 @@ export var getComponentValidationAsync = function (update, performValidationAsyn
|
|
|
85
86
|
draft.validationState = {
|
|
86
87
|
abortController: newAbortController,
|
|
87
88
|
lastSubmitted: currentValue,
|
|
88
|
-
messages: {}
|
|
89
|
+
messages: {},
|
|
89
90
|
};
|
|
90
91
|
});
|
|
91
92
|
return [2 /*return*/, newSubmission];
|
|
@@ -68,7 +68,7 @@ var defaultProps = {
|
|
|
68
68
|
value: '',
|
|
69
69
|
performPersistAsync: undefined,
|
|
70
70
|
performRefresh: undefined,
|
|
71
|
-
summariser: function () { return ({}); }
|
|
71
|
+
summariser: function () { return ({}); },
|
|
72
72
|
};
|
|
73
73
|
describe('getComponentValidationAsync', function () {
|
|
74
74
|
it('should make request and update message if response is ok', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -78,7 +78,7 @@ export var getPerformValidationAsync = function (_a) {
|
|
|
78
78
|
case 3:
|
|
79
79
|
e_1 = _b.sent();
|
|
80
80
|
return [2 /*return*/, trackFailureAndReturn()];
|
|
81
|
-
case 4: return [4 /*yield*/, response.json()
|
|
81
|
+
case 4: return [4 /*yield*/, response.json().catch(function () { return null; })];
|
|
82
82
|
case 5:
|
|
83
83
|
json = (_b.sent());
|
|
84
84
|
message = getValidationMessage(json);
|
|
@@ -42,7 +42,7 @@ describe('getPerformValidationAsync', function () {
|
|
|
42
42
|
var validationAsyncConfig = {
|
|
43
43
|
method: 'POST',
|
|
44
44
|
param: 'param',
|
|
45
|
-
url: '/validate'
|
|
45
|
+
url: '/validate',
|
|
46
46
|
};
|
|
47
47
|
it('should make the request using the specified parameter', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
48
48
|
var spyHttpClient, spyTrackEvent, performValidationAsync;
|
|
@@ -57,7 +57,7 @@ describe('getPerformValidationAsync', function () {
|
|
|
57
57
|
httpClient: spyHttpClient,
|
|
58
58
|
trackEvent: spyTrackEvent,
|
|
59
59
|
validationAsyncConfig: validationAsyncConfig,
|
|
60
|
-
schemaId: 'schemaId'
|
|
60
|
+
schemaId: 'schemaId',
|
|
61
61
|
});
|
|
62
62
|
return [4 /*yield*/, performValidationAsync({ value: 'value', signal: signal })];
|
|
63
63
|
case 1:
|
|
@@ -66,7 +66,7 @@ describe('getPerformValidationAsync', function () {
|
|
|
66
66
|
body: '{"param":"value"}',
|
|
67
67
|
headers: { 'Content-Type': 'application/json' },
|
|
68
68
|
method: 'POST',
|
|
69
|
-
signal: signal
|
|
69
|
+
signal: signal,
|
|
70
70
|
});
|
|
71
71
|
expect(spyTrackEvent).toHaveBeenCalledWith('ValidationAsync Triggered', expect.objectContaining({ schema: 'schemaId' }));
|
|
72
72
|
return [2 /*return*/];
|
|
@@ -84,7 +84,7 @@ describe('getPerformValidationAsync', function () {
|
|
|
84
84
|
performValidationAsync = getPerformValidationAsync({
|
|
85
85
|
httpClient: spyHttpClient,
|
|
86
86
|
trackEvent: trackEvent,
|
|
87
|
-
validationAsyncConfig: validationAsyncConfig
|
|
87
|
+
validationAsyncConfig: validationAsyncConfig,
|
|
88
88
|
});
|
|
89
89
|
file = new File(['file'], 'file.txt');
|
|
90
90
|
return [4 /*yield*/, performValidationAsync({ value: file, signal: signal })];
|
|
@@ -95,7 +95,7 @@ describe('getPerformValidationAsync', function () {
|
|
|
95
95
|
body: expect.any(FormData),
|
|
96
96
|
headers: {},
|
|
97
97
|
method: 'POST',
|
|
98
|
-
signal: signal
|
|
98
|
+
signal: signal,
|
|
99
99
|
});
|
|
100
100
|
return [2 /*return*/];
|
|
101
101
|
}
|
|
@@ -110,14 +110,14 @@ describe('getPerformValidationAsync', function () {
|
|
|
110
110
|
httpClient = getMockHttpClient({
|
|
111
111
|
'/validate': function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
112
112
|
return [2 /*return*/, respondWith({ message: 'Validation succeeded' })];
|
|
113
|
-
}); }); }
|
|
113
|
+
}); }); },
|
|
114
114
|
});
|
|
115
115
|
spyTrackEvent = jest.fn();
|
|
116
116
|
performValidationAsync = getPerformValidationAsync({
|
|
117
117
|
httpClient: httpClient,
|
|
118
118
|
trackEvent: spyTrackEvent,
|
|
119
119
|
validationAsyncConfig: validationAsyncConfig,
|
|
120
|
-
schemaId: 'schemaId'
|
|
120
|
+
schemaId: 'schemaId',
|
|
121
121
|
});
|
|
122
122
|
return [4 /*yield*/, performValidationAsync({ value: 'value', signal: signal })];
|
|
123
123
|
case 1:
|
|
@@ -136,14 +136,14 @@ describe('getPerformValidationAsync', function () {
|
|
|
136
136
|
httpClient = getMockHttpClient({
|
|
137
137
|
'/validate': function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
138
138
|
return [2 /*return*/, respondWith({}, { status: 200 })];
|
|
139
|
-
}); }); }
|
|
139
|
+
}); }); },
|
|
140
140
|
});
|
|
141
141
|
spyTrackEvent = jest.fn();
|
|
142
142
|
performValidationAsync = getPerformValidationAsync({
|
|
143
143
|
httpClient: httpClient,
|
|
144
144
|
trackEvent: spyTrackEvent,
|
|
145
145
|
validationAsyncConfig: validationAsyncConfig,
|
|
146
|
-
schemaId: 'schemaId'
|
|
146
|
+
schemaId: 'schemaId',
|
|
147
147
|
});
|
|
148
148
|
return [4 /*yield*/, performValidationAsync({ value: 'value', signal: signal })];
|
|
149
149
|
case 1:
|
|
@@ -164,14 +164,14 @@ describe('getPerformValidationAsync', function () {
|
|
|
164
164
|
httpClient = getMockHttpClient({
|
|
165
165
|
'/validate': function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
166
166
|
return [2 /*return*/, respondWith({ message: 'error with this field' }, { status: 422 })];
|
|
167
|
-
}); }); }
|
|
167
|
+
}); }); },
|
|
168
168
|
});
|
|
169
169
|
spyTrackEvent = jest.fn();
|
|
170
170
|
performValidationAsync = getPerformValidationAsync({
|
|
171
171
|
httpClient: httpClient,
|
|
172
172
|
trackEvent: spyTrackEvent,
|
|
173
173
|
validationAsyncConfig: validationAsyncConfig,
|
|
174
|
-
schemaId: 'schemaId'
|
|
174
|
+
schemaId: 'schemaId',
|
|
175
175
|
});
|
|
176
176
|
return [4 /*yield*/, expect(performValidationAsync({ value: 'value', signal: signal })).rejects.toThrow('error with this field')];
|
|
177
177
|
case 1:
|
|
@@ -189,14 +189,14 @@ describe('getPerformValidationAsync', function () {
|
|
|
189
189
|
httpClient = getMockHttpClient({
|
|
190
190
|
'/validate': function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
191
191
|
return [2 /*return*/, respondWith({}, { status: 422 })];
|
|
192
|
-
}); }); }
|
|
192
|
+
}); }); },
|
|
193
193
|
});
|
|
194
194
|
spyTrackEvent = jest.fn();
|
|
195
195
|
performValidationAsync = getPerformValidationAsync({
|
|
196
196
|
httpClient: httpClient,
|
|
197
197
|
trackEvent: spyTrackEvent,
|
|
198
198
|
validationAsyncConfig: validationAsyncConfig,
|
|
199
|
-
schemaId: 'schemaId'
|
|
199
|
+
schemaId: 'schemaId',
|
|
200
200
|
});
|
|
201
201
|
return [4 /*yield*/, performValidationAsync({ value: 'value', signal: signal })];
|
|
202
202
|
case 1:
|
|
@@ -218,14 +218,14 @@ describe('getPerformValidationAsync', function () {
|
|
|
218
218
|
httpClient = getMockHttpClient({
|
|
219
219
|
'/validate': function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
220
220
|
return [2 /*return*/, respondWith({ analytics: analytics }, { status: 500 })];
|
|
221
|
-
}); }); }
|
|
221
|
+
}); }); },
|
|
222
222
|
});
|
|
223
223
|
spyTrackEvent = jest.fn();
|
|
224
224
|
performValidationAsync = getPerformValidationAsync({
|
|
225
225
|
httpClient: httpClient,
|
|
226
226
|
trackEvent: spyTrackEvent,
|
|
227
227
|
validationAsyncConfig: validationAsyncConfig,
|
|
228
|
-
schemaId: 'schemaId'
|
|
228
|
+
schemaId: 'schemaId',
|
|
229
229
|
});
|
|
230
230
|
return [4 /*yield*/, performValidationAsync({ value: 'value', signal: signal })];
|
|
231
231
|
case 1:
|
|
@@ -244,14 +244,14 @@ describe('getPerformValidationAsync', function () {
|
|
|
244
244
|
httpClient = getMockHttpClient({
|
|
245
245
|
'/validate': function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
246
246
|
return [2 /*return*/, Promise.reject(new Error())];
|
|
247
|
-
}); }); }
|
|
247
|
+
}); }); },
|
|
248
248
|
});
|
|
249
249
|
spyTrackEvent = jest.fn();
|
|
250
250
|
performValidationAsync = getPerformValidationAsync({
|
|
251
251
|
httpClient: httpClient,
|
|
252
252
|
trackEvent: spyTrackEvent,
|
|
253
253
|
validationAsyncConfig: validationAsyncConfig,
|
|
254
|
-
schemaId: 'schemaId'
|
|
254
|
+
schemaId: 'schemaId',
|
|
255
255
|
});
|
|
256
256
|
return [4 /*yield*/, performValidationAsync({ value: 'value', signal: signal })];
|
|
257
257
|
case 1:
|
|
@@ -10,6 +10,6 @@ export var boxLayoutToComponent = function (uid, _a, mapperProps) {
|
|
|
10
10
|
width: width,
|
|
11
11
|
components: components.map(function (component, index) {
|
|
12
12
|
return mapLayoutToComponent("".concat(uid, ".box-").concat(index), component, mapperProps);
|
|
13
|
-
})
|
|
13
|
+
}),
|
|
14
14
|
});
|
|
15
15
|
};
|
|
@@ -13,6 +13,6 @@ export var columnsLayoutToComponent = function (uid, _a, mapperProps) {
|
|
|
13
13
|
}),
|
|
14
14
|
endComponents: right.map(function (component, index) {
|
|
15
15
|
return mapLayoutToComponent("".concat(uid, ".columns-end-").concat(index), component, mapperProps);
|
|
16
|
-
})
|
|
16
|
+
}),
|
|
17
17
|
});
|
|
18
18
|
};
|
|
@@ -31,6 +31,6 @@ export var decisionLayoutToComponent = function (uid, _a, _b) {
|
|
|
31
31
|
options: options.map(function (_a) {
|
|
32
32
|
var action = _a.action, rest = __rest(_a, ["action"]);
|
|
33
33
|
return (__assign(__assign({}, rest), { onClick: function () { return onAction(action); } }));
|
|
34
|
-
})
|
|
34
|
+
}),
|
|
35
35
|
});
|
|
36
36
|
};
|
|
@@ -18,10 +18,10 @@ export var formLayoutToComponent = function (uid, _a, mapperProps) {
|
|
|
18
18
|
model: model !== null && model !== void 0 ? model : null,
|
|
19
19
|
localValue: stepLocalValue,
|
|
20
20
|
validationErrors: errors === null || errors === void 0 ? void 0 : errors.validation,
|
|
21
|
-
required: true
|
|
21
|
+
required: true,
|
|
22
22
|
}, mapperProps),
|
|
23
23
|
],
|
|
24
24
|
control: control,
|
|
25
|
-
margin: margin
|
|
25
|
+
margin: margin,
|
|
26
26
|
});
|
|
27
27
|
};
|