-
Notifications
You must be signed in to change notification settings - Fork 716
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
Home page fixes #8744
Home page fixes #8744
Conversation
content but are not enrolled in any classes.
kolibri/plugins/learn/assets/src/views/HomePage/__tests__/HomePage.spec.js
Outdated
Show resolved
Hide resolved
@@ -151,9 +151,6 @@ export default [ | |||
name: PageNames.TOPICS_CONTENT, | |||
path: '/topics/c/:id', | |||
handler: toRoute => { | |||
if (unassignedContentGuard()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what the desired effect of this change was. The PR description says
Remove the unassigned content guard from the content page route so that learners can access content when they are only allowed to access assigned content
but removing it will allow learners to access this page no matter their device settings, is that right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - with this guard in place, learners could not access a content page at all. This is a result of the deprecation and removal of the lesson specific content page in favour of TOPICS_CONTENT
- I don't know that this was entirely intentional, but that's where we are now, so we need to allow this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. If we allow all learners to access a resource page, what about related pages that still have the guard in place and it's possible to navigate there from this page, for example this route? Does the guard need to be removed from every related page then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if it'd make sense to rather revisit the guard based on new requirements when compared to removing only one of its occurrences to prevent issues that could result from having it for some routes and not having it for others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry for the invalid route link, not sure what's wrong. I was referencing one route above:
{
name: PageNames.TOPICS_TOPIC,
path: '/topics/t/:id/:subtopic?',
handler: (toRoute, fromRoute) => {
if (unassignedContentGuard()) {
return unassignedContentGuard();
}
// If navigation is triggered by a custom navigation updating the
// context query param, do not run the handler
if (toRoute.params.id === fromRoute.params.id) {
return;
}
showTopicsTopic(store, { id: toRoute.params.id, pageName: toRoute.name });
},
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should still be in place - when we are viewing content in the lesson context, and the unassigned content guard is active, we shouldn't be providing links to topics or non-assigned content pages. There's an open issue for this in the context of the completion modal, but I think in all other cases we are avoiding this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @rtibbles
Summary
References
Fixes #8729
Fixes #8730
Fixes #8732
Reviewer guidance
If a learner is assigned to a classroom but has no lessons or quizzes, does the homepage still load quickly?
Confirm fixes for the three above.
Testing checklist
PR process
Reviewer checklist
yarn
andpip
)