Skip to content

Commit

Permalink
DOP-3374: Render search results with empty previews (#738)
Browse files Browse the repository at this point in the history
  • Loading branch information
rayangler authored and schmalliso committed Nov 22, 2022
1 parent b6bc36d commit 52e4e18
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/SearchResults/SearchResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const HeaderContainer = styled('div')`
`;

const HeaderText = styled('h1')`
color: ${palette.black} !important;
font-size: 18px;
line-height: 21px;
${commonTextStyling};
Expand Down
2 changes: 2 additions & 0 deletions src/components/Searchbar/SearchResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ const StyledPreviewText = styled(Body)`
line-height: 20px;
margin-bottom: ${theme.size.default};
${({ maxLines }) => truncate(maxLines)};
// Reserve some space inside of the search result card when there is no preview
min-height: 20px;
`;

const StyledResultTitle = styled('p')`
Expand Down
2 changes: 2 additions & 0 deletions src/utils/escape-reserved-html-characters.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* See DOP-2863 for rationale.
*/
export const escapeHtml = (unsafe) => {
if (!unsafe) return '';

return unsafe
.replaceAll('&', '&')
.replaceAll('<', '&lt;')
Expand Down
7 changes: 7 additions & 0 deletions tests/unit/__snapshots__/SearchResults.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ exports[`Search Results Page considers a given search filter query param and dis
}
.emotion-4 {
color: #001E2B!important;
font-size: 18px;
line-height: 21px;
font-family: Akzidenz;
Expand Down Expand Up @@ -335,6 +336,7 @@ exports[`Search Results Page considers a given search filter query param and dis
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
min-height: 20px;
}
.emotion-29 {
Expand Down Expand Up @@ -1093,6 +1095,7 @@ exports[`Search Results Page does not return results for a given search term wit
}
.emotion-4 {
color: #001E2B!important;
font-size: 18px;
line-height: 21px;
font-family: Akzidenz;
Expand Down Expand Up @@ -2252,6 +2255,7 @@ exports[`Search Results Page renders loading images before returning no results
}
.emotion-4 {
color: #001E2B!important;
font-size: 18px;
line-height: 21px;
font-family: Akzidenz;
Expand Down Expand Up @@ -3035,6 +3039,7 @@ exports[`Search Results Page renders loading images before returning nonempty re
}
.emotion-4 {
color: #001E2B!important;
font-size: 18px;
line-height: 21px;
font-family: Akzidenz;
Expand Down Expand Up @@ -3818,6 +3823,7 @@ exports[`Search Results Page renders results from a given search term query para
}
.emotion-4 {
color: #001E2B!important;
font-size: 18px;
line-height: 21px;
font-family: Akzidenz;
Expand Down Expand Up @@ -4075,6 +4081,7 @@ exports[`Search Results Page renders results from a given search term query para
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
min-height: 20px;
}
.emotion-23 {
Expand Down

0 comments on commit 52e4e18

Please sign in to comment.