From 3a1ee1d5fc777a47e61defb27ba1b336a0aa1d15 Mon Sep 17 00:00:00 2001 From: Boris Kovar Date: Mon, 9 Nov 2020 13:01:05 +0100 Subject: [PATCH 1/2] -updated version number --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f44f91aaf..ed2b56dc0 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fragalysis-frontend", - "version": "0.9.11", + "version": "0.9.18", "description": "Frontend for fragalysis", "main": "webpack.config.js", "scripts": { From 95701a31107ab321e7ecfc6a946ed8102f9c4822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1na=20Kohanov=C3=A1?= Date: Mon, 9 Nov 2020 14:04:48 +0100 Subject: [PATCH 2/2] #451 Compounds are not displayed for a vector --- .../preview/molecule/redux/dispatchActions.js | 5 ++--- js/reducers/api/selectors.js | 1 + js/reducers/selection/selectors.js | 12 +++++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/js/components/preview/molecule/redux/dispatchActions.js b/js/components/preview/molecule/redux/dispatchActions.js index 9ace772fd..6659ce577 100644 --- a/js/components/preview/molecule/redux/dispatchActions.js +++ b/js/components/preview/molecule/redux/dispatchActions.js @@ -42,8 +42,8 @@ import { setCompoundImage } from '../../summary/redux/actions'; import { noCompoundImage } from '../../summary/redux/reducer'; import { getMoleculeOfCurrentVector } from '../../../../reducers/selection/selectors'; import { resetCurrentCompoundsSettings } from '../../compounds/redux/actions'; -import {selectMoleculeGroup} from '../../moleculeGroups/redux/dispatchActions'; -import {setDirectAccess, setDirectAccessProcessed} from '../../../../reducers/api/actions'; +import { selectMoleculeGroup } from '../../moleculeGroups/redux/dispatchActions'; +import { setDirectAccess, setDirectAccessProcessed } from '../../../../reducers/api/actions'; /** * Convert the JSON into a list of arrow objects @@ -438,5 +438,4 @@ export const applyDirectSelection = (stage, stageSummaryView) => (dispatch, getS // dispatch(setDirectAccess({})); dispatch(setDirectAccessProcessed(true)); } - }; diff --git a/js/reducers/api/selectors.js b/js/reducers/api/selectors.js index 409289146..3bca464a3 100644 --- a/js/reducers/api/selectors.js +++ b/js/reducers/api/selectors.js @@ -1 +1,2 @@ export const getMoleculeList = state => state.apiReducers.molecule_list; +export const getAllMoleculeList = state => state.apiReducers.all_mol_lists; diff --git a/js/reducers/selection/selectors.js b/js/reducers/selection/selectors.js index f54f9b288..8aa98b9d5 100644 --- a/js/reducers/selection/selectors.js +++ b/js/reducers/selection/selectors.js @@ -1,5 +1,5 @@ import { createSelector } from 'reselect'; -import { getMoleculeList } from '../api/selectors'; +import { getAllMoleculeList } from '../api/selectors'; const getCurrentCompoundClass = state => state.previewReducers.compounds.currentCompoundClass; const getVectorList = state => state.selectionReducers.vector_list; @@ -10,14 +10,16 @@ const getCompoundsOfVectors = state => state.selectionReducers.compoundsOfVector export const getMoleculeOfCurrentVector = createSelector( getCurrentVector, getVectorList, - getMoleculeList, + getAllMoleculeList, (selectedVectorSmile, vectorList, moleculeList) => { if (selectedVectorSmile !== null && vectorList && moleculeList) { const foundedVector = vectorList.find(vector => vector.name.includes(selectedVectorSmile)); if (foundedVector) { - for (const molecule in moleculeList) { - if (moleculeList.hasOwnProperty(molecule)) { - if (molecule.id === foundedVector.moleculeId) { + for (const moleculeProperty in moleculeList) { + if (moleculeList.hasOwnProperty(moleculeProperty)) { + let molecules = moleculeList[moleculeProperty]; + let molecule = molecules.find(m => m.id === foundedVector.moleculeId); + if (molecule) { return molecule; } }