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

Allow recreating data grid columns from existing data #914

Merged
merged 10 commits into from
Sep 8, 2022

Conversation

apedroferreira
Copy link
Member

Allow for recreating columns in Data Grid elements, from existing data.
Replaces all columns with the inferred columns when the button is pressed.

Screen.Recording.2022-09-07.at.16.14.37.mov

@apedroferreira apedroferreira self-assigned this Sep 7, 2022
@render
Copy link

render bot commented Sep 7, 2022

@oliviertassinari oliviertassinari requested a deployment to recreate-columns - toolpad-db PR #914 September 7, 2022 15:18 — with Render Abandoned
@@ -176,6 +188,13 @@ function GridColumnsPropEditor({
<React.Fragment>
<DialogTitle>Edit columns</DialogTitle>
<DialogContent>
<IconButton
aria-label="Recreate columns"
Copy link
Member

@Janpot Janpot Sep 7, 2022

Choose a reason for hiding this comment

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

We should probably add a tooltip instead.

@prakhargupta1 @gerdadesign nominating this component as well for a redesign. Perhaps we could even put this inline in the inspector, instead of in a dialog?

Copy link
Member Author

Choose a reason for hiding this comment

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

good idea, i'll add

Copy link
Member Author

Choose a reason for hiding this comment

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

I've added tooltips to the "Recreate columns" and the "Add column" buttons

</IconButton>
<Tooltip title="Recreate columns">
<IconButton
aria-label="Recreate columns"
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

cool i didn't know, i've removed the unnecessary props + added a span so that the tooltip shows when the "recreate columns" button is disabled (as recommended by the MUI console warnings)

>
<RefreshIcon />
</IconButton>
<span>
Copy link
Member

Choose a reason for hiding this comment

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

this prevents it from passing the aria label to the button, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

it's passed to the span, actually that might not be ok good point

Copy link
Member Author

@apedroferreira apedroferreira Sep 7, 2022

Choose a reason for hiding this comment

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

i added describeChild to the tooltip and aria-label in the button, seems like the right way to do it

@apedroferreira apedroferreira merged commit ec1b10d into master Sep 8, 2022
@apedroferreira apedroferreira deleted the recreate-columns branch September 8, 2022 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Datagrid: recreate/refresh columns
4 participants