Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_showAtCourseLevel setting isn't displaying correctly #247

Open
joe-replin opened this issue Mar 20, 2025 · 5 comments · May be fixed by #248 or #249
Open

_showAtCourseLevel setting isn't displaying correctly #247

joe-replin opened this issue Mar 20, 2025 · 5 comments · May be fixed by #248 or #249
Assignees
Labels

Comments

@joe-replin
Copy link
Contributor

Subject of the issue/enhancement/features

#212 introduced a few issues with content visibility in the drawer.

  • If a page is a descendant of a menu model, it and it's descendants will not display in the drawer. In the case of my testing, it is a grouped menu.
  • This additionally prevents any enabled articles, blocks & components from appearing in the drawer.

Your environment

  • FW v5.42.7
  • PLP v8.0.4

Steps to reproduce

  1. Attach to a build with grouped contentObjects.
  2. Enable _showAtCourseLevel.
  3. Optionally, toggle articles, blocks, and components to appear in the drawer.

Expected behaviour

With _showAtCourseLevel enabled, the drawer should behave exactly as it does when the setting is disabled, with the addition of other available pages appearing.

Actual behaviour

  • If a page is a descendant of a menu model (e.g., a grouped menu), neither the page nor its descendants appear in the drawer.
  • This also prevents any enabled articles, blocks, and components from being displayed in the drawer.

Additional context

The course-level item is visible, along with any contentObjects that are direct descendants of the course. However, deeper nested pages and content aren’t shown.

Screenshot

Image

@oliverfoster
Copy link
Member

The previous pr meant that the sub content objects would only show when their parent was the active content object. Is that behaviour broken?
Do you want all content objects to show all of the time?

@joe-replin
Copy link
Contributor Author

joe-replin commented Mar 20, 2025

Previous to the version in the pevious PR (one version before it), all contentObjects would show (aside from menus and the components from non-current pages), so I would expect that when _showAtCourseLevel is enabled.

But yes, it is breaking a course structure with grouped menu objects.

@oliverfoster
Copy link
Member

So it's not showing the sub content objects because the group content object is not navigable and will never be the current page?

@joe-replin
Copy link
Contributor Author

Directly sending you a link to a demonstration.

My theory is that #212 wasn't the appropriate fix for the issue at the time and that the duplication of contentObjects in the drawer was fixed elsewhere. The PR I have submitted for this issue produces a version of pageLevelProgress that aligns with my expectations on how it should work.

@oliverfoster
Copy link
Member

oliverfoster commented Mar 25, 2025

There are course configurations where the plp should show:

  1. A nested hierarchy of sub-menus:
    Image

  2. Just the contentobjects with _pageLevelProgress._isEnabled: true:
    Image

The current code does not allow for option 2, whereas option 2 used to be the default.
Suggest allowing option 2 if the contentobject has _pageLevelProgress._isEnabled: true but the parent has _pageLevelProgress._isEnabled: false, such that the plp configuration is atomic to each contentobject and does not remove its children from plp by default when disabled. Option 1 would be achieved by having both the parent and the child contentobject set to _pageLevelProgress._isEnabled: true, where the natural nesting reappears in line with the current code.
Pull request to fix #249

A secondary problem arises, in that if a sub-menu contentobject is a group (as per box menu) and not meant to be rendered as a sub-menu, then the plp will incorrectly navigate to a sub-menu rendering of the group when a group is clicked. This is primarily because the router treats all contentobjects as the main contentobject and it cannot treat contentobjects as sub-parts of their parent. The only code which is currently aware that it should treat sub-menus as groups is the box menu, which causes issues to arise in the plp and router.
Pull request to fix core adaptlearning/adapt-contrib-core#645
Pull request to fix boxmenu adaptlearning/adapt-contrib-boxMenu#213

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment