- 🇨🇦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.