Only use label_singular when one item is rendered in the listControl #1422
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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](https://user-images.githubusercontent.com/5166612/41238484-527c9562-6d96-11e8-8e7e-636abd925753.png)
With 1 author:
![image](https://user-images.githubusercontent.com/5166612/41238516-5fd64cd0-6d96-11e8-9e26-d9fe177c829e.png)
With 0 authors:
![image](https://user-images.githubusercontent.com/5166612/41238654-c188e8a2-6d96-11e8-9e45-81e0fd245bec.png)
- 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](https://user-images.githubusercontent.com/5166612/41238575-893b999a-6d96-11e8-9976-ab0c3c15ef9d.png)