@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
|
@@ -7,7 +7,7 @@ describe('Given a library for identifying validation failures', function () {
|
|
|
7
7
|
type: 'string',
|
|
8
8
|
minLength: 3,
|
|
9
9
|
maxLength: 10,
|
|
10
|
-
pattern: '^[a-z]+$'
|
|
10
|
+
pattern: '^[a-z]+$',
|
|
11
11
|
};
|
|
12
12
|
});
|
|
13
13
|
it('should return only required', function () {
|
|
@@ -20,7 +20,7 @@ describe('Given a library for identifying validation failures', function () {
|
|
|
20
20
|
type: 'string',
|
|
21
21
|
minLength: 3,
|
|
22
22
|
maxLength: 6,
|
|
23
|
-
pattern: '^[a-z]+$'
|
|
23
|
+
pattern: '^[a-z]+$',
|
|
24
24
|
};
|
|
25
25
|
});
|
|
26
26
|
it('should return an empty array for valid string', function () {
|
|
@@ -47,7 +47,7 @@ describe('Given a library for identifying validation failures', function () {
|
|
|
47
47
|
schema = {
|
|
48
48
|
type: 'string',
|
|
49
49
|
minimum: '2000-01-01T00:00:00Z',
|
|
50
|
-
maximum: '2010-01-01T00:00:00Z'
|
|
50
|
+
maximum: '2010-01-01T00:00:00Z',
|
|
51
51
|
};
|
|
52
52
|
});
|
|
53
53
|
it('should return an empty array for valid date', function () {
|
|
@@ -69,7 +69,7 @@ describe('Given a library for identifying validation failures', function () {
|
|
|
69
69
|
schema = {
|
|
70
70
|
type: 'number',
|
|
71
71
|
minimum: 0,
|
|
72
|
-
maximum: 20
|
|
72
|
+
maximum: 20,
|
|
73
73
|
};
|
|
74
74
|
});
|
|
75
75
|
it('should return an empty array for an integer in range', function () {
|
|
@@ -119,7 +119,7 @@ describe('Given a library for identifying validation failures', function () {
|
|
|
119
119
|
});
|
|
120
120
|
describe('when validating a basic const schema', function () {
|
|
121
121
|
beforeEach(function () {
|
|
122
|
-
schema = {
|
|
122
|
+
schema = { const: 'abcd' };
|
|
123
123
|
});
|
|
124
124
|
it('should return an empty array when the const matches', function () {
|
|
125
125
|
expect(getValidationFailures('abcd', schema, false)).toStrictEqual([]);
|
|
@@ -137,7 +137,7 @@ describe('Given a library for identifying validation failures', function () {
|
|
|
137
137
|
});
|
|
138
138
|
describe('when validating a complex const schema', function () {
|
|
139
139
|
beforeEach(function () {
|
|
140
|
-
schema = {
|
|
140
|
+
schema = { const: { abcd: 'abcd' } };
|
|
141
141
|
});
|
|
142
142
|
it('should return an empty array when the const matches', function () {
|
|
143
143
|
expect(getValidationFailures({ abcd: 'abcd' }, schema, false)).toStrictEqual([]);
|
|
@@ -153,10 +153,10 @@ describe('Given a library for identifying validation failures', function () {
|
|
|
153
153
|
addItemTitle: '',
|
|
154
154
|
editItemTitle: '',
|
|
155
155
|
items: {
|
|
156
|
-
type: 'number'
|
|
156
|
+
type: 'number',
|
|
157
157
|
},
|
|
158
158
|
minItems: 2,
|
|
159
|
-
maxItems: 2
|
|
159
|
+
maxItems: 2,
|
|
160
160
|
};
|
|
161
161
|
});
|
|
162
162
|
it('should return an empty array for a valid array', function () {
|
|
@@ -178,11 +178,11 @@ describe('Given a library for identifying validation failures', function () {
|
|
|
178
178
|
type: 'object',
|
|
179
179
|
properties: {
|
|
180
180
|
a: {
|
|
181
|
-
type: 'number'
|
|
182
|
-
}
|
|
181
|
+
type: 'number',
|
|
182
|
+
},
|
|
183
183
|
},
|
|
184
184
|
required: ['a'],
|
|
185
|
-
displayOrder: ['a']
|
|
185
|
+
displayOrder: ['a'],
|
|
186
186
|
};
|
|
187
187
|
});
|
|
188
188
|
it('should return an empty array for a valid object', function () {
|
|
@@ -14,9 +14,9 @@ import { Avatar } from '@transferwise/components';
|
|
|
14
14
|
import { ArrowLeft } from '@transferwise/icons';
|
|
15
15
|
function BackButton(_a) {
|
|
16
16
|
var title = _a.title, action = _a.action, onAction = _a.onAction;
|
|
17
|
-
return (_jsxs("a",
|
|
17
|
+
return (_jsxs("a", { href: "/", className: "df-back-btn", "aria-label": title, onClick: function (event) {
|
|
18
18
|
event.preventDefault();
|
|
19
19
|
onAction(__assign(__assign({}, action), { skipValidation: true }));
|
|
20
|
-
}
|
|
20
|
+
}, children: [_jsx("span", { className: "sr-only", children: title }), _jsx(Avatar, { type: "icon", children: _jsx(ArrowLeft, { size: "24" }) })] }));
|
|
21
21
|
}
|
|
22
22
|
export default BackButton;
|
|
@@ -78,7 +78,7 @@ var DynamicFlowComponent = function (_a) {
|
|
|
78
78
|
var warnIfNoStepLayout = function (step) {
|
|
79
79
|
if (step && !step.layout) {
|
|
80
80
|
logWarning('Deprecation warning', 'Support for steps with no layout is being dropped. Please add a layout array to your step.', {
|
|
81
|
-
stepId: step.id || step.key
|
|
81
|
+
stepId: step.id || step.key,
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
};
|
|
@@ -91,7 +91,7 @@ var DynamicFlowComponent = function (_a) {
|
|
|
91
91
|
method: method,
|
|
92
92
|
headers: __assign({ 'accept-language': locale, 'Content-Type': 'application/json' }, (etag ? { 'If-None-Match': etag } : {})),
|
|
93
93
|
credentials: 'include',
|
|
94
|
-
body: method === 'GET' ? undefined : JSON.stringify(data)
|
|
94
|
+
body: method === 'GET' ? undefined : JSON.stringify(data),
|
|
95
95
|
});
|
|
96
96
|
}, [httpClient, locale]);
|
|
97
97
|
var performAction = function (action, data) {
|
|
@@ -321,12 +321,12 @@ var DynamicFlowComponent = function (_a) {
|
|
|
321
321
|
}
|
|
322
322
|
});
|
|
323
323
|
}); };
|
|
324
|
-
return (_jsx(LogProvider,
|
|
324
|
+
return (_jsx(LogProvider, { flowId: flowId, stepId: (step === null || step === void 0 ? void 0 : step.id) || (step === null || step === void 0 ? void 0 : step.key), onLog: onLog, children: _jsx(EventsContextProvider, { metadata: analyticsMetadata, onEvent: onEvent, children: _jsx(DynamicFlowProvider, { loading: isLoading, children: _jsx(HttpClientProvider, { httpClient: httpClient, children: _jsx(FeatureContextProvider, { features: features, children: loader !== null ? (loader) : (_jsx(DynamicFlowStep, { step: step, model: combineModels(models), submitted: submitted, globalError: globalError, formErrors: formErrors, stepLayoutOptions: { displayStepTitle: displayStepTitle }, onAction: function (action) {
|
|
325
325
|
void onAction(action);
|
|
326
|
-
}, onModelChange: onModelChange })) })
|
|
326
|
+
}, onModelChange: onModelChange })) }) }) }) }) }));
|
|
327
327
|
};
|
|
328
328
|
function DynamicFlow(props) {
|
|
329
|
-
return (_jsx(ErrorBoundary,
|
|
329
|
+
return (_jsx(ErrorBoundary, { onError: props.onError, children: _jsx(DynamicFlowComponent, __assign({}, props)) }));
|
|
330
330
|
}
|
|
331
331
|
export default DynamicFlow;
|
|
332
332
|
var combineModels = function (formModels) {
|
|
@@ -38,7 +38,7 @@ function InteractiveDemo(_a) {
|
|
|
38
38
|
}
|
|
39
39
|
return fixtureHttpClient(input, init);
|
|
40
40
|
}, [initialStep, initialStatusCode]);
|
|
41
|
-
return (_jsxs("div",
|
|
41
|
+
return (_jsxs("div", { style: { display: 'flex', gap: '1em' }, children: [_jsxs("div", { style: { flexBasis: '50%' }, children: [_jsx("h3", { children: "Editable Demo" }), _jsxs("p", { children: ["You can specify a response status code and body, and DF will load your step.", _jsx("br", {}), "(for ideas, you can select an initial step from the drop down in the controls panel)"] }), _jsxs("fieldset", { children: [_jsx("label", { htmlFor: "status-code", children: "Response Status code: " }), _jsx(StatusCodeSelect, { id: "status-code", state: [initialStatusCode, setInitialStatusCode] })] }), _jsxs("fieldset", { children: [_jsx("label", { htmlFor: "textarea", children: "Response Body:" }), _jsx(InvalidJsonWarning, { initialStep: initialStep }), _jsx("textarea", { id: "textarea", wrap: "off", rows: 40, style: { fontFamily: 'monospace', fontSize: '0.9em', width: '100%' }, value: initialStep, onChange: onTextAreaChange })] })] }), _jsx("div", { style: { flexBasis: '50%' }, children: _jsx(DynamicFlow, { flowId: "the-flow-id", initialAction: initialAction, httpClient: httpClient, onCompletion: action('onCompletion'), onError: action('onError'), onEvent: action('onEvent'), onLog: action('onLog') }, "".concat(initialStep, "-").concat(initialStatusCode)) })] }));
|
|
42
42
|
}
|
|
43
43
|
function InvalidJsonWarning(_a) {
|
|
44
44
|
var initialStep = _a.initialStep;
|
|
@@ -56,23 +56,23 @@ var isValidJson = function (value) {
|
|
|
56
56
|
};
|
|
57
57
|
function StatusCodeSelect(_a) {
|
|
58
58
|
var id = _a.id, _b = _a.state, value = _b[0], setValue = _b[1];
|
|
59
|
-
return (_jsxs("select",
|
|
59
|
+
return (_jsxs("select", { id: id, value: value, onChange: function (event) { return setValue(Number.parseInt(event.target.value, 10)); }, children: [_jsx("option", { children: "200" }), _jsx("option", { children: "400" }), _jsx("option", { children: "500" })] }));
|
|
60
60
|
}
|
|
61
61
|
var meta = {
|
|
62
62
|
title: 'Dev Tools/Dynamic Flow',
|
|
63
|
-
component: EditableDynamicFlow
|
|
63
|
+
component: EditableDynamicFlow,
|
|
64
64
|
};
|
|
65
65
|
export var EditableStep = {
|
|
66
66
|
argTypes: {
|
|
67
67
|
initialStepName: {
|
|
68
68
|
label: 'Initial Step',
|
|
69
69
|
control: 'select',
|
|
70
|
-
options: Object.keys(fixtures)
|
|
71
|
-
}
|
|
70
|
+
options: Object.keys(fixtures),
|
|
71
|
+
},
|
|
72
72
|
},
|
|
73
73
|
args: { initialStepName: Object.keys(fixtures)[0] },
|
|
74
74
|
parameters: {
|
|
75
|
-
chromatic: { disableSnapshot: true }
|
|
76
|
-
}
|
|
75
|
+
chromatic: { disableSnapshot: true },
|
|
76
|
+
},
|
|
77
77
|
};
|
|
78
78
|
export default meta;
|
|
@@ -7,43 +7,43 @@ var cases = {
|
|
|
7
7
|
paragraph: 'It should display a global error on screen. This is valid, expected behaviour.',
|
|
8
8
|
btnType: 'primary',
|
|
9
9
|
status: 422,
|
|
10
|
-
body: "{\"error\": \"Global Error\"}"
|
|
10
|
+
body: "{\"error\": \"Global Error\"}",
|
|
11
11
|
},
|
|
12
12
|
'/422-non-json-parseable': {
|
|
13
13
|
btnText: 'Error 422 with non-json-parseable response body',
|
|
14
14
|
btnType: 'negative',
|
|
15
15
|
paragraph: 'It should trigger onError and onLog. This is not expected behaviour.',
|
|
16
16
|
status: 422,
|
|
17
|
-
body: "Any string that CANNOT be parsed as JSON."
|
|
17
|
+
body: "Any string that CANNOT be parsed as JSON.",
|
|
18
18
|
},
|
|
19
19
|
'/422-json-parseable': {
|
|
20
20
|
btnText: 'Error 422 with json-parseable response body',
|
|
21
21
|
btnType: 'negative',
|
|
22
22
|
paragraph: "It should trigger onError and onLog. This is not expected behaviour.",
|
|
23
23
|
status: 422,
|
|
24
|
-
body: "{ \"valid\": \"JSON\" }"
|
|
24
|
+
body: "{ \"valid\": \"JSON\" }",
|
|
25
25
|
},
|
|
26
26
|
'/200-json-parseable': {
|
|
27
27
|
btnText: "Status 200 with json-parseable response body",
|
|
28
28
|
btnType: 'negative',
|
|
29
29
|
paragraph: "This is not expected behaviour because the response does not cointain the DF-X-Exit header. It should trigger onError and onLog, but it doesn't!.",
|
|
30
30
|
status: 200,
|
|
31
|
-
body: "{ \"valid\": \"JSON\" }"
|
|
31
|
+
body: "{ \"valid\": \"JSON\" }",
|
|
32
32
|
},
|
|
33
33
|
'/200-bad-action': {
|
|
34
34
|
btnText: "Status 200 with bad action body",
|
|
35
35
|
btnType: 'negative',
|
|
36
36
|
paragraph: 'It should trigger onError and onLog. This is not expected behaviour.',
|
|
37
37
|
status: 200,
|
|
38
|
-
body: "{ \"action\": {\"bad\": \"action\"} }"
|
|
38
|
+
body: "{ \"action\": {\"bad\": \"action\"} }",
|
|
39
39
|
},
|
|
40
40
|
'/422-json-parseable-non-object': {
|
|
41
41
|
btnText: 'Error 422 with json-parseable response body, but not an object',
|
|
42
42
|
btnType: 'negative',
|
|
43
43
|
paragraph: 'It should trigger onError and onLog. This is not expected behaviour.',
|
|
44
44
|
status: 422,
|
|
45
|
-
body: "\"A string literal can be parsed as JSON.\""
|
|
46
|
-
}
|
|
45
|
+
body: "\"A string literal can be parsed as JSON.\"",
|
|
46
|
+
},
|
|
47
47
|
};
|
|
48
48
|
var httpClient = function (input, init) {
|
|
49
49
|
action('httpClient')(input, init);
|
|
@@ -70,22 +70,22 @@ function getTestCaseBoxLayout(url, testCase, index) {
|
|
|
70
70
|
title: btnText,
|
|
71
71
|
type: btnType,
|
|
72
72
|
url: url,
|
|
73
|
-
data: { 'button-id': index }
|
|
74
|
-
}
|
|
73
|
+
data: { 'button-id': index },
|
|
74
|
+
},
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
type: 'paragraph',
|
|
78
78
|
text: "Response status: ".concat(status, " - body: ").concat(body, "."),
|
|
79
79
|
align: 'center',
|
|
80
|
-
margin: 'xs'
|
|
80
|
+
margin: 'xs',
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
83
|
type: 'paragraph',
|
|
84
84
|
text: paragraph,
|
|
85
85
|
align: 'center',
|
|
86
|
-
margin: 'md'
|
|
86
|
+
margin: 'md',
|
|
87
87
|
},
|
|
88
|
-
]
|
|
88
|
+
],
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
function getInitialStep() {
|
|
@@ -99,26 +99,26 @@ function getInitialStep() {
|
|
|
99
99
|
{
|
|
100
100
|
type: 'paragraph',
|
|
101
101
|
text: 'Press any buttons and see the httpClient requests and responses in the Actions panel.',
|
|
102
|
-
align: 'center'
|
|
102
|
+
align: 'center',
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
type: 'box',
|
|
106
106
|
width: 'md',
|
|
107
107
|
components: Object.keys(cases).map(function (url, index) {
|
|
108
108
|
return getTestCaseBoxLayout(url, cases[url], index);
|
|
109
|
-
})
|
|
109
|
+
}),
|
|
110
110
|
},
|
|
111
|
-
]
|
|
111
|
+
],
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
114
|
var meta = {
|
|
115
115
|
title: 'Dev Tools/Responses',
|
|
116
|
-
component: ErrorResponsesStory
|
|
116
|
+
component: ErrorResponsesStory,
|
|
117
117
|
};
|
|
118
118
|
export var ErrorResponses = {
|
|
119
119
|
render: function () { return _jsx(ErrorResponsesStory, {}); },
|
|
120
120
|
parameters: {
|
|
121
|
-
chromatic: { disableSnapshot: true }
|
|
122
|
-
}
|
|
121
|
+
chromatic: { disableSnapshot: true },
|
|
122
|
+
},
|
|
123
123
|
};
|
|
124
124
|
export default meta;
|
|
@@ -16,7 +16,7 @@ allStepNames.forEach(function (stepName) {
|
|
|
16
16
|
if (label) {
|
|
17
17
|
var _a = label.split('/'), group = _a[0], name_1 = _a[1];
|
|
18
18
|
storyMap[group] || (storyMap[group] = storiesOf("Dev Tools/".concat(group), module).addParameters({
|
|
19
|
-
chromatic: { disableSnapshot: true }
|
|
19
|
+
chromatic: { disableSnapshot: true },
|
|
20
20
|
}));
|
|
21
21
|
storyMap[group].add(name_1, function () { return (_jsx(DynamicFlow, { flowId: "storybook",
|
|
22
22
|
// eslint-disable-next-line import/namespace
|
|
@@ -24,7 +24,7 @@ selectedStepNames.forEach(function (stepName) {
|
|
|
24
24
|
if (label) {
|
|
25
25
|
var _a = label.split('/'), group = _a[0], name_1 = _a[1];
|
|
26
26
|
storyMap[group] || (storyMap[group] = storiesOf("Dev Tools/".concat(group), module).addParameters({
|
|
27
|
-
chromatic: { disableSnapshot: true }
|
|
27
|
+
chromatic: { disableSnapshot: true },
|
|
28
28
|
}));
|
|
29
29
|
storyMap[group].add(name_1, function () { return (_jsx(DynamicFlow, { flowId: "storybook",
|
|
30
30
|
// eslint-disable-next-line import/namespace
|
|
@@ -13,19 +13,19 @@ function JsonSchemaFormStory(_a) {
|
|
|
13
13
|
}
|
|
14
14
|
var meta = {
|
|
15
15
|
title: 'Dev Tools/JsonSchemaForm',
|
|
16
|
-
component: JsonSchemaFormStory
|
|
16
|
+
component: JsonSchemaFormStory,
|
|
17
17
|
};
|
|
18
18
|
export var Default = {
|
|
19
19
|
argTypes: {
|
|
20
20
|
stepName: {
|
|
21
21
|
label: 'Initial Schema from step',
|
|
22
22
|
control: 'select',
|
|
23
|
-
options: validStepNames
|
|
24
|
-
}
|
|
23
|
+
options: validStepNames,
|
|
24
|
+
},
|
|
25
25
|
},
|
|
26
26
|
args: { stepName: validStepNames[validStepNames.length - 1] },
|
|
27
27
|
parameters: {
|
|
28
|
-
chromatic: { disableSnapshot: true }
|
|
29
|
-
}
|
|
28
|
+
chromatic: { disableSnapshot: true },
|
|
29
|
+
},
|
|
30
30
|
};
|
|
31
31
|
export default meta;
|
|
@@ -72,14 +72,14 @@ var httpClient = getMockHttpClient({
|
|
|
72
72
|
'/refresh-with-delay': getRespondWithDelay(2000),
|
|
73
73
|
'/persist': function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
74
74
|
return [2 /*return*/, respondWith({ token: '123' })];
|
|
75
|
-
}); }); }
|
|
75
|
+
}); }); },
|
|
76
76
|
});
|
|
77
77
|
export default {
|
|
78
78
|
component: DynamicFlow,
|
|
79
79
|
title: 'Dev Tools/Features/Refresh On Change',
|
|
80
80
|
parameters: {
|
|
81
|
-
chromatic: { disableSnapshot: true }
|
|
82
|
-
}
|
|
81
|
+
chromatic: { disableSnapshot: true },
|
|
82
|
+
},
|
|
83
83
|
};
|
|
84
84
|
export function RefreshOnChange() {
|
|
85
85
|
return renderWithStep(initialStep);
|
|
@@ -94,29 +94,29 @@ var objectSchemaProps = {
|
|
|
94
94
|
name: {
|
|
95
95
|
title: 'Full name',
|
|
96
96
|
type: 'string',
|
|
97
|
-
refreshStepOnChange: true
|
|
97
|
+
refreshStepOnChange: true,
|
|
98
98
|
},
|
|
99
99
|
colour: {
|
|
100
100
|
title: 'Favourite colour',
|
|
101
101
|
oneOf: [
|
|
102
|
-
{ title: 'Red',
|
|
103
|
-
{ title: 'Blue',
|
|
104
|
-
{ title: 'Yellow',
|
|
105
|
-
{ title: 'Green',
|
|
102
|
+
{ title: 'Red', const: 'red' },
|
|
103
|
+
{ title: 'Blue', const: 'blue' },
|
|
104
|
+
{ title: 'Yellow', const: 'yellow' },
|
|
105
|
+
{ title: 'Green', const: 'green' },
|
|
106
106
|
],
|
|
107
|
-
refreshStepOnChange: true
|
|
107
|
+
refreshStepOnChange: true,
|
|
108
108
|
},
|
|
109
109
|
age: {
|
|
110
110
|
title: 'Age',
|
|
111
111
|
type: 'integer',
|
|
112
112
|
refreshFormUrl: '/refresh-with-delay',
|
|
113
113
|
description: 'This field has a delayed refresh',
|
|
114
|
-
refreshStepOnChange: true
|
|
114
|
+
refreshStepOnChange: true,
|
|
115
115
|
},
|
|
116
116
|
tnc: {
|
|
117
117
|
title: 'Terms and conditions',
|
|
118
118
|
type: 'boolean',
|
|
119
|
-
refreshStepOnChange: true
|
|
119
|
+
refreshStepOnChange: true,
|
|
120
120
|
},
|
|
121
121
|
'credit-card-number': {
|
|
122
122
|
title: 'Credit card number',
|
|
@@ -130,10 +130,10 @@ var objectSchemaProps = {
|
|
|
130
130
|
description: 'This field will trigger persist async but not refresh on change',
|
|
131
131
|
title: 'Credit Card Number',
|
|
132
132
|
type: 'string',
|
|
133
|
-
control: 'numeric'
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
133
|
+
control: 'numeric',
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
137
|
};
|
|
138
138
|
var initialStep = {
|
|
139
139
|
id: 'Features/Refresh on Change',
|
|
@@ -147,24 +147,24 @@ var initialStep = {
|
|
|
147
147
|
title: 'Float',
|
|
148
148
|
description: 'This field will disappear after refresh on change',
|
|
149
149
|
type: 'number',
|
|
150
|
-
refreshStepOnChange: true
|
|
151
|
-
} })
|
|
150
|
+
refreshStepOnChange: true,
|
|
151
|
+
} }),
|
|
152
152
|
},
|
|
153
153
|
],
|
|
154
154
|
layout: [
|
|
155
155
|
{ type: 'paragraph', text: 'This step will refresh when any of the fields are changed' },
|
|
156
156
|
{
|
|
157
157
|
type: 'form',
|
|
158
|
-
schemaId: '#schema'
|
|
158
|
+
schemaId: '#schema',
|
|
159
159
|
},
|
|
160
160
|
{
|
|
161
161
|
type: 'button',
|
|
162
162
|
title: 'Submit',
|
|
163
163
|
control: 'primary',
|
|
164
|
-
action: { url: '/submit' }
|
|
164
|
+
action: { url: '/submit' },
|
|
165
165
|
},
|
|
166
166
|
],
|
|
167
|
-
refreshUrl: '/refresh'
|
|
167
|
+
refreshUrl: '/refresh',
|
|
168
168
|
};
|
|
169
169
|
var refreshedStep = {
|
|
170
170
|
id: 'Features/Refresh on Change',
|
|
@@ -174,21 +174,21 @@ var refreshedStep = {
|
|
|
174
174
|
$id: '#schema',
|
|
175
175
|
type: 'object',
|
|
176
176
|
displayOrder: ['name', 'colour', 'age', 'tnc', 'credit-card-number'],
|
|
177
|
-
properties: objectSchemaProps
|
|
177
|
+
properties: objectSchemaProps,
|
|
178
178
|
},
|
|
179
179
|
],
|
|
180
180
|
layout: [
|
|
181
181
|
{ type: 'paragraph', text: 'This step will refresh when any of the fields are changed' },
|
|
182
182
|
{
|
|
183
183
|
type: 'form',
|
|
184
|
-
schemaId: '#schema'
|
|
184
|
+
schemaId: '#schema',
|
|
185
185
|
},
|
|
186
186
|
{
|
|
187
187
|
type: 'button',
|
|
188
188
|
title: 'Submit',
|
|
189
189
|
control: 'primary',
|
|
190
|
-
action: { url: '/submit' }
|
|
190
|
+
action: { url: '/submit' },
|
|
191
191
|
},
|
|
192
192
|
],
|
|
193
|
-
refreshUrl: '/refresh'
|
|
193
|
+
refreshUrl: '/refresh',
|
|
194
194
|
};
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
2
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
3
|
if (ar || !(i in from)) {
|
|
@@ -28,9 +17,9 @@ import { abortableDelay } from '../../../../test-utils/fetch-utils';
|
|
|
28
17
|
var storyMap = {};
|
|
29
18
|
var group = 'Dev Tools';
|
|
30
19
|
storyMap[group] || (storyMap[group] = storiesOf("".concat(group, "/Features/Search"), module).addParameters({
|
|
31
|
-
chromatic: { disableSnapshot: true }
|
|
20
|
+
chromatic: { disableSnapshot: true },
|
|
32
21
|
}));
|
|
33
|
-
storyMap[group].add('Search', function () { return (_jsxs(_Fragment, { children: [_jsx("div",
|
|
22
|
+
storyMap[group].add('Search', function () { return (_jsxs(_Fragment, { children: [_jsx("div", { style: { display: 'flex', justifyContent: 'center' }, children: _jsxs("ul", { children: [_jsx("li", { children: "If your search term has 3 or fewer characters, the search results will take 2 seconds to load." }), _jsx("li", { children: "If your search term has more than 3 characters, the search results will take 1 second to load." }), _jsx("li", { children: "If your search term is \"nothing\", then the search results will take 1 second to load, but will be empty." }), _jsx("li", { children: "If your search term is \"error\", then the search results will take 1 second to load, with a status 500." })] }) }), _jsx(DynamicFlow, { flowId: "storybook", initialStep: features.search, httpClient: httpClient, loaderConfig: { size: 'xl', initial: true, submission: false }, onCompletion: action('onCompletion'), onError: action('onError'), onEvent: action('onEvent'), onLog: action('onLog') }, "search")] })); });
|
|
34
23
|
var httpClient = function (input, init) {
|
|
35
24
|
var _a;
|
|
36
25
|
action('httpClient')(input, init);
|
|
@@ -70,8 +59,8 @@ var getFakeSearchResults = function (query) { return __spreadArray(__spreadArray
|
|
|
70
59
|
icon: { name: 'building' },
|
|
71
60
|
value: {
|
|
72
61
|
url: "/next-step?result=".concat(index + 1),
|
|
73
|
-
method: 'GET'
|
|
74
|
-
}
|
|
62
|
+
method: 'GET',
|
|
63
|
+
},
|
|
75
64
|
}); }), true), [
|
|
76
65
|
{
|
|
77
66
|
type: 'search',
|
|
@@ -82,8 +71,8 @@ var getFakeSearchResults = function (query) { return __spreadArray(__spreadArray
|
|
|
82
71
|
url: '/more-search',
|
|
83
72
|
method: 'GET',
|
|
84
73
|
param: 'query',
|
|
85
|
-
query: "get more ".concat(decodeURIComponent(query))
|
|
86
|
-
}
|
|
74
|
+
query: "get more ".concat(decodeURIComponent(query)),
|
|
75
|
+
},
|
|
87
76
|
},
|
|
88
77
|
{
|
|
89
78
|
type: 'search',
|
|
@@ -94,8 +83,8 @@ var getFakeSearchResults = function (query) { return __spreadArray(__spreadArray
|
|
|
94
83
|
url: '/more-search',
|
|
95
84
|
method: 'POST',
|
|
96
85
|
param: 'query',
|
|
97
|
-
query: "post more ".concat(decodeURIComponent(query))
|
|
98
|
-
}
|
|
86
|
+
query: "post more ".concat(decodeURIComponent(query)),
|
|
87
|
+
},
|
|
99
88
|
},
|
|
100
89
|
], false); };
|
|
101
90
|
var getMoreFakeSearchResults = function (query) {
|
|
@@ -108,7 +97,7 @@ var getMoreFakeSearchResults = function (query) {
|
|
|
108
97
|
icon: { name: 'cog' },
|
|
109
98
|
value: {
|
|
110
99
|
url: "/next-step?result=".concat(index + 1),
|
|
111
|
-
method: 'GET'
|
|
112
|
-
}
|
|
100
|
+
method: 'GET',
|
|
101
|
+
},
|
|
113
102
|
}); });
|
|
114
103
|
};
|
|
@@ -22,15 +22,15 @@ export default {
|
|
|
22
22
|
component: DynamicFlow,
|
|
23
23
|
title: 'Dev Tools/Examples/Server Test',
|
|
24
24
|
parameters: {
|
|
25
|
-
chromatic: { disableSnapshot: true }
|
|
25
|
+
chromatic: { disableSnapshot: true },
|
|
26
26
|
},
|
|
27
27
|
argTypes: {
|
|
28
28
|
persistAsync: {
|
|
29
29
|
options: ['succeed', 'failGenerically', 'failValidation'],
|
|
30
30
|
type: 'select',
|
|
31
|
-
defaultValue: 'succeed'
|
|
32
|
-
}
|
|
33
|
-
}
|
|
31
|
+
defaultValue: 'succeed',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
34
|
};
|
|
35
35
|
export function Basic() {
|
|
36
36
|
var initialAction = { method: 'GET', url: 'http://localhost:8888' };
|