Skip to content

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

Merged
fzaninotto merged 16 commits into
masterfrom
ra-mui-field-typescript
Apr 19, 2019
Merged

fzaninotto merged 16 commits into
masterfrom
ra-mui-field-typescript

Conversation

@Kmaschta

@Kmaschta Kmaschta commented Apr 3, 2019 •

Copy link
Copy Markdown
Contributor

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
Comment thread packages/ra-ui-materialui/src/field/BooleanField.tsx
@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 force-pushed the ra-mui-field-typescript branch from c8f44bd to 6a5cff8 Compare 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
Copy Markdown
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

djhi commented Apr 17, 2019

Copy link
Copy Markdown
Contributor

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 force-pushed the ra-mui-field-typescript branch from 0d083ad to d4d6c07 Compare April 17, 2019 16:14
@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
</SimpleShowLayout>
);
const inputs = wrapper.find('pure(TextField)');
const inputs = wrapper.find('EnhancedTextField');

@djhi djhi Apr 17, 2019 •

Copy link
Copy Markdown
Contributor

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

Kmaschta commented Apr 18, 2019 •

Copy link
Copy Markdown
Contributor Author

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

EDIT: Ok, my bad!

@djhi

djhi commented Apr 18, 2019

Copy link
Copy Markdown
Contributor

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

@fzaninotto

Copy link
Copy Markdown
Member

needs rebase following changes on BooleanFields

@djhi
djhi force-pushed the ra-mui-field-typescript branch from 599053e to 2aa80ea Compare April 18, 2019 16:19
@djhi
djhi force-pushed the ra-mui-field-typescript branch from 2aa80ea to 4c0776d Compare April 19, 2019 07:09
@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.

3 participants