Problem/Motivation

Once #3485622: Update legacy theme hooks lands we'll have a functional navigation block with lesson and activity status available for themers.

This should be a good starting point to convert to an SDC for use with UI suite and etc.

The conversion should preserve (or improve) the caching/placeholder logic from that issue - e.g. we want to individually placeholder the activities list for each lesson so that they can be cached independently of each other and loaded ASAP both on cold and warm caches.

 

Issue fork lms-3515744

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

catch created an issue. See original summary.

ob3ron’s picture

Issue summary: View changes
Parent issue: » #3448250: Improve general appearance

Removing "PP-1" as #3485622: Update legacy theme hooks has landed, and adding as a child issue of #3448250: Improve general appearance

ob3ron’s picture

Title: [PP-1] Convert course navigation block to SDC » Convert course navigation block to SDC

ob3ron’s picture

WIP commit - includes a number of navigation improvements:

  • adds single-directory components (SDC) for layout and styling.
  • displays all but the current lesson as collapsed accordion lists, for compactness and better visual progress display.
  • removes the link url from activities that are not available to visit, based on the course-level Free Navigation setting, or if the user is revisiting a completed course.
  • improves the course navigation caching/placeholder logic, with appropriate cache lifetimes based on per-user and per-lesson display options.
  • adds styling to each activity to indicate current / answered / unanswered activities.
  • adds activity scores on course revisit.
ob3ron’s picture

Assigned: Unassigned » ob3ron

Will do additional code cleanup and optimization, meanwhile any feedback on the looks and function is welcome.

catch’s picture

Status: Active » Needs work

Haven't reviewed the MR or functionality yet, but just changing status to make it clear there's something to look at here.

ob3ron’s picture

Status: Needs work » Needs review

Added additional caching improvements and testing. Should be ready for review.

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

ob3ron’s picture

Sorry about the accidental test changes, not sure how that happened!

graber’s picture

No worries, just merged #3525270: Improve / fix course navigation logic, let's use training manager API as much as possible here.

ob3ron’s picture

Updated BlockBuilder to depend on TrainingManager as the single source of truth for activity access.

Also added a progress bar and a few other tweaks to the navigation block.

graber changed the visibility of the branch 3515744-convert-course-navigation to hidden.

catch’s picture

Status: Needs review » Needs work

Added some comments on the MR - I think the locking can be removed and the caching logic potentially simplified a bit.

ob3ron’s picture

Status: Needs work » Needs review

Addressed all feedback; should be good to go!

graber’s picture

Cache is enabled.
All this will need extending automated tests coverage but I'll get to that in a separate issue.

  • graber committed e795fc87 on 1.0.x authored by ob3ron
    Issue #3515744: Convert course navigation block to SDC
    
graber’s picture

Status: Needs review » Fixed

Merged and created one follow-up to optimize this a bit (#3530297: Course nav - additional caching optimization).

Status: Fixed » Closed (fixed)

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