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

Home page fixes #8744

Merged

Conversation

rtibbles
Copy link
Member

@rtibbles rtibbles commented Nov 18, 2021

Summary

  • Fixes issue for learner classroom viewset where there were no contentnodes to query, would query all contentnodes
  • Show classes section to learners who cannot see unassigned content but who are not in any classes
  • 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
  • Fixes an erroneous string reference (that I thought I fixed before?) in the side panel close button
  • Fixes a resumable resource check in the backend to check for progress greater than 0 and less than 1

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

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@rtibbles rtibbles added the TODO: needs review Waiting for review label Nov 18, 2021
@rtibbles rtibbles added this to the 0.15.0 milestone Nov 18, 2021
@pcenov
Copy link
Member

pcenov commented Nov 19, 2021

@rtibbles, yes the issues described in #8729 #8730 #8732 are now fixed and the homepage still loads quickly if a learner is assigned to a classroom with no assigned lessons or quizzes.

@@ -151,9 +151,6 @@ export default [
name: PageNames.TOPICS_CONTENT,
path: '/topics/c/:id',
handler: toRoute => {
if (unassignedContentGuard()) {
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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?

Copy link
Member

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.

Copy link
Member

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 });
    },
  },

Copy link
Member Author

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.

@MisRob MisRob self-requested a review November 22, 2021 16:15
Copy link
Member

@MisRob MisRob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @rtibbles

@rtibbles rtibbles merged commit 40656f7 into learningequality:release-v0.15.x Nov 22, 2021
@rtibbles rtibbles deleted the no_place_like_homepage branch November 22, 2021 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TODO: needs review Waiting for review
Projects
None yet
3 participants