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

label_singular somehow overrides the default "plural" label #1397

Closed
papandreou opened this issue May 31, 2018 · 0 comments
Closed

label_singular somehow overrides the default "plural" label #1397

papandreou opened this issue May 31, 2018 · 0 comments

Comments

@papandreou
Copy link
Contributor

- Do you want to request a feature or report a bug?

bug

- What is the current behavior?

When a field using the list widget has a label_singular defined, the regular label is not displayed when the list has 0 or 2+ items.

screen shot 2018-05-31 at 16 54 41
screen shot 2018-05-31 at 16 54 50
screen shot 2018-05-31 at 16 54 59

- If the current behavior is a bug, please provide the steps to reproduce.

  1. Create a new item in the collection
  2. Observe that it says "0 foobar"
  3. Add a "Foobar" by clicking the Add foobar + button
  4. Observe that it says "1 foobar"
  5. Add another one
  6. Observe that it says "2 foobar"

- What is the expected behavior?

That the label_singular is used only when there is exactly one item, so that it would say "0 foobars" and "2 foobars".

- Please mention your versions where applicable.

Netlify CMS version: 1.8.4
Browser version: Chrome 66.0.3359.181/OSX

- Please link or paste your config.yml below if applicable.

collections:
  -
    name: mycollection
    label: My collection
    folder: thefolder
    slug: "{{id}}"
    create: true
    fields:
      -
        name: 'foobars'
        label: 'Foobars'
        label_singular: 'Foobar'
        widget: 'list'
        fields:
          -
            name: 'foobar'
            label: 'Foobar'
            widget: 'string'
robertkarlsson pushed a commit to robertkarlsson/netlify-cms that referenced this issue Jun 11, 2018
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants