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

[StaticDatePicker] Add className and slot to PickerStaticWrapper #29619

Merged
merged 9 commits into from
Nov 30, 2021

Conversation

kkorach
Copy link
Contributor

@kkorach kkorach commented Nov 10, 2021

This PR adds the className MuiStaticWrapper and slot root to the StaticWrapper component used by the StaticDatePicker. The name does seem a bit generic, but the StaticWrapper is only used by the DatePicker components. I couldn't find any other uses of the name StaticWrapper.

@mui-pr-bot
Copy link

mui-pr-bot commented Nov 10, 2021

Details of bundle changes

@material-ui/lab: parsed: +0.09% , gzip: +0.07%

Generated by 🚫 dangerJS against cdcb212

@kkorach
Copy link
Contributor Author

kkorach commented Nov 11, 2021

Cool, I'll make the change and push it back up today

@mbrookes mbrookes added the component: date picker This is the name of the generic UI component, not the React module! label Nov 12, 2021
@kkorach kkorach requested a review from mnajdova November 15, 2021 17:38
Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Let's add a test to confirm that this works. Apart from that looks good 👍

@mnajdova
Copy link
Member

We need to also update the components.d.ts and overrides.d.ts in https://github.com/mui-org/material-ui/tree/master/packages/mui-lab/src/themeAugmentation to make sure we won't have TypeScript issues.

@kkorach
Copy link
Contributor Author

kkorach commented Nov 16, 2021

@mnajdova Since I've switched the className to be more specific, I get this error: error Expected name to be 'MuiStaticWrapper' but instead got 'MuiPickerStaticWrapper' material-ui/mui-name-matches-component-name

If this is a firm rule, then it would have to be named MuiStaticWrapper. Are there other cases where this rule is disabled?

Also, for testing. What in particular are you thinking we should test. It looks like describeConformance is what is needed? The StaticDataPicker doesn't have one, but StaticDateRangePicker does.

@mnajdova
Copy link
Member

@mnajdova Since I've switched the className to be more specific, I get this error: error Expected name to be 'MuiStaticWrapper' but instead got 'MuiPickerStaticWrapper' material-ui/mui-name-matches-component-name

Right.. I would say we need to rename this component, it is an internal component shouldn't affect developers. Would you be willing to do this? It would wider the scope fo the PR. @michaldudak what do you think about this rename?

If this is a firm rule, then it would have to be named MuiStaticWrapper. Are there other cases where this rule is disabled?

No, we keep the component names consistent with the keys, as I mentioned above in my opinion the component name is too generic in this case.

Also, for testing. What in particular are you thinking we should test. It looks like describeConformance is what is needed? The StaticDataPicker doesn't have one, but StaticDateRangePicker does.

Ensuring that describeConfromance pass would be great 👌

@michaldudak
Copy link
Member

in my opinion the component name is too generic in this case.

100% agree. It may be internal but internal components are also maintained by human beings that sometimes may need some assistance in figuring out what the component is for 😉. Let's rename the component.

@kkorach kkorach requested a review from mnajdova November 22, 2021 20:20
@kkorach kkorach force-pushed the static-date-picker-wrapper branch from 9666f28 to 5b5ab49 Compare November 22, 2021 20:53
@kkorach kkorach force-pushed the static-date-picker-wrapper branch from 5b5ab49 to 316dd70 Compare November 22, 2021 21:13
Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Perfect! Thanks for the work and patience :)

@mnajdova mnajdova changed the title [StaticDatePicker] Add className and slot to StaticWrapper (#29511) [StaticDatePicker] Add className and slot to PickerStaticWrapper Nov 23, 2021
@kkorach
Copy link
Contributor Author

kkorach commented Nov 23, 2021

@mnajdova What's the next step?

@mnajdova
Copy link
Member

@mnajdova What's the next step?

I've merged latest master, let's wait for the green build and merge :)

@mnajdova mnajdova merged commit 0d94283 into mui:master Nov 30, 2021
@mnajdova
Copy link
Member

Great job @kkorach thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: date picker This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants