diff --git a/core/modules/field_ui/config/tour.tour.field-ui-display.yml b/core/modules/field_ui/config/tour.tour.field-ui-display.yml new file mode 100644 index 0000000..dfd2370 --- /dev/null +++ b/core/modules/field_ui/config/tour.tour.field-ui-display.yml @@ -0,0 +1,47 @@ +id: field-ui-display +label: Field UI display +module: field_ui +langcode: en +paths: + - admin/structure/types/manage/*/display +tips: + introduction: + id: introduction + plugin: text + label: Manage display + body: Manage how the content type fields are displayed on your site. + weight: "0" + display-modes: + id: display-modes + plugin: text + label: Display modes + body: Display modes allow content to be output in different ways. E.g., Default display shows all fields, but Teaser display shows only one or two. + weight: "1" + location: left + attributes: + data-class: 'tabs-secondary li:first' + label: + id: label + plugin: text + label: Field label + body: Field labels can be positioned above, inline or hidden. + weight: "2" + attributes: + data-class: 'field-label' + format: + id: format + plugin: text + label: Format + body: Formats are used to display field information in different ways, e.g., tags can be displayed in plain text or link form. + weight: "3" + attributes: + data-class: 'field-format' + custom-display-settings: + id: format + plugin: text + label: Custom display settings + body: Extend field display functionality by enabling additional view modes. + weight: "4" + location: "top" + attributes: + data-id: 'edit-modes' diff --git a/core/modules/field_ui/config/tour.tour.field-ui-fields.yml b/core/modules/field_ui/config/tour.tour.field-ui-fields.yml new file mode 100644 index 0000000..a0f8fcb --- /dev/null +++ b/core/modules/field_ui/config/tour.tour.field-ui-fields.yml @@ -0,0 +1,39 @@ +id: field-ui-fields +label: Field UI fields +langcode: en +module: field_ui +paths: + - admin/structure/types/manage/*/fields +tips: + introduction: + id: introduction + plugin: text + label: Manage fields + body: Manage fields that are assigned to a specific content type. You can create new fields, reuse existing fields, and delete fields. + weight: "0" + field-type: + id: field-type + plugin: text + label: Field type + body: The field type is the type of data this field will store, e.g., a list of items. + weight: "1" + attributes: + data-class: 'html #field-overview th.field-type' + operations: + id: operations + plugin: text + label: Operations + body: Use the drop-down button to edit or delete fields. + weight: "3" + location: "left" + attributes: + data-class: 'html #field-overview th.field-operations' + add-new-field: + id: add-new-field + plugin: text + label: Add new field + body: To create a new field, choose the label, type and widget. The label field automatically generates the machine name field. The field type filters the widget dropdown. + weight: "4" + location: "top" + attributes: + data-id: edit-fields-add-new-field-label diff --git a/core/modules/field_ui/config/tour.tour.field-ui-form-display.yml b/core/modules/field_ui/config/tour.tour.field-ui-form-display.yml new file mode 100644 index 0000000..a618307 --- /dev/null +++ b/core/modules/field_ui/config/tour.tour.field-ui-form-display.yml @@ -0,0 +1,21 @@ +id: field-ui-form-display +label: Field UI form display +module: field_ui +langcode: en +paths: + - admin/structure/types/manage/*/form-display +tips: + introduction: + id: introduction + plugin: text + label: Manage form display + body: Manage how the field forms are displayed when editing content by reordering fields or changing the widget settings. + weight: "0" + widget: + id: widget + plugin: text + label: Widget + body: Choose whether to show or hide the widget. For some fields you can change the widget type, e.g., use autocomplete, checkboxes or a select list. + weight: "1" + attributes: + data-class: 'field-widget' diff --git a/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php b/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php index 0d68e77..aeb17f6 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php @@ -151,8 +151,8 @@ protected function getTableHeader() { $this->t('Field'), $this->t('Weight'), $this->t('Parent'), - $this->t('Label'), - array('data' => $this->t('Format'), 'colspan' => 3), + array('data' => $this->t('Label'), 'class' => 'field-label'), + array('data' => $this->t('Format'), 'colspan' => 3, 'class' => 'field-format'), ); } diff --git a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php index ec5a4c0..c39fbae 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php @@ -106,8 +106,8 @@ public function buildForm(array $form, array &$form_state, $entity_type = NULL, '#header' => array( $this->t('Label'), $this->t('Machine name'), - $this->t('Field type'), - $this->t('Operations'), + array('data' => $this->t('Field type'), 'class' => 'field-type'), + array('data' => $this->t('Operations'), 'class' => 'field-operations'), ), '#regions' => $this->getRegions(), '#attributes' => array( diff --git a/core/modules/field_ui/lib/Drupal/field_ui/FormDisplayOverview.php b/core/modules/field_ui/lib/Drupal/field_ui/FormDisplayOverview.php index a1e8d8b..fb3d591 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/FormDisplayOverview.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/FormDisplayOverview.php @@ -118,7 +118,7 @@ protected function getTableHeader() { $this->t('Field'), $this->t('Weight'), $this->t('Parent'), - array('data' => $this->t('Widget'), 'colspan' => 3), + array('data' => $this->t('Widget'), 'colspan' => 3, 'class' => 'field-widget'), ); } diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUITourTest.php b/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUITourTest.php new file mode 100644 index 0000000..a5fb963 --- /dev/null +++ b/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUITourTest.php @@ -0,0 +1,97 @@ + 'Field UI tour tests', + 'description' => 'Tests the Field UI tour.', + 'group' => 'Tour', + ); + } + + protected function setUp() { + parent::setUp(); + // Create test user. + $admin_user = $this->drupalCreateUser(array( + 'access content', + 'administer content types', + 'administer node fields', + 'administer node form display', + 'administer node display', + 'administer users', + 'administer user display', + 'bypass node access', + 'access tour', + )); + $this->drupalLogin($admin_user); + + // Create content type, with underscores. + $type_name = strtolower($this->randomName(8)) . '_test'; + $this->drupalCreateContentType(array('name' => $type_name, 'type' => $type_name)); + + $machine_name = 'field_' . drupal_strtolower($this->randomName()); + // Create a field instance so we can check the add existing field tip. + $field = entity_create('field_entity', array( + 'name' => $machine_name, + 'entity_type' => 'node', + 'type' => 'text', + 'settings' => array( + 'max_length' => '255', + ), + )); + $field->save(); + + entity_create('field_instance', array( + 'field_name' => $machine_name, + 'entity_type' => 'node', + 'label' => $this->randomString(), + 'bundle' => $type_name, + ))->save(); + + // Create a second content type. + $type_name = strtolower($this->randomName(8)) . '_test'; + $type = $this->drupalCreateContentType(array('name' => $type_name, 'type' => $type_name)); + $this->typeName = $type->type; + } + + /** + * Tests field_ui tour tip availability. + */ + public function testFieldUiTourTips() { + $this->drupalGet('/admin/structure/types/manage/' . $this->typeName . '/fields'); + $this->assertTourTips(); + } +} diff --git a/core/modules/filter/tests/filter_test/lib/Drupal/filter_test/Plugin/Filter/FilterTestReplace.php b/core/modules/filter/tests/filter_test/lib/Drupal/filter_test/Plugin/Filter/FilterTestReplace.php index ab1f07f..df208e2 100644 --- a/core/modules/filter/tests/filter_test/lib/Drupal/filter_test/Plugin/Filter/FilterTestReplace.php +++ b/core/modules/filter/tests/filter_test/lib/Drupal/filter_test/Plugin/Filter/FilterTestReplace.php @@ -29,7 +29,7 @@ class FilterTestReplace extends FilterBase { */ public function process($text, $langcode, $cache, $cache_id) { $text = array(); - $text[] = 'Filter: ' . $this->getLabel() . ' (' . $this->getPluginId() . ')'; + $text[] = 'Filter: ' . $this->getLabel() . ' (' . $this->getPluginID() . ')'; $text[] = 'Language: ' . $langcode; $text[] = 'Cache: ' . ($cache ? 'Enabled' : 'Disabled'); if ($cache_id) { diff --git a/core/modules/tour/css/tour.module.css b/core/modules/tour/css/tour.module.css index afb0afd..42e8c34 100644 --- a/core/modules/tour/css/tour.module.css +++ b/core/modules/tour/css/tour.module.css @@ -44,3 +44,7 @@ .toolbar .tour-toolbar-tab.toolbar-tab.hidden { display: none; } + +.joyride-tip-guide ul { + margin: 0; +}