Verified Commit e22a8d84 authored by Dave Long's avatar Dave Long
Browse files

task: #3370326 Refine labels and descriptions for field types

By: rkoller
By: benjifisher
By: dww
By: emma horrell
By: lauriii
By: berdir
By: marcoscano
By: tstoeckler
By: ifrik
By: joachim
By: yoroy
By: arpitr
By: asherry
By: bernardm28
By: dydave
By: h2cm
By: mr_scumbag
By: philipnorton42
By: drubb
By: franz-m
By: jurgenhaas
By: martin mayer
By: cedewey
By: jannafiester
By: joannajackson
By: simohell
By: matthews
By: treevis
By: timurtripp
(cherry picked from commit 73f1c59d)
parent 7a1b1f74
Loading
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
plain_text:
  label: 'Plain text'
  description: 'Text field that does not support markup.'
  description: 'Text without markup and formatting'
  weight: -50
number:
  label: 'Number'
  description: 'Field to store number. I.e. id, price, or quantity.'
  description: 'Numeric value like quantity or radio frequency'
  weight: -40
reference:
  label: 'Reference'
  description: 'Field to reference other content.'
  description: 'Reference other content'
  weight: -30
date_time:
  label: 'Date and time'
  description: 'Field to store date and time values.'
  description: 'A date and/or time value'
  summary: 'The field types use different formats to store date and time in the database. All field types can be displayed in various ways.'
  weight: -10
general:
  label: 'General'
+7 −0
Original line number Diff line number Diff line
@@ -25,6 +25,13 @@ public function getDescription(): string|\Stringable {
    return $this->pluginDefinition['description'];
  }

  /**
   * {@inheritdoc}
   */
  public function getSummary(): string|\Stringable {
    return $this->pluginDefinition['summary'];
  }

  /**
   * {@inheritdoc}
   */
+8 −0
Original line number Diff line number Diff line
@@ -23,6 +23,14 @@ public function getLabel(): string|\Stringable;
   */
  public function getDescription(): string|\Stringable;

  /**
   * Returns the field group summary.
   *
   * @return string|\Stringable
   *   The category summary.
   */
  public function getSummary(): string|\Stringable;

  /**
   * Returns the field group weight.
   *
+4 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
 *   CATEGORY_NAME:
 *     label: STRING
 *     description: STRING
 *     summary: STRING (optional)
 *     weight: INTEGER
 *     libraries:
 *       - STRING
@@ -44,6 +45,7 @@ class FieldTypeCategoryManager extends DefaultPluginManager implements FieldType
  protected $defaults = [
    'label' => '',
    'description' => '',
    'summary' => '',
    'weight' => 0,
    'class' => FieldTypeCategory::class,
  ];
@@ -74,7 +76,8 @@ protected function getDiscovery(): YamlDiscovery {
      $this->discovery = new YamlDiscovery('field_type_categories', $directories);
      $this->discovery
        ->addTranslatableProperty('label')
        ->addTranslatableProperty('description');
        ->addTranslatableProperty('description')
        ->addTranslatableProperty('summary');
    }
    return $this->discovery;
  }
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
#[FieldType(
  id: "boolean",
  label: new TranslatableMarkup("Boolean"),
  description: new TranslatableMarkup("Field to store a true or false value."),
  description: new TranslatableMarkup("True or false value"),
  default_widget: "boolean_checkbox",
  default_formatter: "boolean",
)]
Loading