From 62a686a9cbea51c907f641e0615c35df7964367b Mon Sep 17 00:00:00 2001 From: pem Date: Thu, 10 Oct 2019 10:57:31 +0200 Subject: [PATCH] Remove empty interfaces and fix 2 potential bugs --- packages/ra-ui-materialui/src/form/SimpleForm.js | 4 +++- packages/ra-ui-materialui/src/form/TabbedForm.js | 4 +++- .../ra-ui-materialui/src/input/AutocompleteArrayInput.tsx | 4 +--- packages/ra-ui-materialui/src/input/AutocompleteInput.tsx | 4 +--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/ra-ui-materialui/src/form/SimpleForm.js b/packages/ra-ui-materialui/src/form/SimpleForm.js index a1df694665d..a216e38c311 100644 --- a/packages/ra-ui-materialui/src/form/SimpleForm.js +++ b/packages/ra-ui-materialui/src/form/SimpleForm.js @@ -33,7 +33,9 @@ const SimpleForm = ({ initialValues, defaultValue, saving, ...props }) => { const submit = values => { const finalRedirect = - typeof redirect === undefined ? props.redirect : redirect.current; + typeof redirect.current === undefined + ? props.redirect + : redirect.current; const finalValues = sanitizeEmptyValues(finalInitialValues, values); props.save(finalValues, finalRedirect); diff --git a/packages/ra-ui-materialui/src/form/TabbedForm.js b/packages/ra-ui-materialui/src/form/TabbedForm.js index 3663582b4d8..43a70d9345a 100644 --- a/packages/ra-ui-materialui/src/form/TabbedForm.js +++ b/packages/ra-ui-materialui/src/form/TabbedForm.js @@ -47,7 +47,9 @@ const TabbedForm = ({ initialValues, defaultValue, saving, ...props }) => { const submit = values => { const finalRedirect = - typeof redirect === undefined ? props.redirect : redirect.current; + typeof redirect.current === undefined + ? props.redirect + : redirect.current; const finalValues = sanitizeEmptyValues(finalInitialValues, values); props.save(finalValues, finalRedirect); diff --git a/packages/ra-ui-materialui/src/input/AutocompleteArrayInput.tsx b/packages/ra-ui-materialui/src/input/AutocompleteArrayInput.tsx index 8cbdd20908a..9e0ea023cc5 100644 --- a/packages/ra-ui-materialui/src/input/AutocompleteArrayInput.tsx +++ b/packages/ra-ui-materialui/src/input/AutocompleteArrayInput.tsx @@ -23,8 +23,6 @@ import InputHelperText from './InputHelperText'; import AutocompleteSuggestionList from './AutocompleteSuggestionList'; import AutocompleteSuggestionItem from './AutocompleteSuggestionItem'; -interface Props {} - interface Options { suggestionsContainerProps?: any; labelProps?: any; @@ -93,7 +91,7 @@ interface Options { * */ const AutocompleteArrayInput: FunctionComponent< - Props & InputProps & DownshiftProps + InputProps & DownshiftProps > = ({ allowEmpty, classes: classesOverride, diff --git a/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx b/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx index 8d891096a99..eb25917235d 100644 --- a/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx +++ b/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx @@ -23,8 +23,6 @@ import InputHelperText from './InputHelperText'; import AutocompleteSuggestionList from './AutocompleteSuggestionList'; import AutocompleteSuggestionItem from './AutocompleteSuggestionItem'; -interface Props {} - interface Options { suggestionsContainerProps?: any; labelProps?: any; @@ -93,7 +91,7 @@ interface Options { * */ const AutocompleteInput: FunctionComponent< - Props & InputProps & DownshiftProps + InputProps & DownshiftProps > = ({ allowEmpty, classes: classesOverride,