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

add embedded_list formatter #1210

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JacerOmri
Copy link

Add basic formatter for embedded_list fields
It would map the array items to the value of the first target field configured

remyburel pushed a commit to remyburel/ng-admin that referenced this pull request Oct 28, 2016
Copy link
Contributor

@jpetitcolas jpetitcolas left a comment

Choose a reason for hiding this comment

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

Thanks! I got a comment about your code. Moreover, can you add some unit tests? :)

return function (entry) {
return {
name: label,
value: entry.values[field.name()].map((obj => obj[field.targetFields()[0].name()]))
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps would it be more coherent to use the same value as for the reference_many?

value: entry.listValues[field.name()].join(', ')

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.

2 participants