From 662dd106928677ed8fc3e424ca5debdc1e440d86 Mon Sep 17 00:00:00 2001 From: Josue Ruiz <7465495+SwaySway@users.noreply.github.com> Date: Fri, 21 Oct 2022 17:12:13 -0700 Subject: [PATCH] fix: hide cancel button by default (#696) --- ...studio-ui-codegen-react-forms.test.ts.snap | 52 ++---------------- .../form-renderer-helper.test.ts.snap | 9 +++- .../react-forms/form-renderer-helper.test.ts | 19 +++++++ .../event-handler-props.ts | 5 ++ .../forms/form-renderer-helper/type-helper.ts | 19 ++++--- .../lib/forms/react-form-renderer.ts | 2 - .../helpers/map-cta.test.ts | 18 +++++++ .../lib/__tests__/utils/form-utils.test.ts | 54 +++++++++++++++++++ .../helpers/map-cta.ts | 4 ++ packages/codegen-ui/lib/utils/form-utils.ts | 32 +++++++++++ packages/codegen-ui/lib/utils/index.ts | 1 + 11 files changed, 156 insertions(+), 59 deletions(-) create mode 100644 packages/codegen-ui/lib/__tests__/utils/form-utils.test.ts create mode 100644 packages/codegen-ui/lib/utils/form-utils.ts diff --git a/packages/codegen-ui-react/lib/__tests__/__snapshots__/studio-ui-codegen-react-forms.test.ts.snap b/packages/codegen-ui-react/lib/__tests__/__snapshots__/studio-ui-codegen-react-forms.test.ts.snap index 7248f87fe..89eaff3dc 100644 --- a/packages/codegen-ui-react/lib/__tests__/__snapshots__/studio-ui-codegen-react-forms.test.ts.snap +++ b/packages/codegen-ui-react/lib/__tests__/__snapshots__/studio-ui-codegen-react-forms.test.ts.snap @@ -1895,8 +1895,7 @@ function ArrayField({ ); } export default function NestedJson(props) { - const { onSubmit, onCancel, onValidate, onChange, overrides, ...rest } = - props; + const { onSubmit, onValidate, onChange, overrides, ...rest } = props; const { tokens } = useTheme(); const initialValues = { \\"first-Name\\": undefined, @@ -2232,14 +2231,6 @@ export default function NestedJson(props) { {...getOverrideProps(overrides, \\"ClearButton\\")} > - - - -