-
Notifications
You must be signed in to change notification settings - Fork 832
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
Implement text props name convention #1773
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/mui-org/material-ui-pickers/1zmba7wng |
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
Regarding #1429, I would propose we close it once we have the counterpart of the localization strings in the mono repository, probably with a working demo in https://material-ui.com/guides/localization/#example. I think that we need to make sure it works, end-to-end. It would also be a great constrain to avoid regressions. What do you think?
Agree, I think that after 5 localization strings for a single component, we should start to wonder. With 10, a There is one aspect I wonder about. How should we handle the strings duplication and fragmentation? Do you have an example of what the change to |
I propose the following strategy:
|
@dmtrKovalenko This plan sounds awesome! |
const onCloseMock = jest.fn(); | ||
const onChangeMock = jest.fn(); | ||
const component = mount( | ||
<MobileDatePicker | ||
renderInput={props => <TextField {...props} />} | ||
autoOk | ||
showTodayButton | ||
cancelLabel="stream" | ||
cancelText="stream" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for providing a string in this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is probably not the best way, but I am testing typescript bindings for props such way.
Probably need to add some special kind of typescript definition tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the purpose is to have a test equivalent to, say, https://github.com/mui-org/material-ui/blob/a75c19f267edfdf71487764961de5c425096f47b/packages/material-ui/src/Typography/typography.spec.tsx?
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
@dmtrKovalenko We have an ongoing thread on the naming convention for these props in mui/material-ui#21018 (comment). |
This PR resolves the first part of #1654 and probably closes #1429
One question as for me. For now, all of our text props are spread through the different components, like
PickersModalDialog
,ArrowSwitcher
, andKeyboardDateInput
. It looks like that will be too awful to localize.Maybe we should add one prop like
texts
with all the text props combined in 1 object? But it is still possible to pass any prop to the justDatePicker
, so support localization only for root components could be a workaround as well