Over at #2137095-40: Should supported releases be shown on downloads table even if it contains insecure modules? If so, how? webchick pointed out that we lost the color-coded rows in the release node table listing all the contents of a packaged release. So, d.o distribution releases no longer give you a quick visual cue as to the status of all the included projects being bundled into the distro. This was originally added via #645074: Provide mechanism to color-code the rows in various tables based on a field in the view but apparently was somehow lost during the d.o D7 porting.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dokumori’s picture

Assigned: Unassigned » dokumori
Issue tags: +drupal.org szeged sprint

For reference: this colour-coding is preserved in this dev site - example: https://test-drupal.redesign.devdrupal.org/node/2114375

drumm’s picture

A good way to implement this may be something like project_issue_preprocess_views_view_table() from project_issue module. That adds the classes for row coloring on issue queue pages.

We don't necessarily need an img tag. There are already words, so this is accessible.

dokumori’s picture

FileSize
4.69 KB

Thank @drumm. Based on your recommendation, I've made the following changes:

1. implemented hook_preprocess_views_view_table() in project_package.module to inject css classes dynamically for colouring the row

2. updated the view 'project_package_local_items' to inject css classes dynamically to add the icons

3. added a css file (project_package.css) for styling the table

FYI:

1) I didn't make changes intentionally, but as the patch shows, relationship for the update status field has been undone. If I keep this, the results will go crazy i.e. all items will be marked as 'not secure' or 'update available'... The current config works as expected on the dev site (https://sprint10-drupal.redesign.devdrupal.org/node/837736/release )

2) Also on the dev site, I get the error Fatal error: Call to undefined function project_release_compatibility_list() #1822476: Fatal error: Call to undefined function project_release_compatibility_list() when I access project pages. This happens even before applying this patch, but just so you know...

tvn’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 3: project_2114375-3.patch, failed testing.

dokumori’s picture

Status: Needs work » Needs review
FileSize
3.53 KB

Ok, rolled the patch against 7.x-2.x branch. My previous branch was based on the tag 7.x-2.0-unstable1 and the weirdness 1) and 2) I reported in #3 no longer exists.

drumm’s picture

Status: Needs review » Needs work

Looks good. A couple small things:

  • Use drupal_clean_css_identifier(drupal_strtolower()) instead of check_plain(...) for CSS classes.
  • Is white-space: nowrap; necessary? It is good to keep module CSS as light as possible. We can always add site-specific CSS to our theme.
dokumori’s picture

Thanks for the swift review and response @drumm.

  • check_plain() has been replaced by drupal_clean_css_identifier(drupal_strotolower()). check_plain() was actually used in project_issue_preprocess_views_view_table() so that should be taken care of as well ;)
  • You are right, white-space: nowrap; is indeed unnecessary. It's a remnant from last night when I was trying to figure out the best way to add the icons

The attached patch has these points fixed and also been tested on dev.

dokumori’s picture

Status: Needs work » Needs review

oops

dokumori’s picture

FileSize
3.52 KB

Sorry, found an unnecessary whitespace in line 38. Re-rolled.

  • Commit f0722be on 7.x-2.x authored by dokumori, committed by drumm:
    #2152549 restore color-coding for update status on packaged release...
drumm’s picture

Status: Needs review » Fixed
Issue tags: +needs drupal.org deployment

Looks good. Deploying will need a full cache clear for the new CSS, changed View, and added hook implementation.

drumm’s picture

Issue tags: -needs drupal.org deployment

Now deployed.

Status: Fixed » Closed (fixed)

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