Problem/Motivation

To stick to the design system approach for claro the implementation for components should stick to predefined variants.

Proposed resolution

Since Add support for Dropbutton variants (3057581) is moved forward claro can rely on it.

Remaining tasks

- Test patch
- Figure out how to solve views display settings: https://git.drupalcode.org/project/claro/blob/8.x-1.x/claro.theme#L435 (addressing in #1899236: Add new Splitbutton render element to eventually replace Dropbutton)

CommentFileSizeAuthor
#39 3060697-39.patch10.78 KBLal_
#37 interdiff_35-37.txt1.33 KBbnjmnm
#37 3060697-37.patch10.75 KBbnjmnm
#35 3060697-35.patch10.75 KBbnjmnm
#35 interdiff_30-35.txt1.64 KBbnjmnm
#30 3060697-30.patch10.23 KBMeenakshiG
#29 3060697-29.patch10.21 KBMeenakshiG
#26 interdiff-3060697-24-26.txt441 byteshuzooka
#26 claro-dropbutton_variant_with_dropbutton_type-3060697-26.patch10.21 KBhuzooka
#24 claro-dropbutton_variant_with_dropbutton_type-3060697-24.patch10 KBhuzooka
#20 interdiff-3060697-16-20.txt982 byteshuzooka
#20 claro-dropbutton_variant_with_dropbutton_type-3060697-20.patch10.09 KBhuzooka
#16 interdiff-3060697-13-16.txt1.4 KBhuzooka
#16 claro-dropbutton_variant_with_dropbutton_type-3060697-16.patch9.84 KBhuzooka
#13 claro-dropbutton_variant_with_dropbutton_type-3060697.patch8.45 KBhuzooka
#9 3060697_9-dropbutton-variants.patch5.87 KBshashikant_chauhan
#2 3060697-dropbutton-variants.patch5.38 KBquiron
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quiron created an issue. See original summary.

quiron’s picture

This is an initial patch for early review.

lauriii’s picture

Status: Active » Postponed

Postponed this until #3057581: Add support for Dropbutton variants gets done.

ccasals’s picture

Manual testing of the patch resulted in a failure to apply on latest dev build.

Comment for the googlers out there - dropbuttons for things like the paragraphs widget break in both the alpha and latest dev release, I believe as a result of this issue. Using a different form widget is a work around.

Wim Leers’s picture

Title: Use dropbutton variants with #dropbutton_type instead of custom classes » [PP-1] Use dropbutton variants with #dropbutton_type instead of custom classes

#3057581: Add support for Dropbutton variants is RTBc, hopefully this is soon unblocked 🤞

lauriii’s picture

Title: [PP-1] Use dropbutton variants with #dropbutton_type instead of custom classes » Use dropbutton variants with #dropbutton_type instead of custom classes
Status: Postponed » Needs review

#3057581: Add support for Dropbutton variants is in. Marking this for review.

Wim Leers’s picture

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

Project: Claro » Drupal core
Version: 8.x-1.x-dev » 8.9.x-dev
Component: Code » Claro theme
shashikant_chauhan’s picture

Rerolled the patch, based on patch in #2

shashikant_chauhan’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 9: 3060697_9-dropbutton-variants.patch, failed testing. View results

huzooka’s picture

Assigned: Unassigned » huzooka
huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review
FileSize
8.45 KB

I tried to create an interdiff, but it won't make any sense...

Status: Needs review » Needs work
huzooka’s picture

Assigned: Unassigned » huzooka
huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review
FileSize
9.84 KB
1.4 KB
lauriii’s picture

+++ b/core/themes/claro/claro.theme
@@ -242,9 +242,13 @@ function claro_element_info_alter(&$type) {
+    // We need to specify #dropbutton_type before the default prerender happens.

Would it be possible to explain why this is needed?

Otherwise this looks good 👏I cleared caches and tested both tables with operations and Views UI and they work as expected. ✨

huzooka’s picture

Status: Needs review » Needs work
huzooka’s picture

Assigned: Unassigned » huzooka
huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review
FileSize
10.09 KB
982 bytes

Addressing #17.

lauriii’s picture

Status: Needs review » Reviewed & tested by the community

Thank you for adding the clarification on why it was needed. It makes sense now ✌️

Tested manually to confirm that there are no visual changes on the content list or block UI and everything seems to work as expected 👏

huzooka’s picture

Assigned: Unassigned » huzooka
Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll
huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review

Rebased #20.

huzooka’s picture

huzooka’s picture

Assigned: Unassigned » huzooka
Status: Needs review » Needs work
huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
10.21 KB
441 bytes
lauriii’s picture

Status: Needs review » Reviewed & tested by the community

The changes since #21 look good.

lauriii’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll
MeenakshiG’s picture

Status: Needs work » Needs review
FileSize
10.21 KB
MeenakshiG’s picture

Devipriya Rajamanickam’s picture

Assigned: Unassigned » Devipriya Rajamanickam
Devipriya Rajamanickam’s picture

Assigned: Devipriya Rajamanickam » Unassigned
Percy101’s picture

Issue tags: -Needs reroll

The patch applied cleanly

bnjmnm’s picture

Version: 8.9.x-dev » 9.1.x-dev
Status: Needs review » Needs work

Moved this to 9.1 and the patch still applies cleanly.

  1. It looks like this will require an update hook as I got a WSOD due the change to trustedCallbacks in ClaroPreRender not being fully acknowledged. A cache clear addressed this.
  2. +++ b/core/themes/claro/claro.theme
    @@ -242,9 +242,17 @@ function claro_element_info_alter(&$type) {
    +    // In Claro, Operations should always use the extrasmall dropbutton variant.
    +    // While the string value of the #dropbutton_type is added as component
    +    // modifier CSS class in
    +    // \Drupal\Core\Render\Element\Dropbutton::preRenderDropbutton, we have to
    +    // specify #dropbutton_type before the default prerender happens
    

    I think this could be a little easier to understand if this is rearranged a little. Maybe start with "#dropbutton_type must be placed before the default renderer because..."

bnjmnm’s picture

Status: Needs work » Needs review
FileSize
1.64 KB
10.75 KB

Addressing #34

tim.plunkett’s picture

Status: Needs review » Needs work

Looks good! Just two doc nits, the implementation is great.

  1. +++ b/core/themes/claro/claro.theme
    @@ -245,9 +245,17 @@ function claro_element_info_alter(&$type) {
    +  // Add a pre-render function for Operations to set dropbutton_type.
    

    add # to dropbutton_type

  2. +++ b/core/themes/claro/claro.theme
    @@ -245,9 +245,17 @@ function claro_element_info_alter(&$type) {
    +    // In Claro, Operations should always use the extrasmall dropbutton variant.
    +    // Adding CSS classes for variants requires the element to have
    +    // the #dropbutton_type property by the time it reaches
    +    // \Drupal\Core\Render\Element\Dropbutton::preRenderDropbutton.
    +    // This ensures #dropbutton_type is available to preRenderDropbutton.
    

    There's some odd wrapping on this comment, and missing () on the method names

bnjmnm’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
10.75 KB
1.33 KB

TY @tim.plunkett This addresses #36

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

Lal_’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
10.78 KB

Re-rolling as it failed to apply

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Thanks so much! Those post_updates clash so often.

Also, on a clean reroll, no need to unRTBC! Only if you made substantive changes (which isn't really a reroll) or were unsure about conflicts that needed resolving.

  • lauriii committed 0551c86 on 9.1.x
    Issue #3060697 by huzooka, bnjmnm, Meenakshi.g, quiron,...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Committed 0551c86 and pushed to 9.1.x. Thanks!

Status: Fixed » Closed (fixed)

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