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

[DataGrid] Add demo to the "Custom columns" page that does not use generator #13695

Merged
merged 25 commits into from
Sep 11, 2024

Conversation

arminmeh
Copy link
Contributor

@arminmeh arminmeh commented Jul 1, 2024

Closes #13110
Closes #9270

Only last point from the proposal was actually missing (example without generator)

I have added a demo that collects most customized cell renderers that we have in our docs.
@mui/x-data-grid-generator is still used to get the actuall renderers and to generate random data

Preview: https://deploy-preview-13695--material-ui-x.netlify.app/x/react-data-grid/custom-columns/#full-example

Update
Renderers are outside of the main folder of the component's docs to skip the regression tests
This produces the same problem with the long names as discussed in mui/material-ui#42913 (comment)

So, I will add a feature to "Allow using custom labels (default to filename) for imported files, instead of entire relative path"
from mui/material-ui#41754

TODO

  • Set custom file labels for the cell renderer files

@arminmeh arminmeh added docs Improvements or additions to the documentation component: data grid This is the name of the generic UI component, not the React module! labels Jul 1, 2024
@mui-bot
Copy link

mui-bot commented Jul 1, 2024

@cherniavskii cherniavskii added customization: css Design CSS customizability customization: extend Logic customizability labels Jul 5, 2024
@arminmeh
Copy link
Contributor Author

arminmeh commented Jul 8, 2024

There is an issue with the toolbar that I will have to fix in https://github.com/mui/material-ui first
With too many files, file names are squashed together

Once I have the other PR I will link it here

Docs infra PR
mui/material-ui#42913

@arminmeh
Copy link
Contributor Author

arminmeh commented Aug 8, 2024

Before the PR is merged, mui/material-ui#42733 should be resolved

@cherniavskii
Copy link
Member

cherniavskii commented Aug 27, 2024

We need to link to this demo in https://mui.com/x/react-data-grid/faq/#what-is-the-purpose-of-usedemodata-hook-used-in-the-documentation-examples (adding a callout), so that users that are looking for useDemoData implementation can use the custom columns demo and copy the column definitions and/or cell renderers from there.
UPD: done in 4866de8 (#13695)

This will close #13110, as duplicating useDemoData for every demo is not feasible.

@cherniavskii
Copy link
Member

Renderers are outside of the main folder of the component's docs to skip the regression tests

I've moved them to the same folder where the demo is and ignored them in the regression tests.
The file names are short enough, and they match the import paths:

@cherniavskii
Copy link
Member

@arminmeh please review my changes and let me know what you think

@arminmeh
Copy link
Contributor Author

arminmeh commented Sep 9, 2024

Thanks for taking over @cherniavskii

the changes are fine, but I still see issues with the CodeSandbox/StackBlitz demos on the preview page
charts dependency is missing (not sure if it is because the import is not in the main file, but in a custom renderer)

I see that in mui/material-ui#41754 that the issue for CodeSandbox/StackBlitz is closed, but the checkbox is not checked
@bharatkashyap do you know if some additional changes are in progress

@bharatkashyap
Copy link
Member

bharatkashyap commented Sep 9, 2024

I see that in mui/material-ui#41754 that the issue for CodeSandbox/StackBlitz is closed, but the checkbox is not checked @bharatkashyap do you know if some additional changes are in progress

Ah no, that checkbox is supposed to be checked since the issue was supposed to be resolved with that PR. While the original issue was fixed, I can look into what's causing the issue in this particular demo

@cherniavskii
Copy link
Member

@bharatkashyap @arminmeh I've opened mui/material-ui#43713 with a fix

@cherniavskii
Copy link
Member

@arminmeh The demo now works in Stackblitz and Codesandbox, thanks for spotting it!

@cherniavskii cherniavskii enabled auto-merge (squash) September 11, 2024 21:48
@cherniavskii cherniavskii added the dx Related to developers' experience label Sep 11, 2024
@cherniavskii cherniavskii merged commit 5d86576 into mui:master Sep 11, 2024
20 checks passed
@arminmeh arminmeh deleted the docs-page-custom-columns branch September 11, 2024 22:10
@arminmeh
Copy link
Contributor Author

@cherniavskii thanks for the sandbox fixes and for the updates that made it finally merged 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! customization: css Design CSS customizability customization: extend Logic customizability docs Improvements or additions to the documentation dx Related to developers' experience size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
4 participants