feat(multisearch): rewrited redux store to support multisearch
Description
Added ability to multisearch values.
Thinks done
- Proposed new structure for the redux
- commented out, and skipped every conflict that interacts with search drawer
Breaking changes
-
GroupedSearchResults
components are broken -
ResultsListResults
components are broken This two groups of components needs to be discussed with Mateusz to allow merging changes
Additionally
- Fixed bug: QueryParams Bug -> Removed query params functionality. The solution is no longer valid.
- Fixed bug: Imposible to see search results again
How to check this PR
- start with
SearchBar
component andonSearch
function - understand new structure of the BioEntity,Drugs,Chemicals,Mirna - they are all the same. Check
fetchDataState
thenbioEntity.types
or any other type from mentioned group - check
search.thunk
and follow the route - check the BioEntity,Drugs,Chemicals,Mirna reducer If you check one of BioEntity,Drugs,Chemicals,Mirna -> rest is exactly the same
Merge request reports
Activity
requested review from @AdrianOrlow and @MateuszBolewski
13 }); 8 14 }); 9 15 builder.addCase(getChemicals.fulfilled, (state, action) => { 10 state.data = action.payload; 16 const chemicals = state.data.find(chemical => chemical.searchQueryElement === action.meta.arg); 17 if (chemicals) { 18 chemicals.data = action.payload; 19 chemicals.loading = 'succeeded'; 20 } 21 }); 22 builder.addCase(getChemicals.rejected, (state, action) => { 23 const chemicals = state.data.find(chemical => chemical.searchQueryElement === action.meta.arg); 24 if (chemicals) { 25 chemicals.loading = 'failed'; 26 // TODO: error management to be discussed in the team 27 } - Comment on lines +24 to +27
Why it is setting loading as failed only when there is a searched element in the chemicals array?
If we searched for an exact chemical and a thunk is rejected then this chemical won't be in the array, so will this be ever the case?
What if the request fails? Should it stay as "pending"?
The same applies for similar reducer builders like drugs, mirna etc.
- poc.ts 0 → 100644
1 // scenario: user inputs multi values up to 7 separated by comma. Click search changed this line in version 2 of the diff
added 20 commits
-
6e2b3cdc...e8e61c10 - 18 commits from branch
development
- 7765dda0 - Merge branch 'development' into feature/multisearch
- 90396fe7 - feat(search query): added search query to support multisearch
-
6e2b3cdc...e8e61c10 - 18 commits from branch
added 1 commit
- d392e6c7 - Revert "feat(search query): added search query to support multisearch"
added 20 commits
-
590a3eff...ae10651f - 19 commits from branch
development
- e4ba0765 - Merge branch 'development' into feature/multisearch
-
590a3eff...ae10651f - 19 commits from branch
enabled an automatic merge when the pipeline for e4ba0765 succeeds
mentioned in commit 8e885530