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

Only use label_singular when one item is rendered in the listControl #1422

Merged

Conversation

robertkarlsson
Copy link

@robertkarlsson robertkarlsson commented Jun 11, 2018

Fixes #1397.
Check the size of the item list and set the listLabel based on that.
If no label_singular is set, fall back to the normal label

- Summary

The list control always used the singular name as label if one is specified, even when the list contains 0 or > 1 items. It's now based on the amount of items thats provided.

- Test plan
Tested with the existing authors settings in the example CMS.

With 2 authors:
image

With 1 author:
image

With 0 authors:
image

- Description for the changelog
Base the listLabel on the size of the list provided.

- A picture of a cute animal (not mandatory but encouraged)
image

Fixes decaporg#1397.
Check the size of the item list and set the listlabel based on that.
If no label_singular is set, fall back to the normal label
@verythorough
Copy link
Contributor

Deploy preview for netlify-cms-www ready!

Built with commit aea97b2

https://deploy-preview-1422--netlify-cms-www.netlify.com

@verythorough
Copy link
Contributor

Deploy preview for cms-demo ready!

Built with commit aea97b2

https://deploy-preview-1422--cms-demo.netlify.com

Copy link
Contributor

@erquhart erquhart left a comment

Choose a reason for hiding this comment

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

Thanks!

@erquhart erquhart merged commit f365955 into decaporg:master Jun 12, 2018
erquhart pushed a commit to erquhart/netlify-cms that referenced this pull request Jun 12, 2018
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