Closed (fixed)
Project:
Git Info Report
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Aug 2019 at 18:59 UTC
Updated:
13 Jun 2020 at 19:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
lolandese commentedWe tried this initially using Details | Details.php | Drupal 8.7.x | Drupal API.
Unfortunately, with #665790: Redesign the status report page the collapsing behavior was changed to only kick-in on small screens for all status report items. We should override this behavior for our Git section to get this feature back for all screen sizes.
Comment #3
lolandese commentedComment #4
lolandese commentedA valid alternative could be to add an ellipsis ( ... ) with a read more link. That might be easier to implement.
Note that we already cut off the git status output after 600 characters using
substr($statuscmd, 0, 600).Some resources to explore further:
Comment #5
lolandese commentedComment #6
lolandese commentedAnother alternative is to aggregate possibly long lists (changed and ignored files) and show only a count, once going over a threshold (preferably configurable).
Comment #7
lolandese commentedAlternatively, we could render the Git Info report on its own page. To explore how we could still have the warning/error detection system from Drupal core to apply also for this new route and suppress it on the Status report without hacking Drupal core.
Probably to adopt part of Drupal's API calls for this in our own code. To start by looking into:
function hook_requirements($phase)in core/lib/Drupal/Core/Extension/module.api.php.Routing of the Status report is in /var/www/html/brown.localhost/web/core/modules/system/system.routing.yml and the route name is system.status. The menu link is in /var/www/html/brown.localhost/web/core/modules/system/system.links.menu.yml.
To see where the report output is tied to that route.
EDIT:
Ah.We thought of that before: #3087770: Move the GIT Info Report to its own page
Comment #8
lolandese commentedComment #9
lolandese commentedObsolete as #3087770: Move the GIT Info Report to its own page is a better way to go.
Comment #10
lolandese commentedNow that we have the report on a dedicated page, we can pick this up to limit long lists with a "more" link that uncollapses the remaining items. We only show a certain amount up to a configurable threshold.
See for probably the easiest implementation Painless Collapsible Divs In Drupal ⚡ | TimOnWeb. Adding a dependency on ctools to the module would be acceptable.
Comment #11
lolandese commentedUuf! Seems that this was removed from D8 cTools and did not go into Drupal core either. Doing a search in contrib did not give usable options either. Seems that we should make a small helper module and replicate what was done in cTools. Obviously D8 theming has changed completely, although /sites/all/modules/contrib/ctools/js/collapsible-div.js seems to be for the most part reusable.
Comment #12
lolandese commentedLet's try first with Details | Details.php | Drupal 8.8.x | Drupal API.
Comment #13
lolandese commentedComment #15
lolandese commentedBesides fixing of the test we should also implement the non-limited (-1) option for number of last commits, where we remove the word "last" if all commits are shown.
Comment #16
lolandese commentedComment #18
lolandese commentedHappy this could be done with the drupal core function mentioned in #12. It is more likely the collapsible element created this way will render without issues on the common admin themes.