Problem/Motivation

The code and comments in the Settings Tray module inconsistently uses "Off Canvas" as 2 words and 1 word.

This was added to #2784443: Move off-canvas functionality from Settings tray module into drupal.dialog.ajax library so that other modules can use it but it makes sense to do this a separate issue

Proposed resolution

Change all occurrences of offcanvas to 2 words Off Canvas under /core/modules/outside_in, i.e there should be no examples of "offcanvas" or "Offcanvas" in this folder anywhere.

For example

*.js and *.css file names
from offcanvas.* to off-canvas

CSS ids and class names
offcanvas to off-canvas

outside_in.services.yml
offcanvas to off_canvas

php variable names with underscores
From offcanvas to off_canvas
php variable names with camelcase
From Offcanvas to OffCanvas

To see the previous see the previous attempt to do this see this diff file: https://www.drupal.org/files/issues/interdiff-24-28_6.txt

Remaining tasks

do it

User interface changes

None

API changes

None

Data model changes

none

Comments

tedbow created an issue. See original summary.

tedbow’s picture

Issue summary: View changes
selvira’s picture

Assigned: Unassigned » selvira

I'm going to work in this issue.
Greetings.

selvira’s picture

Status: Active » Needs review
StatusFileSize
new37.23 KB

Here you are the patch with the whole variables changed, I hope it'll be enough.
greetings!.

Status: Needs review » Needs work

The last submitted patch, 4: 2862625-3-Rename_offcanvas_variables.patch, failed testing.

selvira’s picture

Status: Needs work » Needs review
StatusFileSize
new34.87 KB

Ok, I'll try a second chance with my test succeeded .
Regards

Status: Needs review » Needs work

The last submitted patch, 6: 2862625-5-Rename_offcanvas_variables.patch, failed testing.

selvira’s picture

Status: Needs work » Needs review
StatusFileSize
new46.37 KB

Status: Needs review » Needs work

The last submitted patch, 8: 2862625-8-Rename_offcanvas_variables.patch, failed testing.

selvira’s picture

It's seems like I have a problem with drupal standard coding but I not modify those!! jeje I suppose that the tests are not working very well.
Tomorrow I'll check again about that..

Please @tedbow confirm me that everything is as you expected.
Many thanks in advance!.

Greetings.

tedbow’s picture

@MaxFire thanks for working on this. You may not have introduced the standards violations. They have existed before.

When do the git diff are you using "-M" option? This will detect that files are renamed from for example "offcanvas.js" to "off-canvas.js" instead of thinking it is new file(hopefully). This will make patch smaller and will include lines.

I do something like
git diff -M 8.4.x > ../filename.patch

selvira’s picture

Status: Needs work » Needs review
StatusFileSize
new37.93 KB

Hi!,
Thanks for everything, you're completely right about that yay!.
I just add the patch again with that changes, thanks again, I hope this

Greetings.

Status: Needs review » Needs work

The last submitted patch, 12: 2862625-12-Rename_offcanvas_variables.patch, failed testing.

tedbow’s picture

@Maxfire awesome work a couple more changes that need to make the test pass.

  1. +++ b/core/modules/outside_in/outside_in.services.yml
    --- a/core/modules/outside_in/src/Ajax/OpenOffCanvasDialogCommand.php
    +++ b/core/modules/outside_in/src/Ajax/OpenOffCanvasDialogCommand.php
    
    +++ b/core/modules/outside_in/src/Ajax/OpenOffCanvasDialogCommand.php
    @@ -33,7 +33,7 @@ class OpenOffCanvasDialogCommand extends OpenDialogCommand {
    +    parent::__construct('#drupal-off_canvas', $title, $content, $dialog_options, $settings);
    
    +++ b/core/modules/outside_in/src/Tests/Ajax/OffCanvasDialogTest.php
    @@ -32,9 +32,9 @@ public function testDialog() {
    +      'selector' => '#drupal-off_canvas',
    
    +++ b/core/modules/outside_in/tests/src/FunctionalJavascript/OffCanvasTest.php
    @@ -12,23 +12,23 @@ class OffCanvasTest extends OutsideInJavascriptTestBase {
    +      $web_assert->elementNotExists('css', '#drupal-off_canvas');
    

    This is the html id attribute and should be #drupal-off-canvas.

    It is causing a test to fail.

  2. +++ b/core/modules/outside_in/templates/outside-in-page-wrapper.html.twig
    index 761693b..f4b815d 100644
    --- a/core/modules/outside_in/tests/modules/offcanvas_test/offcanvas_test.routing.yml
    
    --- a/core/modules/outside_in/tests/modules/offcanvas_test/offcanvas_test.routing.yml
    +++ b/core/modules/outside_in/tests/modules/offcanvas_test/offcanvas_test.routing.yml
    

    The test module directory and file names should be update to match namespace, off_canvas_test.
    info, routing, etc files

    This cause the test not to find off_canvas_test module

gaurav.kapoor’s picture

Status: Needs work » Needs review
StatusFileSize
new31.85 KB

Fixed 14.1

Status: Needs review » Needs work

The last submitted patch, 15: 2862625-15-Rename_offcanvas_variables.patch, failed testing.

selvira’s picture

Status: Needs work » Needs review
StatusFileSize
new34.1 KB

Status: Needs review » Needs work

The last submitted patch, 17: 2862625-14-Rename_offcanvas_variables.patch, failed testing.

selvira’s picture

Status: Needs work » Needs review
StatusFileSize
new38.25 KB

Thanks Tedbow! jeje I changed everything as you say, i don't know what happen now...
Tomorrow i hope to finish the issue.

Thanks again for your help!

selvira’s picture

Status: Needs review » Needs work

The last submitted patch, 19: 2862625-19-Rename_offcanvas_variables.patch, failed testing.

selvira’s picture

Status: Needs work » Needs review
StatusFileSize
new39.87 KB

Status: Needs review » Needs work

The last submitted patch, 22: 2862625-22-Rename_offcanvas_variables.patch, failed testing.

nesta_’s picture

Issue tags: +DevDaysSeville
selvira’s picture

Status: Needs work » Needs review
StatusFileSize
new39.19 KB

Status: Needs review » Needs work

The last submitted patch, 25: 2862625-25-Rename_offcanvas_variables.patch, failed testing.

selvira’s picture

Status: Needs work » Needs review
StatusFileSize
new39.87 KB
tedbow’s picture

@Maxfire awesome work!!! Tests pass and I just checked and there are no occurrences of "offcanvas" or "Offcanvas" in the files and no files name "offcanvas" lower case.

Looking at it further....

GrandmaGlassesRopeMan’s picture

+++ b/core/modules/outside_in/css/off-canvas.css
@@ -1,23 +1,23 @@
+ * CSS for OffCanvas tray.

This should be

* CSS for off-canvas dialog

In general I think we want to move away from using tray. Additionally in the comments, unless it comes first (just capitalize off) it should be off-canvas dialog..

GrandmaGlassesRopeMan’s picture

Status: Needs review » Needs work
selvira’s picture

Status: Needs work » Needs review
StatusFileSize
new39.87 KB

I just modify the comments just in "off-canvas dialog" case and the appreciation of @drpal also, thanks a lot for that!.

Greetings.

tedbow’s picture

Issue tags: -Novice
StatusFileSize
new2.28 KB

@Maxfire thanks for the updates
Uploading an interdiff between 27 and 31

Found some other variations in the comments still

  1. Off-Canvas tray
  2. off-canvas tray
  3. off-canvas tray
  4. off_canvas tray
  5. off canvas tray
  6. dialog-off-canvas tray
  7. OffCanvas(no "tray")

These should all also be changed to "off-canvas dialog"
Just to be clear only the comments now are an issue. I think code and file names are perfect.

Sorry we were so inconsistent when creating this module :(

Also removing novice tag, tricky probably than we thought ;)

selvira’s picture

StatusFileSize
new42.31 KB

Don't worry about that, I copy that, here you are the new patch.

Thanks!.

tedbow’s picture

Status: Needs review » Needs work

Almost there! Just a few more changes.

+++ b/core/modules/outside_in/tests/modules/offcanvas_test/src/Controller/TestController.php
@@ -96,12 +96,12 @@ public function linksDisplay() {
+   * Displays dialogs links to be displayed inside the off_canvas dialog.
...
+   * inside the off_canvas dialog.

+++ b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php
@@ -53,7 +53,7 @@ protected function setUp() {
+   * Tests opening off_canvas dialog by click blocks and elements in the blocks.

Change "off_canvas dialog" to "off-canvas dialog"

+++ b/core/modules/outside_in/tests/modules/offcanvas_test/src/Controller/TestController.php
@@ -96,12 +96,12 @@ public function linksDisplay() {
+   * @todo Update tests to check these links work in the off_canvas fialog.

Typo, "off_canvas fialog" should be "off-canvas dialog"

selvira’s picture

Status: Needs work » Needs review
StatusFileSize
new42.31 KB

Oks, I got it.
Here you are the patch updated.

Greetings.

GrandmaGlassesRopeMan’s picture

@Maxfire

I think this is looking good. Probably another set of eyes to make sure we didn't miss anything is appropriate.

selvira’s picture

Assigned: selvira » Unassigned

Thanks for your advise @drpal, I just unassign this issue.

Greetings!.

tedbow’s picture

Status: Needs review » Needs work

Just needs a re-roll.

tedbow’s picture

StatusFileSize
new43.91 KB

Re-roll

tedbow’s picture

Status: Needs work » Needs review
GrandmaGlassesRopeMan’s picture

Status: Needs review » Reviewed & tested by the community
lauriii’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/modules/outside_in/tests/modules/off_canvas_test/off_canvas_test.info.yml
    @@ -1,4 +1,4 @@
    -name: 'Off-canvas tests'
    +name: 'off-canvas tests'
    

    This change should be reverted

  2. +++ b/core/modules/outside_in/tests/modules/off_canvas_test/off_canvas_test.routing.yml
    @@ -0,0 +1,29 @@
    +  path: '/off_canvas-test-links'
    

    Is there a particular reason why it is off_canvas instead of off-canvas on the url?

tedbow’s picture

Status: Needs work » Needs review
StatusFileSize
new5.8 KB
new44.3 KB

@lauriii thanks for taking a look this issue.

re #42
1. fixed
2. Nice catch! That was problem with the search/replace probably for "offcanvas/off_canvas". Fixed

I also found 1 other case in outside_in.routing.yml where we were using off_canvas in a path where we didn't need to be. Fixed that too.

GrandmaGlassesRopeMan’s picture

Status: Needs review » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 43: 2862625-43.patch, failed testing.

tedbow’s picture

Status: Needs work » Needs review
StatusFileSize
new44.83 KB

Another re-roll

GrandmaGlassesRopeMan’s picture

Status: Needs review » Reviewed & tested by the community
jrockowitz’s picture

I just tested this patch with #2866554: Add Quick Edit off canvas form. and the renaming works exactly as expected with some minor and predictable tweaks to the Webform off-canvas integration.

I am hoping at DrupalCon to be able to demo the Webform module's system tray integration.

I know the outside_in.module is still experimental, I just want to get more people inspired to experiment.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed a614ec6 to 8.4.x and fb9bacc to 8.3.x. Thanks!

Backported to 8.3.x because settings tray is experimental.

  • alexpott committed a614ec6 on 8.4.x
    Issue #2862625 by Maxfire, tedbow, gaurav.kapoor, drpal, lauriii: Rename...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

tedbow’s picture

Component: outside_in.module » settings_tray.module

Changing to new settings_tray.module component. @drpal thanks for script help! :)