Problem/Motivation
\Drupal::service('typed_data_manager')->createDataDefinition('entity:user')->getLabel();
helpfully returns the the label of the entity type, in this case user.
\Drupal::service('typed_data_manager')->createDataDefinition('field_item:string')->getLabel();
returns nothing.
It would be helpful if this returned the label of the field type. This can be used when working with configurable contexts to show what type of data a context is.
Steps to reproduce
Run \Drupal::service('typed_data_manager')->createDataDefinition('field_item:string')->getLabel();
get nothing returned
Proposed resolution
Add a getLabel() method to FieldItemDataDefinition that returns the label of the field type plugin.
Remaining tasks
Change record
User interface changes
NA
API changes
core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php has a new method getLabel().
Data model changes
NA
Release notes snippet
NA