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

[RFR] Migrate ra-ui-materialui to TypeScript (Part 2: fields) #3091

Merged
merged 16 commits into from
Apr 19, 2019

Conversation

Kmaschta
Copy link
Contributor

@Kmaschta Kmaschta commented Apr 3, 2019

Wish me luck.

TODO

  • Migrate fields components to TS
  • Use Identifier instead of string everywhere an id is used
  • Use the withTranslate from Gildas' PR

@Kmaschta Kmaschta changed the base branch from master to next April 3, 2019 14:45
@Kmaschta Kmaschta force-pushed the ra-mui-field-typescript branch 3 times, most recently from cab2191 to c8f44bd Compare April 11, 2019 18:25
@djhi djhi changed the base branch from next to master April 17, 2019 09:30
@djhi djhi changed the base branch from master to next April 17, 2019 09:32
@djhi djhi changed the base branch from next to master April 17, 2019 09:33
@djhi djhi changed the title [WIP] Migrate ra-ui-materialui to TypeScript (Part 2: fields) [RFR] Migrate ra-ui-materialui to TypeScript (Part 2: fields) Apr 17, 2019
@djhi djhi changed the title [RFR] Migrate ra-ui-materialui to TypeScript (Part 2: fields) [WIP] Migrate ra-ui-materialui to TypeScript (Part 2: fields) Apr 17, 2019
}

// Props injected by react-admin
export interface InjectedFieldProps {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be exported by ra-core

@djhi
Copy link
Contributor

djhi commented Apr 17, 2019

I'm going to revert the changes on all the Reference fields components. I believe they should leverage types declared but not yet exported from ra-core.

@djhi djhi changed the title [WIP] Migrate ra-ui-materialui to TypeScript (Part 2: fields) [RFR] Migrate ra-ui-materialui to TypeScript (Part 2: fields) Apr 17, 2019
@@ -12,7 +12,7 @@ describe('<SimpleShowLayout />', () => {
<TextField source="bar" />
</SimpleShowLayout>
);
const inputs = wrapper.find('pure(TextField)');
const inputs = wrapper.find('EnhancedTextField');
Copy link
Contributor

@djhi djhi Apr 17, 2019

Choose a reason for hiding this comment

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

By setting the displayName on the EnhancedTextField, we can avoid testing implementation details (decoration by the pure HOC) here

@Kmaschta
Copy link
Contributor Author

Kmaschta commented Apr 18, 2019

There are still some Component.propTypes in this PR, are they still needed?
Thanks for the helping hand btw ❤️

EDIT: Ok, my bad!

@djhi
Copy link
Contributor

djhi commented Apr 18, 2019

Actually I added them back. Yes they are necessary for run time check for people not using TS

@fzaninotto
Copy link
Member

needs rebase following changes on BooleanFields

@fzaninotto fzaninotto merged commit 93bc43f into master Apr 19, 2019
@fzaninotto fzaninotto deleted the ra-mui-field-typescript branch April 19, 2019 09:03
@fzaninotto fzaninotto added this to the 2.8.6 milestone Apr 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants