Problem/Motivation

It would be nice if themes could provide unique styling (colors, etc.) based on revision status, published, and latest revision info. This patch adds some classes to assist with that, and default styles in the module to indicate node/revision properties like published, latest and current.

Identifying revision state currently can be done by visually scanning for the text. With a small amount of additional CSS we can enhance this by making entire rows visibly distinguishable by moderation state and active/current revision flag.

Steps to reproduce

View a node revisions path at node/469/revisions with Diff module enabled.

Proposed resolution

Set row classes for each moderation state and add a library for moderation state colors.

Remaining tasks

  1. [x] Prototype
  2. [x] Consider https://www.drupal.org/docs/develop/user-interface-standards/table
  3. [ ] Consider UX of color usage
  4. [x] Consider aria labels - don't think TR can have labels applied?
  5. [x] Consider Drupal\node\Controller\NodeController::revisionOverview
  6. [ ] Add tests

User interface changes

Colors on revisions list.

API changes

Data model changes

CommentFileSizeAuthor
#2 diff-add_classes-3252547-2.patch1.02 KBazinck

Issue fork diff-3252547

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

azinck created an issue. See original summary.

azinck’s picture

Status: Active » Needs review
StatusFileSize
new1.02 KB

Status: Needs review » Needs work

The last submitted patch, 2: diff-add_classes-3252547-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

xurizaemon’s picture

Title: Provide some useful classes on revision overview form » Add useful classes and visually indicate content moderation status on overview form if available
Issue summary: View changes

xurizaemon’s picture

Issue summary: View changes
xurizaemon’s picture

Issue summary: View changes
xurizaemon’s picture

Issue summary: View changes

ARIA labels on the TR: I don't think we can do this, since it requires an interactive element per https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attribut...

Compared to Drupal\node\Controller\NodeController::revisionOverview - before MR, revision-current is already provided by Drupal\diff\Form\RevisionOverviewForm. We will add revision-latest and moderation-state-<state_machine_name>.

xurizaemon’s picture

Issue summary: View changes
xurizaemon’s picture

Issue summary: View changes
heddn’s picture

Version: 8.x-1.x-dev » 2.x-dev
Status: Needs work » Needs review
acbramley’s picture

Status: Needs review » Needs work

MR has conflicts and I'm personally not a huge fan of changing this in the module. People are used to the defaults by now and admin themes should be IMO in charge of stylising these types of things.