@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
|
@@ -88,7 +88,7 @@ export var createBooleanInputComponent = function (booleanInputProps, updateComp
|
|
|
88
88
|
var persist_1 = getComponentPersistAsync(update, performPersistAsync);
|
|
89
89
|
return __assign(__assign({}, booleanComponent), { isPersisted: true, onChange: function (updatedValue) {
|
|
90
90
|
booleanComponent.onChange.call(this, updatedValue);
|
|
91
|
-
persist_1(this.persistedState, this.getLocalValue())
|
|
91
|
+
persist_1(this.persistedState, this.getLocalValue()).catch(function () { }); // Noop
|
|
92
92
|
}, getSubmittableValue: function () {
|
|
93
93
|
return __awaiter(this, void 0, void 0, function () {
|
|
94
94
|
return __generator(this, function (_a) {
|
|
@@ -101,7 +101,7 @@ export var createBooleanInputComponent = function (booleanInputProps, updateComp
|
|
|
101
101
|
var validateAsync_1 = getComponentValidationAsync(update, performValidationAsync);
|
|
102
102
|
return __assign(__assign({}, booleanComponent), { onChange: function (updatedValue) {
|
|
103
103
|
booleanComponent.onChange.call(this, updatedValue);
|
|
104
|
-
validateAsync_1(this.validationState, this.getLocalValue())
|
|
104
|
+
validateAsync_1(this.validationState, this.getLocalValue()).catch(function () { }); // Noop
|
|
105
105
|
} });
|
|
106
106
|
}
|
|
107
107
|
return booleanComponent;
|
|
@@ -105,7 +105,7 @@ export var createDateInputComponent = function (textInputProps, updateComponent)
|
|
|
105
105
|
dateInputComponent.onChange.call(this, updatedValue);
|
|
106
106
|
var isValid = getValidationErrors(updatedValue).length === 0;
|
|
107
107
|
if (isValid) {
|
|
108
|
-
persist_1(this.persistedState, this.getLocalValue())
|
|
108
|
+
persist_1(this.persistedState, this.getLocalValue()).catch(function () { }); // Noop
|
|
109
109
|
}
|
|
110
110
|
}, getSubmittableValue: function () {
|
|
111
111
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -119,7 +119,7 @@ export var createDateInputComponent = function (textInputProps, updateComponent)
|
|
|
119
119
|
var validateAsync_1 = getComponentValidationAsync(update, performValidationAsync);
|
|
120
120
|
return __assign(__assign({}, dateInputComponent), { onBlur: function () {
|
|
121
121
|
if (this.validate()) {
|
|
122
|
-
validateAsync_1(this.validationState, this.getLocalValue())
|
|
122
|
+
validateAsync_1(this.validationState, this.getLocalValue()).catch(function () { }); // Noop
|
|
123
123
|
}
|
|
124
124
|
} });
|
|
125
125
|
}
|
|
@@ -103,7 +103,7 @@ export var createIntegerInputComponent = function (integerInputProps, updateComp
|
|
|
103
103
|
var persist_1 = getComponentPersistAsync(update, performPersistAsync);
|
|
104
104
|
return __assign(__assign({}, integerComponent), { isPersisted: true, onBlur: function () {
|
|
105
105
|
if (this.validate()) {
|
|
106
|
-
persist_1(this.persistedState, this.getLocalValue())
|
|
106
|
+
persist_1(this.persistedState, this.getLocalValue()).catch(function () { }); // Noop
|
|
107
107
|
}
|
|
108
108
|
}, getSubmittableValue: function () {
|
|
109
109
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -117,7 +117,7 @@ export var createIntegerInputComponent = function (integerInputProps, updateComp
|
|
|
117
117
|
var validateAsync_1 = getComponentValidationAsync(update, performValidationAsync);
|
|
118
118
|
return __assign(__assign({}, integerComponent), { onBlur: function () {
|
|
119
119
|
if (this.validate()) {
|
|
120
|
-
validateAsync_1(this.validationState, this.getLocalValue())
|
|
120
|
+
validateAsync_1(this.validationState, this.getLocalValue()).catch(function () { }); // Noop
|
|
121
121
|
}
|
|
122
122
|
} });
|
|
123
123
|
}
|
|
@@ -103,7 +103,7 @@ export var createNumberInputComponent = function (numberInputProps, updateCompon
|
|
|
103
103
|
var persist_1 = getComponentPersistAsync(update, performPersistAsync);
|
|
104
104
|
return __assign(__assign({}, numberComponent), { isPersisted: true, onBlur: function () {
|
|
105
105
|
if (this.validate()) {
|
|
106
|
-
persist_1(this.persistedState, this.getLocalValue())
|
|
106
|
+
persist_1(this.persistedState, this.getLocalValue()).catch(function () { }); // Noop
|
|
107
107
|
}
|
|
108
108
|
}, getSubmittableValue: function () {
|
|
109
109
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -117,7 +117,7 @@ export var createNumberInputComponent = function (numberInputProps, updateCompon
|
|
|
117
117
|
var validateAsync_1 = getComponentValidationAsync(update, performValidationAsync);
|
|
118
118
|
return __assign(__assign({}, numberComponent), { onBlur: function () {
|
|
119
119
|
if (this.validate()) {
|
|
120
|
-
validateAsync_1(this.validationState, this.getLocalValue())
|
|
120
|
+
validateAsync_1(this.validationState, this.getLocalValue()).catch(function () { }); // Noop
|
|
121
121
|
}
|
|
122
122
|
} });
|
|
123
123
|
}
|
|
@@ -103,7 +103,7 @@ export var createSelectInputComponent = function (selectProps, updateComponent)
|
|
|
103
103
|
if (updatedIndex !== null && this.analyticsId) {
|
|
104
104
|
selectProps.trackEvent('OneOf Selected', {
|
|
105
105
|
oneOfId: this.analyticsId,
|
|
106
|
-
schemaId: this.children[updatedIndex].analyticsId
|
|
106
|
+
schemaId: this.children[updatedIndex].analyticsId,
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
109
|
update(function (draft) {
|
|
@@ -125,7 +125,7 @@ export var createSelectInputComponent = function (selectProps, updateComponent)
|
|
|
125
125
|
selectComponent.onSelect.call(this, updatedIndex);
|
|
126
126
|
var isValid = getValidationErrors(this.getLocalValue()).length === 0;
|
|
127
127
|
if (isValid && updatedIndex !== null) {
|
|
128
|
-
persist(this.persistedState, this.getLocalValue())
|
|
128
|
+
persist(this.persistedState, this.getLocalValue()).catch(function () { }); // Noop
|
|
129
129
|
}
|
|
130
130
|
}, getSubmittableValue: function () {
|
|
131
131
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -103,7 +103,7 @@ export var createTextInputComponent = function (textInputProps, updateComponent)
|
|
|
103
103
|
var persist_1 = getComponentPersistAsync(update, performPersistAsync);
|
|
104
104
|
return __assign(__assign({}, inputComponent), { isPersisted: true, onBlur: function () {
|
|
105
105
|
if (this.validate()) {
|
|
106
|
-
persist_1(this.persistedState, this.getLocalValue())
|
|
106
|
+
persist_1(this.persistedState, this.getLocalValue()).catch(function () { }); // Noop
|
|
107
107
|
}
|
|
108
108
|
}, getSubmittableValue: function () {
|
|
109
109
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -117,7 +117,7 @@ export var createTextInputComponent = function (textInputProps, updateComponent)
|
|
|
117
117
|
var validateAsync_1 = getComponentValidationAsync(update, performValidationAsync);
|
|
118
118
|
return __assign(__assign({}, inputComponent), { onBlur: function () {
|
|
119
119
|
if (this.validate()) {
|
|
120
|
-
validateAsync_1(this.validationState, this.getLocalValue())
|
|
120
|
+
validateAsync_1(this.validationState, this.getLocalValue()).catch(function () { }); // Noop
|
|
121
121
|
}
|
|
122
122
|
} });
|
|
123
123
|
}
|
|
@@ -126,7 +126,7 @@ export var createUploadInputComponent = function (uploadInputProps, updateCompon
|
|
|
126
126
|
_b.label = 3;
|
|
127
127
|
case 3:
|
|
128
128
|
submission = _a;
|
|
129
|
-
return [4 /*yield*/, persist(this.persistedState, submission)
|
|
129
|
+
return [4 /*yield*/, persist(this.persistedState, submission).catch(function (error) {
|
|
130
130
|
update(function (draft) {
|
|
131
131
|
// Force the user to re-upload the file if there's an error, rather than retrying
|
|
132
132
|
draft.persistedState.lastSubmitted = null;
|
|
@@ -75,7 +75,7 @@ export var createRepeatableComponent = function (repeatableProps, updateComponen
|
|
|
75
75
|
title: summary === null || summary === void 0 ? void 0 : summary.defaultTitle,
|
|
76
76
|
description: summary === null || summary === void 0 ? void 0 : summary.defaultDescription,
|
|
77
77
|
icon: summary === null || summary === void 0 ? void 0 : summary.defaultIcon,
|
|
78
|
-
image: summary === null || summary === void 0 ? void 0 : summary.defaultImage
|
|
78
|
+
image: summary === null || summary === void 0 ? void 0 : summary.defaultImage,
|
|
79
79
|
} }, componentProps), { onEdit: function (itemIndex) {
|
|
80
80
|
update(function (draft) {
|
|
81
81
|
draft.editableComponent = createEditableComponent(draft.components[itemIndex].getLocalValue());
|
|
@@ -61,7 +61,7 @@ describe('RepeatableComponent', function () {
|
|
|
61
61
|
summariser: function () { return ({}); },
|
|
62
62
|
createEditableComponent: function (value) {
|
|
63
63
|
return createMockTextInputComponent({ value: value });
|
|
64
|
-
}
|
|
64
|
+
},
|
|
65
65
|
};
|
|
66
66
|
describe('editing', function () {
|
|
67
67
|
it('should update the edited component on save', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -48,7 +48,7 @@ export var createSearchComponent = function (searchProps, performSearch, onActio
|
|
|
48
48
|
performSearch({
|
|
49
49
|
signal: signal,
|
|
50
50
|
query: query,
|
|
51
|
-
config: searchConfig
|
|
51
|
+
config: searchConfig,
|
|
52
52
|
})
|
|
53
53
|
.then(function (state) {
|
|
54
54
|
if (!signal.aborted) {
|
|
@@ -57,7 +57,8 @@ export var createSearchComponent = function (searchProps, performSearch, onActio
|
|
|
57
57
|
draft.isLoading = false;
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
})
|
|
60
|
+
})
|
|
61
|
+
.catch(function () {
|
|
61
62
|
if (!signal.aborted) {
|
|
62
63
|
update(function (draft) {
|
|
63
64
|
draft.error = 'No response';
|
|
@@ -103,6 +104,6 @@ export var createSearchComponent = function (searchProps, performSearch, onActio
|
|
|
103
104
|
getSummary: function () { return ({}); },
|
|
104
105
|
validate: function () { return true; },
|
|
105
106
|
onChange: onChange,
|
|
106
|
-
onSelect: onSelect
|
|
107
|
+
onSelect: onSelect,
|
|
107
108
|
};
|
|
108
109
|
};
|
|
@@ -50,7 +50,7 @@ describe('SearchComponent', function () {
|
|
|
50
50
|
uid: '0',
|
|
51
51
|
emptyMessage: '',
|
|
52
52
|
margin: 'md',
|
|
53
|
-
title: 'title'
|
|
53
|
+
title: 'title',
|
|
54
54
|
}, performSearch, onAction, mockUpdateFunction);
|
|
55
55
|
component.onChange('query');
|
|
56
56
|
expect(performSearch).toHaveBeenCalledTimes(0);
|
|
@@ -69,7 +69,7 @@ describe('SearchComponent', function () {
|
|
|
69
69
|
uid: '0',
|
|
70
70
|
emptyMessage: '',
|
|
71
71
|
margin: 'md',
|
|
72
|
-
title: 'title'
|
|
72
|
+
title: 'title',
|
|
73
73
|
}, performSearch, onAction, mockUpdateFunction);
|
|
74
74
|
component.onChange('query');
|
|
75
75
|
expect(performSearch).toHaveBeenCalledTimes(0);
|
|
@@ -99,7 +99,7 @@ describe('SearchComponent', function () {
|
|
|
99
99
|
uid: '0',
|
|
100
100
|
emptyMessage: '',
|
|
101
101
|
margin: 'md',
|
|
102
|
-
title: 'title'
|
|
102
|
+
title: 'title',
|
|
103
103
|
}, performSearch, onAction, mockUpdateFunction);
|
|
104
104
|
component.onChange('query');
|
|
105
105
|
return [4 /*yield*/, waitFor(function () {
|
|
@@ -134,7 +134,7 @@ describe('SearchComponent', function () {
|
|
|
134
134
|
uid: '0',
|
|
135
135
|
emptyMessage: '',
|
|
136
136
|
margin: 'md',
|
|
137
|
-
title: 'title'
|
|
137
|
+
title: 'title',
|
|
138
138
|
}, performSearch, onAction, mockUpdateFunction);
|
|
139
139
|
component.onChange('query');
|
|
140
140
|
return [4 /*yield*/, waitFor(function () {
|
|
@@ -176,7 +176,7 @@ describe('SearchComponent', function () {
|
|
|
176
176
|
uid: '0',
|
|
177
177
|
emptyMessage: '',
|
|
178
178
|
margin: 'md',
|
|
179
|
-
title: 'title'
|
|
179
|
+
title: 'title',
|
|
180
180
|
}, performSearch, onAction, mockUpdateFunction);
|
|
181
181
|
component.onChange('query');
|
|
182
182
|
return [4 /*yield*/, waitFor(function () {
|
|
@@ -210,7 +210,7 @@ describe('SearchComponent', function () {
|
|
|
210
210
|
uid: '0',
|
|
211
211
|
emptyMessage: '',
|
|
212
212
|
margin: 'md',
|
|
213
|
-
title: 'title'
|
|
213
|
+
title: 'title',
|
|
214
214
|
}, performSearch, onAction, mockUpdateFunction);
|
|
215
215
|
component.onChange('query');
|
|
216
216
|
return [4 /*yield*/, waitFor(function () {
|
|
@@ -247,7 +247,7 @@ describe('SearchComponent', function () {
|
|
|
247
247
|
uid: '0',
|
|
248
248
|
emptyMessage: '',
|
|
249
249
|
margin: 'md',
|
|
250
|
-
title: 'title'
|
|
250
|
+
title: 'title',
|
|
251
251
|
}, performSearch, onAction, mockUpdateFunction);
|
|
252
252
|
component.onChange('query');
|
|
253
253
|
return [4 /*yield*/, waitFor(function () {
|
|
@@ -278,12 +278,12 @@ describe('SearchComponent', function () {
|
|
|
278
278
|
uid: '0',
|
|
279
279
|
emptyMessage: '',
|
|
280
280
|
margin: 'md',
|
|
281
|
-
title: 'title'
|
|
281
|
+
title: 'title',
|
|
282
282
|
}, performSearch, onAction, mockUpdateFunction);
|
|
283
283
|
component.onSelect({
|
|
284
284
|
type: 'action',
|
|
285
285
|
title: 'title',
|
|
286
|
-
value: { id: 'selected-action-id' }
|
|
286
|
+
value: { id: 'selected-action-id' },
|
|
287
287
|
});
|
|
288
288
|
expect(onAction).toHaveBeenCalledWith(expect.objectContaining({ id: 'selected-action-id' }));
|
|
289
289
|
return [2 /*return*/];
|
|
@@ -303,20 +303,20 @@ describe('SearchComponent', function () {
|
|
|
303
303
|
uid: '0',
|
|
304
304
|
emptyMessage: '',
|
|
305
305
|
margin: 'md',
|
|
306
|
-
title: 'title'
|
|
306
|
+
title: 'title',
|
|
307
307
|
}, performSearch, onAction, mockUpdateFunction);
|
|
308
308
|
component.onSelect({
|
|
309
309
|
type: 'search',
|
|
310
310
|
title: 'title',
|
|
311
|
-
value: { url: '/new-search', param: 'query', method: 'GET', query: 'new' }
|
|
311
|
+
value: { url: '/new-search', param: 'query', method: 'GET', query: 'new' },
|
|
312
312
|
});
|
|
313
313
|
expect(performSearch).toHaveBeenCalledWith(expect.objectContaining({
|
|
314
314
|
query: 'new',
|
|
315
315
|
config: expect.objectContaining({
|
|
316
316
|
url: '/new-search',
|
|
317
317
|
method: 'GET',
|
|
318
|
-
param: 'query'
|
|
319
|
-
})
|
|
318
|
+
param: 'query',
|
|
319
|
+
}),
|
|
320
320
|
}));
|
|
321
321
|
return [2 /*return*/];
|
|
322
322
|
});
|
|
@@ -51,7 +51,7 @@ describe('isPartialLocalValueMatch', function () {
|
|
|
51
51
|
var fileB = new File(['ABCD'], 'a.txt', { type: 'text/plain' });
|
|
52
52
|
var componentB = {
|
|
53
53
|
isPersisted: true,
|
|
54
|
-
getLocalValue: function () { return fileB; }
|
|
54
|
+
getLocalValue: function () { return fileB; },
|
|
55
55
|
};
|
|
56
56
|
expect(isPartialLocalValueMatch(fileA, componentB)).toBe(true);
|
|
57
57
|
});
|
|
@@ -60,7 +60,7 @@ describe('isPartialLocalValueMatch', function () {
|
|
|
60
60
|
var fileB = new File(['ABCD'], 'zzzz.txt', { type: 'text/plain' });
|
|
61
61
|
var componentB = {
|
|
62
62
|
isPersisted: true,
|
|
63
|
-
getLocalValue: function () { return fileB; }
|
|
63
|
+
getLocalValue: function () { return fileB; },
|
|
64
64
|
};
|
|
65
65
|
expect(isPartialLocalValueMatch(fileA, componentB)).toBe(false);
|
|
66
66
|
});
|
|
@@ -70,7 +70,7 @@ describe('isPartialLocalValueMatch', function () {
|
|
|
70
70
|
var fileA = new File(['ABCD'], 'a.txt', { type: 'text/plain' });
|
|
71
71
|
var fileB = new File(['ABCD'], 'a.txt', { type: 'text/plain' });
|
|
72
72
|
var componentB = {
|
|
73
|
-
getLocalValue: function () { return fileB; }
|
|
73
|
+
getLocalValue: function () { return fileB; },
|
|
74
74
|
};
|
|
75
75
|
expect(isPartialLocalValueMatch(fileA, componentB)).toBe(true);
|
|
76
76
|
});
|
|
@@ -78,7 +78,7 @@ describe('isPartialLocalValueMatch', function () {
|
|
|
78
78
|
var fileA = new File(['ABCD'], 'a.txt', { type: 'text/plain' });
|
|
79
79
|
var fileB = new File(['ABCD'], 'zzzz.txt', { type: 'text/plain' });
|
|
80
80
|
var componentB = {
|
|
81
|
-
getLocalValue: function () { return fileB; }
|
|
81
|
+
getLocalValue: function () { return fileB; },
|
|
82
82
|
};
|
|
83
83
|
expect(isPartialLocalValueMatch(fileA, componentB)).toBe(false);
|
|
84
84
|
});
|
|
@@ -89,7 +89,7 @@ var makeDomainComponent = function (localValue) {
|
|
|
89
89
|
return {
|
|
90
90
|
type: 'repeatable',
|
|
91
91
|
getLocalValue: function () { return localValue; },
|
|
92
|
-
getChildren: function () { return localValue.map(makeDomainComponent); }
|
|
92
|
+
getChildren: function () { return localValue.map(makeDomainComponent); },
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
if (isObjectLocalValue(localValue)) {
|
|
@@ -99,10 +99,10 @@ var makeDomainComponent = function (localValue) {
|
|
|
99
99
|
var key = _a[0], v = _a[1];
|
|
100
100
|
return [key, makeDomainComponent(v)];
|
|
101
101
|
})),
|
|
102
|
-
getLocalValue: function () { return localValue; }
|
|
102
|
+
getLocalValue: function () { return localValue; },
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
105
|
return {
|
|
106
|
-
getLocalValue: function () { return localValue; }
|
|
106
|
+
getLocalValue: function () { return localValue; },
|
|
107
107
|
};
|
|
108
108
|
};
|
|
@@ -72,7 +72,7 @@ export var getComponentPersistAsync = function (update, performPersistAsync) {
|
|
|
72
72
|
return [2 /*return*/, resolvedNull_1];
|
|
73
73
|
}
|
|
74
74
|
signal = newAbortController.signal;
|
|
75
|
-
newSubmission = performPersistAsync({ value: currentValue, signal: signal })
|
|
75
|
+
newSubmission = performPersistAsync({ value: currentValue, signal: signal }).catch(function (error) {
|
|
76
76
|
if (error instanceof DOMException && error.name === 'AbortError') {
|
|
77
77
|
// No op, the request was aborted
|
|
78
78
|
return null;
|
|
@@ -87,7 +87,7 @@ export var getComponentPersistAsync = function (update, performPersistAsync) {
|
|
|
87
87
|
draft.persistedState = {
|
|
88
88
|
abortController: newAbortController,
|
|
89
89
|
lastSubmitted: currentValue,
|
|
90
|
-
submission: newSubmission
|
|
90
|
+
submission: newSubmission,
|
|
91
91
|
};
|
|
92
92
|
});
|
|
93
93
|
return [2 /*return*/, newSubmission];
|
|
@@ -110,7 +110,7 @@ export var getComponentMultiPersistAsync = function (update, performPersistAsync
|
|
|
110
110
|
}
|
|
111
111
|
newAbortController = new AbortController();
|
|
112
112
|
signal = newAbortController.signal;
|
|
113
|
-
newSubmission = performPersistAsync({ value: value, signal: signal })
|
|
113
|
+
newSubmission = performPersistAsync({ value: value, signal: signal }).catch(function (error) {
|
|
114
114
|
update(function (draft) {
|
|
115
115
|
// The file was not persisted, so delete it
|
|
116
116
|
draft.persistedState = draft.persistedState.filter(function (state) { return state.id !== id; });
|
|
@@ -123,7 +123,7 @@ export var getComponentMultiPersistAsync = function (update, performPersistAsync
|
|
|
123
123
|
id: id,
|
|
124
124
|
abortController: newAbortController,
|
|
125
125
|
lastSubmitted: null,
|
|
126
|
-
submission: newSubmission
|
|
126
|
+
submission: newSubmission,
|
|
127
127
|
},
|
|
128
128
|
], false);
|
|
129
129
|
});
|
|
@@ -67,7 +67,7 @@ var defaultProps = {
|
|
|
67
67
|
value: '',
|
|
68
68
|
performValidationAsync: undefined,
|
|
69
69
|
performRefresh: undefined,
|
|
70
|
-
summariser: function () { return ({}); }
|
|
70
|
+
summariser: function () { return ({}); },
|
|
71
71
|
};
|
|
72
72
|
describe('getComponentPersistAsync', function () {
|
|
73
73
|
it('should call update function with the correct arguments', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -2,5 +2,5 @@ import { isNullish } from '../../../utils/type-validators';
|
|
|
2
2
|
export var getInitialPersistedState = function (lastSubmitted, model) { return ({
|
|
3
3
|
abortController: new AbortController(),
|
|
4
4
|
lastSubmitted: !isNullish(model) ? lastSubmitted !== null && lastSubmitted !== void 0 ? lastSubmitted : null : null,
|
|
5
|
-
submission: Promise.resolve(model !== null && model !== void 0 ? model : null)
|
|
5
|
+
submission: Promise.resolve(model !== null && model !== void 0 ? model : null),
|
|
6
6
|
}); };
|
|
@@ -45,7 +45,7 @@ describe('getPerformPersistAsync', function () {
|
|
|
45
45
|
idProperty: 'id',
|
|
46
46
|
method: 'POST',
|
|
47
47
|
param: 'param',
|
|
48
|
-
url: '/persist'
|
|
48
|
+
url: '/persist',
|
|
49
49
|
};
|
|
50
50
|
it('should make the request using the specified parameter', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
51
51
|
var spyHttpClient, spyTrackEvent, performPersistAsync;
|
|
@@ -60,7 +60,7 @@ describe('getPerformPersistAsync', function () {
|
|
|
60
60
|
logEvent: logEvent,
|
|
61
61
|
persistAsyncConfig: persistAsyncConfig,
|
|
62
62
|
genericErrorMessage: genericErrorMessage,
|
|
63
|
-
schemaId: 'schemaId'
|
|
63
|
+
schemaId: 'schemaId',
|
|
64
64
|
});
|
|
65
65
|
return [4 /*yield*/, performPersistAsync({ value: 'value', signal: signal })];
|
|
66
66
|
case 1:
|
|
@@ -69,7 +69,7 @@ describe('getPerformPersistAsync', function () {
|
|
|
69
69
|
body: '{"param":"value"}',
|
|
70
70
|
headers: { 'Content-Type': 'application/json' },
|
|
71
71
|
method: 'POST',
|
|
72
|
-
signal: signal
|
|
72
|
+
signal: signal,
|
|
73
73
|
});
|
|
74
74
|
expect(spyTrackEvent).toHaveBeenCalledWith('PersistAsync Triggered', expect.objectContaining({ schema: 'schemaId' }));
|
|
75
75
|
return [2 /*return*/];
|
|
@@ -87,7 +87,7 @@ describe('getPerformPersistAsync', function () {
|
|
|
87
87
|
trackEvent: trackEvent,
|
|
88
88
|
logEvent: logEvent,
|
|
89
89
|
persistAsyncConfig: persistAsyncConfig,
|
|
90
|
-
genericErrorMessage: genericErrorMessage
|
|
90
|
+
genericErrorMessage: genericErrorMessage,
|
|
91
91
|
});
|
|
92
92
|
file = new File(['file'], 'file.txt');
|
|
93
93
|
return [4 /*yield*/, performPersistAsync({ value: file, signal: signal })];
|
|
@@ -98,7 +98,7 @@ describe('getPerformPersistAsync', function () {
|
|
|
98
98
|
body: expect.any(FormData),
|
|
99
99
|
headers: {},
|
|
100
100
|
method: 'POST',
|
|
101
|
-
signal: signal
|
|
101
|
+
signal: signal,
|
|
102
102
|
});
|
|
103
103
|
return [2 /*return*/];
|
|
104
104
|
}
|
|
@@ -113,7 +113,7 @@ describe('getPerformPersistAsync', function () {
|
|
|
113
113
|
httpClient = getMockHttpClient({
|
|
114
114
|
'/persist': function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
115
115
|
return [2 /*return*/, respondWith({ id: 1 })];
|
|
116
|
-
}); }); }
|
|
116
|
+
}); }); },
|
|
117
117
|
});
|
|
118
118
|
spyTrackEvent = jest.fn();
|
|
119
119
|
performPersistAsync = getPerformPersistAsync({
|
|
@@ -122,7 +122,7 @@ describe('getPerformPersistAsync', function () {
|
|
|
122
122
|
logEvent: logEvent,
|
|
123
123
|
persistAsyncConfig: persistAsyncConfig,
|
|
124
124
|
genericErrorMessage: genericErrorMessage,
|
|
125
|
-
schemaId: 'schemaId'
|
|
125
|
+
schemaId: 'schemaId',
|
|
126
126
|
});
|
|
127
127
|
return [4 /*yield*/, performPersistAsync({ value: 'value', signal: signal })];
|
|
128
128
|
case 1:
|
|
@@ -141,7 +141,7 @@ describe('getPerformPersistAsync', function () {
|
|
|
141
141
|
httpClient = getMockHttpClient({
|
|
142
142
|
'/persist': function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
143
143
|
return [2 /*return*/, respondWith(1)];
|
|
144
|
-
}); }); }
|
|
144
|
+
}); }); },
|
|
145
145
|
});
|
|
146
146
|
spyTrackEvent = jest.fn();
|
|
147
147
|
performPersistAsync = getPerformPersistAsync({
|
|
@@ -150,7 +150,7 @@ describe('getPerformPersistAsync', function () {
|
|
|
150
150
|
logEvent: logEvent,
|
|
151
151
|
persistAsyncConfig: persistAsyncConfig,
|
|
152
152
|
genericErrorMessage: genericErrorMessage,
|
|
153
|
-
schemaId: 'schemaId'
|
|
153
|
+
schemaId: 'schemaId',
|
|
154
154
|
});
|
|
155
155
|
return [4 /*yield*/, expect(performPersistAsync({ value: 'value', signal: signal })).rejects.toThrow(genericErrorMessage)];
|
|
156
156
|
case 1:
|
|
@@ -170,7 +170,7 @@ describe('getPerformPersistAsync', function () {
|
|
|
170
170
|
httpClient = getMockHttpClient({
|
|
171
171
|
'/persist': function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
172
172
|
return [2 /*return*/, respondWith({ validation: { param: 'error with this field' } }, { status: 422 })];
|
|
173
|
-
}); }); }
|
|
173
|
+
}); }); },
|
|
174
174
|
});
|
|
175
175
|
spyTrackEvent = jest.fn();
|
|
176
176
|
performPersistAsync = getPerformPersistAsync({
|
|
@@ -179,7 +179,7 @@ describe('getPerformPersistAsync', function () {
|
|
|
179
179
|
logEvent: logEvent,
|
|
180
180
|
persistAsyncConfig: persistAsyncConfig,
|
|
181
181
|
genericErrorMessage: genericErrorMessage,
|
|
182
|
-
schemaId: 'schemaId'
|
|
182
|
+
schemaId: 'schemaId',
|
|
183
183
|
});
|
|
184
184
|
return [4 /*yield*/, expect(performPersistAsync({ value: 'value', signal: signal })).rejects.toThrow('error with this field')];
|
|
185
185
|
case 1:
|
|
@@ -199,7 +199,7 @@ describe('getPerformPersistAsync', function () {
|
|
|
199
199
|
return __generator(this, function (_a) {
|
|
200
200
|
return [2 /*return*/, respondWith({ validation: { param: 'error with this field' }, analytics: { some: 'extras' } }, { status: 422 })];
|
|
201
201
|
});
|
|
202
|
-
}); }
|
|
202
|
+
}); },
|
|
203
203
|
});
|
|
204
204
|
spyTrackEvent = jest.fn();
|
|
205
205
|
performPersistAsync = getPerformPersistAsync({
|
|
@@ -208,7 +208,7 @@ describe('getPerformPersistAsync', function () {
|
|
|
208
208
|
logEvent: logEvent,
|
|
209
209
|
persistAsyncConfig: persistAsyncConfig,
|
|
210
210
|
genericErrorMessage: genericErrorMessage,
|
|
211
|
-
schemaId: 'schemaId'
|
|
211
|
+
schemaId: 'schemaId',
|
|
212
212
|
});
|
|
213
213
|
return [4 /*yield*/, expect(performPersistAsync({ value: 'value', signal: signal })).rejects.toThrow('error with this field')];
|
|
214
214
|
case 1:
|
|
@@ -230,7 +230,7 @@ describe('getPerformPersistAsync', function () {
|
|
|
230
230
|
return __generator(this, function (_a) {
|
|
231
231
|
return [2 /*return*/, respondWith({ validation: { param: 'error with this field' }, analytics: { some: 'extras' } }, { status: 500 })];
|
|
232
232
|
});
|
|
233
|
-
}); }
|
|
233
|
+
}); },
|
|
234
234
|
});
|
|
235
235
|
spyTrackEvent = jest.fn();
|
|
236
236
|
performPersistAsync = getPerformPersistAsync({
|
|
@@ -239,7 +239,7 @@ describe('getPerformPersistAsync', function () {
|
|
|
239
239
|
logEvent: logEvent,
|
|
240
240
|
persistAsyncConfig: persistAsyncConfig,
|
|
241
241
|
genericErrorMessage: genericErrorMessage,
|
|
242
|
-
schemaId: 'schemaId'
|
|
242
|
+
schemaId: 'schemaId',
|
|
243
243
|
});
|
|
244
244
|
return [4 /*yield*/, expect(performPersistAsync({ value: 'value', signal: signal })).rejects.toThrow(genericErrorMessage)];
|
|
245
245
|
case 1:
|
|
@@ -258,7 +258,7 @@ describe('getPerformPersistAsync', function () {
|
|
|
258
258
|
httpClient = getMockHttpClient({
|
|
259
259
|
'/persist': function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
260
260
|
return [2 /*return*/, Promise.reject(new Error())];
|
|
261
|
-
}); }); }
|
|
261
|
+
}); }); },
|
|
262
262
|
});
|
|
263
263
|
spyTrackEvent = jest.fn();
|
|
264
264
|
performPersistAsync = getPerformPersistAsync({
|
|
@@ -267,7 +267,7 @@ describe('getPerformPersistAsync', function () {
|
|
|
267
267
|
logEvent: logEvent,
|
|
268
268
|
persistAsyncConfig: persistAsyncConfig,
|
|
269
269
|
genericErrorMessage: genericErrorMessage,
|
|
270
|
-
schemaId: 'schemaId'
|
|
270
|
+
schemaId: 'schemaId',
|
|
271
271
|
});
|
|
272
272
|
return [4 /*yield*/, expect(performPersistAsync({ value: 'value', signal: signal })).rejects.toThrow(genericErrorMessage)];
|
|
273
273
|
case 1:
|
|
@@ -53,13 +53,13 @@ export var getPerformSearchFunction = function (httpClient, defaultConfig) {
|
|
|
53
53
|
? httpClient(addQueryParameter(url, param, query), {
|
|
54
54
|
method: method,
|
|
55
55
|
headers: headers,
|
|
56
|
-
signal: signal
|
|
56
|
+
signal: signal,
|
|
57
57
|
})
|
|
58
58
|
: httpClient(url, {
|
|
59
59
|
method: method,
|
|
60
60
|
headers: headers,
|
|
61
61
|
signal: signal,
|
|
62
|
-
body: JSON.stringify((_c = {}, _c[param] = query, _c))
|
|
62
|
+
body: JSON.stringify((_c = {}, _c[param] = query, _c)),
|
|
63
63
|
});
|
|
64
64
|
return [4 /*yield*/, request];
|
|
65
65
|
case 1:
|
|
@@ -76,7 +76,7 @@ var parseResponse = function (response) { return __awaiter(void 0, void 0, void
|
|
|
76
76
|
switch (_a.label) {
|
|
77
77
|
case 0:
|
|
78
78
|
if (!response.ok) return [3 /*break*/, 2];
|
|
79
|
-
return [4 /*yield*/, response.json()
|
|
79
|
+
return [4 /*yield*/, response.json().catch(function () { return null; })];
|
|
80
80
|
case 1:
|
|
81
81
|
body = _a.sent();
|
|
82
82
|
if (isValidResponseBody(body)) {
|