Problem/Motivation

Projects should have a "is_compatible" flag in the event that incompatible modules are returned.

Steps to reproduce

And external API might return modules that aren't compatible with this specific version of Drupal.

Proposed resolution

Force this field into the projects and also use that flag in the front-end.

Remaining tasks

  • ✅ File an issue about this project
  • ☐ Manual Testing
  • ☐ Code Review
  • ☐ Accessibility Review
  • ☐ Automated tests needed/written?
CommentFileSizeAuthor
#6 Screenshot 2022-06-13 at 12.26.15.png117.88 KBfjgarlin
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

fjgarlin created an issue. See original summary.

fjgarlin’s picture

Need the related issues to be merged first, otherwise, I'll be getting a lot of merge conflicts, etc.

fjgarlin’s picture

fjgarlin’s picture

Currently, the mock and the jsonapi plugin curate the data and make sure that projects are compatible with the current version.
I'll wait for the related tickets to be merged to tackle this task.

fjgarlin’s picture

Status: Active » Needs review
StatusFileSize
new117.88 KB

This MR forces the Plugins to provide a "is_compatible" attribute that should check whether the module is compatible with the current installed Drupal version.

Each plugin should determine how to do this. For example:
* The Mock plugin filters the modules before adding them to the database, so the logic is as simple as "is_compatible = TRUE".
* The jsonapi plugin (#3240319) actually checks the currently installed version with the semver range values returned by the api endpoint, and determines validity based on that (this plugin also allows querying per version for example).
* The random plugin just randomizes this :-)

The user experience is the same on our Mock and Jsonapi plugins, but this works as a failsafe in case future plugins provide non-compatible modules, AND it opens the door to a new filter in the UI, in case we'll want this.

A test has been added to the MR to check this feature.

To test this issue:
* Trigger drupalpod or your go-to test-environment
* Enabled "Project Browser Devel" module
* Visit the "Browse" page and you should see the new flag in action in the shape of a disabled button. I tried to use existing elements for this.

Screenshot

fjgarlin’s picture

Assigned: fjgarlin » Unassigned
fjgarlin’s picture

Status: Needs review » Needs work
fjgarlin’s picture

Status: Needs work » Needs review
fjgarlin’s picture

Assigned: Unassigned » tim.plunkett

bnjmnm made their first commit to this issue’s fork.

tim.plunkett’s picture

Assigned: tim.plunkett » Unassigned
Status: Needs review » Needs work

I'm fine with this from a code perspective, but I'm worried about the color contrast of that text on the button. Will ask someone to help verify whether it is accessible enough.

bnjmnm’s picture

Re #12 The color contrast does need to be updated to meet the AA standard of 4.5:1 text/bg.

It's worth noting the current solution uses Claro's color palette which has a low contrast ratio and is usually acceptable if the form element is disabled. However, in this case, the disabled button is also the only place that communicates that the module is incompatible. This is important/relevant information, so it's beholden to the contrast requirements. If the button had no consequential information when disabled (other than what the button does), then it could get away with low contrast.

fjgarlin’s picture

Assigned: Unassigned » fjgarlin

Will rebase and apply a text color of #706969 as mentioned in slack.

fjgarlin’s picture

Assigned: fjgarlin » Unassigned
Status: Needs work » Needs review

CSS change addressing #12 and #13 with the agreed value is now in place. Ready to review again.

  • tim.plunkett committed 47ea5fa on 1.0.x authored by fjgarlin
    Issue #3283826 by fjgarlin, bnjmnm: is_compatible flag should be present...
tim.plunkett’s picture

Status: Needs review » Fixed

Thanks @bnjmnm and @fjgarlin! Merged.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.