Problem/Motivation
On the confirmation forms (example: /admin/structure/views/view/content/delete) the "cancel" option is styled as a link when it should be styled as a button.
There are three types of buttons supported in core and in the Seven style guide. Standard, primary, and danger.
It's important that the correct button types are used consistently throughout Drupal
Remaining tasks
Review and commit
User interface changes
The anchor tag in all entity deletion confirmation forms got one new class, button
.
API changes
None.
Beta phase evaluation
Issue category | Bug because usability standards |
---|---|
Issue priority | Not critical because minor usability defect |
Unfrozen changes | Unfrozen because it only changes markup |
Prioritized changes | The main goal of this issue is usability |
Comment | File | Size | Author |
---|---|---|---|
#20 | 2469929-20.patch | 516 bytes | mondrake |
#20 | interdiff_18-20.txt | 1.09 KB | mondrake |
#18 | 2469929-18.patch | 1.59 KB | mondrake |
#9 | Screen Shot 2015-04-14 at 11.35.02 AM.png | 73.69 KB | Bojan Zivkov |
Comments
Comment #1
LewisNymanComment #2
Bojan Zivkov CreditAttribution: Bojan Zivkov commentedI will take it
Comment #3
Bojan Zivkov CreditAttribution: Bojan Zivkov commentedComment #4
Bojan Zivkov CreditAttribution: Bojan Zivkov commentedThis is not views related, it's related to all entities.
So i added the "danger" button class to ConfirmFormHelper.
Comment #5
Bojan Zivkov CreditAttribution: Bojan Zivkov commentedComment #6
LewisNyman@Bojan Živkov Is there a way of knowing which pages this will affect?
Comment #7
Bojan Zivkov CreditAttribution: Bojan Zivkov commented@LewisNyman This will affect all "delete confirmation" pages where "cancel" button is displayed.
Comment #8
Bojan Zivkov CreditAttribution: Bojan Zivkov commentedComment #9
Bojan Zivkov CreditAttribution: Bojan Zivkov commentedComment #10
LewisNymanWe discussed this at Drupal Dev Days and found that the scope of this issue is broader than just views. The title and issue summary has been updated and screenshots added.
Comment #11
alexpottThis issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 168a859 and pushed to 8.0.x. Thanks!
Comment #13
mondrakeThis does not look right to me. The element now in red is the 'cancel' link, which is usually meant to say 'abort the delete request and return to the entity edit form', i.e. it is not deleting anything. It's the 'Delete' button that should be styled for danger I think.
Also - the patch changed ConfirmFormHelper so now all the 'cancel' links in any confirmation form are red. Should the change be on EntityDeleteForm instead?
Comment #14
tim.plunkettUnless this needs to be urgently reverted, please open a new issue.
And the priority should be normal or major, not critical. Thanks!
Comment #16
alexpottActually I agree with @mondrake - why is a cancel link styled as a danger button. Reverted since there is no conflict.
Comment #17
LewisNymanAh sorry guys, too many issues! The cancel link should be styled as a button, I've updated the issue summary to reflect this.
Comment #18
mondrakeHow about this?
Before:
After:
Comment #19
LewisNymanThe change the the cancel element looks good, but we should leave the confirm button as a primary button for now, there is an issue open to add styling for elements that are primary and danger #2278715: Introduce a primary-danger link/button class
Do we need this change to the CSS? Maybe if we need this should add it in a separate issue
Comment #20
mondrake@LewisNyman ah ok did not know, makes sense. See new patch and screenshots.
The
text-shadow: none;
in previous patch was needed to avoid inheriting text-shadow attributes from primary button. But I guess it will all have to be sorted in the other issue.After:
Comment #21
mondrakeComment #22
LewisNymanNice, thanks :)
Comment #23
mondrakeNote that this applies to all confirmation forms - ContentEntityConfirmFormBase, EntityConfirmFormBase, ConfirmFormBase - not just entity delete. Updated title and IS.
Comment #24
roderik(updated screenshots - the original links in the issue summary were apparently dead links)
Comment #25
YesCT CreditAttribution: YesCT commentedComment #26
YesCT CreditAttribution: YesCT commentedComment #27
xjmSo this change is being made according to the Seven style guide, per the summary, but it's not just changing Seven; it's changing all confirm forms, everywhere.
I'm fairly certain there was a reason these cancel links and other secondary operations were made links instead of buttons previously and this is reverting that. Setting Needs Review for more discussion. Please add references to the summary for other issues/documentation related to this, as well.
Comment #28
tim.plunkettI recall the same as @xjm, but I guess it was for other cancel links and not just confirm forms, because confirm forms have ALWAYS been links.
#922634: Odd form actions in confirm_form() switched it from using #markup => l() to #type => link, and that was in 2010.
#29465: New drupal forms api. added confirm_form, using l()
Comment #29
Bojhan CreditAttribution: Bojhan as a volunteer commentedI think that the web has evolved. We used to style it as a cancel link, because we wanted to make a clear visual distinction. However we now have primary buttons implemented very consistently. This should help us get to the same user behaviour.
With the new style guide we are pursuing a more common web standard for these primary/secondary buttons. We now only (intend to) use the link style for deletions, since that has to really stand out.
So I think its just a change in our approach, from 2009 :)
Comment #30
LewisNymanThis is true, and consistent with how we add the other
button
classes. We want to maintain the design intent in the admin UI, and allow other admin themes to 'reskin' the UI instead of re-making the design decisions. See Changes to Drupal 8 that affect admin theme maintainers for more info.Comment #31
veronicanerak CreditAttribution: veronicanerak as a volunteer commentedI tested the 2469929-20.patch and it works fine as seen in the issue summary
Comment #33
xjmExcellent, thanks @tim.plunkett, @Bojhan, and @LewisNyman for the additional information.
This issue mostly only changes markup (and render arrays), and is a usability and themeability improvement per @Bojhan and @LewisNyman, so it's fairly unfrozen and a prioritized change per https://www.drupal.org/core/beta-changes and can be completed any time during the Drupal 8 beta phase. Committed and pushed to 8.0.x. Thanks for adding the beta evaluation for to the issue summary, and also for the screenshots and manual testing illustrating the change.
Comment #35
Elin Yordanov CreditAttribution: Elin Yordanov commentedIt would be nice if we had that also on Drupal 7.x.