Skip to content
Snippets Groups Projects

feat(multisearch): rewrited redux store to support multisearch

Merged Tadeusz Miesiąc requested to merge feature/multisearch into development
2 unresolved threads

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

How to check this PR

  • start with SearchBar component and onSearch function
  • understand new structure of the BioEntity,Drugs,Chemicals,Mirna - they are all the same. Check fetchDataState then bioEntity.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
Edited by Tadeusz Miesiąc

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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.

  • It's because:

    chemicalsStore = { data: [{searchQueryElement: 'element1', data: [...], loading: ..., error: ...},{searchQueryElement: 'element2', data: [...], loading: ..., error: ...}] loading: ... error: ... }

    This finds corresponding loading element for given searchQueryElement

  • Please register or sign in to reply
  • poc.ts 0 → 100644
    1 // scenario: user inputs multi values up to 7 separated by comma. Click search
  • LGTM

    Deleting poc file is an RFC

  • Adrian Orłów approved this merge request

    approved this merge request

  • Tadeusz Miesiąc added 20 commits

    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

    Compare with previous version

  • added 1 commit

    • d392e6c7 - Revert "feat(search query): added search query to support multisearch"

    Compare with previous version

  • Tadeusz Miesiąc added 3 commits

    added 3 commits

    • 90396fe7 - feat(search query): added search query to support multisearch
    • f68fca3d - fix(fix): fix
    • c8d8a561 - Merge branch 'feature/searchparams' into 'feature/multisearch'

    Compare with previous version

  • Tadeusz Miesiąc added 2 commits

    added 2 commits

    • 62207997 - feat(perfect match): implemented perfect match component
    • 590a3eff - Merge branch 'feature/perfect-match' into 'feature/multisearch'

    Compare with previous version

  • Tadeusz Miesiąc added 20 commits

    added 20 commits

    Compare with previous version

  • Tadeusz Miesiąc enabled an automatic merge when the pipeline for e4ba0765 succeeds

    enabled an automatic merge when the pipeline for e4ba0765 succeeds

  • Tadeusz Miesiąc mentioned in commit 8e885530

    mentioned in commit 8e885530

  • Please register or sign in to reply
    Loading