Part of #1921152: META: Start providing tour tips for other core modules.

Problem/Motivation

Write tour integration for custom_block.module

Proposed resolution

Create tour yml files for required admin screens in custom_block.

Remaining tasks

Review custom_block_menu() and decide on screens that require tour integration
Write tour integration

User interface changes

New tours

API changes

None

Technical pointers when creating tour tips

See: https://drupal.org/node/1921152#tour-tips-tech-note for tech notes on making tour tips.

Files: 
CommentFileSizeAuthor
#39 drupal-block_content_tour-1926294-39.patch5.92 KBAntti J. Salminen
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 72,737 pass(es), 1 fail(s), and 0 exception(s). View
#36 interdiff.txt4.33 KBXano
#36 drupal_1926294_36.patch6 KBXano
FAILED: [[SimpleTest]]: [MySQL] 64,609 pass(es), 1 fail(s), and 0 exception(s). View
#15 drupal8.block-module.1926294-15.patch1.46 KBclemens.tolboom
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch drupal8.block-module.1926294-15.patch. Unable to apply patch. See the log in the details link for more information. View
#8 custom_block_tour_test-1926294-7.patch2.22 KBrcaracaus
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch custom_block_tour_test-1926294-7_0.patch. Unable to apply patch. See the log in the details link for more information. View
#7 custom_block_tour_test-1926294-7.patch2.25 KBrcaracaus
FAILED: [[SimpleTest]]: [MySQL] 58,146 pass(es), 1 fail(s), and 0 exception(s). View
#5 block_tour-1926294-4.patch3.7 KBbenjy
PASSED: [[SimpleTest]]: [MySQL] 57,918 pass(es). View
#4 block_tour-1926294-4.patch0 bytesbenjy
PASSED: [[SimpleTest]]: [MySQL] 57,670 pass(es). View
#2 block_tour-1926294-2.patch3.7 KBpmackay
None View

Comments

pmackay’s picture

I'm looking at this in Portland sprint.

pmackay’s picture

FileSize
3.7 KB
None View

Here's an initial stab at creating some tour definitions for block and custom_block:

pmackay’s picture

Status: Active » Needs review
pmackay’s picture

Issue summary: View changes

Updated issue summary.

benjy’s picture

FileSize
0 bytes
PASSED: [[SimpleTest]]: [MySQL] 57,670 pass(es). View

Re-uploading because the test bot failed.

benjy’s picture

FileSize
3.7 KB
PASSED: [[SimpleTest]]: [MySQL] 57,918 pass(es). View

Would help if I uploaded the right file.

larowlan’s picture

Status: Needs review » Postponed
Issue tags: +Needs tests
@@ -0,0 +1,44 @@
+id: block
+module: ''
+label: Block
+status: '1'
+langcode: en
+paths:
+  - admin/structure/block
+tips:
+  choose-the-theme:
+    id: choose-the-theme
+    plugin: text
+    label: 'Choose the theme'
+    weight: '-10'
+    attributes:
+      data-class: primary
+    body: 'Block placement is specific to a theme. Choose the theme in which to edit the block configuration.'
+    location: left
+  demonstration:
+    id: demonstration
+    plugin: text
+    label: Demonstration
+    weight: '-9'
+    attributes:
+      data-id: block-help
+    body: '''Demonstrate block regions'' will show highlighted block regions and the current blocks positioned in those regions. It is useful to see where a new block can be added.'
+    location: bottom

Wrong issue?

Needs tests, so postponed until #2028535: Provide a TourTestBase class for use by core and contrib modules is in (please help review that).

rcaracaus’s picture

FileSize
2.25 KB
FAILED: [[SimpleTest]]: [MySQL] 58,146 pass(es), 1 fail(s), and 0 exception(s). View

I ended up having to test this thing about 20 times, added bunch of combinations of different permissions and modules, I had to enable 'seven' theme as default in the TestBasic class, and had to set/place the the help block.

rcaracaus’s picture

FileSize
2.22 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch custom_block_tour_test-1926294-7_0.patch. Unable to apply patch. See the log in the details link for more information. View

Pretty sure my last one was missing new line.

nick_schuch’s picture

Status: Postponed » Needs review

Status: Needs review » Needs work
Issue tags: -Needs tests, -#d8ux, -Tour

The last submitted patch, custom_block_tour_test-1926294-7.patch, failed testing.

larowlan’s picture

Status: Needs work » Needs review
Issue tags: +Needs tests, +#d8ux, +Tour
larowlan’s picture

Issue tags: +Needs reroll

In light of #2078635: Add an 'Add custom block type' local action to the 'Custom block library' this is fairly important, but will need a re-roll as everything has moved around.

Status: Needs review » Needs work

The last submitted patch, custom_block_tour_test-1926294-7.patch, failed testing.

clemens.tolboom’s picture

Checking for the path used by custom block

$ grep path core/modules/block/custom_block/custom_block.routing.yml

sorted by block and block type

path: '/admin/structure/block/custom-blocks'
path: '/block/add'
path: block/add/{custom_block_type}
path: '/block/{custom_block}'
path: '/block/{custom_block}/delete'

path: '/admin/structure/block/custom-blocks/types'
path: '/admin/structure/block/custom-blocks/manage/{custom_block_type}/delete'
path: '/admin/structure/block/custom-blocks/manage/{custom_block_type}'
path: '/admin/structure/block/custom-blocks/types/add'

    Patch #5 covers

  1. +++ b/core/modules/block/config/tour.tour.block.yml
    @@ -0,0 +1,44 @@
    +  - admin/structure/block
    

    Basic path

  2. +++ b/core/modules/block/custom_block/config/tour.tour.custom-block-edit.yml
    @@ -0,0 +1,26 @@
    +  - 'admin/structure/custom-blocks/manage/*/edit'
    

    Custom block edit. This patch is replaced by block/*

  3. +++ b/core/modules/block/custom_block/config/tour.tour.custom-blocks-list.yml
    @@ -0,0 +1,26 @@
    +  - admin/structure/custom-blocks
    

    List is moved to admin/structure/block/custom-blocks

clemens.tolboom’s picture

FileSize
1.46 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch drupal8.block-module.1926294-15.patch. Unable to apply patch. See the log in the details link for more information. View
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/TourCustomBlockTest.php
@@ -0,0 +1,45 @@
+class TourCustomBlockTest extends TourTestBasic {

I'm not sure I understand this tests.

For testing tours do we have to create content? That feels weird.

The custom block module should have code for testing creating custom blocks.

I guess our TourTestBasic missed some feature or the test should merge into a testcase of Custom Block itself.

For now I add only a fix for #5

No need for testing this patch now.

clemens.tolboom’s picture

FileSize
3.5 KB
PASSED: [[SimpleTest]]: [MySQL] 58,930 pass(es). View

And now the complete fix patch from #5 ... consider #15 as the interdiff :p

clemens.tolboom’s picture

Assigned: larowlan » clemens.tolboom

Darn .. my bad. I try to move around the texts now.

  1. +++ b/core/modules/block/custom_block/config/tour.tour.custom-block-edit.yml
    @@ -0,0 +1,26 @@
    +  editing-the-block:
    +    id: editing-the-block
    +    plugin: text
    +    label: 'Editing the block'
    +    weight: '-9'
    +    attributes:
    +      data-class: primary
    +    body: 'Select the tabs to edit the custom block fields, how they are displayed or to delete the custom block. '
    +    location: left
    

    This is not applicable on the path block/* anymore.

    Belong to path ...

  2. +++ b/core/modules/block/custom_block/config/tour.tour.custom-blocks-list.yml
    @@ -0,0 +1,26 @@
    +  - 'block/*'
    

    Wrong path ... this belong to 2 different pages.

clemens.tolboom’s picture

FileSize
4.3 KB
PASSED: [[SimpleTest]]: [MySQL] 59,227 pass(es). View

I've fixed mentioned issues from #17.

I don't think we need a tour for block/* as that is a simple edit page right?

Tomorrow I start working on #15 aka tests. I wrote part of the TourTestBase and it does not seem to fit it's job :-/

nick_schuch’s picture

clemens.tolboom,

The TourTestBase was a complete rewrite as per our discussion. Can you please provide feedback to this issue as to how it does not fit?

nick_schuch’s picture

As block_ui is still be worked on I do not recommend working on this issue until that is done.

clemens.tolboom’s picture

FileSize
5.84 KB
FAILED: [[SimpleTest]]: [MySQL] 59,160 pass(es), 1 fail(s), and 0 exception(s). View

I've merged the test from #8 without the patch on TourTestBase together with #18 to run into #2098325: Tour UI converts tip plugin from 'text' to 'text_extended'

Uninstalling Tour UI did not help removing bad tours provided by Tour UI or Tour Builder. That's another Core issue.

The tour in #8 test the block tour so I changed the code to reflect this.

@rcaracaus nicely added the help block but it is not activate. Error "Found corresponding page element for tour tip with id #block-help" I do not understand.

clemens.tolboom’s picture

  1. +++ b/core/modules/block/lib/Drupal/block/Tests/TourBlockTest.php
    @@ -0,0 +1,54 @@
    +    //'/admin/structure/block/seven' => array(),
    

    This path cannot be tested somehow. Does this has to do with

  2. +++ b/core/modules/block/lib/Drupal/block/Tests/TourBlockTest.php
    @@ -0,0 +1,54 @@
    +      array(
    +        'plugin_id' => 'system_help_block',
    +        'settings' => array('region' => 'help', 'machine_name' => 'help'),
    +        'weight' => '0',
    +      ),
    +    );
    +    foreach ($this->testBlocks as $values) {
    +      $this->drupalPlaceBlock($values['plugin_id'], $values['settings']);
    

    This does not enable the help block somehow.

  3. +++ b/core/modules/tour/lib/Drupal/tour/Tests/TourTestBasic.php
    @@ -48,6 +48,12 @@
    +    // Enable the admin theme.
    +    theme_enable(array('seven')); ¶
    +    \Drupal::config('system.theme')->set('admin', 'seven')->save();
    +    \Drupal::config('system.theme')->set('default', 'seven')->save();
    +    ¶
    

    This block is regarding #15 as I don't think our TourTestBasic should enable themes. That's up to the custom tests I guess in this case TourBlockTest as it wants to test theme seven.

larowlan’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
Issue tags: -Needs tests, -#d8ux, -Needs reroll, -Tour

The last submitted patch, drupal8.block-module.1926294-21.patch, failed testing.

Xano’s picture

Status: Needs work » Needs review
Issue tags: +Needs tests, +#d8ux, +Needs reroll, +Tour
clemens.tolboom’s picture

Assigned: clemens.tolboom » Unassigned

As @nick_schuch mentioned in #20 I wait for better times :

Xano’s picture

Issue tags: -Needs reroll

The last submitted patch, drupal8.block-module.1926294-21.patch, failed testing.

Anonymous’s picture

Issue summary: View changes

Updated issue summary.

kim.pepper’s picture

jaskho’s picture

Assigned: Unassigned » jaskho
larowlan’s picture

benjy’s picture

Status: Needs work » Needs review
FileSize
5.88 KB
FAILED: [[SimpleTest]]: [MySQL] 64,569 pass(es), 35 fail(s), and 1 exception(s). View
1.61 KB

I simply re-rolled this to use routes because I wanted to have a play with tours after DrupalSouth. They're pretty neat!

On a side note, I read in the docs about route_params but would have been good if there was an example. https://drupal.org/developing/api/tour

Status: Needs review » Needs work

The last submitted patch, 32: 1926294_32.patch, failed testing.

Xano’s picture

Status: Needs work » Needs review
FileSize
5.88 KB
FAILED: [[SimpleTest]]: [MySQL] 64,537 pass(es), 33 fail(s), and 0 exception(s). View
2.09 KB

I cleaned up the test, which was a mess to look at.

Most test failures were random, although there is one in the newly added test that I am getting locally as well and can't wrap my head around: \Drupal\tour\Tests\TourTestBase::assertTourTips() finds a rout with HTML ID block-help on the page using XPath, but later, when checking with PHPUnit, it can no longer find anything with that class, which causes the single test failure.

Status: Needs review » Needs work

The last submitted patch, 34: drupal_1926294_34.patch, failed testing.

Xano’s picture

Status: Needs work » Needs review
FileSize
6 KB
FAILED: [[SimpleTest]]: [MySQL] 64,609 pass(es), 1 fail(s), and 0 exception(s). View
4.33 KB

Fixed the config schema failures.

Status: Needs review » Needs work

The last submitted patch, 36: drupal_1926294_36.patch, failed testing.

tim.plunkett’s picture

Component: block.module » custom_block.module
Antti J. Salminen’s picture

Title: Write tour integration for custom_block.module » Write tour integration for block_content.module
Assigned: jaskho » Unassigned
Status: Needs work » Needs review
FileSize
5.92 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 72,737 pass(es), 1 fail(s), and 0 exception(s). View

Only setting to needs review for tests. Reroll for block_content rename, PSR-4, move to config/install. Also fixed the long-standing problem with the help block test (block needed to be added for the admin theme).

As the block classes are being changed per #1896098: Add a plugin class to the blocks to identify instances in css and the current block id (block-$themename-help) requires a complicated selector, I didn't add it so it still doesn't pass though.

Didn't touch the strings in the UI because those haven't changed in block_content either at this time.

Status: Needs review » Needs work

The last submitted patch, 39: drupal-block_content_tour-1926294-39.patch, failed testing.

alexpott’s picture

Component: custom_block.module » block_content.module

Moving to correct component.

webchick’s picture

Status: Needs work » Postponed

This one seems like a good thing to do, but postponed on #1921152-109: META: Start providing tour tips for other core modules. for now.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.