@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
|
@@ -9,10 +9,10 @@ export var instructionsLayoutToComponent = function (uid, _a) {
|
|
|
9
9
|
var context = _a.context, text = _a.text;
|
|
10
10
|
return ({
|
|
11
11
|
context: mapLegacyContext(context),
|
|
12
|
-
text: text
|
|
12
|
+
text: text,
|
|
13
13
|
});
|
|
14
14
|
}),
|
|
15
15
|
margin: margin,
|
|
16
|
-
title: title
|
|
16
|
+
title: title,
|
|
17
17
|
});
|
|
18
18
|
};
|
|
@@ -10,11 +10,11 @@ export var listLayoutToComponent = function (uid, _a) {
|
|
|
10
10
|
description: description,
|
|
11
11
|
icon: icon,
|
|
12
12
|
title: itemTitle,
|
|
13
|
-
status: status ? mapLegacyStatus(status) : undefined
|
|
13
|
+
status: status ? mapLegacyStatus(status) : undefined,
|
|
14
14
|
});
|
|
15
15
|
}),
|
|
16
16
|
margin: margin,
|
|
17
|
-
title: title
|
|
17
|
+
title: title,
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
var mapLegacyStatus = function (status) {
|
|
@@ -8,10 +8,10 @@ export var modalLayoutToComponent = function (uid, _a, mapperProps) {
|
|
|
8
8
|
content: {
|
|
9
9
|
components: components.map(function (component, index) {
|
|
10
10
|
return mapLayoutToComponent("".concat(uid, ".modal-").concat(index), component, mapperProps);
|
|
11
|
-
})
|
|
11
|
+
}),
|
|
12
12
|
},
|
|
13
13
|
control: control,
|
|
14
14
|
margin: margin,
|
|
15
|
-
trigger: trigger
|
|
15
|
+
trigger: trigger,
|
|
16
16
|
});
|
|
17
17
|
};
|
|
@@ -19,21 +19,21 @@ export var reviewLayoutToComponent = function (uid, _a, _b) {
|
|
|
19
19
|
control: getOrientationControl({ control: control, orientation: orientation }),
|
|
20
20
|
fields: fields.map(function (field) { var _a; return (__assign(__assign({}, field), { help: (_a = field.help) === null || _a === void 0 ? void 0 : _a.markdown })); }),
|
|
21
21
|
margin: margin,
|
|
22
|
-
title: title
|
|
22
|
+
title: title,
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
var getReviewAction = function (onAction, callToAction, action) {
|
|
26
26
|
if (callToAction) {
|
|
27
27
|
return {
|
|
28
28
|
title: callToAction.title,
|
|
29
|
-
onClick: function () { return onAction(callToAction.action); }
|
|
29
|
+
onClick: function () { return onAction(callToAction.action); },
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
// for legacy reasons, we need to support regular actions, and use the legacy action.title for the CTA title
|
|
33
33
|
if (action === null || action === void 0 ? void 0 : action.title) {
|
|
34
34
|
return {
|
|
35
35
|
title: action.title,
|
|
36
|
-
onClick: function () { return onAction(action); }
|
|
36
|
+
onClick: function () { return onAction(action); },
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
return undefined;
|
|
@@ -31,7 +31,7 @@ export var mapSchemaToComponent = function (schemaMapperProps, mapperProps) {
|
|
|
31
31
|
components: [
|
|
32
32
|
alertLayoutToComponent("".concat(uid, ".container.alert"), alert),
|
|
33
33
|
getSchemaComponent(__assign(__assign({}, schemaMapperProps), { uid: "".concat(uid, ".container") }), mapperProps),
|
|
34
|
-
]
|
|
34
|
+
],
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
return getSchemaComponent(schemaMapperProps, mapperProps);
|
|
@@ -40,7 +40,7 @@ describe('mapSchemaToComponents', function () {
|
|
|
40
40
|
describe('when no alert is given', function () {
|
|
41
41
|
it('returns a StepComponent for the schema', function () {
|
|
42
42
|
var schema = {
|
|
43
|
-
type: 'string'
|
|
43
|
+
type: 'string',
|
|
44
44
|
};
|
|
45
45
|
var component = mapSchemaToComponent(getMockSchemaMapperProps({ schema: schema, model: null }), getMockMapperProps());
|
|
46
46
|
expect(component.type).toBe('text');
|
|
@@ -50,17 +50,17 @@ describe('mapSchemaToComponents', function () {
|
|
|
50
50
|
it('returns a ContainerComponent containing the alert and the schema', function () {
|
|
51
51
|
var schema = {
|
|
52
52
|
type: 'string',
|
|
53
|
-
alert: { type: 'alert', markdown: 'content' }
|
|
53
|
+
alert: { type: 'alert', markdown: 'content' },
|
|
54
54
|
};
|
|
55
55
|
var component = mapSchemaToComponent(getMockSchemaMapperProps({ schema: schema, model: null }), getMockMapperProps());
|
|
56
56
|
expect(component.type).toBe('container');
|
|
57
57
|
expect(component.getChildren()).toStrictEqual(expect.arrayContaining([
|
|
58
58
|
expect.objectContaining({
|
|
59
59
|
type: 'alert',
|
|
60
|
-
markdown: 'content'
|
|
60
|
+
markdown: 'content',
|
|
61
61
|
}),
|
|
62
62
|
expect.objectContaining({
|
|
63
|
-
type: 'text'
|
|
63
|
+
type: 'text',
|
|
64
64
|
}),
|
|
65
65
|
]));
|
|
66
66
|
});
|
|
@@ -74,27 +74,27 @@ describe('mapSchemaToComponents', function () {
|
|
|
74
74
|
properties: {
|
|
75
75
|
cbs: {
|
|
76
76
|
title: 'Const boolean schema',
|
|
77
|
-
|
|
77
|
+
const: true,
|
|
78
78
|
},
|
|
79
79
|
cns: {
|
|
80
80
|
title: 'Const number schema',
|
|
81
|
-
|
|
81
|
+
const: 42,
|
|
82
82
|
},
|
|
83
83
|
css: {
|
|
84
84
|
title: 'Const string schema',
|
|
85
|
-
|
|
85
|
+
const: 'Hello World!',
|
|
86
86
|
},
|
|
87
87
|
cos: {
|
|
88
88
|
title: 'Const object schema',
|
|
89
|
-
|
|
90
|
-
name: 'John Doe'
|
|
91
|
-
}
|
|
89
|
+
const: {
|
|
90
|
+
name: 'John Doe',
|
|
91
|
+
},
|
|
92
92
|
},
|
|
93
93
|
cas: {
|
|
94
94
|
title: 'Const array schema',
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
}
|
|
95
|
+
const: ['Hello', 'World!'],
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
98
|
};
|
|
99
99
|
describe('when the getValue function is called', function () {
|
|
100
100
|
it('returns the const values', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -111,7 +111,7 @@ describe('mapSchemaToComponents', function () {
|
|
|
111
111
|
cns: 42,
|
|
112
112
|
css: 'Hello World!',
|
|
113
113
|
cos: { name: 'John Doe' },
|
|
114
|
-
cas: ['Hello', 'World!']
|
|
114
|
+
cas: ['Hello', 'World!'],
|
|
115
115
|
});
|
|
116
116
|
return [2 /*return*/];
|
|
117
117
|
}
|
|
@@ -130,21 +130,21 @@ describe('mapSchemaToComponents', function () {
|
|
|
130
130
|
type: 'boolean',
|
|
131
131
|
title: 'Hidden boolean schema',
|
|
132
132
|
hidden: true,
|
|
133
|
-
|
|
133
|
+
default: true,
|
|
134
134
|
},
|
|
135
135
|
hns: {
|
|
136
136
|
type: 'number',
|
|
137
137
|
title: 'Hidden number schema',
|
|
138
138
|
hidden: true,
|
|
139
|
-
|
|
139
|
+
default: 42,
|
|
140
140
|
},
|
|
141
141
|
hss: {
|
|
142
142
|
type: 'string',
|
|
143
143
|
title: 'Hidden string schema',
|
|
144
144
|
hidden: true,
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
}
|
|
145
|
+
default: 'Hello World!',
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
148
|
};
|
|
149
149
|
describe('when model is null', function () {
|
|
150
150
|
describe('and the getValue function is called', function () {
|
|
@@ -160,7 +160,7 @@ describe('mapSchemaToComponents', function () {
|
|
|
160
160
|
_a.apply(void 0, [_b.sent()]).toStrictEqual({
|
|
161
161
|
hbs: true,
|
|
162
162
|
hns: 42,
|
|
163
|
-
hss: 'Hello World!'
|
|
163
|
+
hss: 'Hello World!',
|
|
164
164
|
});
|
|
165
165
|
return [2 /*return*/];
|
|
166
166
|
}
|
|
@@ -177,7 +177,7 @@ describe('mapSchemaToComponents', function () {
|
|
|
177
177
|
case 0:
|
|
178
178
|
component = mapSchemaToComponent(getMockSchemaMapperProps({
|
|
179
179
|
schema: hiddenSchemas,
|
|
180
|
-
model: { hbs: false, hns: 0, hss: 'Hello' }
|
|
180
|
+
model: { hbs: false, hns: 0, hss: 'Hello' },
|
|
181
181
|
}), getMockMapperProps());
|
|
182
182
|
_a = expect;
|
|
183
183
|
return [4 /*yield*/, component.getSubmittableValue()];
|
|
@@ -185,7 +185,7 @@ describe('mapSchemaToComponents', function () {
|
|
|
185
185
|
_a.apply(void 0, [_b.sent()]).toStrictEqual({
|
|
186
186
|
hbs: false,
|
|
187
187
|
hns: 0,
|
|
188
|
-
hss: 'Hello'
|
|
188
|
+
hss: 'Hello',
|
|
189
189
|
});
|
|
190
190
|
return [2 /*return*/];
|
|
191
191
|
}
|
|
@@ -118,7 +118,7 @@ export var mapStepToComponent = function (_a) {
|
|
|
118
118
|
components: __spreadArray(__spreadArray([], additionalComponents, true), layoutComponents, true),
|
|
119
119
|
external: external,
|
|
120
120
|
loadingState: loadingState,
|
|
121
|
-
updateComponent: updateComponent
|
|
121
|
+
updateComponent: updateComponent,
|
|
122
122
|
});
|
|
123
123
|
return stepComponent;
|
|
124
124
|
};
|
|
@@ -129,14 +129,14 @@ var makeAdditionalComponents = function (step, uid, displayStepTitle) {
|
|
|
129
129
|
type: 'heading',
|
|
130
130
|
text: title,
|
|
131
131
|
align: 'center',
|
|
132
|
-
size: 'lg'
|
|
132
|
+
size: 'lg',
|
|
133
133
|
})
|
|
134
134
|
: undefined;
|
|
135
135
|
var stepError = (errors === null || errors === void 0 ? void 0 : errors.error)
|
|
136
136
|
? alertLayoutToComponent("".concat(uid, ".global-error"), {
|
|
137
137
|
type: 'alert',
|
|
138
138
|
markdown: errors.error,
|
|
139
|
-
context: 'negative'
|
|
139
|
+
context: 'negative',
|
|
140
140
|
})
|
|
141
141
|
: undefined;
|
|
142
142
|
return __spreadArray(__spreadArray([], (heading ? [heading] : []), true), (stepError ? [stepError] : []), true);
|
|
@@ -55,11 +55,11 @@ describe('mapStepToComponent', function () {
|
|
|
55
55
|
id: 'step',
|
|
56
56
|
title: '',
|
|
57
57
|
schemas: [],
|
|
58
|
-
layout: []
|
|
58
|
+
layout: [],
|
|
59
59
|
};
|
|
60
60
|
var mapperProps = __assign(__assign({}, getMapperProps()), { step: step, displayStepTitle: true });
|
|
61
61
|
expect(mapStepToComponent(mapperProps)).toEqual(expect.objectContaining({
|
|
62
|
-
type: 'step'
|
|
62
|
+
type: 'step',
|
|
63
63
|
}));
|
|
64
64
|
});
|
|
65
65
|
describe('when step contains a global error', function () {
|
|
@@ -69,13 +69,13 @@ describe('mapStepToComponent', function () {
|
|
|
69
69
|
title: '',
|
|
70
70
|
schemas: [],
|
|
71
71
|
layout: [],
|
|
72
|
-
errors: { error: 'This is a global error' }
|
|
72
|
+
errors: { error: 'This is a global error' },
|
|
73
73
|
};
|
|
74
74
|
var mapperProps = __assign(__assign({}, getMapperProps()), { step: step, displayStepTitle: true });
|
|
75
75
|
expect(mapStepToComponent(mapperProps).components).toContainEqual(expect.objectContaining({
|
|
76
76
|
type: 'alert',
|
|
77
77
|
markdown: 'This is a global error',
|
|
78
|
-
context: 'negative'
|
|
78
|
+
context: 'negative',
|
|
79
79
|
}));
|
|
80
80
|
});
|
|
81
81
|
it('places the alert between content and title (when provided)', function () {
|
|
@@ -84,7 +84,7 @@ describe('mapStepToComponent', function () {
|
|
|
84
84
|
title: 'Title',
|
|
85
85
|
schemas: [],
|
|
86
86
|
layout: [{ type: 'paragraph', text: 'This is below an alert' }],
|
|
87
|
-
errors: { error: 'This is a global error' }
|
|
87
|
+
errors: { error: 'This is a global error' },
|
|
88
88
|
};
|
|
89
89
|
var mapperProps = __assign(__assign({}, getMapperProps()), { step: step, displayStepTitle: true });
|
|
90
90
|
expect(mapStepToComponent(mapperProps).components).toEqual(expect.arrayContaining([
|
|
@@ -92,7 +92,7 @@ describe('mapStepToComponent', function () {
|
|
|
92
92
|
expect.objectContaining({
|
|
93
93
|
type: 'alert',
|
|
94
94
|
markdown: 'This is a global error',
|
|
95
|
-
context: 'negative'
|
|
95
|
+
context: 'negative',
|
|
96
96
|
}),
|
|
97
97
|
expect.objectContaining({ type: 'paragraph' }),
|
|
98
98
|
]));
|
|
@@ -104,7 +104,7 @@ describe('mapStepToComponent', function () {
|
|
|
104
104
|
title: '',
|
|
105
105
|
schemas: [],
|
|
106
106
|
layout: [],
|
|
107
|
-
errors: { error: '' }
|
|
107
|
+
errors: { error: '' },
|
|
108
108
|
};
|
|
109
109
|
var mapperProps = __assign(__assign({}, getMockMapperProps()), { step: step, displayStepTitle: true, loadingState: 'idle' });
|
|
110
110
|
expect(mapStepToComponent(mapperProps).components).toHaveLength(0);
|
|
@@ -117,12 +117,12 @@ describe('mapStepToComponent', function () {
|
|
|
117
117
|
id: 'step',
|
|
118
118
|
title: 'Title',
|
|
119
119
|
schemas: [],
|
|
120
|
-
layout: []
|
|
120
|
+
layout: [],
|
|
121
121
|
};
|
|
122
122
|
var mapperProps = __assign(__assign({}, getMapperProps()), { step: step, displayStepTitle: true });
|
|
123
123
|
expect(mapStepToComponent(mapperProps).components).toContainEqual(expect.objectContaining({
|
|
124
124
|
type: 'heading',
|
|
125
|
-
text: 'Title'
|
|
125
|
+
text: 'Title',
|
|
126
126
|
}));
|
|
127
127
|
});
|
|
128
128
|
it('does not render the heading when displayStepTitle is false', function () {
|
|
@@ -130,7 +130,7 @@ describe('mapStepToComponent', function () {
|
|
|
130
130
|
id: 'step',
|
|
131
131
|
title: 'Title',
|
|
132
132
|
schemas: [],
|
|
133
|
-
layout: []
|
|
133
|
+
layout: [],
|
|
134
134
|
};
|
|
135
135
|
var mapperProps = __assign(__assign({}, getMapperProps()), { step: step, displayStepTitle: false });
|
|
136
136
|
expect(mapStepToComponent(mapperProps).components).toHaveLength(0);
|
|
@@ -147,10 +147,10 @@ describe('mapStepToComponent', function () {
|
|
|
147
147
|
title: 'Action title',
|
|
148
148
|
url: '/submit',
|
|
149
149
|
type: 'primary',
|
|
150
|
-
method: 'POST'
|
|
150
|
+
method: 'POST',
|
|
151
151
|
},
|
|
152
152
|
],
|
|
153
|
-
layout: [{ type: 'button', action: { $ref: 'action-id' } }]
|
|
153
|
+
layout: [{ type: 'button', action: { $ref: 'action-id' } }],
|
|
154
154
|
};
|
|
155
155
|
it('returns a composition with a ButtonComponent with the correct action', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
156
156
|
var onAction, mapperProps, stepComponent, btn;
|
|
@@ -22,7 +22,7 @@ export var allOfSchemaToComponent = function (schemaMapperProps, mapperProps) {
|
|
|
22
22
|
model: model,
|
|
23
23
|
localValue: localValue,
|
|
24
24
|
required: required,
|
|
25
|
-
validationErrors: validationErrors
|
|
25
|
+
validationErrors: validationErrors,
|
|
26
26
|
}, mapperProps);
|
|
27
27
|
});
|
|
28
28
|
return createAllOfComponent(__assign(__assign({}, mapCommonSchemaProps(schemaMapperProps)), { components: components }));
|
|
@@ -26,7 +26,7 @@ export var arraySchemaToRepeatableComponent = function (schemaMapperProps, mappe
|
|
|
26
26
|
model: item,
|
|
27
27
|
localValue: value === null || value === void 0 ? void 0 : value[index],
|
|
28
28
|
// TODO tests for this
|
|
29
|
-
validationErrors: validationErrors
|
|
29
|
+
validationErrors: validationErrors,
|
|
30
30
|
}, mapperProps);
|
|
31
31
|
});
|
|
32
32
|
var createEditableComponent = function (editableValue) {
|
|
@@ -35,7 +35,7 @@ export var arraySchemaToRepeatableComponent = function (schemaMapperProps, mappe
|
|
|
35
35
|
schema: items,
|
|
36
36
|
localValue: editableValue,
|
|
37
37
|
model: localValueToJsonElement(editableValue),
|
|
38
|
-
validationErrors: undefined
|
|
38
|
+
validationErrors: undefined,
|
|
39
39
|
}, mapperProps);
|
|
40
40
|
};
|
|
41
41
|
var errorMessageFunctions = getErrorMessageFunctions(schema.validationMessages);
|
|
@@ -17,7 +17,7 @@ import { mapCommonSchemaProps } from './utils/mapCommonSchemaProps';
|
|
|
17
17
|
import { getValidationAsyncInitialState } from './utils/getValidationAsyncInitialState';
|
|
18
18
|
export var booleanSchemaToComponent = function (schemaMapperProps, mapperProps) {
|
|
19
19
|
var schema = schemaMapperProps.schema, localValue = schemaMapperProps.localValue, model = schemaMapperProps.model;
|
|
20
|
-
var defaultValue = schema
|
|
20
|
+
var defaultValue = schema.default;
|
|
21
21
|
var updateComponent = mapperProps.updateComponent, onRefresh = mapperProps.onRefresh;
|
|
22
22
|
var performRefresh = getPerformRefresh(schema, onRefresh);
|
|
23
23
|
var _a = getPersistAsyncInitialState(schemaMapperProps, mapperProps), performPersistAsync = _a.performPersistAsync, persistedState = _a.persistedState;
|
|
@@ -3,12 +3,12 @@ import { getConstSummary } from '../../features/summary/summary-utils';
|
|
|
3
3
|
export var constSchemaToComponent = function (uid, schemaMapperProps) {
|
|
4
4
|
var _a;
|
|
5
5
|
var schema = schemaMapperProps.schema;
|
|
6
|
-
var title = schema.title, constValue = schema
|
|
6
|
+
var title = schema.title, constValue = schema.const, analyticsId = schema.analyticsId, $id = schema.$id;
|
|
7
7
|
var titleOrValue = (_a = title !== null && title !== void 0 ? title : constValue) !== null && _a !== void 0 ? _a : null;
|
|
8
8
|
return createConstComponent({
|
|
9
9
|
uid: uid,
|
|
10
10
|
analyticsId: analyticsId !== null && analyticsId !== void 0 ? analyticsId : $id,
|
|
11
11
|
summary: getConstSummary(schema, titleOrValue),
|
|
12
|
-
value: schema
|
|
12
|
+
value: schema.const,
|
|
13
13
|
});
|
|
14
14
|
};
|
|
@@ -19,7 +19,7 @@ import { mapCommonSchemaProps } from './utils/mapCommonSchemaProps';
|
|
|
19
19
|
import { getValidationAsyncInitialState } from './utils/getValidationAsyncInitialState';
|
|
20
20
|
export var integerSchemaToComponent = function (schemaMapperProps, mapperProps) {
|
|
21
21
|
var schema = schemaMapperProps.schema, localValue = schemaMapperProps.localValue, model = schemaMapperProps.model, _a = schemaMapperProps.required, required = _a === void 0 ? false : _a;
|
|
22
|
-
var autocompleteHint = schema.autocompleteHint, validationMessages = schema.validationMessages, defaultValue = schema
|
|
22
|
+
var autocompleteHint = schema.autocompleteHint, validationMessages = schema.validationMessages, defaultValue = schema.default;
|
|
23
23
|
var getErrorMessageFunctions = mapperProps.getErrorMessageFunctions, updateComponent = mapperProps.updateComponent, onRefresh = mapperProps.onRefresh;
|
|
24
24
|
var errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
25
25
|
var _b = getPersistAsyncInitialState(schemaMapperProps, mapperProps), performPersistAsync = _b.performPersistAsync, persistedState = _b.persistedState;
|
|
@@ -19,7 +19,7 @@ import { mapCommonSchemaProps } from './utils/mapCommonSchemaProps';
|
|
|
19
19
|
import { getValidationAsyncInitialState } from './utils/getValidationAsyncInitialState';
|
|
20
20
|
export var numberSchemaToComponent = function (schemaMapperProps, mapperProps) {
|
|
21
21
|
var schema = schemaMapperProps.schema, model = schemaMapperProps.model, localValue = schemaMapperProps.localValue, _a = schemaMapperProps.required, required = _a === void 0 ? false : _a;
|
|
22
|
-
var autocompleteHint = schema.autocompleteHint, validationMessages = schema.validationMessages, defaultValue = schema
|
|
22
|
+
var autocompleteHint = schema.autocompleteHint, validationMessages = schema.validationMessages, defaultValue = schema.default;
|
|
23
23
|
var getErrorMessageFunctions = mapperProps.getErrorMessageFunctions, updateComponent = mapperProps.updateComponent, onRefresh = mapperProps.onRefresh;
|
|
24
24
|
var errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
25
25
|
var _b = getPersistAsyncInitialState(schemaMapperProps, mapperProps), performPersistAsync = _b.performPersistAsync, persistedState = _b.persistedState;
|
package/build/revamp/domain/mappers/schema/objectSchemaToComponent/objectSchemaToComponent.js
CHANGED
|
@@ -34,7 +34,7 @@ export var objectSchemaToComponent = function (schemaMapperProps, mapperProps) {
|
|
|
34
34
|
model: isObjectModel(model) ? model[propName] : null,
|
|
35
35
|
localValue: isObjectLocalValue(localValue) ? localValue[propName] : null,
|
|
36
36
|
required: (_b = required === null || required === void 0 ? void 0 : required.includes(propName)) !== null && _b !== void 0 ? _b : false,
|
|
37
|
-
validationErrors: isObject(validationErrors) ? validationErrors[propName] : undefined
|
|
37
|
+
validationErrors: isObject(validationErrors) ? validationErrors[propName] : undefined,
|
|
38
38
|
}, mapperProps), _a));
|
|
39
39
|
}, {});
|
|
40
40
|
return createObjectComponent(__assign(__assign({}, mapCommonSchemaProps(schemaMapperProps)), { componentMap: componentMap, displayOrder: displayOrder }));
|
package/build/revamp/domain/mappers/schema/objectSchemaToComponent/objectSchemaToComponent.spec.js
CHANGED
|
@@ -49,9 +49,9 @@ describe('objectSchemaToComponent', function () {
|
|
|
49
49
|
schema: {
|
|
50
50
|
type: 'object',
|
|
51
51
|
properties: {},
|
|
52
|
-
displayOrder: []
|
|
52
|
+
displayOrder: [],
|
|
53
53
|
},
|
|
54
|
-
model: null
|
|
54
|
+
model: null,
|
|
55
55
|
});
|
|
56
56
|
component = objectSchemaToComponent(schemaMapperProps, defaultMapperProps);
|
|
57
57
|
_a = expect;
|
|
@@ -72,15 +72,15 @@ describe('objectSchemaToComponent', function () {
|
|
|
72
72
|
type: 'object',
|
|
73
73
|
properties: {
|
|
74
74
|
name: {
|
|
75
|
-
type: 'string'
|
|
75
|
+
type: 'string',
|
|
76
76
|
},
|
|
77
77
|
occupation: {
|
|
78
|
-
type: 'string'
|
|
79
|
-
}
|
|
78
|
+
type: 'string',
|
|
79
|
+
},
|
|
80
80
|
},
|
|
81
|
-
displayOrder: ['name', 'occupation']
|
|
81
|
+
displayOrder: ['name', 'occupation'],
|
|
82
82
|
},
|
|
83
|
-
model: null
|
|
83
|
+
model: null,
|
|
84
84
|
});
|
|
85
85
|
component = objectSchemaToComponent(schemaMapperProps, defaultMapperProps);
|
|
86
86
|
_a = expect;
|
|
@@ -98,18 +98,18 @@ describe('objectSchemaToComponent', function () {
|
|
|
98
98
|
type: 'object',
|
|
99
99
|
properties: {
|
|
100
100
|
name: {
|
|
101
|
-
type: 'string'
|
|
101
|
+
type: 'string',
|
|
102
102
|
},
|
|
103
103
|
occupation: {
|
|
104
|
-
type: 'string'
|
|
105
|
-
}
|
|
104
|
+
type: 'string',
|
|
105
|
+
},
|
|
106
106
|
},
|
|
107
|
-
displayOrder: ['name', 'occupation']
|
|
107
|
+
displayOrder: ['name', 'occupation'],
|
|
108
108
|
},
|
|
109
109
|
model: {
|
|
110
110
|
name: 'John Smith',
|
|
111
|
-
city: 'New York'
|
|
112
|
-
}
|
|
111
|
+
city: 'New York',
|
|
112
|
+
},
|
|
113
113
|
});
|
|
114
114
|
it('sets the component value to the initial model', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
115
115
|
var component, _a;
|
|
@@ -121,7 +121,7 @@ describe('objectSchemaToComponent', function () {
|
|
|
121
121
|
return [4 /*yield*/, component.getSubmittableValue()];
|
|
122
122
|
case 1:
|
|
123
123
|
_a.apply(void 0, [_b.sent()]).toStrictEqual(expect.objectContaining({
|
|
124
|
-
name: 'John Smith'
|
|
124
|
+
name: 'John Smith',
|
|
125
125
|
}));
|
|
126
126
|
return [2 /*return*/];
|
|
127
127
|
}
|
|
@@ -136,22 +136,22 @@ describe('objectSchemaToComponent', function () {
|
|
|
136
136
|
type: 'object',
|
|
137
137
|
properties: {
|
|
138
138
|
name: {
|
|
139
|
-
type: 'string'
|
|
139
|
+
type: 'string',
|
|
140
140
|
},
|
|
141
141
|
occupation: {
|
|
142
|
-
type: 'string'
|
|
143
|
-
}
|
|
142
|
+
type: 'string',
|
|
143
|
+
},
|
|
144
144
|
},
|
|
145
|
-
displayOrder: ['name', 'occupation']
|
|
145
|
+
displayOrder: ['name', 'occupation'],
|
|
146
146
|
},
|
|
147
147
|
model: {
|
|
148
148
|
name: 'Jane Doe',
|
|
149
|
-
occupation: 'Programmer'
|
|
149
|
+
occupation: 'Programmer',
|
|
150
150
|
},
|
|
151
151
|
validationErrors: {
|
|
152
152
|
name: 'Problem with this name',
|
|
153
|
-
occupation: 'Problem with this occupation'
|
|
154
|
-
}
|
|
153
|
+
occupation: 'Problem with this occupation',
|
|
154
|
+
},
|
|
155
155
|
});
|
|
156
156
|
var component = objectSchemaToComponent(schemaMapperProps, defaultMapperProps);
|
|
157
157
|
expect(component.componentMap.name.errors).toStrictEqual([
|
|
@@ -30,7 +30,7 @@ import { mapCommonSchemaProps } from '../utils/mapCommonSchemaProps';
|
|
|
30
30
|
export var oneOfSchemaToComponent = function (schemaMapperProps, mapperProps) {
|
|
31
31
|
var _a, _b;
|
|
32
32
|
var uid = schemaMapperProps.uid, localValue = schemaMapperProps.localValue, schema = schemaMapperProps.schema, model = schemaMapperProps.model, initialError = schemaMapperProps.validationErrors, _c = schemaMapperProps.required, required = _c === void 0 ? false : _c;
|
|
33
|
-
var initialModel = (_a = model !== null && model !== void 0 ? model : schema
|
|
33
|
+
var initialModel = (_a = model !== null && model !== void 0 ? model : schema.default) !== null && _a !== void 0 ? _a : null;
|
|
34
34
|
var options = schema.oneOf.map(function (childSchema, index) {
|
|
35
35
|
var _a = childSchema.title, title = _a === void 0 ? '' : _a, description = childSchema.description, image = childSchema.image, icon = childSchema.icon, _b = childSchema.keywords, keywords = _b === void 0 ? [] : _b;
|
|
36
36
|
return {
|
|
@@ -46,12 +46,12 @@ export var oneOfSchemaToComponent = function (schemaMapperProps, mapperProps) {
|
|
|
46
46
|
model: initialModel,
|
|
47
47
|
localValue: localValue,
|
|
48
48
|
validationErrors: initialError,
|
|
49
|
-
required: required
|
|
50
|
-
}, mapperProps)
|
|
49
|
+
required: required,
|
|
50
|
+
}, mapperProps),
|
|
51
51
|
};
|
|
52
52
|
});
|
|
53
53
|
var getErrorMessageFunctions = mapperProps.getErrorMessageFunctions, updateComponent = mapperProps.updateComponent, trackEvent = mapperProps.trackEvent, onRefresh = mapperProps.onRefresh;
|
|
54
|
-
var defaultValue = schema
|
|
54
|
+
var defaultValue = schema.default, validationMessages = schema.validationMessages;
|
|
55
55
|
var errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
56
56
|
var _d = getPersistAsyncInitialState(schemaMapperProps, mapperProps), performPersistAsync = _d.performPersistAsync, persistedState = _d.persistedState;
|
|
57
57
|
var initialValue = performPersistAsync ? localValue : (_b = model !== null && model !== void 0 ? model : defaultValue) !== null && _b !== void 0 ? _b : null;
|