Skip to content

add header search box suggestions#59

Open
bblaisATcoveo wants to merge 2 commits intoServiceCanada:mainfrom
bblaisATcoveo:header-suggestions
Open

add header search box suggestions#59
bblaisATcoveo wants to merge 2 commits intoServiceCanada:mainfrom
bblaisATcoveo:header-suggestions

Conversation

@bblaisATcoveo
Copy link
Contributor

Add the suggestions to the global search box in the header of every page


// changing the URL without reloading the page to remove actionCause
if ( window.history.pushState ) {
var newurl = winLoc.href.replace( '&actionCause=' + urlParams.actionCause, '' );
Copy link
Contributor

Choose a reason for hiding this comment

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

You should use params.actionCause on this line

// changing the URL without reloading the page to remove actionCause
if ( window.history.pushState ) {
var newurl = winLoc.href.replace( '&actionCause=' + urlParams.actionCause, '' );
window.history.pushState( { path : newurl }, '', newurl );
Copy link
Contributor

Choose a reason for hiding this comment

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

During our next technical touchpoint with GC Search team, let's make it an item to consider and test this in case of edge cases such as other parameters used; I'm thinking Canadian Food Guide (https://food-guide.canada.ca/en/), as well as Canada Gazette (https://gazette.gc.ca/accueil-home-eng.html).


// override actionCause if present
if ( params.actionCause ) {
requestContent.analytics.actionCause = params.actionCause;
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't you need to clear params.actionClause it here as well?

*/
.query-suggestions {
background-color: white;
border-bottom: 1px solid #ccc;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this line since the style will apply from line 44 in this file instead. And please ensure the border color is consistent.

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.

2 participants