Skip to content
Snippets Groups Projects
Commit a5e40a80 authored by Adrian Orłów's avatar Adrian Orłów
Browse files

feat: rfc changes

parent 0a163574
No related branches found
No related tags found
2 merge requests!223reset the pin numbers before search results are fetch (so the results will be...,!165feat: Add submap connections (MIN-276)
import lensIcon from '@/assets/vectors/icons/lens.svg'; import lensIcon from '@/assets/vectors/icons/lens.svg';
import { getSubmapConnectionsBioEntity } from '@/redux/bioEntity/thunks/getSubmapConnectionsBioEntity';
import { import {
currentSelectedSearchElement, currentSelectedSearchElement,
searchDrawerOpenSelector, searchDrawerOpenSelector,
...@@ -52,7 +51,6 @@ export const SearchBar = (): JSX.Element => { ...@@ -52,7 +51,6 @@ export const SearchBar = (): JSX.Element => {
const searchValues = getSearchValuesArrayAndTrimToSeven(searchValue); const searchValues = getSearchValuesArrayAndTrimToSeven(searchValue);
dispatch(resetReactionsData()); dispatch(resetReactionsData());
dispatch(getSubmapConnectionsBioEntity());
dispatch(getSearchData({ searchQueries: searchValues, isPerfectMatch })); dispatch(getSearchData({ searchQueries: searchValues, isPerfectMatch }));
openSearchDrawerIfClosed(getDefaultSearchTab(searchValues)); openSearchDrawerIfClosed(getDefaultSearchTab(searchValues));
}; };
...@@ -62,7 +60,6 @@ export const SearchBar = (): JSX.Element => { ...@@ -62,7 +60,6 @@ export const SearchBar = (): JSX.Element => {
if (event.code === ENTER_KEY_CODE) { if (event.code === ENTER_KEY_CODE) {
dispatch(resetReactionsData()); dispatch(resetReactionsData());
dispatch(getSubmapConnectionsBioEntity());
dispatch(getSearchData({ searchQueries: searchValues, isPerfectMatch })); dispatch(getSearchData({ searchQueries: searchValues, isPerfectMatch }));
openSearchDrawerIfClosed(getDefaultSearchTab(searchValues)); openSearchDrawerIfClosed(getDefaultSearchTab(searchValues));
} }
......
...@@ -8,7 +8,6 @@ import { ...@@ -8,7 +8,6 @@ import {
import { getCanvasIcon } from '@/components/Map/MapViewer/utils/config/getCanvasIcon'; import { getCanvasIcon } from '@/components/Map/MapViewer/utils/config/getCanvasIcon';
import { PINS_COLORS } from '@/constants/canvas'; import { PINS_COLORS } from '@/constants/canvas';
import { DEFAULT_MAX_ZOOM } from '@/constants/map'; import { DEFAULT_MAX_ZOOM } from '@/constants/map';
import { getSubmapConnectionsBioEntity } from '@/redux/bioEntity/thunks/getSubmapConnectionsBioEntity';
import { openSearchDrawerWithSelectedTab } from '@/redux/drawer/drawer.slice'; import { openSearchDrawerWithSelectedTab } from '@/redux/drawer/drawer.slice';
import { numberByEntityNumberIdSelector } from '@/redux/entityNumber/entityNumber.selectors'; import { numberByEntityNumberIdSelector } from '@/redux/entityNumber/entityNumber.selectors';
import { useAppDispatch } from '@/redux/hooks/useAppDispatch'; import { useAppDispatch } from '@/redux/hooks/useAppDispatch';
...@@ -56,7 +55,6 @@ export const BioEntitiesPinsListItem = ({ ...@@ -56,7 +55,6 @@ export const BioEntitiesPinsListItem = ({
const handleSearchMapForPin = (): void => { const handleSearchMapForPin = (): void => {
const searchValues = getSearchValuesArrayAndTrimToSeven(name); const searchValues = getSearchValuesArrayAndTrimToSeven(name);
dispatch(resetReactionsData()); dispatch(resetReactionsData());
dispatch(getSubmapConnectionsBioEntity());
dispatch(getSearchData({ searchQueries: searchValues, isPerfectMatch: true })); dispatch(getSearchData({ searchQueries: searchValues, isPerfectMatch: true }));
dispatch(openSearchDrawerWithSelectedTab(getDefaultSearchTab(searchValues))); dispatch(openSearchDrawerWithSelectedTab(getDefaultSearchTab(searchValues)));
}; };
......
/* eslint-disable no-magic-numbers */ /* eslint-disable no-magic-numbers */
import { FIRST_ARRAY_ELEMENT, SECOND_ARRAY_ELEMENT } from '@/constants/common'; import { FIRST_ARRAY_ELEMENT, SECOND_ARRAY_ELEMENT, THIRD_ARRAY_ELEMENT } from '@/constants/common';
import { SEARCH_STATE_INITIAL_MOCK } from '@/redux/search/search.mock'; import { SEARCH_STATE_INITIAL_MOCK } from '@/redux/search/search.mock';
import { AppDispatch, RootState, StoreType } from '@/redux/store'; import { AppDispatch, RootState, StoreType } from '@/redux/store';
import { getReduxStoreWithActionsListener } from '@/utils/testing/getReduxStoreActionsListener'; import { getReduxStoreWithActionsListener } from '@/utils/testing/getReduxStoreActionsListener';
...@@ -105,12 +105,10 @@ describe('PerfectMatchSwitch - component', () => { ...@@ -105,12 +105,10 @@ describe('PerfectMatchSwitch - component', () => {
type: 'reactions/resetReactionsData', type: 'reactions/resetReactionsData',
}); });
expect(actions[2].type).toBe('project/getSubmapConnectionsBioEntity/pending'); expect(actions[THIRD_ARRAY_ELEMENT].meta.arg).toStrictEqual({
expect(actions[3].meta.arg).toStrictEqual({
isPerfectMatch: true, isPerfectMatch: true,
searchQueries: ['nadh', 'scna'], searchQueries: ['nadh', 'scna'],
}); });
expect(actions[3].type).toEqual('project/getSearchData/pending'); expect(actions[THIRD_ARRAY_ELEMENT].type).toEqual('project/getSearchData/pending');
}); });
}); });
/* eslint-disable jsx-a11y/label-has-associated-control */ /* eslint-disable jsx-a11y/label-has-associated-control */
import { getSubmapConnectionsBioEntity } from '@/redux/bioEntity/thunks/getSubmapConnectionsBioEntity';
import { useAppDispatch } from '@/redux/hooks/useAppDispatch'; import { useAppDispatch } from '@/redux/hooks/useAppDispatch';
import { useAppSelector } from '@/redux/hooks/useAppSelector'; import { useAppSelector } from '@/redux/hooks/useAppSelector';
import { resetReactionsData } from '@/redux/reactions/reactions.slice'; import { resetReactionsData } from '@/redux/reactions/reactions.slice';
...@@ -22,7 +21,6 @@ export const PerfectMatchSwitch = (): JSX.Element => { ...@@ -22,7 +21,6 @@ export const PerfectMatchSwitch = (): JSX.Element => {
setChecked(isCheckedNewValue); setChecked(isCheckedNewValue);
dispatch(resetReactionsData()); dispatch(resetReactionsData());
dispatch(getSubmapConnectionsBioEntity());
dispatch(getSearchData({ searchQueries: searchValue, isPerfectMatch: isCheckedNewValue })); dispatch(getSearchData({ searchQueries: searchValue, isPerfectMatch: isCheckedNewValue }));
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment