Skip to content

Conversation

@DanBloxham-sw
Copy link
Contributor

@DanBloxham-sw DanBloxham-sw commented Jan 20, 2022

…ing page

JIRA link

https://softwiretech.atlassian.net/browse/HEEDLS-650

Description

Added searching and pagination to the Recommended Learning page.

Screenshots

Desktop:

recommended learning desktop

Desktop (No JS):

recommended learning desktop NO JS

Tablet:

Mobile:


Developer checks

(Leave tasks unticked if they haven't been appropriate for your ticket.)

I have:

  • Run the formatter and made sure there are no IDE errors.
  • Written tests for the changes (accessibility tests, unit tests for controller, data services, services, view models, etc)
  • Manually tested my work with and without JavaScript. Full manual testing guidelines can be found here: https://softwiretech.atlassian.net/wiki/spaces/HEE/pages/6703648740/Testing
  • Updated/added documentation in Swiki and/or Readme. Links (if any) are below:
  • Updated my Jira ticket with information about other parts of the system that were touched as part of the MR and have to be sanity tested to ensure nothing’s broken.
  • Scanned over my own MR to ensure everything is as expected.

Copy link
Contributor

@AlexJacksonDS AlexJacksonDS left a comment

Choose a reason for hiding this comment

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

A couple of questions, but looks mostly fine

public AllRecommendedLearningItemsViewModel(IEnumerable<RecommendedResource> resources, int selfAssessmentId)
{
RecommendedResources =
resources.OrderByDescending(r => r.RecommendationScore).Select(r => new SearchableRecommendedResourceViewModel(r, selfAssessmentId));
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need the order by here? Or is this to make the javascript ordering work as expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without it, the JS ordering doesn't work properly. But that is only because I have no properly set up the JS ordering as we would expect.

We need to order based on the Recommendation Score, but we don't currently pass that through to card (only the wording for the tag). I thought that, rather than adding some hidden values to each card and setting up the SortOptions, I'd just order them in this view model first. The JS manipulation then preserves the order as it is because it doesn't have anything to sort on.

It's only a small reduction in the code necessary, and not a big time sink to implement the usual way, so I'm happy to implement that if you think it'd be better than using this workaround.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough, I don't really thing it matters either way, so lets just leave it for now

Copy link
Contributor

@davidm-m davidm-m left a comment

Choose a reason for hiding this comment

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

All looks good to me, I'm just interested to know why we don't want caching on certain endpoints.

return competencies;
}

[NoCaching]
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for my benefit, why do we need NoCaching?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was going to link the thread but realised it was in the signposting channel you don't have access to.

This tackles the drive-through bug fix in the ticket description. In short, when going through the self assessment journey, clicking some links causes the current page content to be temporarily replaced with a loading-spinner while waiting for the response for the next page. If you reach the next page, and then hit the back button, the previous page is recovered from the browser cache to display, rather than making a call to the action. Because the cache has the latest version of the page, it has the loading spinner replace all the content on that page, making it useless until you refresh the page. NoCaching just cuts out the need to refresh, as it forces the browser to always make a call to the action.

@DanBloxham-sw DanBloxham-sw merged commit e72164a into master Jan 25, 2022
@DanBloxham-sw DanBloxham-sw deleted the HEEDLS-650-RecommendedLearningPageSearchAndPaginate branch January 25, 2022 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants