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 imports to guesser output #7699

Merged
merged 5 commits into from
May 18, 2022
Merged

Add imports to guesser output #7699

merged 5 commits into from
May 18, 2022

Conversation

fzaninotto
Copy link
Member

Problem

Guesser output can't be copy/pasted directly, as it misses the import part.

Solution

Add the imports

Example output

Guessed Show:
+
+import { DateField, ReferenceField, Show, SimpleShowLayout, TextField } from 'react-admin';

export const CommentShow = () => (
    <Show>
        <SimpleShowLayout>
            <TextField source="id" />
            <DateField source="author.undefined" />
            <ReferenceField source="post_id" reference="posts"><TextField source="id" /></ReferenceField>
            <TextField source="body" />
            <DateField source="created_at" />
        </SimpleShowLayout>
    </Show>
);

@fzaninotto fzaninotto added the RFR Ready For Review label May 16, 2022
@vercel vercel bot temporarily deployed to Preview – react-admin May 16, 2022 20:11 Inactive
Copy link
Contributor

@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.

There's a linter warning left, otherwise 👍

@djhi djhi added this to the 4.0.5 milestone May 17, 2022
@vercel vercel bot temporarily deployed to Preview – react-admin May 17, 2022 14:21 Inactive
@djhi djhi merged commit b7ad7b3 into next May 18, 2022
@djhi djhi deleted the guessers-with-import branch May 18, 2022 12:07
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.

None yet

3 participants