Skip to content

Add human readable name#759

Merged
jmolivas merged 4 commits intohechoendrupal:masterfrom
Sutharsan:issue-743-human-readable-name
Jul 31, 2015
Merged

Add human readable name#759
jmolivas merged 4 commits intohechoendrupal:masterfrom
Sutharsan:issue-743-human-readable-name

Conversation

@Sutharsan
Copy link
Copy Markdown
Contributor

This PR adds a human readable name (--label) to content entity and config entity generators.
Adds a human readable formatter StringUtils::camelCaseToHuman.
Applies the HR label format to plugins.

Affected commands:

generate:entity:config
generate:entity:content
generate:plugin:block
generate:plugin:field
generate:plugin:fieldformatter
generate:plugin:fieldtype
generate:plugin:fieldwidget
generate:plugin:imageeffect
generate:plugin:rest:resource
generate:plugin:rulesaction
generate:plugin:type:annotation

* upstream/master:
  Sync guzzle ver with core
  Fix comment style.
  Set default widget and formatter.
  Add command generate:plugin:field
  Fixes after testing.
  Add console strings.
  Add generator commands.
  Add plugin generators.
  Add field plugin templates.
  Code style.
  Add service definition for plugin manager.
  Add generator for custom plugin type with annotation discovery.
Add StringUtils::camelCaseToHuman.
Add label to entities.
@jmolivas jmolivas modified the milestone: 0.8.0-release Jul 23, 2015
jmolivas added a commit that referenced this pull request Jul 31, 2015
@jmolivas jmolivas merged commit eccafd3 into hechoendrupal:master Jul 31, 2015
@jmolivas
Copy link
Copy Markdown
Member

Thanks for the PR @Sutharsan

@pfrenssen
Copy link
Copy Markdown
Contributor

This now looks a bit weird in the permissions department. If I create a "Book" entity type the permission titles now read:

  • View book
  • Edit book
  • Delete book
  • Adminster book

Because this is singular this is confusing. Which book am I allowed to edit? What if I want to give a role the permission to edit all books?

It would be better if we follow the pattern used for all permissions in core: display the plural form. Since we do not know how our entity is spelled in plural we can simply add the word "entities":

  • View book entities
  • Edit book entities
  • Delete book entities
  • Adminster book entities

In the future it might be interesting to ask the user for the plural form when generating entities, we might be able to use it elsewhere too. But for now this would do the trick.

When we are touching this it would also be good to fix the spelling errors (e.g. "adminster") and remove the descriptions, since they are not adding any additional information and have bad grammar.

I'll open a new PR for this.

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