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] Add link function to ReferenceField #3282

Merged
merged 6 commits into from Jun 13, 2019

Conversation

fargito
Copy link
Contributor

@fargito fargito commented May 28, 2019

Fixes #2288

  • enable linkType function for ReferenceField
  • update docs

PR to next as it is a new feature

Copy link
Contributor

@djhi djhi left a comment

Choose a reason for hiding this comment

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

Great 👍 However, I think linkType isn't a good name anymore. Maybe you should rename it to redirectTo. @fzaninotto ?

@djhi djhi added this to the 3.0.0 milestone Jun 1, 2019
Copy link
Member

@fzaninotto fzaninotto left a comment

Choose a reason for hiding this comment

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

I agree that linkType makes less sense if it also accepts a function. link is better. But can you make it backwards compatible, e.g. by using either link or linkType, and by logging a deprecation warning if the latter is used?

packages/ra-core/src/controller/field/useReference.ts Outdated Show resolved Hide resolved
docs/Fields.md Outdated Show resolved Hide resolved
packages/ra-core/src/controller/field/useReference.ts Outdated Show resolved Hide resolved
docs/Fields.md Outdated Show resolved Hide resolved
docs/Fields.md Outdated Show resolved Hide resolved
packages/ra-core/src/controller/field/useReference.ts Outdated Show resolved Hide resolved
packages/ra-core/src/controller/field/useReference.ts Outdated Show resolved Hide resolved
packages/ra-core/src/controller/field/useReference.ts Outdated Show resolved Hide resolved
packages/ra-core/src/controller/field/useReference.ts Outdated Show resolved Hide resolved
packages/ra-core/src/controller/field/useReference.ts Outdated Show resolved Hide resolved
packages/ra-ui-materialui/src/field/ReferenceField.js Outdated Show resolved Hide resolved
@fargito
Copy link
Contributor Author

fargito commented Jun 5, 2019

I need to change the tests as well, do you want me to test the backward compatibility ?

@fargito fargito changed the title [RFR] Add linktype function to ReferenceField [RFR] Add link function to ReferenceField Jun 7, 2019
@fargito
Copy link
Contributor Author

fargito commented Jun 12, 2019

@fzaninotto did you have time to review this ;) ?

@fzaninotto fzaninotto merged commit 10564c0 into marmelab:next Jun 13, 2019
@fzaninotto
Copy link
Member

Thanks!

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