Skip to content

Commit f5b939e

Browse files
boriskovar-m2msmatej-vavrekRoboMatuska
authored
#1296, #1299, partial (?) #1305, partial #1303 (#402)
* 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 * - #1296, #1299, partial (?) #1305, partial #1303 * #1208 updated status lights on hover info and some logic behind it * #1208 added check for status change * #1208 do not spam toast of unavailable status --------- Co-authored-by: matej <matej.vavrek@m2ms.sk> Co-authored-by: RobertMatuska <robert.matuska@m2ms.sk>
1 parent 2bb175f commit f5b939e

File tree

14 files changed

+245
-124
lines changed

14 files changed

+245
-124
lines changed

docker-compose.dev.vector.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ services:
105105
DEBUG_FRAGALYSIS: 'True'
106106
PROXY_FORWARDED_PROTO_HEADER: 'http'
107107
LEGACY_URL: 'https://fragalysis.diamond.ac.uk'
108+
DEPLOYMENT_MODE: 'development'
108109
depends_on:
109110
database:
110111
condition: service_healthy

js/components/preview/molecule/moleculeView/moleculeView.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,8 @@ const MoleculeView = memo(
961961
// let moleculeTitle = data?.code.replace(new RegExp(`${target_on_name}-`, 'i'), '');
962962
// let moleculeTitle = data?.code;
963963
let moleculeTitle = data?.code.replaceAll(`${target_on_name}-`, '');
964+
const moleculeTitleTruncated = moleculeTitle.substring(0, 20) + (moleculeTitle.length > 20 ? '...' : '');
965+
964966
const [isNameCopied, setNameCopied] = useClipboard(moleculeTitle, { successDuration: 5000 });
965967

966968
const moleculeLPCControlButtonDisabled = ['ligand', 'protein', 'complex'].some(
@@ -1013,7 +1015,7 @@ const MoleculeView = memo(
10131015
}}
10141016
className={classes.moleculeTitleLabel}
10151017
>
1016-
{moleculeTitle}
1018+
{moleculeTitleTruncated}
10171019
</div>
10181020
</Tooltip>
10191021
{generateTagPopover()}

js/components/preview/molecule/observationCmpList.js

Lines changed: 19 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -657,16 +657,6 @@ export const ObservationCmpList = memo(({ hideProjects }) => {
657657
});
658658
const uniqueSelectedMoleculeForHitNavigator = [...new Set(selectedMolecule)];
659659

660-
const newMolsToEdit = [];
661-
currentMolecules.forEach(cm => {
662-
if (moleculesToEditIds.includes(cm.id)) {
663-
newMolsToEdit.push(cm.id);
664-
}
665-
});
666-
if (newMolsToEdit.length !== moleculesToEditIds.length) {
667-
dispatch(setMolListToEdit(newMolsToEdit));
668-
}
669-
670660
const changePredefinedFilter = event => {
671661
let newFilter = Object.assign({}, filter);
672662

@@ -722,44 +712,35 @@ export const ObservationCmpList = memo(({ hideProjects }) => {
722712
let filteredLHSCompoundsList = useMemo(() => {
723713
const compounds = [];
724714
lhsCompoundsList.forEach(compound => {
725-
const molsForCmp = joinedMoleculeLists.filter(molecule => molecule.cmpd === compound.id);
726-
if (molsForCmp.length > 0) {
715+
const molsForCmp = joinedMoleculeLists.filter(molecule => molecule.cmpd === compound.origId);
716+
if (molsForCmp?.length > 0) {
727717
compounds.push(compound);
728718
}
729719
});
730720
return compounds;
731-
}, [lhsCompoundsList, joinedMoleculeLists]);
732-
733-
let compoundMolecules = useMemo(() => {
734-
const compoundMolecules = {};
735-
736-
filteredLHSCompoundsList.forEach(compound => {
737-
const molsForCmp = allMoleculesList.filter(molecule => molecule.cmpd === compound.id);
738-
compoundMolecules[compound.id] = molsForCmp.sort((a, b) => {
739-
if (a.code < b.code) {
740-
return -1;
741-
}
742-
if (a.code > b.code) {
743-
return 1;
744-
}
745-
return 0;
746-
});
747-
});
748-
749-
return compoundMolecules;
750-
}, [filteredLHSCompoundsList, allMoleculesList]);
721+
}, [joinedMoleculeLists, lhsCompoundsList]);
751722

752723
useEffect(() => {
753724
if (isObservationDialogOpen && observationsForLHSCmp?.length > 0) {
754725
const cmpId = observationsForLHSCmp[0].cmpd;
755-
const cmp = filteredLHSCompoundsList.find(c => c.id === cmpId);
726+
const cmp = filteredLHSCompoundsList.find(c => c.origId === cmpId);
756727
if (!cmp) {
757728
dispatch(setObservationsForLHSCmp([]));
758729
dispatch(setOpenObservationsDialog(false));
759730
}
760731
}
761732
}, [isObservationDialogOpen, filteredLHSCompoundsList, observationsForLHSCmp, dispatch]);
762733

734+
const newMolsToEdit = [];
735+
allMoleculesList.forEach(cm => {
736+
if (moleculesToEditIds.includes(cm.id)) {
737+
newMolsToEdit.push(cm.id);
738+
}
739+
});
740+
if (newMolsToEdit.length !== moleculesToEditIds.length) {
741+
dispatch(setMolListToEdit(newMolsToEdit));
742+
}
743+
763744
const isLigandOn = changeButtonClassname(fragmentDisplayList, joinedLigandMatchLength);
764745
const isProteinOn = changeButtonClassname(proteinList, joinedProteinMatchLength);
765746
const isComplexOn = changeButtonClassname(complexList, joinedComplexMatchLength);
@@ -1243,9 +1224,8 @@ export const ObservationCmpList = memo(({ hideProjects }) => {
12431224
useWindow={false}
12441225
>
12451226
{filteredLHSCompoundsList.map((data, index, array) => {
1246-
const molsForCmp = compoundMolecules[data.id];
1247-
// const selected = allSelectedLHSCmps.some(molecule => molecule.id === data.id);
1248-
const selected = allSelectedMolecules.some(molecule => molecule.cmpd === data.id);
1227+
const molsForCmp = data.associatedObs;
1228+
const selected = allSelectedMolecules.some(molecule => molecule.cmpd === data.origId);
12491229

12501230
return (
12511231
<ObservationCmpView
@@ -1277,7 +1257,9 @@ export const ObservationCmpList = memo(({ hideProjects }) => {
12771257
<Grid item>
12781258
<Grid container spacing={1} justifyContent="space-between" alignItems="center" direction="row">
12791259
<Grid item>
1280-
<span className={classes.total}>{`Total ${joinedMoleculeLists?.length}`}</span>
1260+
<span
1261+
className={classes.total}
1262+
>{`Total cmps/obs ${filteredLHSCompoundsList?.length}/${joinedMoleculeLists?.length}`}</span>
12811263
</Grid>
12821264
<Grid item>
12831265
<ButtonGroup variant="text" size="medium" color="primary" aria-label="contained primary button group">

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ const ObservationCmpView = memo(
11571157
// dispatch(appendToObsCmpListToEdit(currentID));
11581158
} else {
11591159
observations?.forEach(obs => {
1160-
dispatch(appendToMolListToEdit(obs.id));
1160+
dispatch(removeFromMolListToEdit(obs.id));
11611161
});
11621162
// dispatch(removeFromObsCmpListToEdit(currentID));
11631163
}

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -710,10 +710,8 @@ export const getFirstMolOfFirstCompound = () => (dispatch, getState) => {
710710
const compoundsList = state.apiReducers.lhs_compounds_list;
711711
const firstCompound = compoundsList[0];
712712
if (firstCompound) {
713-
const molList = state.apiReducers.all_mol_lists;
714-
const firstMols = molList?.filter(m => m.cmpd === firstCompound.id);
715-
if (firstMols && firstMols.length > 0) {
716-
return firstMols[0];
713+
if (firstCompound.associatedObs?.length > 0) {
714+
return firstCompound.associatedObs[0];
717715
} else {
718716
return null;
719717
}

js/components/preview/tags/api/tagsApi.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,22 @@ export const getAllDataNew = async targetId => {
3535
});
3636
};
3737

38+
export const getCanonSites = async targetId => {
39+
return api({ url: `${base_url}/api/canon_sites/?target=${targetId}` }).then(response => {
40+
if (response?.data) {
41+
return response.data?.results;
42+
}
43+
});
44+
};
45+
46+
export const getCanonConformSites = async targetId => {
47+
return api({ url: `${base_url}/api/canon_site_confs/?target=${targetId}` }).then(response => {
48+
if (response?.data) {
49+
return response.data?.results;
50+
}
51+
});
52+
};
53+
3854
export const getCompoundsLHS = async targetId => {
3955
return api({ url: `${base_url}/api/cmpdimg/?target=${targetId}` }).then(response => {
4056
if (response?.data) {

js/components/preview/tags/redux/dispatchActions.js

Lines changed: 63 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,15 @@ import {
3232
} from '../../../../reducers/api/actions';
3333
import { setSortDialogOpen } from '../../molecule/redux/actions';
3434
import { resetCurrentCompoundsSettings } from '../../compounds/redux/actions';
35-
import { updateExistingTag, getTags, getAllDataNew, getTagCategories, getCompoundsLHS } from '../api/tagsApi';
35+
import {
36+
updateExistingTag,
37+
getTags,
38+
getAllDataNew,
39+
getTagCategories,
40+
getCompoundsLHS,
41+
getCanonSites,
42+
getCanonConformSites
43+
} from '../api/tagsApi';
3644
import {
3745
getMoleculeTagForTag,
3846
createMoleculeTagObject,
@@ -182,6 +190,8 @@ export const loadMoleculesAndTagsNew = targetId => async (dispatch, getState) =>
182190
dispatch(setNoTagsReceived(false));
183191
}
184192
const tagCategories = await getTagCategories();
193+
// const canonSitesList = await getCanonSites(targetId);
194+
const canonConformSitest = await getCanonConformSites(targetId);
185195

186196
const data = await getAllDataNew(targetId);
187197
let allMolecules = [];
@@ -221,20 +231,65 @@ export const loadMoleculesAndTagsNew = targetId => async (dispatch, getState) =>
221231
dispatch(setAllDataLoaded(true));
222232

223233
return getCompoundsLHS(targetId).then(compounds => {
234+
const expandedCompounds = [];
235+
let newIdStart = Math.max(...compounds?.map(c => c.id)) + 1;
224236
compounds?.forEach(c => {
225-
const siteObs = allMolecules.find(m => m.cmpd === c.id);
226-
c['smiles'] = siteObs ? siteObs.smiles : '';
227-
c['code'] = siteObs ? `${siteObs.code}/${siteObs.canon_site_conf}` : '';
237+
const siteObs = allMolecules.filter(m => m.cmpd === c.id);
238+
const canonConformSites = siteObs?.map(so => {
239+
return {
240+
smiles: so.smiles,
241+
code: so.code,
242+
canon_site_conf: so.canon_site_conf,
243+
canon_site: canonConformSitest.find(ccf => ccf.id === so.canon_site_conf)?.canon_site
244+
};
245+
});
246+
canonConformSites?.forEach(cs => {
247+
let newObject = { ...c };
248+
249+
newObject['smiles'] = cs.smiles;
250+
newObject['code'] = `${cs.code}/${cs.canon_site}`;
251+
newObject['origId'] = c.id;
252+
newObject['id'] = newIdStart++;
253+
newObject['canonSiteConf'] = cs.canon_site_conf;
254+
newObject['canonSite'] = cs.canon_site;
255+
256+
const associatedObs = siteObs
257+
.filter(
258+
so =>
259+
canonConformSitest.find(ccf => ccf.id === so.canon_site_conf)?.canon_site === newObject.canonSite &&
260+
so.cmpd === c.id
261+
)
262+
.map(so => {
263+
return {
264+
...so,
265+
canon_site: canonConformSitest.find(ccf => ccf.id === so.canon_site_conf)?.canon_site
266+
};
267+
})
268+
.sort((a, b) => {
269+
if (a.code < b.code) {
270+
return -1;
271+
}
272+
if (a.code > b.code) {
273+
return 1;
274+
}
275+
return 0;
276+
});
277+
newObject['associatedObs'] = associatedObs;
278+
279+
if (!expandedCompounds.find(ec => ec.origId === newObject.origId && ec.canonSite === newObject.canonSite)) {
280+
expandedCompounds.push(newObject);
281+
}
282+
});
228283
});
229-
compounds.sort((a, b) => {
230-
if (a.smiles < b.smiles) {
284+
expandedCompounds.sort((a, b) => {
285+
if (a.code < b.code) {
231286
return -1;
232287
}
233-
if (a.smiles > b.smiles) {
288+
if (a.code > b.code) {
234289
return 1;
235290
}
236291
return 0;
237292
});
238-
dispatch(setLHSCompoundsLIst([...compounds]));
293+
dispatch(setLHSCompoundsLIst(expandedCompounds));
239294
});
240295
};
Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,9 @@
1-
import { Grid, Tooltip, makeStyles } from "@material-ui/core";
1+
import { Grid } from "@material-ui/core";
22
import React, { memo } from "react";
3-
4-
const useStyles = makeStyles(theme => ({
5-
circle: {
6-
display: 'flex',
7-
flex: 1
8-
}
9-
}));
10-
11-
export const SERVICE_STATUSES = {
12-
OK: 'OK',
13-
DEGRADED: 'DEGRADED'
14-
}
15-
16-
export const SERVICE_STATUS_COLORS = {
17-
OK: 'green',
18-
DEGRADED: 'orange',
19-
OTHER: 'red'
20-
}
3+
import { StatusLight } from "./StatusLight";
214

225
export const ServiceStatus = memo(({ service }) => {
23-
const getColor = (status) => {
24-
switch (status) {
25-
case SERVICE_STATUSES.OK:
26-
return SERVICE_STATUS_COLORS.OK;
27-
case SERVICE_STATUSES.DEGRADED:
28-
return SERVICE_STATUS_COLORS.DEGRADED;
29-
default:
30-
return SERVICE_STATUS_COLORS.OTHER;
31-
}
32-
}
336
return <Grid item>
34-
<Tooltip title={`${service.name} - ${service.state}`}>
35-
<svg height="20" width="20" className={useStyles().circle}>
36-
<defs>
37-
<linearGradient id="darkGradient" gradientTransform="rotate(90)">
38-
<stop offset="0%" stopColor="rgba(0,0,0,0.4289916650253851)" />
39-
<stop offset="100%" stopColor="rgba(255,255,255,0)" />
40-
</linearGradient>
41-
</defs>
42-
{/* TODO do not use two circles but use gradient as overlay? */}
43-
<circle cx="10" cy="10" r="9" fill={getColor(service.state)} />
44-
<circle cx="10" cy="10" r="9" stroke="#ccc" strokeWidth="1" fill="url('#darkGradient')" />
45-
</svg>
46-
</Tooltip>
7+
<StatusLight service={service} />
478
</Grid>;
489
});
Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,45 @@
1-
import { Grid } from "@material-ui/core";
1+
import { Grid, Table, TableBody, TableCell, TableRow, Tooltip, makeStyles, styled } from "@material-ui/core";
22
import React, { memo } from "react";
33
import { ServiceStatus } from "./ServiceStatus";
4+
import { StatusLight } from "./StatusLight";
5+
import { tooltipClasses } from "@mui/material";
6+
7+
const useStyles = makeStyles(theme => ({
8+
cell: {
9+
color: theme.palette.primary.contrastText
10+
}
11+
}));
412

513
export const ServicesStatus = memo(({ services }) => {
6-
return <Grid container direction="row" justifyContent="flex-start" alignItems="center" spacing={1}>
7-
{services.map((service) =>
8-
<ServiceStatus key={`status-${service.id}`} service={service} />
9-
)}
10-
</Grid>
14+
15+
const classes = useStyles();
16+
17+
const NoMaxWidthTooltip = styled(({ className, ...props }) => (
18+
<Tooltip {...props} classes={{ popper: className }} />
19+
))({
20+
[`& .${tooltipClasses.tooltip}`]: {
21+
maxWidth: 'none'
22+
}
23+
});
24+
25+
const StyledTableRow = styled(TableRow)(({ theme }) => ({
26+
// hide last border
27+
'&:last-child td, &:last-child th': {
28+
border: 0
29+
}
30+
}));
31+
32+
return <NoMaxWidthTooltip title={<Table><TableBody>
33+
{services.map((service) => <StyledTableRow key={service.id}>
34+
<TableCell className={classes.cell}><StatusLight service={service} /></TableCell>
35+
<TableCell className={classes.cell}>{service.state}</TableCell>
36+
<TableCell className={classes.cell}>{service.name}</TableCell>
37+
</StyledTableRow>)}
38+
</TableBody></Table>}>
39+
<Grid container direction="row" justifyContent="flex-start" alignItems="center" spacing={1}>
40+
{services.map((service) =>
41+
<ServiceStatus key={`status-${service.id}`} service={service} />
42+
)}
43+
</Grid>
44+
</NoMaxWidthTooltip>
1145
});

0 commit comments

Comments
 (0)