Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOP-3791 #856

Merged
merged 60 commits into from
Jul 20, 2023
Merged
Changes from 58 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
1b62003
DOP-3785: adding a persistent search bar
bianca-laube Jun 21, 2023
ffaa041
updating tests for new front end change
bianca-laube Jun 23, 2023
2eb0303
updating snapshots
bianca-laube Jun 23, 2023
af0b115
DOP-3788: changed the chips css and showed result numbers
bianca-laube Jun 26, 2023
108b194
updated snapshots
bianca-laube Jun 27, 2023
d2889fb
fixed component
bianca-laube Jun 27, 2023
736d213
fixing miniscule details
bianca-laube Jun 27, 2023
16509a8
fixed empty search and placeholder value
bianca-laube Jun 28, 2023
eed1e24
Adding feature flag
bianca-laube Jun 29, 2023
8356841
fixing empty container on empty search
bianca-laube Jul 5, 2023
2819361
updated tests snapshots
bianca-laube Jul 5, 2023
660587f
updating border radius
bianca-laube Jul 5, 2023
e47ab53
DOP-3789: updating card styling
bianca-laube Jul 6, 2023
620dbab
proper format for empty result on prod
bianca-laube Jul 6, 2023
2a0669d
catching infinite load edge case
bianca-laube Jul 7, 2023
14d0c7c
changing link colour if selected in history
bianca-laube Jul 7, 2023
9fcda2f
fixing infinite loop edge case second location
bianca-laube Jul 7, 2023
f667fb6
getting rid of redunt checks
bianca-laube Jul 7, 2023
ac10901
Merge branch 'master' into DOP-3785
bianca-laube Jul 7, 2023
7069943
merging with the updated DOP-3785 ticket
bianca-laube Jul 7, 2023
060932e
added the feature flag
bianca-laube Jul 7, 2023
f072d3a
fixing cards in mobile view
bianca-laube Jul 7, 2023
9a1c234
Merge branch 'DOP-3788' into DOP-3789
bianca-laube Jul 7, 2023
63da229
fixing the colour of the title
bianca-laube Jul 7, 2023
33e813b
adding feature flag
bianca-laube Jul 10, 2023
ab571c9
fixing html sanitizer
bianca-laube Jul 10, 2023
f4bdc8d
changed styleTag with feature flag
bianca-laube Jul 10, 2023
6c0ab2f
FIXED sanitizeHTML
bianca-laube Jul 10, 2023
b06bf47
updated changed with DOP-3788
bianca-laube Jul 10, 2023
a1dcea3
updated with master
bianca-laube Jul 11, 2023
36a1f24
working completely with the feature flag
bianca-laube Jul 12, 2023
8914c16
adding new no results module
bianca-laube Jul 13, 2023
5ea7d0c
Refactoring code
bianca-laube Jul 13, 2023
1725fb4
cleaning up code
bianca-laube Jul 13, 2023
678d545
cleaning up code
bianca-laube Jul 13, 2023
e233b4b
refactoring ternary statments
bianca-laube Jul 14, 2023
612a901
changing init value from null to ''
bianca-laube Jul 14, 2023
5b6fa5e
cleaning up unused variables
bianca-laube Jul 17, 2023
a9c553d
merging with master
bianca-laube Jul 17, 2023
01931ca
working with feature flag
bianca-laube Jul 17, 2023
7466676
changed naming of variable
bianca-laube Jul 17, 2023
3030e7a
updated with new changes in master/DOP-3789
bianca-laube Jul 17, 2023
82d0355
updating DOP-3786
bianca-laube Jul 17, 2023
f9624df
fixing empty search on init load
bianca-laube Jul 17, 2023
ac3ca89
fixing color variable
bianca-laube Jul 17, 2023
1ab3d7a
merigng with master
bianca-laube Jul 17, 2023
928f0e7
adding back functionality
bianca-laube Jul 17, 2023
7df813e
getting rid of double var declaration
bianca-laube Jul 17, 2023
0252740
getting rid of the double init variable
bianca-laube Jul 17, 2023
1052efe
refactor ternary operators. remove firstload state
seungpark Jul 18, 2023
d2c72bc
fixing blank state
bianca-laube Jul 18, 2023
52c6de1
adding difference in empty on first load
bianca-laube Jul 18, 2023
aeb3884
refactored feature flag code
bianca-laube Jul 18, 2023
36e3a65
updating with DOP-3786
bianca-laube Jul 18, 2023
64be4d8
fixing number result showing up
bianca-laube Jul 18, 2023
73da3f7
updated with DOP-3786
bianca-laube Jul 18, 2023
0995dc2
Merge branch 'master' into DOP-3791
bianca-laube Jul 19, 2023
16b7ea0
adding back mobile filter
bianca-laube Jul 19, 2023
39d6f51
fixing loading skeleton
bianca-laube Jul 19, 2023
7b85d7c
getting rid of duplicate search filter
bianca-laube Jul 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/components/SearchResults/SearchResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,16 @@ const SearchResults = () => {
setSearchFilter(searchProperty);
}, [search, firstRenderComplete]);

// add loading skeleton when new filter selected and loading results
useEffect(() => {
newSearchInput && setSearchFinished(false);
bianca-laube marked this conversation as resolved.
Show resolved Hide resolved
}, [searchFilter]);

// Update results on a new search query or filters
// When the filter is changed, find the corresponding property to display
useEffect(() => {
if (!searchTerm || !Object.keys(searchPropertyMapping).length) {
if (!searchTerm && firstRenderComplete) setSearchFinished(true);
return;
}
const fetchNewSearchResults = async () => {
Expand All @@ -314,7 +320,7 @@ const SearchResults = () => {
setSearchFinished(true);
};
fetchNewSearchResults();
}, [searchFilter, searchPropertyMapping, searchTerm]);
}, [searchFilter, searchPropertyMapping, searchTerm, firstRenderComplete]);

return (
<>
Expand Down Expand Up @@ -375,6 +381,11 @@ const SearchResults = () => {
</FilterBadgesWrapper>
)}
</ResultTag>
<MobileSearchButtonWrapper>
<Button leftGlyph={<Icon glyph={mobileFilterButton.glyph} />} onClick={mobileFilterButton.onClick}>
{mobileFilterButton.text}
</Button>
</MobileSearchButtonWrapper>
</HeaderContainer>

{/* loading state for new search input */}
Expand Down Expand Up @@ -448,6 +459,7 @@ const SearchResults = () => {
</FiltersContainer>
</>
)}
{showMobileFilters && isTabletOrMobile && <MobileFilters />}
</SearchResultsContainer>
)}

Expand Down Expand Up @@ -482,7 +494,7 @@ const SearchResults = () => {
</Button>
</MobileSearchButtonWrapper>
</HeaderContainer>
{searchResults?.length ? (
{searchResults?.length && searchFinished ? (
<>
<StyledSearchResults>
{searchResults.map(({ title, preview, url, searchProperty }, index) => (
Expand Down
Loading