Skip to content
Snippets Groups Projects
Commit f2385607 authored by Tadeusz Miesiąc's avatar Tadeusz Miesiąc
Browse files

fix(pr fixes): pr fixes

parent f761422e
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...,!38feat(results list): connected drugs drawer to results list
Pipeline #80053 passed
import { assertNever } from '@/utils/assertNever';
import { PinType } from '../PinsList.types';
export const getPinColor = (type: PinType): string => {
switch (type) {
case 'bioEntity':
return 'fill-primary-500';
case 'drugs':
return 'fill-orange';
case 'chemicals':
return 'fill-purple';
case 'mirna':
return 'fill-primary-500';
case 'none':
return '';
default:
return assertNever(type);
}
const pinColors: Record<PinType, string> = {
bioEntity: 'fill-primary-500',
drugs: 'fill-orange',
chemicals: 'fill-purple',
mirna: 'fill-primary-500',
none: 'none',
};
return pinColors[type];
};
......@@ -31,13 +31,13 @@ export const resultListSelector = createSelector(rootSelector, state => {
switch (selectedType) {
case 'drugs':
return state.drugs.data!.map(drug => ({
return (state.drugs.data || []).map(drug => ({
id: drug.id,
name: drug.name,
data: drug,
}));
case 'chemicals':
return state.chemicals.data!.map(chemical => ({
return (state.chemicals.data || []).map(chemical => ({
id: chemical.id.id,
name: chemical.name,
data: chemical,
......@@ -45,7 +45,11 @@ export const resultListSelector = createSelector(rootSelector, state => {
case 'bioEntity':
return undefined;
case 'mirna':
return state.mirnas.data!.map(mirna => ({ id: mirna.id, name: mirna.name, data: mirna }));
return (state.mirnas.data || []).map(mirna => ({
id: mirna.id,
name: mirna.name,
data: mirna,
}));
case 'none':
return undefined;
default:
......
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