Skip to content

Commit 57b30e1

Browse files
boriskovar-m2msmatej-vavrekRoboMatuska
authored
#1295, #1300, #1315 (#403)
* 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 * - probably fix for #1295 - fixed #1300 and #1315 --------- Co-authored-by: matej <matej.vavrek@m2ms.sk> Co-authored-by: RobertMatuska <robert.matuska@m2ms.sk>
1 parent f5b939e commit 57b30e1

15 files changed

+193
-220
lines changed

js/components/datasets/inspirationDialog.js

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,11 @@ export const InspirationDialog = memo(
168168
*/
169169
const getRefUrl = useCallback(() => {
170170
let refUrl = '';
171-
if (datasetID && scoreDatasetMap.hasOwnProperty(datasetID) && scoreDatasetMap[datasetID].hasOwnProperty('ref_url')) {
171+
if (
172+
datasetID &&
173+
scoreDatasetMap.hasOwnProperty(datasetID) &&
174+
scoreDatasetMap[datasetID].hasOwnProperty('ref_url')
175+
) {
172176
refUrl = scoreDatasetMap[datasetID].ref_url.description;
173177
}
174178
return refUrl;
@@ -188,7 +192,7 @@ export const InspirationDialog = memo(
188192
}, [inspirationMoleculeDataList, searchString]);
189193

190194
const allSelectedMolecules = inspirationMoleculeDataList.filter(
191-
molecule => moleculesToEditIds.includes(molecule.id) || molecule.id === molForTagEditId
195+
molecule => moleculesToEditIds.includes(molecule.id) /* || molForTagEditId.some(mid => molecule.id === mid)*/
192196
);
193197

194198
// TODO: refactor from this line (duplicity in datasetMoleculeList.js)
@@ -458,7 +462,7 @@ export const InspirationDialog = memo(
458462
V={vectorOnList.includes(molecule.id)}
459463
I={informationList.includes(data.id)}
460464
selected={selected}
461-
isTagEditorInvokedByMolecule={data.id === molForTagEditId}
465+
isTagEditorInvokedByMolecule={molForTagEditId.some(mid => data.id === mid)}
462466
disableL={selected && groupNglControlButtonsDisabledState.ligand}
463467
disableP={selected && groupNglControlButtonsDisabledState.protein}
464468
disableC={selected && groupNglControlButtonsDisabledState.complex}
@@ -467,29 +471,47 @@ export const InspirationDialog = memo(
467471
</GroupNglControlButtonsContext.Provider>
468472
);
469473
})}
470-
{moleculeList.length > 0 &&
471-
<Grid container justifyContent="center" alignItems="center" direction="column" className={classes.notFound}>
472-
{getRationale().length > 0 &&
474+
{moleculeList.length > 0 && (
475+
<Grid
476+
container
477+
justifyContent="center"
478+
alignItems="center"
479+
direction="column"
480+
className={classes.notFound}
481+
>
482+
{getRationale().length > 0 && (
473483
<Grid item>
474484
<Typography variant="body2">{getRationale()}</Typography>
475-
</Grid>}
476-
{getRefUrl().length > 0 &&
485+
</Grid>
486+
)}
487+
{getRefUrl().length > 0 && (
477488
<Grid container justifyContent="center" alignItems="center" direction="row">
478489
<Grid item>
479490
<Typography variant="body2">Design-set rationale URL</Typography>
480491
</Grid>
481492
<Grid item>
482493
<Tooltip title="Open">
483-
<IconButton className={classes.panelButton} color={'inherit'} onClick={() => window.open(getRefUrl(), '_blank')}>
494+
<IconButton
495+
className={classes.panelButton}
496+
color={'inherit'}
497+
onClick={() => window.open(getRefUrl(), '_blank')}
498+
>
484499
<Link />
485500
</IconButton>
486501
</Tooltip>
487502
</Grid>
488-
</Grid>}
503+
</Grid>
504+
)}
489505
</Grid>
490-
}
506+
)}
491507
{!(moleculeList.length > 0) && (
492-
<Grid container justifyContent="center" alignItems="center" direction="row" className={classes.notFound}>
508+
<Grid
509+
container
510+
justifyContent="center"
511+
alignItems="center"
512+
direction="row"
513+
className={classes.notFound}
514+
>
493515
<Grid item>
494516
<Typography variant="body2">No molecules found!</Typography>
495517
</Grid>

js/components/preview/molecule/moleculeList.js

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -423,21 +423,23 @@ export const MoleculeList = memo(({ hideProjects }) => {
423423
setCurrentPage(currentPage + 1);
424424
};
425425

426-
if (molForTagEditId && !joinedMoleculeLists.some(m => m.id === molForTagEditId)) {
427-
const tagEditMol = dispatch(getMoleculeForId(molForTagEditId));
428-
if (tagEditMol) {
429-
// joinedMoleculeLists = [tagEditMol, ...joinedMoleculeLists];
430-
joinedMoleculeLists.push(tagEditMol);
431-
joinedMoleculeLists.sort((a, b) => {
432-
if (a.code < b.code) {
433-
return -1;
434-
}
435-
if (a.code > b.code) {
436-
return 1;
437-
}
438-
return 0;
439-
});
440-
}
426+
if (molForTagEditId && !joinedMoleculeLists.some(m => m.id === molForTagEditId.some(mid => m.id === mid))) {
427+
molForTagEditId.forEach(mid => {
428+
const tagEditMol = dispatch(getMoleculeForId(mid));
429+
if (tagEditMol) {
430+
joinedMoleculeLists.push(tagEditMol);
431+
}
432+
});
433+
// joinedMoleculeLists = [tagEditMol, ...joinedMoleculeLists];
434+
joinedMoleculeLists.sort((a, b) => {
435+
if (a.code < b.code) {
436+
return -1;
437+
}
438+
if (a.code > b.code) {
439+
return 1;
440+
}
441+
return 0;
442+
});
441443
}
442444

443445
if (moleculesToEditIds && moleculesToEditIds.length > 0 && isGlobalEdit) {
@@ -535,8 +537,10 @@ export const MoleculeList = memo(({ hideProjects }) => {
535537

536538
const allSelectedMolecules = useMemo(
537539
() =>
538-
allMoleculesList.filter(molecule => moleculesToEditIds.includes(molecule.id) || molecule.id === molForTagEditId),
539-
[allMoleculesList, moleculesToEditIds, molForTagEditId]
540+
allMoleculesList.filter(
541+
molecule => moleculesToEditIds.includes(molecule.id) /*|| molForTagEditId.some(mid => molecule.id === mid)*/
542+
),
543+
[allMoleculesList, moleculesToEditIds /*, molForTagEditId*/]
540544
);
541545

542546
let currentMolecules = joinedMoleculeLists.slice(0, listItemOffset);
@@ -1199,7 +1203,7 @@ export const MoleculeList = memo(({ hideProjects }) => {
11991203
<GroupNglControlButtonsContext.Provider value={groupNglControlButtonsDisabledState}>
12001204
{currentMolecules.map((data, index, array) => {
12011205
const selected = allSelectedMolecules.some(molecule => molecule.id === data.id);
1202-
const isTagEditorInvokedByMolecule = data.id === molForTagEditId;
1206+
const isTagEditorInvokedByMolecule = molForTagEditId.some(mid => data.id === mid);
12031207

12041208
return (
12051209
<MoleculeView

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -514,10 +514,10 @@ const MoleculeView = memo(
514514
if (tagEditModalOpenNew) {
515515
setTagEditModalOpenNew(false);
516516
dispatch(setTagEditorOpenObs(!tagEditModalOpenNew));
517-
dispatch(setMoleculeForTagEdit(null));
517+
dispatch(setMoleculeForTagEdit([]));
518518
} else {
519519
setTagEditModalOpenNew(true);
520-
dispatch(setMoleculeForTagEdit(data.id));
520+
dispatch(setMoleculeForTagEdit([data.id]));
521521
dispatch(setTagEditorOpenObs(true));
522522
if (setRef) {
523523
setRef(ref.current);
@@ -576,10 +576,10 @@ const MoleculeView = memo(
576576
if (tagEditModalOpenNew) {
577577
setTagEditModalOpenNew(false);
578578
dispatch(setTagEditorOpenObs(!tagEditModalOpenNew));
579-
dispatch(setMoleculeForTagEdit(null));
579+
dispatch(setMoleculeForTagEdit([]));
580580
} else {
581581
setTagEditModalOpenNew(true);
582-
dispatch(setMoleculeForTagEdit(data.id));
582+
dispatch(setMoleculeForTagEdit([data.id]));
583583
dispatch(setTagEditorOpenObs(true));
584584
if (setRef) {
585585
setRef(ref.current);
@@ -651,10 +651,10 @@ const MoleculeView = memo(
651651
if (tagEditModalOpenNew) {
652652
setTagEditModalOpenNew(false);
653653
dispatch(setTagEditorOpenObs(!tagEditModalOpenNew));
654-
dispatch(setMoleculeForTagEdit(null));
654+
dispatch(setMoleculeForTagEdit([]));
655655
} else {
656656
setTagEditModalOpenNew(true);
657-
dispatch(setMoleculeForTagEdit(data.id));
657+
dispatch(setMoleculeForTagEdit([data.id]));
658658
dispatch(setTagEditorOpenObs(true));
659659
if (setRef) {
660660
setRef(ref.current);

0 commit comments

Comments
 (0)