Open
Conversation
Trombach
suggested changes
Feb 20, 2022
research-hub-web/src/app/components/search-page/search-page.component.html
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
The bar is currently not sticky.
Contributor
Author
There was a problem hiding this comment.
@Trombach may need your help on this one.
...ponents/search-page/intranet-search-results-list/intranet-search-results-list.component.scss
Outdated
Show resolved
Hide resolved
...rch-hub-web/src/app/components/search-page/intranet-search/intranet-search.component.spec.ts
Show resolved
Hide resolved
Contributor
Author
|
@Trombach have addressed most comments, just haven't managed to fix the sticky filter bar. Also added some (very) basic error handling for if there's any issue with fetching search results. The error handling could be improved with adding more informative message for the user, but for now I think it is enough. |
Contributor
Author
|
@Trombach also, if you have time could you please do a quick check of the interface in Safari? 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature
Include results from the Staff Intranet in the ResearchHub search results UI
Description
The Intranet contains documents that overlap with the material the Research Hub provides. It is helpful to be able to include results from the Intranet in the Research Hub search, enabling users to navigate directly to these documents from the Research Hub search results page.
Intranet search results are accessed via a Swiftype API, within a collection called "Staff Intranet". This feature provides an update to the search page UI so logged-in users can choose to view the Intranet results, as well as the implementation of the backend API wrapper to access the Swiftype API securely. More information around the technical and security considerations of adding this feature can be found here.
Solution
Swiftype API Wrapper - Lambda function
A new endpoint has been added to the Hub-Search-Proxy lambda function which acts as a middleware between the UI and the Swiftype API. The purpose of this is to provide a secure way to access the Intranet search results, which must be behind SSO, as well as keeping the Swiftype API key in a secure location which will never be exposed to the frontend.
The new endpoint function is implemented in a separate handler file (uoasearch.js). The endpoint path is /uoasearch, which is configured in the serverless.yml, along with an API Gateway Authorizer to enable Cognito user pool authorization of requests to the endpoint. Requests must contain a valid auth token or they will be blocked by API Gateway. Requests are authorized by checking the user is in the valid access group to be able to view Staff Intranet data.
Search UI Changes
A tabbed interface has been added to the search results page using Angular Material Tabs component. ResearchHub results are shown in the default tab, and Staff Intranet results are shown (if the user is logged in) in a second tab, as a separate list. Results are only returned when a search query is present. Search filters are not applied on the Intranet results.
New components/services:
Cloudfront Function change
Screenshots
Before
After
Staff Intranet tab:

Testing
research-hub-web
IntranetSearchComponent:
IntranetSearchResultsListComponent:
IntranetSearchService
hub-search-proxy
Have the changes been checked in the following browsers?