Problem/Motivation

Seperate core templates from non essential css classes.

Proposed resolution

modify templates:

  • core/modules/system/templates/checkboxes.html.twig
  • core/modules/system/templates/confirm-form.html.twig
  • core/modules/system/templates/container.html.twig

Rename .form-wrapper to .js-form-wrapper to follow css coding standards
#2431671: [meta] Add in js- prefixed classes for separation of JS & CSS functionality

Remaining tasks

* visual test of renames classes
* test should be done on classy and stark
* test url:
/admin/config/regional/translate ( FILTER TRANSLATABLE STRINGS box)
/node/1/edit (sidebar)

User interface changes

API changes

Original report by @username

See parent issue(s) and related issue(s) for details,

Twig Templates to modify

CommentFileSizeAuthor
#82 2407723-82.patch4.53 KBGauravvvv
#80 2407723-nr-bot.txt144 bytesneeds-review-queue-bot
#75 interdiff-69-72.txt830 bytesBS Pavan
#75 2407723-72.patch4.6 KBBS Pavan
#70 interdiff-69-65.txt619 bytesimalabya
#70 2407723-69.patch3.63 KBimalabya
#69 2407723.69.patch3.63 KBSakthivel M
#67 2407723.67.patch513.23 KBSakthivel M
#65 2407723-65.patch3.01 KBranjith_kumar_k_u
#59 interdiff-57-59.txt485 byteskostyashupenko
#59 remove_classes_from-2407723-59.patch2.97 KBkostyashupenko
#57 remove_classes_from-2407723-57.patch2.37 KBkostyashupenko
#49 remove_classes_from-2407723-45_0.patch3.08 KBaadrian
#46 remove_classes_from-2407723-45.patch3.08 KBmgifford
#45 interdiff-removecclasses-44to45.txt439 bytesdavidhernandez
#45 remove_classes_from-2407723-45.patch3.08 KBdavidhernandez
#44 remove_classes_from-2407723-44.patch2.65 KBdavidhernandez
#42 2407723-42-convert-form-checkbox-classes.patch2.64 KBRainbowArray
#34 container-before.png85.75 KBrteijeiro
#34 container-after.png85.34 KBrteijeiro
#32 c-templates-35.diff2.5 KBmortendk
#24 c-templates-24.diff2.5 KBmortendk
#18 quickedit.png141.69 KBrteijeiro
#15 stark-pre-patch.png55.43 KBmortendk
#15 stark-post-patch.png62.05 KBmortendk
#15 stark-node-edit-pre-patch.png107.51 KBmortendk
#15 stark-node-edit-post-patch.png113.58 KBmortendk
#15 stark-lang-transaltion-2.png35.57 KBmortendk
#15 stark-lang-transaltion-1.png52.17 KBmortendk
#15 patch-quick-edit.png35.84 KBmortendk
#15 patch-node-edit.png179.71 KBmortendk
#15 patch-node-edit-2.png189.29 KBmortendk
#15 patch-language-translation-2.png51.08 KBmortendk
#15 patch-language-translation-1.png42.58 KBmortendk
#8 2407723-remove-classes-update-tests-7.patch11.01 KBmherchel
#5 core-c-template-cleanup.diff6.6 KBmortendk
#2 issue-2407723-1.patch2.18 KBSivaji_Ganesh_Jojodae

Issue fork drupal-2407723

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Sivaji_Ganesh_Jojodae’s picture

Issue summary: View changes
Sivaji_Ganesh_Jojodae’s picture

Status: Active » Needs review
FileSize
2.18 KB
davidhernandez’s picture

Status: Needs review » Postponed

Postponing this until we decide how we are moving forward. Keep an eye on #2348543: [meta] Consensus Banana Phase 2, transition templates to the starterkit theme for updates. Thanks.

davidhernandez’s picture

Title: Copy system templates c*.html.twig to Classy » Remove classes from system templates c*.html.twig
Issue summary: View changes
Status: Postponed » Needs work

Un-postponing. The templates have been copied to Classy, so all we need to do is remove classes from the original templates.

mortendk’s picture

Status: Needs work » Needs review
FileSize
6.6 KB

.form-wrapper in container.html.twig is used all over with loads of js dependencies, a rename of that css class to js-form-wrapperto follow the css standards.
If we dont rename this, then core files wont work as expexted.

Classes in use in system.theme .form-checkboxes, is also used in /views_ui/js/views-admin.js but should use classys checkbox.html.twig file (as we havent yet moved views_ui anywhere)

Status: Needs review » Needs work

The last submitted patch, 5: core-c-template-cleanup.diff, failed testing.

mherchel’s picture

I'm going to try to fix this right now, FYI

mherchel’s picture

Status: Needs work » Needs review
FileSize
11.01 KB

Tests updated.

mortendk’s picture

Issue summary: View changes
mortendk’s picture

Issue summary: View changes
mortendk’s picture

Issue tags: +Needs screenshots

looks good to me but we need visual testing on this, so we dont do any regression

mortendk’s picture

Issue tags: +drupalcafe-feb2015
mortendk’s picture

Issue summary: View changes
mortendk’s picture

Issue summary: View changes
mortendk’s picture

Screenshots from test

test on seven:
Filter can be open & closed with handy little form wrapper:

Edit node sidebar open/close form wrapper

Quick edit

Stark test


node edit
Pre patch:

post patch:

Quick edit -post patch

Quick edit

mortendk’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs screenshots, -drupalcafe-feb2015 +Classy

do what it should do - clean core / visually tested

mortendk’s picture

Status: Reviewed & tested by the community » Needs review

doooh i cant rtbc this i added first patch

rteijeiro’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
FileSize
141.69 KB

It looks good and works like in the screenshots provided by @mortendk. Good job!

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 8: 2407723-remove-classes-update-tests-7.patch, failed testing.

mortendk’s picture

Status: Needs work » Reviewed & tested by the community

test is passed again #8 come on test bot -> settings this back to rtbc

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs change record
+++ b/core/misc/states.js
@@ -509,7 +509,7 @@
+        .closest('.form-item, .form-submit, .js-form-wrapper').toggleClass('form-disabled', e.value)

Are we going to also prefex form-item and form-sumbit with js-? I'm not entirely convinced by this change.

Also we should get a general change record for all the core class name changes.

mortendk’s picture

Are we going to also prefex form-item and form-sumbit with js-? I'm not entirely convinced by this change.

good point looks like we have to go through all forms and figure out how much .form-item & .form-submits are needed, & form-disabled for the js to work.
shakes fist at the js & css mashups

mortendk’s picture

Status: Needs work » Needs review
FileSize
2.5 KB

took a long hard look at this patch & the one for all the f* templates #2407727: Remove classes from system templates f*.html.twig, theres a big chunk of css & js dependencies that needs to be fixed.
i suggest that we clean what can be cleaned here for now (form-checkboxes) and in #2408473: Rewrite form.css inline with our CSS standards do the js & css dependency stuff.

this patch adds a js-form-checkboxes for the wrapper, for the selction of checkboxes & .form-checkboxes for the general styling, the style class is removed from crore template

rteijeiro’s picture

Status: Needs review » Reviewed & tested by the community

Ok, so keep this easy and clean-up "form-wrapper" class in a different step. Back to RTBC then...

mortendk’s picture

webchick’s picture

Assigned: Unassigned » alexpott

Back to Alex. However, after reading his concerns I'm now thinking I should probably not have committed #2426595: Rename indentation class to js-indentation. Hm. :\

davidhernandez’s picture

Indentation should be ok. It's whole purpose is functional, not style, and most of that change was JS.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Still needs a change record.

davidhernandez’s picture

I don't think this one in particular needs a change record. Didn't we compile that for something else, and create a doc page? I think it was part of then menu class name rewriting.

mortendk’s picture

Status: Needs work » Needs review
Issue tags: -Needs change record

change record added

mortendk’s picture

rteijeiro’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/system/templates/checkboxes.html.twig
    @@ -14,4 +14,4 @@
    +<div{{ attributes.addClass('js-form-checkboxes') }}>{{ children }}</div>
    

    Should we keep form-checkboxes class or...

  2. +++ b/core/themes/classy/templates/form/checkboxes.html.twig
    @@ -14,4 +14,4 @@
    +<div{{ attributes.addClass('js-form-checkboxes', 'form-checkboxes') }}>{{ children }}</div>
    

    Should we remove it here?

rteijeiro’s picture

Issue summary: View changes
Status: Needs work » Reviewed & tested by the community
FileSize
85.34 KB
85.75 KB

Forget my last comment. Class should stay in Classy template and be removed in system template.

It looks good!

Container BEFORE

Container AFTER

alexpott’s picture

Status: Reviewed & tested by the community » Needs review
+++ b/core/modules/views_ui/js/views-admin.js
@@ -775,7 +775,7 @@
-          $(this).parents('.form-checkboxes').find('input[type=checkbox]').each(function () {
+          $(this).parents('.js-form-checkboxes').find('input[type=checkbox]').each(function () {

I can't find where this behaviour is actually used. Anyone know?

mortendk’s picture

to be honest i have no idea - we found it and changed it.

my guess is somewhere are use can click on "select all checkboxes" but thats my best guess.

damiankloip’s picture

This is used on handler forms, E.g. entity bundle type 'select all' but we have just realised this is currently broken anyway, so will make a follow up issue to fix that!

alexpott’s picture

Re #37 considering this is currently broken - no can have tested what they've changed so we have to fix views behaviour first.

damiankloip’s picture

star-szr’s picture

Assigned: alexpott » Unassigned

It looks to me like this is now a duplicate of #2431671: [meta] Add in js- prefixed classes for separation of JS & CSS functionality, can someone please confirm? Looked at the patches in #8 and #32.

mortendk’s picture

dont looks like they are cleaning up & prefixing the form checkboxes ?
... or do i need new classes ?

RainbowArray’s picture

FileSize
2.64 KB

Old patch, so rolled a fresh copy to get new eyes on this.

davidhernandez’s picture

Status: Needs review » Needs work
+++ b/core/themes/classy/templates/form/checkboxes.html.twig
@@ -12,4 +12,4 @@
+<div{{ attributes.addClass('js-form-checkboxes form-checkboxes') }}>{{ children }}</div>

Is this a change I guess we missed with the js-* prefix issues? Or did we only do form-item-*?

Also, missing removal from container.html.twig.

davidhernandez’s picture

Status: Needs work » Needs review
FileSize
2.65 KB

Minor reroll.

davidhernandez’s picture

Here is the container removal. We need to check this in Stark. There is some admin css looking for form-wrapper classes, but did not track down if it is specifically here.

mgifford’s picture

Re-uploading patch for bot.

Status: Needs review » Needs work

The last submitted patch, 46: remove_classes_from-2407723-45.patch, failed testing.

davidhernandez’s picture

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

This looks like it would still be doable.

aadrian’s picture

Status: Needs work » Needs review
FileSize
3.08 KB

rerolled

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

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now 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.

RainbowArray’s picture

aadrian: Thanks for the patch! It's really helpful if you can provide an interdiff to the previous patch so whoever is rerunning can see what changes have been made to the patch. If the patch is a reroll, just make sure to note that, because interdiffs don't make sense to do for rerolls.

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

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now 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.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now 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.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.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.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

markhalliwell’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
kostyashupenko’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
2.37 KB

rerolled

alexpott’s picture

Status: Needs review » Needs work

We need to change core/themes/stable/templates/form/checkboxes.html.twig too.

kostyashupenko’s picture

Status: Needs work » Needs review
FileSize
2.97 KB
485 bytes

Added new patch based on previous comment (#58)

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.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.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.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.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

ranjith_kumar_k_u’s picture

Issue tags: -
FileSize
3.01 KB

The last patch failed to apply on 9.2, so re-rolled for 9.2

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Sakthivel M’s picture

Fixed Custom Commands Failed, #67 please review the patch

imalabya’s picture

Status: Needs review » Needs work
+++ b/core/themes/stable/templates/form/checkboxes.html.twig
--- a/core/yarn.lock
+++ b/core/yarn.lock

Your patch have an updated yarn.lock.

Sakthivel M’s picture

Status: Needs work » Needs review
FileSize
3.63 KB

#69 Re-created patch, Please review it

imalabya’s picture

Added a patch from #65

imalabya’s picture

@Sakthivel M Sorry didn't notice you already added a patch for it. :)

The last submitted patch, 67: 2407723.67.patch, failed testing. View results

The last submitted patch, 69: 2407723.69.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 70: 2407723-69.patch, failed testing. View results

BS Pavan’s picture

Status: Needs work » Needs review
FileSize
4.6 KB
830 bytes

Hi
Since checkboxes.html.twig file of classy is updated in this ticket, I think we need to change md5_file value also.
Updating md5_file hash value as per latest patch.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

vikashsoni’s picture

Patch not applying giving error while trying to apply
Needs - Re-roll

Checking patch core/modules/system/templates/checkboxes.html.twig...
Checking patch core/modules/system/templates/container.html.twig...
Checking patch core/modules/views_ui/js/views-admin.es6.js...
error: while searching for:
.once('filterConfigSelectAll');
const $selectAllCheckbox = $selectAll.find('input[type=checkbox]');
const $checkboxes = $selectAll
.closest('.form-checkboxes')
.find(
'.js-form-type-checkbox:not(.js-form-item-options-value-all) input[type="checkbox"]',
);

error: patch failed: core/modules/views_ui/js/views-admin.es6.js:1084
error: core/modules/views_ui/js/views-admin.es6.js: patch does not apply
Checking patch core/modules/views_ui/js/views-admin.js...
error: while searching for:
var $context = $(context);
var $selectAll = $context.find('.js-form-item-options-value-all').once('filterConfigSelectAll');
var $selectAllCheckbox = $selectAll.find('input[type=checkbox]');
var $checkboxes = $selectAll.closest('.form-checkboxes').find('.js-form-type-checkbox:not(.js-form-item-options-value-all) input[type="checkbox"]');

if ($selectAll.length) {
$selectAll.show();

error: patch failed: core/modules/views_ui/js/views-admin.js:479
error: core/modules/views_ui/js/views-admin.js: patch does not apply
Checking patch core/tests/Drupal/KernelTests/Core/Theme/ConfirmClassyCopiesTest.php...
Checking patch core/themes/classy/templates/form/checkboxes.html.twig...
Checking patch core/themes/stable/templates/form/checkboxes.html.twig...

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
FileSize
144 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Gauravvvv’s picture

Status: Needs work » Needs review
FileSize
4.53 KB

Re-rolled patch #70, Also added few missing files, add updated CSS files. Not adding interdiff as patch #70, no longer applies to D11. please review

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Think this is good (if something we still want to do)

Searched the repo for "form-checkboxes" and didn't find anything using that specific class.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 82: 2407723-82.patch, failed testing. View results

vsujeetkumar made their first commit to this issue’s fork.

vsujeetkumar’s picture

#82 not applied on 11.x, Re-roll patch needed.

vsujeetkumar’s picture

Issue tags: +Needs reroll

vsujeetkumar’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll

Re-roll & Convert Patch #82 into MR. Please have a look.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Reroll seems fine.

smustgrave’s picture

quietone’s picture

Status: Reviewed & tested by the community » Needs review

Sorry, but this needs a review of the change record. It was added in 2015 and does not mention classes being removed. Is it correct?

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs change record updates

@quietone is correct.