Skip to content

Commit 2bb175f

Browse files
matej-vavrekboriskovar-m2msRoboMatuska
authored
#1249 update (#401)
* Update build-main.yaml got rid of scheduled rebuild because it's messing up data * updated react16 to react 18.2, replaced hot-loaders modules by react-refresh, removed react-undo module * added proper values for Typography variant * renamed obsolete create theme function * #1063 added header and search * #1063 fixed body table, page count and search * #1063 fixed minor bugs and set clear filter * Squashed commit of the following: commit 10925d2 Author: RobertMatuska <robert.matuska@m2ms.sk> Date: Thu Sep 28 10:27:36 2023 +0200 #1114 edited text and style * #1161 setted search and filter for old target list * #1161 fixed discourse icon padding * #1161 fixed filtered list sort * #1161 fixed target access sort and filter * #1161 fixed change page * #1145 preserve state of molecule rendering, save also actions of representation changes to snapshot * do not wrap display controls buttons * #1167 resize target list colmuns * #1161 fixed sorting * #1161 fixed sorting * #1161 edit sort functionality for filter table * #1161 fixed search, filter, sort by target access * #1161 created init date column * #1161 # filtering and sorting init date * #1161 fixed clear and sort init date * #1161 fixed target sorting * Squashed commit of the following: commit d489526 Merge: 1c45038 411921f Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Oct 16 08:24:05 2023 +0200 Merge branch '#1173' of https://github.com/m2ms/fragalysis-frontend into #1173 commit 1c45038 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Fri Oct 13 11:03:49 2023 +0200 - implemented #1173 also with save/restore and undo/redo functionality commit 411921f Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Fri Oct 13 11:03:49 2023 +0200 - implemented #1173 also with save/restore and undo/redo functionality * merge * Squashed commit of the following: commit 7883c15 Merge: 5e2b937 19b9f24 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Oct 16 11:19:36 2023 +0200 Merge branch '#1172' of https://github.com/m2ms/fragalysis-frontend into #1172 commit 5e2b937 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Oct 16 11:16:15 2023 +0200 - added compound_set to csv export - #1172 commit 19b9f24 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Oct 16 11:16:15 2023 +0200 - added compound_set to csv export - #1172 commit 75ac125 Merge: f50666c 574c7b5 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Oct 16 08:26:08 2023 +0200 Merge branch '#1172' of https://github.com/m2ms/fragalysis-frontend into #1172 commit f50666c Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Fri Oct 13 13:45:34 2023 +0200 - implemented #1172 commit 574c7b5 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Fri Oct 13 13:45:34 2023 +0200 - implemented #1172 * #1167 fixed issues * #1167 reworked resizer * #1161 fixed merge bugs * #1161 removed console * updated react16 to react 18.2, replaced hot-loaders modules by react-refresh, removed react-undo module * added proper values for Typography variant * renamed obsolete create theme function * changed deprecated justify= to justifyContent= * fixed some landing page errors, mostly missing key and using useState outside of useEffect in functional component * #1061 loading and toast functionality move from header context into LoadingContext and ToastContext, added loading indicator for tags and hits panes + hit/molecule control buttons * #1171 return representations when loading protein without quality to show it in display control * do not set logged in toast message if user is not logged in * fixed Tooltip error messages about its disabled child, fixed invalid variant type and removed xs from Grid container (it is Grid item property) * fixed null value for open property * fixed "ButtonGroup component doesn't accept a Fragment as a child. Consider providing an array instead" * fixed "<div> cannot appear as a descendant of <p>" error by adding "component={'div'}" property to complex Typography component * removed invalid way of setting color for tag, it does not work - only throws error and with proper setting it is same as background color.. * fixed missing key error * fixed invalid references erros * fixed unknown properties error and missing key * - #1139 - updated docker-compose file to be ready for new backend version * - initial implementation of #1139 - tags and molecules * - #1139 - tags, molecules updated to use new api - not final version * - changed configuration * - #1139 - updated docker-compose file to be ready for new backend version * - initial implementation of #1139 - tags and molecules * - #1139 - tags, molecules updated to use new api - not final version * - fixed search bar placeholder for hits * - #1139 - updated docker-compose file to be ready for new backend version * - initial implementation of #1139 - tags and molecules * - #1139 - tags, molecules updated to use new api - not final version * - initial implementation of #1139 - tags and molecules * - #1139 - tags, molecules updated to use new api - not final version * - #1139 - fixed snapshot creation and restoration * #1167 target and project list resizer * #1167 fixed project list width * #1161 changed width * - #1183 - dynamic handling of tag categories * - fixed #1186 * - job file transfer backend * - checkpoint * - new CI/CD * Update build-main.yaml got rid of scheduled rebuild because it's messing up data * updated react16 to react 18.2, replaced hot-loaders modules by react-refresh, removed react-undo module * added proper values for Typography variant * renamed obsolete create theme function * changed deprecated justify= to justifyContent= * fixed some landing page errors, mostly missing key and using useState outside of useEffect in functional component * rebase * #1171 return representations when loading protein without quality to show it in display control * do not set logged in toast message if user is not logged in * fixed Tooltip error messages about its disabled child, fixed invalid variant type and removed xs from Grid container (it is Grid item property) * fixed null value for open property * fixed "ButtonGroup component doesn't accept a Fragment as a child. Consider providing an array instead" * fixed "<div> cannot appear as a descendant of <p>" error by adding "component={'div'}" property to complex Typography component * removed invalid way of setting color for tag, it does not work - only throws error and with proper setting it is same as background color.. * fixed missing key error * fixed invalid references erros * fixed unknown properties error and missing key * - #1139 - updated docker-compose file to be ready for new backend version * - initial implementation of #1139 - tags and molecules * - #1139 - tags, molecules updated to use new api - not final version * - changed configuration * - #1139 - updated docker-compose file to be ready for new backend version * - initial implementation of #1139 - tags and molecules * - #1139 - tags, molecules updated to use new api - not final version * - fixed search bar placeholder for hits * - #1139 - updated docker-compose file to be ready for new backend version * - initial implementation of #1139 - tags and molecules * - #1139 - tags, molecules updated to use new api - not final version * - initial implementation of #1139 - tags and molecules * - #1139 - tags, molecules updated to use new api - not final version * - #1139 - fixed snapshot creation and restoration * - #1183 - dynamic handling of tag categories * - job file transfer backend * - checkpoint * - new CI/CD * - fixed build errors * Squashed commit of the following: commit d5c9709 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Thu Nov 16 07:36:56 2023 +0100 - fixes blank page * #1035 added front-end pert of status lights for services * #1035 added API endpoint and changed refresh rate to 30 seconds for now * #1035 do not end up on failed response * Squashed commit of the following: commit e1dd8bd Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 21 09:16:46 2023 +0100 - #1211 fixed and also fixed other problems which were hiding problems with snapshot restoration * Squashed commit of the following: commit e79b49f Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Thu Dec 7 09:44:55 2023 +0100 - fixed RHS for #1239 * #1217 save all actions to action list for snapshot not only the first ones, fixed of possible crash, adjusted restoring representations from snapshot * - updated docker-compose * Squashed commit of the following: commit 50d574d Merge: 1fdebff 3b4e7a7 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Wed Dec 13 09:06:19 2023 +0100 Merge branch '#1190' of https://github.com/m2ms/fragalysis-frontend into #1190 commit 1fdebff Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Wed Dec 13 08:14:58 2023 +0100 - RC of #1190 commit dabee45 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Dec 5 09:20:02 2023 +0100 - checkpoint commit 4e9a674 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Thu Nov 16 13:17:05 2023 +0100 - using new backend image commit c90fc47 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 16:13:26 2023 +0100 - L, P, C, S, V buttons work now commit 515cb8b Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 08:28:59 2023 +0100 - checkpoint commit ab0a297 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 06:42:52 2023 +0100 - checkpoint commit 216762b Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 08:28:59 2023 +0100 - checkpoint commit 6f628a7 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 06:42:52 2023 +0100 - checkpoint commit 823bf2c Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 16:13:26 2023 +0100 - L, P, C, S, V buttons work now commit a7aa657 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 08:28:59 2023 +0100 - checkpoint commit 101751b Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 06:42:52 2023 +0100 - checkpoint commit 5a6935a Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 08:28:59 2023 +0100 - checkpoint commit 1d01387 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 06:42:52 2023 +0100 - checkpoint commit b3c7813 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Thu Nov 16 13:17:05 2023 +0100 - using new backend image commit f48dc9d Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 16:13:26 2023 +0100 - L, P, C, S, V buttons work now commit 813b553 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 08:28:59 2023 +0100 - checkpoint commit b49f773 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 06:42:52 2023 +0100 - checkpoint commit 98f566b Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 08:28:59 2023 +0100 - checkpoint commit a01f097 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 06:42:52 2023 +0100 - checkpoint commit a6d8930 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 14 16:42:23 2023 +0100 - #1190 - implemented tags commit 392938b Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 16:13:26 2023 +0100 - L, P, C, S, V buttons work now commit 69ab4c2 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 08:28:59 2023 +0100 - checkpoint commit e6b700b Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 06:42:52 2023 +0100 - checkpoint commit a7e6aad Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 08:28:59 2023 +0100 - checkpoint commit 4fc93c0 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 12:03:11 2023 +0100 - checkpoint commit 58573f6 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 06:42:52 2023 +0100 - checkpoint commit ecc3d6c Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Thu Nov 2 07:59:19 2023 +0100 - #1190 - compounds for LHS commit 3b4e7a7 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Wed Dec 13 08:14:58 2023 +0100 - RC of #1190 commit 1debb80 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Dec 5 09:20:02 2023 +0100 - checkpoint commit 4f714be Merge: 730d9e5 bcc1568 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Wed Nov 22 07:41:51 2023 +0100 Merge branch '#1190' of https://github.com/m2ms/fragalysis-frontend into #1190 # Conflicts: # js/reducers/api/apiReducers.js # js/reducers/api/constants.js commit 730d9e5 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Thu Nov 16 13:17:05 2023 +0100 - using new backend image commit 76ea646 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 16:13:26 2023 +0100 - L, P, C, S, V buttons work now commit 67439de Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 08:28:59 2023 +0100 - checkpoint commit a38e0a3 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 06:42:52 2023 +0100 - checkpoint commit 64b67c5 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 08:28:59 2023 +0100 - checkpoint commit 35b2777 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 06:42:52 2023 +0100 - checkpoint commit 8104514 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 14 16:42:23 2023 +0100 - #1190 - implemented tags commit 5432a99 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 16:13:26 2023 +0100 - L, P, C, S, V buttons work now commit f5ea66f Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 08:28:59 2023 +0100 - checkpoint commit d3fb020 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 06:42:52 2023 +0100 - checkpoint commit 84d4889 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 08:28:59 2023 +0100 - checkpoint commit 2979630 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 12:03:11 2023 +0100 - checkpoint commit 7241df5 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 06:42:52 2023 +0100 - checkpoint commit 195e30e Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Thu Nov 2 07:59:19 2023 +0100 - #1190 - compounds for LHS commit bcc1568 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Thu Nov 16 13:17:05 2023 +0100 - using new backend image commit 60136ed Merge: 85c06a9 a18f80f Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Thu Nov 16 08:01:49 2023 +0100 Merge branch '#1190' of https://github.com/m2ms/fragalysis-frontend into #1190 commit 85c06a9 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 14 16:42:23 2023 +0100 - #1190 - implemented tags commit 6dd0268 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 16:13:26 2023 +0100 - L, P, C, S, V buttons work now commit 0854241 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 08:28:59 2023 +0100 - checkpoint commit 1686e02 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 06:42:52 2023 +0100 - checkpoint commit ffba65b Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 08:28:59 2023 +0100 - checkpoint commit 1f22288 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 12:03:11 2023 +0100 - checkpoint commit e5a04e5 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 06:42:52 2023 +0100 - checkpoint commit 155a96b Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Thu Nov 2 07:59:19 2023 +0100 - #1190 - compounds for LHS commit a18f80f Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 14 16:42:23 2023 +0100 - #1190 - implemented tags commit 43b7476 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 16:13:26 2023 +0100 - L, P, C, S, V buttons work now commit 1f9eba8 Merge: 17b9cb1 3d51ab0 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 08:52:19 2023 +0100 Merge branch '#1190' of https://github.com/m2ms/fragalysis-frontend into #1190 commit 17b9cb1 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 08:28:59 2023 +0100 - checkpoint commit 63122eb Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 12:03:11 2023 +0100 - checkpoint commit 362ec04 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 06:42:52 2023 +0100 - checkpoint commit 26d2f31 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Thu Nov 2 07:59:19 2023 +0100 - #1190 - compounds for LHS commit 3d51ab0 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Nov 13 08:28:59 2023 +0100 - checkpoint commit e3138f7 Merge: 3beca8c c95b841 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Thu Nov 9 13:47:44 2023 +0100 Merge branch '#1190' of https://github.com/m2ms/fragalysis-frontend into #1190 commit 3beca8c Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 12:03:11 2023 +0100 - checkpoint commit 2d8e3c4 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 06:42:52 2023 +0100 - checkpoint commit fa13fe9 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Thu Nov 2 07:59:19 2023 +0100 - #1190 - compounds for LHS commit c95b841 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 12:03:11 2023 +0100 - checkpoint commit 74fb512 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Nov 7 06:42:52 2023 +0100 - checkpoint commit 2833754 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Thu Nov 2 07:59:19 2023 +0100 - #1190 - compounds for LHS * - fix for tags * - fixed issue with checkboxes for #1190 * #1181 fixed min width and maximum width design * #1181 created compound sets table * #1181 fixed layout with Compound sets * #1181 changed functionality for radio buttons * #1181 RHS UI improvements, fixed some related error * #1203 download compound molecules as csv export, populate compound summary table from common scores * #1181 changed active filter icon from different colour to red dot indicator * #1202 added rationale and ref_url info into inspiration dialog * #1204 search compound sets by title * #1181 added tooltips for all columns * #1202 updated visual of summary * #1181 adjusted columns widths, show number of compounds in set in # column * #1181 adjusted RHS height and increased maximum width * #1121 renamed references of unique_name to name since it was removed * Squashed commit of the following: commit a8e1fda Merge: e97995d 7f619a7 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Wed Dec 20 10:21:56 2023 +0100 Merge branch '#1077' of https://github.com/m2ms/fragalysis-frontend into #1077 commit e97995d Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Wed Dec 20 07:48:27 2023 +0100 - small fix for #1077 commit 8ee8cb1 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Dec 19 10:54:25 2023 +0100 - fixed problem with UI showing error that target from URL is not recognized when the targets are not yet loaded commit 32018c9 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Dec 19 10:27:28 2023 +0100 - checking out the sorting of target list commit da3abeb Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Dec 18 14:22:03 2023 +0100 - #1195 commit f593a1e Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Dec 18 12:41:31 2023 +0100 - #1166 commit 96733ed Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Dec 18 09:02:49 2023 +0100 - implemented #1077 commit 7f619a7 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Wed Dec 20 07:48:27 2023 +0100 - small fix for #1077 commit c29b995 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Dec 19 10:54:25 2023 +0100 - fixed problem with UI showing error that target from URL is not recognized when the targets are not yet loaded commit a70d4a2 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Dec 19 10:27:28 2023 +0100 - checking out the sorting of target list commit 5f1ea56 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Dec 18 14:22:03 2023 +0100 - #1195 commit 7c5c6b5 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Dec 18 12:41:31 2023 +0100 - #1166 commit d51914e Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Mon Dec 18 09:02:49 2023 +0100 - implemented #1077 * - workaround for #1075 and partial implementation of #1256 * - updated 'download is preparing' message * - forgot to remove debug sleep... * - hot fix for #1075 * - hotfix for #1075 - weird merge by github * - #1256 - added link to success toast * Squashed commit of the following: commit 0e242e1 Author: Boris Kovar <boris.kovar@m2ms.sk> Date: Tue Jan 16 13:52:38 2024 +0100 - additional fixes for #1075 - fixed #1267 - fixed #1260 - fixed #1270 * - copy now copies whole name of the compound/observationCmpView.js - target name was removed from the name of the compound/observation when displayed * #1249 dataset molecules can use side observation molecule for P, C, S renders * #1249 preserve color of RHS compound when toggling its P, C, S buttons * #1249 fixed inconsistent coloring of rendered objects on activating RHS/LHS compound buttons * - improved direct display comments to show issues and examples --------- Co-authored-by: Boris Kovar <boris.kovar@m2ms.sk> Co-authored-by: RobertMatuska <robert.matuska@m2ms.sk>
1 parent f09202b commit 2bb175f

File tree

7 files changed

+101
-42
lines changed

7 files changed

+101
-42
lines changed

js/components/datasets/datasetMoleculeList.js

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,14 @@ const DatasetMoleculeList = ({ title, datasetID, url }) => {
428428
);
429429

430430
const ligandList = useSelector(state => state.datasetsReducers.ligandLists[datasetID]);
431-
const proteinList = useSelector(state => state.datasetsReducers.proteinLists[datasetID]);
432-
const complexList = useSelector(state => state.datasetsReducers.complexLists[datasetID]);
433-
const surfaceList = useSelector(state => state.datasetsReducers.surfaceLists[datasetID]);
431+
// const proteinList = useSelector(state => state.datasetsReducers.proteinLists[datasetID]);
432+
// const complexList = useSelector(state => state.datasetsReducers.complexLists[datasetID]);
433+
// const surfaceList = useSelector(state => state.datasetsReducers.surfaceLists[datasetID]);
434+
// #1249 dataset molecules currently could use side observation molecule for some renders
435+
const proteinList = useSelector(state => state.selectionReducers.proteinList);
436+
const complexList = useSelector(state => state.selectionReducers.complexList);
437+
const surfaceList = useSelector(state => state.selectionReducers.surfaceList);
438+
const allMoleculesList = useSelector(state => state.apiReducers.all_mol_lists);
434439

435440
// const [selectedMolecules, setSelectedMolecules] = useState([]);
436441

@@ -1308,6 +1313,15 @@ const DatasetMoleculeList = ({ title, datasetID, url }) => {
13081313
}
13091314
// }
13101315

1316+
// #1249 dataset molecules currently could use side observation molecule for some renders
1317+
let idToFind = data.id;
1318+
if (data.site_observation_code) {
1319+
const molecule = allMoleculesList.find(mol => mol.code === data.site_observation_code);
1320+
if (molecule) {
1321+
idToFind = molecule.id;
1322+
}
1323+
}
1324+
13111325
return (
13121326
<DatasetMoleculeView
13131327
ref={addMoleculeViewRef}
@@ -1322,9 +1336,9 @@ const DatasetMoleculeList = ({ title, datasetID, url }) => {
13221336
previousItemData={index > 0 && array[index - 1]}
13231337
nextItemData={index < array?.length && array[index + 1]}
13241338
L={ligandList?.includes(data.id)}
1325-
P={proteinList?.includes(data.id)}
1326-
C={complexList?.includes(data.id)}
1327-
S={surfaceList?.includes(data.id)}
1339+
P={proteinList?.includes(idToFind)}
1340+
C={complexList?.includes(idToFind)}
1341+
S={surfaceList?.includes(idToFind)}
13281342
V={false}
13291343
moveMolecule={moveMolecule}
13301344
isLocked={locked}

js/components/datasets/datasetMoleculeView/datasetMoleculeView.js

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ import { centerOnLigandByMoleculeID } from '../../../reducers/ngl/dispatchAction
6363
import { ArrowDownward, ArrowUpward, MyLocation } from '@material-ui/icons';
6464
import { isString } from 'lodash';
6565
import { SvgTooltip } from '../../common';
66-
import { getMolImage } from '../../preview/molecule/redux/dispatchActions';
66+
import { addComplex, addHitProtein, addSurface, getMolImage, removeComplex, removeHitProtein, removeSurface } from '../../preview/molecule/redux/dispatchActions';
6767
import { MOL_TYPE } from '../../preview/molecule/redux/constants';
6868
import {
6969
deselectVectorCompound,
@@ -450,7 +450,21 @@ const DatasetMoleculeView = memo(
450450

451451
const colourToggle = getRandomColor(data);
452452

453-
const isPdbAvailable = !!(data && data.pdb_info);
453+
// #1249 dataset molecules currently could use side observation molecule for some renders
454+
const allMolecules = useSelector(state => state.apiReducers.all_mol_lists);
455+
const [pdbData, setPdbData] = useState(null);
456+
const isPdbAvailable = !!(data && (data.pdb_info || pdbData));
457+
458+
useEffect(() => {
459+
if (data.site_observation_code) {
460+
const molecule = allMolecules.find(mol => mol.code === data.site_observation_code);
461+
if (molecule) {
462+
setPdbData(molecule);
463+
}
464+
} else {
465+
setPdbData(data.pdb_info);
466+
}
467+
}, [data, allMolecules]);
454468

455469
const [moleculeTooltipOpen, setMoleculeTooltipOpen] = useState(false);
456470
const moleculeImgRef = useRef(null);
@@ -484,8 +498,8 @@ const DatasetMoleculeView = memo(
484498

485499
const addNewLigand = (skipTracking = false) => {
486500
dispatch(
487-
withDisabledDatasetMoleculeNglControlButton(datasetID, currentID, 'ligand', async () => {
488-
await dispatch(addDatasetLigand(stage, data, colourToggle, datasetID, skipTracking));
501+
withDisabledDatasetMoleculeNglControlButton(datasetID, currentID, 'ligand', () => {
502+
dispatch(addDatasetLigand(stage, data, colourToggle, datasetID, skipTracking));
489503
})
490504
);
491505
};
@@ -522,14 +536,16 @@ const DatasetMoleculeView = memo(
522536
};
523537

524538
const removeSelectedProtein = (skipTracking = false) => {
525-
dispatch(removeDatasetHitProtein(stage, data, colourToggle, datasetID, skipTracking));
539+
// dispatch(removeDatasetHitProtein(stage, data, colourToggle, datasetID, skipTracking));
540+
dispatch(removeHitProtein(stage, pdbData, colourToggle, skipTracking));
526541
selectedAll.current = false;
527542
};
528543

529544
const addNewProtein = (skipTracking = false) => {
530545
dispatch(
531-
withDisabledDatasetMoleculeNglControlButton(datasetID, currentID, 'protein', async () => {
532-
await dispatch(addDatasetHitProtein(stage, data, colourToggle, datasetID, skipTracking));
546+
withDisabledDatasetMoleculeNglControlButton(datasetID, currentID, 'protein', () => {
547+
dispatch(addHitProtein(stage, pdbData, colourToggle, true, skipTracking, undefined, true));
548+
// dispatch(addDatasetHitProtein(stage, data, colourToggle, datasetID, skipTracking));
533549
})
534550
);
535551
};
@@ -554,14 +570,16 @@ const DatasetMoleculeView = memo(
554570
};
555571

556572
const removeSelectedComplex = (skipTracking = false) => {
557-
dispatch(removeDatasetComplex(stage, data, colourToggle, datasetID, skipTracking));
573+
// dispatch(removeDatasetComplex(stage, data, colourToggle, datasetID, skipTracking));
574+
dispatch(removeComplex(stage, pdbData, colourToggle, skipTracking));
558575
selectedAll.current = false;
559576
};
560577

561578
const addNewComplex = (skipTracking = false) => {
562579
dispatch(
563-
withDisabledDatasetMoleculeNglControlButton(datasetID, currentID, 'complex', async () => {
564-
await dispatch(addDatasetComplex(stage, data, colourToggle, datasetID, skipTracking));
580+
withDisabledDatasetMoleculeNglControlButton(datasetID, currentID, 'complex', () => {
581+
// dispatch(addDatasetComplex(stage, data, colourToggle, datasetID, skipTracking));
582+
dispatch(addComplex(stage, pdbData, colourToggle, skipTracking, undefined, true));
565583
})
566584
);
567585
};
@@ -586,14 +604,16 @@ const DatasetMoleculeView = memo(
586604
};
587605

588606
const removeSelectedSurface = () => {
589-
dispatch(removeDatasetSurface(stage, data, colourToggle, datasetID));
607+
// dispatch(removeDatasetSurface(stage, data, colourToggle, datasetID));
608+
dispatch(removeSurface(stage, pdbData, colourToggle));
590609
selectedAll.current = false;
591610
};
592611

593612
const addNewSurface = async () => {
594613
dispatch(
595-
withDisabledDatasetMoleculeNglControlButton(datasetID, currentID, 'surface', async () => {
596-
await dispatch(addDatasetSurface(stage, data, colourToggle, datasetID));
614+
withDisabledDatasetMoleculeNglControlButton(datasetID, currentID, 'surface', () => {
615+
dispatch(addSurface(stage, pdbData, colourToggle, false, undefined, true));
616+
// dispatch(addDatasetSurface(stage, data, colourToggle, datasetID));
597617
})
598618
);
599619
};
@@ -714,7 +734,7 @@ const DatasetMoleculeView = memo(
714734
}
715735
const moleculeTitleNext = nextItem && nextItem.name;
716736

717-
let dataValue = { colourToggle, isLigandOn, isProteinOn, isComplexOn, isSurfaceOn };
737+
let dataValue = { isLigandOn, isProteinOn, isComplexOn, isSurfaceOn };
718738

719739
dispatch(setCrossReferenceCompoundName(moleculeTitleNext));
720740
if (setRef && ref.current) {
@@ -758,7 +778,7 @@ const DatasetMoleculeView = memo(
758778
}
759779
const moleculeTitleNext = nextItem && nextItem.name;
760780

761-
let dataValue = { colourToggle, isLigandOn, isProteinOn, isComplexOn, isSurfaceOn };
781+
let dataValue = { isLigandOn, isProteinOn, isComplexOn, isSurfaceOn };
762782

763783
dispatch(setCrossReferenceCompoundName(moleculeTitleNext));
764784
if (setRef && ref.current) {
@@ -799,7 +819,7 @@ const DatasetMoleculeView = memo(
799819
}
800820
const moleculeTitlePrev = previousItem && previousDatasetID.name;
801821

802-
let dataValue = { colourToggle, isLigandOn, isProteinOn, isComplexOn, isSurfaceOn };
822+
let dataValue = { isLigandOn, isProteinOn, isComplexOn, isSurfaceOn };
803823

804824
dispatch(setCrossReferenceCompoundName(moleculeTitlePrev));
805825
if (setRef && ref.current) {
@@ -845,7 +865,7 @@ const DatasetMoleculeView = memo(
845865
}
846866
const moleculeTitlePrev = previousItem && previousItem.name;
847867

848-
let dataValue = { colourToggle, isLigandOn, isProteinOn, isComplexOn, isSurfaceOn };
868+
let dataValue = { isLigandOn, isProteinOn, isComplexOn, isSurfaceOn };
849869

850870
dispatch(setCrossReferenceCompoundName(moleculeTitlePrev));
851871
if (setRef && ref.current) {

js/components/datasets/redux/dispatchActions.js

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,17 @@ export const loadDatasetCompoundsWithScores = (datasetsToLoad = null) => (dispat
295295
datasets.map(dataset =>
296296
// Hint for develop purposes add param &limit=20
297297
api({ url: `${base_url}/api/compound-mols-scores/?computed_set=${dataset.id}` })
298-
.then(response => {
298+
.then(async response => {
299+
// -----> add 'site_observation_code' to molecules whereas '/compound-molecules' has more molecule info so far, can be removed later
300+
const compondMolecules = await api({ url: `${base_url}/api/compound-molecules/?compound_set=${dataset.id}` });
301+
const compondMoleculesMap = {};
302+
compondMolecules.data.results.forEach(molecule => compondMoleculesMap[molecule.name] = molecule.site_observation_code);
303+
response.data.results.forEach(molecule => {
304+
if (compondMoleculesMap.hasOwnProperty(molecule.name)) {
305+
molecule['site_observation_code'] = compondMoleculesMap[molecule.name];
306+
}
307+
});
308+
// <-----
299309
dispatch(
300310
addMoleculeList(
301311
dataset.id,
@@ -1310,34 +1320,34 @@ export const moveSelectedMoleculeSettings = (
13101320
const promises = [];
13111321
if (newItem && data) {
13121322
if (data.isLigandOn) {
1313-
let representations = getRepresentationsByType(data.objectsInView, item, OBJECT_TYPE.LIGAND, datasetID);
1323+
let representations = getRepresentationsByType(data.objectsInView, newItem, OBJECT_TYPE.LIGAND, datasetID);
13141324
promises.push(
13151325
dispatch(
1316-
addDatasetLigand(stage, newItem, data.colourToggle, datasetIdOfMolecule, skipTracking, representations)
1326+
addDatasetLigand(stage, newItem, getRandomColor(newItem), datasetIdOfMolecule, skipTracking, representations)
13171327
)
13181328
);
13191329
}
13201330
if (data.isProteinOn) {
1321-
let representations = getRepresentationsByType(data.objectsInView, item, OBJECT_TYPE.PROTEIN, datasetID);
1331+
let representations = getRepresentationsByType(data.objectsInView, newItem, OBJECT_TYPE.PROTEIN, datasetID);
13221332
promises.push(
13231333
dispatch(
1324-
addDatasetHitProtein(stage, newItem, data.colourToggle, datasetIdOfMolecule, skipTracking, representations)
1334+
addDatasetHitProtein(stage, newItem, getRandomColor(newItem), datasetIdOfMolecule, skipTracking, representations)
13251335
)
13261336
);
13271337
}
13281338
if (data.isComplexOn) {
1329-
let representations = getRepresentationsByType(data.objectsInView, item, OBJECT_TYPE.COMPLEX, datasetID);
1339+
let representations = getRepresentationsByType(data.objectsInView, newItem, OBJECT_TYPE.COMPLEX, datasetID);
13301340
promises.push(
13311341
dispatch(
1332-
addDatasetComplex(stage, newItem, data.colourToggle, datasetIdOfMolecule, skipTracking, representations)
1342+
addDatasetComplex(stage, newItem, getRandomColor(newItem), datasetIdOfMolecule, skipTracking, representations)
13331343
)
13341344
);
13351345
}
13361346
if (data.isSurfaceOn) {
1337-
let representations = getRepresentationsByType(data.objectsInView, item, OBJECT_TYPE.SURFACE, datasetID);
1347+
let representations = getRepresentationsByType(data.objectsInView, newItem, OBJECT_TYPE.SURFACE, datasetID);
13381348
promises.push(
13391349
dispatch(
1340-
addDatasetSurface(stage, newItem, data.colourToggle, datasetIdOfMolecule, skipTracking, representations)
1350+
addDatasetSurface(stage, newItem, getRandomColor(newItem), datasetIdOfMolecule, skipTracking, representations)
13411351
)
13421352
);
13431353
}

js/components/direct/directDisplay.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ export const DirectDisplay = memo(props => {
3333

3434
useEffect(() => {
3535
// example url http://127.0.0.1:8080/viewer/react/preview/direct/target/MID2A/tas/lb00000/mols/X0301_0A/L/P/S/X0393_0B/L/P
36-
// based on the issue #431
36+
// example url with 'exact' https://fragalysis-tibor-default.xchem-dev.diamond.ac.uk/viewer/react/preview/direct/target/NUDT7A_CRUDE/mols/NUDT7A_CRUDE-X0156_1/exact/L/P
37+
// based on the issues #431, #448, #447
3738
const param = match.params[0];
3839
if (!directAccessProcessed && param && param.startsWith(URL_TOKENS.target)) {
3940
let withoutKeyword = param.split(URL_TOKENS.target);

js/components/preview/molecule/observationCmpView/observationCmpView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ const ObservationCmpView = memo(
482482
const disableMoleculeNglControlButtons =
483483
useSelector(state => state.previewReducers.molecule.disableNglControlButtons[currentID]) || {};
484484

485-
const colourToggle = getRandomColor(data);
485+
const colourToggle = getRandomColor(getFirstObservation());
486486

487487
const getCalculatedProps = useCallback(
488488
() => [

js/components/preview/molecule/redux/dispatchActions.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,15 +238,17 @@ export const addComplex = (
238238
data,
239239
colourToggle,
240240
skipTracking = false,
241-
representations = undefined
241+
representations = undefined,
242+
preserveColour = false
242243
) => async dispatch => {
243244
dispatch(appendComplexList(generateMoleculeId(data), skipTracking));
244245
return dispatch(
245246
loadObject({
246247
target: Object.assign({ display_div: VIEWS.MAJOR_VIEW }, generateComplexObject(data, colourToggle, base_url)),
247248
stage,
248249
previousRepresentations: representations,
249-
orientationMatrix: null
250+
orientationMatrix: null,
251+
preserveColour
250252
})
251253
).finally(() => {
252254
const currentOrientation = stage.viewerControls.getOrientation();
@@ -269,15 +271,17 @@ export const addSurface = (
269271
data,
270272
colourToggle,
271273
skipTracking = false,
272-
representations = undefined
274+
representations = undefined,
275+
preserveColour = false
273276
) => async dispatch => {
274277
dispatch(appendSurfaceList(generateMoleculeId(data), skipTracking));
275278
return dispatch(
276279
loadObject({
277280
target: Object.assign({ display_div: VIEWS.MAJOR_VIEW }, generateSurfaceObject(data, colourToggle, base_url)),
278281
stage,
279282
previousRepresentations: representations,
280-
orientationMatrix: null
283+
orientationMatrix: null,
284+
preserveColour
281285
})
282286
).finally(() => {
283287
const currentOrientation = stage.viewerControls.getOrientation();
@@ -519,7 +523,8 @@ export const addHitProtein = (
519523
colourToggle,
520524
withQuality = false,
521525
skipTracking = false,
522-
representations = undefined
526+
representations = undefined,
527+
preserveColour = false
523528
) => async dispatch => {
524529
// data.sdf_info = molFile;
525530
dispatch(appendProteinList(generateMoleculeId(data), skipTracking));
@@ -542,7 +547,8 @@ export const addHitProtein = (
542547
previousRepresentations: representations,
543548
orientationMatrix: null,
544549
loadQuality: hasAdditionalInformation,
545-
quality: qualityInformation
550+
quality: qualityInformation,
551+
preserveColour
546552
})
547553
).finally(() => {
548554
const currentOrientation = stage.viewerControls.getOrientation();
@@ -1173,7 +1179,7 @@ export const loadMolImage = (molId, molType, width, height) => {
11731179
return Promise.resolve();
11741180
}
11751181

1176-
let onCancel = () => {};
1182+
let onCancel = () => { };
11771183
return api({
11781184
url,
11791185
onCancel

js/reducers/ngl/dispatchActions.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ export const loadObject = ({
4747
orientationMatrix,
4848
markAsRightSideLigand,
4949
loadQuality,
50-
quality
50+
quality,
51+
preserveColour = false
5152
}) => async (dispatch, getState) => {
5253
if (stage) {
5354
const state = getState();
@@ -67,6 +68,13 @@ export const loadObject = ({
6768
previousRepresentations = stashedObjects.representations;
6869
}
6970

71+
// override previous representations colour with original colour
72+
if (preserveColour === true && previousRepresentations) {
73+
previousRepresentations.forEach(representation => {
74+
representation.params.colorValue = versionFixedTarget.colour;
75+
});
76+
}
77+
7078
console.count(`Before object is loaded`);
7179
return nglObjectDictionary[versionFixedTarget.OBJECT_TYPE]({
7280
stage,

0 commit comments

Comments
 (0)