Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate AutocompleteArrayInput to MUI Autocomplete #6971

Merged
merged 15 commits into from
Jan 3, 2022

Conversation

djhi
Copy link
Collaborator

@djhi djhi commented Dec 10, 2021

  • Implementation
  • Tests
  • Stories
  • Documentation
  • Upgrade guide
  • Refactor
  • Remove options prop

@djhi djhi added the WIP Work In Progress label Dec 10, 2021
@djhi djhi added this to the 4.0.0-alpha.1 milestone Dec 10, 2021
@vercel vercel bot temporarily deployed to Preview – react-admin December 10, 2021 11:17 Inactive
@vercel vercel bot temporarily deployed to Preview – react-admin-storybook December 10, 2021 11:17 Inactive
@vercel vercel bot temporarily deployed to Preview – react-admin December 10, 2021 13:28 Inactive
@vercel vercel bot temporarily deployed to Preview – react-admin-storybook December 10, 2021 13:28 Inactive
@vercel vercel bot temporarily deployed to Preview – react-admin-storybook December 14, 2021 14:12 Inactive
@vercel vercel bot temporarily deployed to Preview – react-admin December 14, 2021 14:12 Inactive
@vercel vercel bot temporarily deployed to Preview – react-admin-storybook December 14, 2021 15:02 Inactive
@vercel vercel bot temporarily deployed to Preview – react-admin December 14, 2021 15:02 Inactive
@vercel vercel bot temporarily deployed to Preview – react-admin-storybook December 14, 2021 15:04 Inactive
@djhi djhi added the RFR Ready For Review label Dec 14, 2021
@vercel vercel bot temporarily deployed to Preview – react-admin December 14, 2021 15:08 Inactive
@vercel vercel bot temporarily deployed to Preview – react-admin-storybook December 15, 2021 10:50 Inactive
@vercel vercel bot temporarily deployed to Preview – react-admin December 15, 2021 10:50 Inactive
@djhi djhi removed the WIP Work In Progress label Dec 15, 2021
@vercel vercel bot temporarily deployed to Preview – react-admin-storybook December 15, 2021 13:45 Inactive
@vercel vercel bot temporarily deployed to Preview – react-admin December 15, 2021 13:45 Inactive
@vercel vercel bot temporarily deployed to Preview – react-admin December 15, 2021 13:54 Inactive
@vercel vercel bot temporarily deployed to Preview – react-admin-storybook December 15, 2021 13:54 Inactive
@djhi djhi added WIP Work In Progress and removed RFR Ready For Review labels Dec 15, 2021
@vercel vercel bot temporarily deployed to Preview – react-admin-storybook December 15, 2021 14:59 Inactive
@vercel vercel bot temporarily deployed to Preview – react-admin December 15, 2021 14:59 Inactive
@djhi djhi added RFR Ready For Review and removed WIP Work In Progress labels Dec 15, 2021
@fzaninotto
Copy link
Member

The storybook isn't deployed by Vercel, is it normal?

docs/Inputs.md Outdated
@@ -647,7 +647,7 @@ If you want to limit the initial choices shown to the current value only, you ca
When dealing with a large amount of `choices` you may need to limit the number of suggestions that are rendered in order to maintain usable performance. The `shouldRenderSuggestions` is an optional prop that allows you to set conditions on when to render suggestions. An easy way to improve performance would be to skip rendering until the user has entered 2 or 3 characters in the search box. This lowers the result set significantly, and might be all you need (depending on your data set).
Ex. `<AutocompleteInput shouldRenderSuggestions={(val) => { return val.trim().length > 2 }} />` would not render any suggestions until the 3rd character has been entered. This prop is passed to the underlying `react-autosuggest` component and is documented [here](https://github.com/moroshko/react-autosuggest#should-render-suggestions-prop).

`<AutocompleteInput>` renders a [material-ui `<TextField>` component](https://material-ui.com/api/text-field/). Use the `options` attribute to override any of the `<TextField>` attributes:
`<AutocompleteInput>` renders a [material-ui `<Autocomplete>` component](https://mui.com/components/autocomplete/). Use the `options` attribute to override any of the `<Autocomplete>` attributes:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought you removed that possibility

docs/Inputs.md Show resolved Hide resolved
docs/Inputs.md Show resolved Hide resolved
packages/ra-core/src/form/useSuggestions.ts Show resolved Hide resolved
useSupportCreateSuggestion,
} from './useSupportCreateSuggestion';

/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should keep some jsDoc, at least to explain that it's deprecated

@@ -407,10 +457,74 @@ If you provided a React element for the optionText prop, you must also provide t
);
};

export interface AutocompleteInputProps
extends ChoicesInputProps<AutocompleteProps<any, false, false, false>>,
// @ts-ignore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the ignore?

},
}));
export const AutocompleteArrayInput = props => (
<AutocompleteInput multiple {...props} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<AutocompleteInput multiple {...props} />
<AutocompleteInput {...props} multiple />

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case

@fzaninotto fzaninotto mentioned this pull request Dec 22, 2021
UPGRADE.md Outdated Show resolved Hide resolved
@vercel vercel bot temporarily deployed to Preview – react-admin-storybook January 3, 2022 10:31 Inactive
@vercel vercel bot temporarily deployed to Preview – react-admin January 3, 2022 10:32 Inactive
@fzaninotto fzaninotto merged commit 842b005 into next Jan 3, 2022
@fzaninotto fzaninotto deleted the mui-autocomplete-array branch January 3, 2022 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants