Skip to content

feat: add reactions details on map + interactive layer improvements

Closes MIN-118

User story:

As a user I would like to visually see where are the substances I’ve clicked, so I can select them easily from the map.

Also I would like to click on a reaction, see it's lines and products highlighted, so I can learn more from my research

Scenarios covered:

SCENARIO 1

  1. User clicks on the map
  2. BioEntity (ALIAS) is fetched and stored within bioEntites
  3. Icon of BioEntity is rendered on the map

SCENARIO 2

  1. User clicks on the map
  2. Reaction (REACTION) is fetched and stored within reactions
  3. Products (products, reactants, modifiers) of Reaction are fetched and stored within bioEntites
  4. Lines of Reaction are rendered on the map
  5. Icons of Products are rendered on the map

SCENARIO 3

  1. User clicks on the map
  2. [SCENARIO 1 OR 2]
  3. User clicks on the map [AGAIN]
  4. Reactions data is reseted. Note: BioEntity data is resetted always on fetch, so it's not needed
  5. [REST AS ABOVE]

SCENARIO 4

  1. User searches for something
  2. BioEntities (CONTENT) are rendered on the map, filtered by current model id
    • IF user selected currentSearchElement -> filtered by search element
    • IF user NOT selected currentSearchElement -> every element

Important info:

  1. this PR covers only presenting bioEntity (content) data as implementing other categories is too complex to do it in one PR (changes in API path, request result data structure, tests, mocks etc.)
  2. this PR doesn't serve full integration with search module. SCENARIO 4 covers only search->show pins, if user selects reaction/pin on the map (SCENARIO 1-3), it won't cover that properly. To do that, we need to reset search input and currentSearchElement on every click, but it's not possible to implement when search input is not globally stored in the Redux (resolved in !63 (merged))

Additional needed improvements:

  • divided tests into separate files and wrote test files for each of them

image

Edited by Adrian Orłów

Merge request reports