Allow admin_description for @CommerceCheckoutPane plugins

Created on 28 August 2024, 19 days ago
Updated 12 September 2024, 4 days ago

Problem/Motivation

Commerce checkout panes currently have

  • id
  • label
  • default_step

properties.

For advanced use-cases in commerce and contrib it would be good to be able to provide an admin_description property which is shown in the checkout flows administration (e.g. /admin/commerce/config/checkout-flows/manage/default?destination=/admin/commerce/config/checkout-flows) beside the label.

The description should allow to provide additional information about what the pane does.
One concrete example is: 📌 Clarify Facebook Checkout CommerceCheckoutPane by title Fixed
Here I now had to misuse the label to place additional information.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Feature request
Status

RTBC

Version

3.0

Component

Checkout

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Anybody
  • 🇩🇪Germany Anybody Porta Westfalica

    Before implementing this, do the maintainers agree this makes sense and would be merged?

  • 🇮🇱Israel jsacksick

    Greenlight to work on this, we can probably just call the attribute "description", don't think there is a need to prefix description by admin_.

  • 🇩🇪Germany Anybody Porta Westfalica

    Thank you @jsacksick cool! :)

    The admin_prefix idea comes from block plugins in core: https://www.drupal.org/docs/creating-modules/creating-custom-blocks/crea...

    They have a label and admin_label for different goals and I thought the target audience for this description is the admin area, not the end-user UI checkout UI, as it explains, what the pane is used for (for site builders / admins). Perhaps this is clearer now?

    But we'll do it as you'd like it to be as maintainer. Just wanted to explain it more clearly.

  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇮🇱Israel jsacksick

    Ok, I'm convinced, let's stick with "admin_description" then.

  • 🇩🇪Germany Anybody Porta Westfalica

    Thanks, I'll put this on our roadmap! :)

  • 🇩🇪Germany Anybody Porta Westfalica

    Just came across a case where an optional admin_label would also make sense to set a different admin UI label from the user-facing label in Drupal 8+ version Active

    Should work similar to how Core blocks do it.

  • 🇮🇱Israel jsacksick

    @anybody: hm... Hm... Technically this is why we have a "display_label". When set, it is going to be used on the frontend and the label is only going to be used in the admin.
    So I guess we have support for that already in a way.

  • 🇩🇪Germany Anybody Porta Westfalica

    @jsacksick thanks, sorry I didn't see that. So it's different from core blocks logic then. Thank you!

  • 🇩🇪Germany Anybody Porta Westfalica
  • First commit to issue fork.
  • Merge request !328Draft: Initial implementation → (Open) created by LRWebks
  • Assigned to LRWebks
  • Status changed to Needs work 12 days ago
  • 🇩🇪Germany LRWebks Porta Westfalica
  • Pipeline finished with Failed
    12 days ago
    Total: 348s
    #273424
  • 🇮🇱Israel jsacksick

    I don't think the configuration summary is the right place for this... Probably makes more sense to display that under the label (assuming that is possible).
    The configuration summary shows a summary of the actual configuration... This isn't related to configuration, but is more of a help text for admins?

  • 🇩🇪Germany Anybody Porta Westfalica

    @jsacksick yeah that's right. Placing it there was a first attempt to see if placing it on the right side is better or below the label... @lrwebks could you post a screenshot of the current situation please?

  • Status changed to Needs review 12 days ago
  • 🇩🇪Germany LRWebks Porta Westfalica

    If the pipeline is green, my work is done here! The description definitely works. Do you want me to go over already existing Pane types within the base Commerce and add descriptions to them now?

  • Pipeline finished with Success
    12 days ago
    Total: 496s
    #273548
  • 🇩🇪Germany LRWebks Porta Westfalica

    I suppose that I should also implement some tests for the admin description, so I'll be working on those now. Feel free to already take a look at what's been done!

  • Status changed to Needs work 12 days ago
  • 🇩🇪Germany Anybody Porta Westfalica

    @lrwebks see #15, furthermore needs tests and I left a comment. :)

  • 🇩🇪Germany LRWebks Porta Westfalica

    Here's a screenshot of the current look within the Checkout Flows configuration:

    I'm currently working on the fix that @Anybody pointed out, as well as implementing the proper tests.

  • Pipeline finished with Failed
    6 days ago
    Total: 683s
    #279186
  • 🇩🇪Germany LRWebks Porta Westfalica

    The pipeline fails, but the failure actually seems unrelated, as I cannot draw any connection between the code that I changed and the failing test. Additionally, the pipeline was green for the commit that I made before the latest one, yet when I revert my changes locally back to the commit that passed PHPUnit, the failure persists. @Anybody, would you mind taking a look, testing it locally, or sharing any possible ideas?

    I am continuing now to open a second MR, in which I place the admin description below the Pane title in the UI, so that we can later decide on which of the two UI approaches is more suitable to be merged.

  • 🇩🇪Germany Anybody Porta Westfalica

    @lrwebks I left some comment. I thought we talked about a separate MR for the different approach ...

    Please provide a screenshot of the final result after the changes.

  • Merge request !333Resolve #3470787 "Description below label" → (Open) created by LRWebks
  • Pipeline finished with Failed
    4 days ago
    Total: 456s
    #280919
  • Pipeline finished with Failed
    4 days ago
    Total: 455s
    #280922
  • Status changed to Needs review 4 days ago
  • 🇩🇪Germany LRWebks Porta Westfalica

    Due to the fact that the pane configuration list is a table, @Anybody and I currently found it to only be possible to move the description below the label via the '#suffix' key. Improvement ideas for this approach are appreciated! Back to review!

  • Pipeline finished with Failed
    4 days ago
    Total: 571s
    #280943
  • 🇩🇪Germany LRWebks Porta Westfalica

    Here's the look with the admin description above the configuration summary:

    And here's the description below the pane label (personal favorite):

    Note that I am working on a pretty similar issue ( Display 'default_step' property of @CommerceCheckoutPane plugins in administration Needs work ) where I put a label denoting the default_step property below the pane label, so if both issues are merged, there will be two lines of information (admin_description, default_step) below the pane label.

  • Status changed to Needs work 4 days ago
  • 🇩🇪Germany Anybody Porta Westfalica

    Thanks @lrwebks, indeed I also don't see a good other way to place it there. Maybe @jsacksick has other ideas or final comments.

    I left some final clean-up comments, afterwards I think we should set this RTBC for maintainer feedback. Great and nice learnings for you here :)

  • Status changed to Needs review 4 days ago
  • 🇩🇪Germany LRWebks Porta Westfalica
  • Issue was unassigned.
  • Status changed to RTBC 4 days ago
  • 🇩🇪Germany Anybody Porta Westfalica

    GREAT! I like it (see #25, MR!333)

    RTBC from my side, let's wait for Maintainer feedback!

  • Pipeline finished with Failed
    4 days ago
    Total: 541s
    #280964
Production build 0.71.5 2024