Skip to content

[core] Simplify isPrintableKey logic #5414

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

Merged
merged 2 commits into from
Jul 7, 2022

Conversation

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
@mnajdova mnajdova changed the title [data grid] Fix broken "start editing" integration with Japanese [DataGrid] Fix broken "start editing" integration with Japanese Jul 7, 2022
@mnajdova mnajdova added component: data grid This is the name of the generic UI component, not the React module! feature: Editing Related to the data grid Editing feature labels Jul 7, 2022

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
@mui-bot
Copy link

mui-bot commented Jul 7, 2022

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 247.7 531.9 389 365.14 104.292
Sort 100k rows ms 455 859.5 776.8 709.18 153.574
Select 100k rows ms 108.1 252.1 193.4 186.58 46.018
Deselect 100k rows ms 108.9 185 139.2 148.4 29.335

Generated by 🚫 dangerJS against 9c4bfec

@mnajdova mnajdova marked this pull request as ready for review July 7, 2022 09:49
Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

It could be great to add a test case for this. It's the second time we iterate on the logic to fix a bug. The first time was in #1409. We also fix the logic with, say when typing "$12" into the cell.

@mnajdova
Copy link
Member Author

mnajdova commented Jul 7, 2022

It could be great to add a test case for this. It's the second time we iterate on the logic to fix a bug. The first time was in #1409. We also fix the logic with, say when typing "$12" into the cell.

Sure, makes sense. I was looking a bit at the test in cellEditing.DataGridPro.new.test.tsx, but looks like the test used directly the apiRef.current.startCellEditMode API. I may not have much context, but I was expecting that the tests would focus on the cell, simulate some key-down and validate that the editing has started. I am not sure where/what exactly the test should test out.

@flaviendelangle flaviendelangle merged commit ffd1940 into mui:master Jul 7, 2022
@flaviendelangle
Copy link
Member

Feel free to open another PR for the test
I'm merging to unlock you in this release 👍

@mnajdova
Copy link
Member Author

mnajdova commented Jul 7, 2022

Feel free to open another PR for the test
I'm merging to unlock you in this release 👍

Thanks @flaviendelangle

@oliviertassinari oliviertassinari added the core Infrastructure work going on behind the scenes label Jul 8, 2022
@oliviertassinari oliviertassinari changed the title [DataGrid] Fix broken "start editing" integration with Japanese [core] Simplify isPrintableKey logic Jul 8, 2022
@m4theushw
Copy link
Member

Sure, makes sense. I was looking a bit at the test in cellEditing.DataGridPro.new.test.tsx, but looks like the test used directly the apiRef.current.startCellEditMode API. I may not have much context, but I was expecting that the tests would focus on the cell, simulate some key-down and validate that the editing has started. I am not sure where/what exactly the test should test out.

This test file is divided into groups whose tests inside reproduce how the user would interact with the editing functionality. The first group is apiRef and it contains only tests checking the methods from the editing API. Here we test the behavior of apiRef.current.startCellEditMode, for example. It might be controversy to call API methods here but they're part of the public API, so users can call them directly. The group start edit mode is where we have tests simulating user interactions (e.g. keydown). Since we're already tested what the API methods do in the previous group, here we only check that they are called with the right params. Inside this group there're different groups equivalent to the different ways that users can interact with the API, e.g. by double-click, by pressing Enter, by pressing a printable character and so on.

The new test could be inside

describe('by pressing Enter', () => {
it(`should publish 'cellEditStart' with reason=enterKeyDown`, () => {

joserodolfofreitas pushed a commit to joserodolfofreitas/mui-x that referenced this pull request Jul 15, 2022

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
alexfauquette pushed a commit to alexfauquette/mui-x that referenced this pull request Aug 26, 2022

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
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! core Infrastructure work going on behind the scenes feature: Editing Related to the data grid Editing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants