fix: news search redirects and loading indicator (#38048)

Disable loading indicator and redirect to full news search page url so NGINX no longer redirects to ../news/news/search?query=...
This commit is contained in:
Kristofer Koishigawa
2020-01-13 07:52:27 +09:00
committed by mrugesh
parent e925e854f1
commit 978bae6716
3 changed files with 4 additions and 4 deletions

View File

@ -115,7 +115,7 @@ export class SearchBar extends Component {
// when non-empty search input submitted // when non-empty search input submitted
return query return query
? window.location.assign( ? window.location.assign(
`https://freecodecamp.org/news/search/?query=${encodeURIComponent( `https://www.freecodecamp.org/news/search/?query=${encodeURIComponent(
query query
)}` )}`
) )
@ -188,7 +188,7 @@ export class SearchBar extends Component {
onChange={this.handleChange} onChange={this.handleChange}
onFocus={this.handleFocus} onFocus={this.handleFocus}
onSubmit={this.handleSearch} onSubmit={this.handleSearch}
showLoadingIndicator={true} showLoadingIndicator={false}
translations={{ placeholder }} translations={{ placeholder }}
/> />
</ObserveKeys> </ObserveKeys>

View File

@ -17,7 +17,7 @@ const CustomHits = connectHits(
{ {
objectID: `default-hit-${searchQuery}`, objectID: `default-hit-${searchQuery}`,
query: searchQuery, query: searchQuery,
url: `https://freecodecamp.org/news/search/?query=${encodeURIComponent( url: `https://www.freecodecamp.org/news/search/?query=${encodeURIComponent(
searchQuery searchQuery
)}`, )}`,
title: `See all results for ${searchQuery}`, title: `See all results for ${searchQuery}`,

View File

@ -14,7 +14,7 @@ const Suggestion = ({ hit, handleMouseEnter, handleMouseLeave }) => {
} }
href={ href={
dropdownFooter dropdownFooter
? `https://freecodecamp.org/news/search/?query=${encodeURIComponent( ? `https://www.freecodecamp.org/news/search/?query=${encodeURIComponent(
hit.query hit.query
)}` )}`
: hit.url : hit.url