Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Part of #1921152: META: Start providing tour tips for other core modules.
Problem/Motivation
Write tour integration for Dblog admin page
Proposed resolution
Create tour yml files for admin screen in admin/reports/dblog.
Remaining tasks
Provide patch of tour integration for dblog page
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.
Comment | File | Size | Author |
---|---|---|---|
#49 | interdiff_44-49.txt | 2.86 KB | ranjith_kumar_k_u |
#49 | 2040833-49.patch | 5.69 KB | ranjith_kumar_k_u |
#44 | interdiff_43-44.txt | 6.98 KB | ridhimaabrol24 |
#44 | 2040833-44.patch | 7 KB | ridhimaabrol24 |
#43 | interdiff_42-43.txt | 477 bytes | ridhimaabrol24 |
Comments
Comment #1
nick_schuch CreditAttribution: nick_schuch commentedTour needs tests since we now have #2028535
Comment #2
lisarex CreditAttribution: lisarex commentedGoing to unassign myself since I don't know how much time I'll have to get back into this, but I will try to make it happen!
Comment #3
tim-e CreditAttribution: tim-e commentedComment #4
tim-e CreditAttribution: tim-e commentedComment #5
tim-e CreditAttribution: tim-e commentedInitial run at the tour. Im uploading this patch as Im not sure if I will have time tonight to finish the tests.
Note: I grabbed the help text from the module help but this may need to be reviewed.
Also I was having an issue being able to target the table with id admin-dblog. Whenever I used it with data-id it just wouldnt work.
Comment #6
tim-e CreditAttribution: tim-e commentedInitial run at the tour. Im uploading this patch as Im not sure if I will have time tonight to finish the tests.
Note: I grabbed the help text from the module help but this may need to be reviewed.
Also I was having an issue being able to target the table with id admin-dblog. Whenever I used it with data-id it just wouldnt work.
Comment #7
nielsonm CreditAttribution: nielsonm commentedAdded another attempt at a dblog tour.
Comment #8
nielsonm CreditAttribution: nielsonm commentedComment #9
nick_schuch CreditAttribution: nick_schuch commentedWe still need some test coverage before moving to needs review. I don't mind writing the tests.
Comment #10
nick_schuch CreditAttribution: nick_schuch commentedThis patch:
- Adds test coverage.
- Updates path to route.
Comment #11
batigolixHurray! I managed to write a tour (a year has passed since my first attempt ;)
Sorry that I could not create a patch, but the patch from #10 did not apply on my out-of-date D8 version. So that is why I attach just the tour itself.
I completely re-wrote the tour from #10 based on hook_help for the dblog module & info on d.o and other stuff scraped from the internets.
Changed
to
in order to get the tour working in my D8 site, but I know I shouldnt do that in a real patch
I would like to have this reviewed and use the feedback to improve the guide lines at https://drupal.org/developing/api/tour & https://drupal.org/node/2040099 so that it will become easier to write and review other tours.
What I would like to find out are things are:
- whether to start with an About and a More information
- wording of tip label
- does it makes sense to explain stock items like pagers
- use of links
- use of html in tip body
- standard for tip ID naming
- how to refer to page elements (e.g. say "click this button" or "click the Submit button")
- if it is okay to target variable information in a page like e.g. data-class: 'admin-dblog tr:first-child td:nth-child(1)'
Fire at will, and let's collect feedback so that it will become easier to write and review tours.
p.s. Could someone provide me the link for the issue for multi page tours?
Comment #12
nick_schuch CreditAttribution: nick_schuch commentedHi batigolix!
Here is the link to the multipage https://drupal.org/node/1942576.
- whether to start with an About and a More information
I think that is a good idea. Or maybe we can split it up into 2 tips. The first being the "About" or "Overview" and the last tip of the tour being "More information". We could also use the "Modal" for these, which is a tips default state if no selectors are given.
- wording of tip label
I think we should keep it to a few words. Which you have done! eg. "Filtering messages".
- does it makes sense to explain stock items like pagers
I don't think we need to descibe the pagers. But am open to either.
- use of links
All for it! I think as long as the resource is a stable drupal.org (or similiar) page lets do it.
- use of html in tip body
Encouraged, we can do things like lists and bold certain words.
- standard for tip ID naming
I like the way you have done it, which is very similiar to how I have approached it as well. Prefixed with the module name and incorporates the label name.
- how to refer to page elements (e.g. say "click this button" or "click the Submit button")
I think it comes down to context. If the tip was pointing to the button than "this" would be sufficient. But if it were a part of another tip then I would go with "click the Submit button".
- if it is okay to target variable information in a page like e.g. data-class: 'admin-dblog tr:first-child td:nth-child(1)'
Yep, but we have to keep in mind if the selector is not on the page then the tip will not display.
Comment #13
batigolixi updated the guidelines a bit: https://drupal.org/node/2040099
Comment #14
wiifmOK, had a stab at updating this.
Changes since the last patch:
hook_tour_tips_alter()
, I am unsure if this is the best way to approach this, so I am open to better ways to solve this.:first-child
or:nth-child()
, as I found after reading the source. I also had to add a class to the message table cell in order to select it.Command to run the tests:
sudo -u www-data php core/scripts/run-tests.sh --verbose --url http://d8.localhost/ --file core/modules/dblog/lib/Drupal/dblog/Tests/Tour/DbLogTourTest.php
And results:
Comment #16
wiifmWell at least the error message was helpful, try this.
Comment #17
jastraat CreditAttribution: jastraat commentedI applied the patch in #16. After copying the tour.tour.dblog.yml file to my site config staging directory, synchronizing, and clearing the cache, the tour behaved as expected on the recent log message page.
Will users need to manually add these tours to their configuration though? I'm just curious what the intention is.
Comment #19
wiifmMore chasing HEAD changes:
$_SERVER['HTTP_REFERER']
replaced with\Drupal::request()->server->get('HTTP_REFERER')
config/install
dir (no changes)Tests pass locally now.
Comment #20
wiifmWhoops, added additional file. Re-uploading patch (interdiff is stil the same).
Comment #21
wiifmAssigning to myself to re-roll
Comment #22
wiifmRe-rolled patch, changes since last one
Passes all tests with:
sudo -u www-data php core/scripts/run-tests.sh --verbose --url http://d8.localhost/ --file core/modules/dblog/src/Tests/Tour/DbLogTourTest.php
Comment #24
wiifmFix up the random exception (not a fail):
Comment #27
webchickThis one seems like a good thing to do, but postponed on #1921152-109: META: Start providing tour tips for other core modules. for now.
Comment #33
Farnoosh CreditAttribution: Farnoosh as a volunteer commentedComment #36
clemens.tolboom@Farnoosh your patch misses code from #24
Testbot complains about
4 out 7 displayed
Only 4 out of the 7 tips are presented on http://drupal.d8/admin/reports/dblog
Comment #37
prashantgajare CreditAttribution: prashantgajare as a volunteer and at TATA Consultancy Services for Pfizer, Inc. commentedUpdated patch with fix of Missing @group annotation.
Comment #38
dagmarA few comments for the next patch.
body: 'Click <em>Clear log messages</em> to remove the messages from the database.'
It may be interesting to mention this deletes "all" the logs from the databaseComment #42
ridhimaabrol24 CreditAttribution: ridhimaabrol24 at Srijan | A Material+ Company for Drupal India Association commentedComment #43
ridhimaabrol24 CreditAttribution: ridhimaabrol24 at Srijan | A Material+ Company for Drupal India Association commentedFixing failed tests
Comment #44
ridhimaabrol24 CreditAttribution: ridhimaabrol24 at Srijan | A Material+ Company for Drupal India Association commentedFixing the failed tests in patch #43 and implemented suggestions from #38.
Moved tests to the src/Functional Folder.
The array syntax has been changed to [].
Used FakeLogEntries::generateLogEntries() in tests.
Elaborated the text for deleting log messages.
Replaced the deprecated function \Drupal::url in dblog.module file.
Fixed the yml file to show all the tips. Only 4 out of 7 were previously visible.
Added a test method to the test file.
Please review!
Comment #45
ridhimaabrol24 CreditAttribution: ridhimaabrol24 at Srijan | A Material+ Company for Drupal India Association commentedComment #49
ranjith_kumar_k_u CreditAttribution: ranjith_kumar_k_u at Zyxware Technologies commentedRe-rolled #44 and fixed a few CS errors.
Comment #54
quietone CreditAttribution: quietone at PreviousNext commentedThis extension is being deprecated, see #3336033: [Meta] Tasks to deprecate Tour module. It will be removed from core and moved to a contrib project, #3376099: [11.x] [Meta] Tasks to remove Tour.
This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.