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

Add ability to set meta in page components #7841

Merged
merged 10 commits into from
Jun 16, 2022
Merged

Add ability to set meta in page components #7841

merged 10 commits into from
Jun 16, 2022

Conversation

fzaninotto
Copy link
Member

  • Add support for meta in <Create>
  • Add support for meta in <Show>
  • Add support for meta in <List>
  • Add support for meta in <Edit>
  • Add documentation
  • Add tests
import { Edit, SimpleForm } from 'react-admin';

const PostEdit = () => (
    <Edit mutationOptions={{ meta: { foo: 'bar' } }}>
        <SimpleForm>
            ...
        </SimpleForm>
    </Edit>
);

Closes #7357
Refs #7785, #7665

@fzaninotto fzaninotto added the RFR Ready For Review label Jun 16, 2022
@fzaninotto fzaninotto added this to the 4.2.0 milestone Jun 16, 2022
Copy link
Collaborator

@djhi djhi left a comment

Choose a reason for hiding this comment

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

Nice! There are a few warnings left and I think we should also support the meta prop on the delete buttons

@fzaninotto
Copy link
Member Author

The Delete button can be in another PR

@vercel vercel bot temporarily deployed to Preview – react-admin June 16, 2022 11:38 Inactive
@gengue
Copy link

gengue commented Jun 26, 2022

This is great 🥇
It would be really useful to have this meta prop in Reference inputs as well, most of the time we just need id and name to be rendered in a Select or Autocomplete, but the dataProvider will fetch the default list with this prop we could have more control in forms

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