"Place order" and "Fulfill order" should be styled as primary buttons

Created on 15 January 2020, almost 5 years ago
Updated 19 August 2023, over 1 year ago

Problem/Motivation

When viewing an order in the backend theme both "Fulfill order" and "Cancel order" buttons are gray. However, "Fulfill order" should be a primary action/button.

Proposed resolution

Style "Fulfill order"/"Place order" as primary buttons. The same concept is being followed in Node module (See node/%/delete path).

Remaining tasks

User interface changes

Before:

After:

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

2.0

Component

User experience

Created by

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇨🇦Canada redsky

    This seems like a good idea to me but I'm wondering what might trigger a button to be the primary button. The transitions are determined from the *.workflows.yml file and you can create custom workflows that might not be "Fulfill order" or "Place order" ( See State Machine module ).

    If you could specify that a transition was the default some how you could trigger the primary button styling based on that. I only see "label", "from" and "to" in the State Machine examples I've seen though.

    transitions:
        place:
          label: 'Place order'
          from: [draft]
          to: completed
    
  • 🇩🇪Germany Anybody Porta Westfalica

    Perhaps it would be a good idea then to allow a certain property for transitions to set it "primary", "highlighted","suggested" or something like that?

    Alternatively we should simply do it the other way around and treat "Cancel order" as the special state, which is always non-primary, while the other expected ones are more visible by primary?

    The 2nd idea is what I think fits 99% of all cases?

  • 🇨🇦Canada redsky

    I like the idea of a property of the transition something like this?

    transitions:
        place:
          label: 'Place order'
          from: [draft]
          to: completed
          primary: true

    I have no idea if it's possible, I looked quickly through the State Machine module and didn't see anything. I did see requests to add properties like a description, so this would be a similar effort. I'll look deeper over there and if I don't find anything maybe I could raise an issue asking if it's possible or make a feature request.

  • 🇨🇦Canada redsky

    I created a feature request in State Machine Add a field to the schema for transitions to support #button_type Active that I think could support this feature request. I got looking at the Drupal User Interface Standards and it seemed to be me in addition to the "primary" button type we should also consider the "dangerous" button type.

Production build 0.71.5 2024