Skip to content

Commit

Permalink
Pre-release before christmass (#393)
Browse files Browse the repository at this point in the history
* 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

* - implemented #1077

* - #1166

* - #1195

* - checking out the sorting of target list

* - fixed problem with UI showing error that target from URL is not recognized when the targets are not yet loaded

* #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

* - small fix for #1077

* - implemented #1077

* - #1166

* - #1195

* - checking out the sorting of target list

* - fixed problem with UI showing error that target from URL is not recognized when the targets are not yet loaded

* - small fix for #1077

---------

Co-authored-by: matej <matej.vavrek@m2ms.sk>
Co-authored-by: RobertMatuska <robert.matuska@m2ms.sk>
  • Loading branch information
3 people authored Dec 20, 2023
1 parent 96eb422 commit 6047698
Show file tree
Hide file tree
Showing 17 changed files with 1,203 additions and 159 deletions.
14 changes: 11 additions & 3 deletions js/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ export default memo(
targetName !== undefined ? (
<>
{currentProject.authorID === null ||
currentProject.projectID === null ||
currentProject.authorID === userId ? (
currentProject.projectID === null ||
currentProject.authorID === userId ? (
<Button
onClick={() => {
isProjectModalLoading === false
Expand Down Expand Up @@ -547,7 +547,15 @@ export default memo(
</Grid>

<Divider />
<ListItem button onClick={() => history.push(URLS.landing)}>
<ListItem
button
onClick={() => {
dispatch(setIsActionsRestoring(false, false));
dispatch(setProjectActionListLoaded(false));
history.push(URLS.landing);
window.location.reload();
}}
>
<ListItemIcon>
<Home />
</ListItemIcon>
Expand Down
4 changes: 2 additions & 2 deletions js/components/preview/molecule/moleculeView/moleculeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,6 @@ const MoleculeView = memo(

const [isCopied, setCopied] = useClipboard(data.smiles, { successDuration: 5000 });

const [hasMap, setHasMap] = useState();

const hasAllValuesOn = isLigandOn && isProteinOn && isComplexOn;
const hasSomeValuesOn = !hasAllValuesOn && (isLigandOn || isProteinOn || isComplexOn);

Expand Down Expand Up @@ -413,6 +411,8 @@ const MoleculeView = memo(

let proteinData = data?.proteinData;

const hasMap = proteinData?.diff_info || proteinData?.event_info || proteinData?.sigmaa_info;

useEffect(() => {
setTagEditModalOpenNew(tagEditorOpenObs);
}, [tagEditorOpenObs]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import {
addQuality,
getQualityInformation,
getDensityMapData,
getProteinData,
withDisabledMoleculeNglControlButton,
getCategoryById
} from '../redux/dispatchActions';
Expand Down Expand Up @@ -356,6 +355,8 @@ const ObservationCmpView = memo(

const [tagEditModalOpenNew, setTagEditModalOpenNew] = useState(tagEditorOpen);

const [hasMap, setHasMap] = useState(false);

const { getNglView } = useContext(NglContext);
const stage = getNglView(VIEWS.MAJOR_VIEW) && getNglView(VIEWS.MAJOR_VIEW).stage;

Expand Down Expand Up @@ -400,6 +401,29 @@ const ObservationCmpView = memo(
return result;
};

const getFirstObservationWithDensity = useCallback(() => {
let result = null;

for (const obs of observations) {
if (obs?.proteinData?.diff_info || obs?.proteinData?.sigmaa_info || obs?.proteinData?.event_info) {
result = obs;
break;
}
}

return result;
}, [observations]);

useEffect(() => {
for (let i = 0; i < observations.length; i++) {
const obs = observations[i];
if (obs?.proteinData?.diff_info || obs?.proteinData?.sigmaa_info || obs?.proteinData?.event_info) {
setHasMap(true);
break;
}
}
}, [observations]);

const fragmentDisplayList = useSelector(state => state.selectionReducers.fragmentDisplayList);
const proteinList = useSelector(state => state.selectionReducers.proteinList);
const complexList = useSelector(state => state.selectionReducers.complexList);
Expand All @@ -421,8 +445,6 @@ const ObservationCmpView = memo(

const [isCopied, setCopied] = useClipboard(data.smiles, { successDuration: 5000 });

const [hasMap, setHasMap] = useState();

const hasAllValuesOn = isLigandOn && isProteinOn && isComplexOn;
const hasSomeValuesOn = !hasAllValuesOn && (isLigandOn || isProteinOn || isComplexOn);

Expand Down Expand Up @@ -919,13 +941,15 @@ const ObservationCmpView = memo(
};

const removeSelectedDensity = () => {
dispatch(removeDensity(stage, data, colourToggle, false));
const firstObs = getFirstObservationWithDensity();
dispatch(removeDensity(stage, firstObs, colourToggle, false));
};

const addNewDensityCustom = async () => {
dispatch(
withDisabledMoleculeNglControlButton(currentID, 'density', async () => {
await dispatch(addDensityCustomView(stage, data, colourToggle, isWireframeStyle));
const firstObs = getFirstObservationWithDensity();
await dispatch(addDensityCustomView(stage, firstObs, colourToggle, isWireframeStyle));
})
);
};
Expand All @@ -935,7 +959,8 @@ const ObservationCmpView = memo(
withDisabledMoleculeNglControlButton(currentID, 'ligand', async () => {
await dispatch(
withDisabledMoleculeNglControlButton(currentID, 'density', async () => {
await dispatch(addDensity(stage, data, colourToggle, isWireframeStyle));
const firstObs = getFirstObservationWithDensity();
await dispatch(addDensity(stage, firstObs, colourToggle, isWireframeStyle));
})
);
})
Expand All @@ -947,7 +972,8 @@ const ObservationCmpView = memo(
const onDensity = () => {
setLoadingDensity(true);
if (isDensityOn === false && isDensityCustomOn === false) {
dispatch(getDensityMapData(data)).then(r => {
const firstObs = getFirstObservationWithDensity();
dispatch(getDensityMapData(firstObs)).then(r => {
if (r) {
dispatch(setDensityModalOpen(true));
} else {
Expand Down Expand Up @@ -1406,7 +1432,7 @@ const ObservationCmpView = memo(
<DensityMapsModal
openDialog={densityModalOpen}
setOpenDialog={setDensityModalOpen}
data={data}
data={getFirstObservationWithDensity()}
setDensity={addNewDensity}
isQualityOn={isQualityOn}
/>
Expand Down
109 changes: 53 additions & 56 deletions js/components/preview/molecule/redux/dispatchActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,11 @@ export const removeSurface = (stage, data, colourToggle, skipTracking = false) =
export const getDensityMapData = data => dispatch => {
return dispatch(getProteinData(data))
.then(i => {
if (i && i.length > 0) {
let proteinData = i[0];
data.proteinData = proteinData;
if (proteinData.sigmaa_info || proteinData.diff_info) {
return true;
}
let proteinData = i;
data.proteinData = proteinData;
if (proteinData.sigmaa_info || proteinData.diff_info) {
return true;
}

return false;
})
.catch(error => {
Expand Down Expand Up @@ -354,20 +351,18 @@ const setDensity = (
let molDataId = generateMoleculeId(data);
if (!data.proteinData) {
dispatch(getProteinData(data)).then(i => {
if (i && i.length > 0) {
const proteinData = i[0];
data.proteinData = proteinData;

molDataId['render_event'] = data.proteinData.render_event;
molDataId['render_sigmaa'] = data.proteinData.render_sigmaa;
molDataId['render_diff'] = data.proteinData.render_diff;
molDataId['render_quality'] = data.proteinData.render_quality;

dispatch(appendDensityList(generateMoleculeId(data), skipTracking));
dispatch(appendToDensityListType(molDataId, skipTracking));
if (data.proteinData.render_quality) {
return dispatch(addQuality(stage, data, colourToggle, true));
}
const proteinData = i;
data.proteinData = proteinData;

molDataId['render_event'] = data.proteinData.render_event;
molDataId['render_sigmaa'] = data.proteinData.render_sigmaa;
molDataId['render_diff'] = data.proteinData.render_diff;
molDataId['render_quality'] = data.proteinData.render_quality;

dispatch(appendDensityList(generateMoleculeId(data), skipTracking));
dispatch(appendToDensityListType(molDataId, skipTracking));
if (data.proteinData.render_quality) {
return dispatch(addQuality(stage, data, colourToggle, true));
}
});
} else {
Expand Down Expand Up @@ -1095,43 +1090,45 @@ export const getQualityInformation = (data, molType, width, height) => (dispatch
};

export const getProteinData = molecule => dispatch => {
return dispatch(getProteinDataByMolId(molecule.id, molecule.code));
};

export const getProteinDataByMolId = (molId, proteinCode) => (dispatch, getState) => {
const state = getState();
const proteindDataCache = state.previewReducers.molecule.proteinDataCache;

const molIdStr = molId.toString();
if (proteindDataCache.hasOwnProperty(molIdStr)) {
return new Promise((resolve, reject) => {
resolve(proteindDataCache[molIdStr]);
});
} else {
return loadProteinData(proteinCode).then(i => {
if (!proteindDataCache.hasOwnProperty(molIdStr)) {
dispatch(addProteindDataToCache(molId.toString(), i));
}
return i;
});
}
return new Promise((resolve, reject) => {
resolve(molecule.proteinData);
}); /*dispatch(getProteinDataByMolId(molecule.id, molecule.code));*/
};

const loadProteinData = code => {
if (code) {
let url = new URL(`${base_url}/api/proteins/?code=${code}`);
let onCancel = () => {};
return api({
url,
onCancel
}).then(response => {
return response.data.results;
});
} else {
console.error('Trying to load protein data for unknown molecule protein code.');
return Promise.resolve();
}
};
// export const getProteinDataByMolId = (molId, proteinCode) => (dispatch, getState) => {
// const state = getState();
// const proteindDataCache = state.previewReducers.molecule.proteinDataCache;

// const molIdStr = molId.toString();
// if (proteindDataCache.hasOwnProperty(molIdStr)) {
// return new Promise((resolve, reject) => {
// resolve(proteindDataCache[molIdStr]);
// });
// } else {
// return loadProteinData(proteinCode).then(i => {
// if (!proteindDataCache.hasOwnProperty(molIdStr)) {
// dispatch(addProteindDataToCache(molId.toString(), i));
// }
// return i;
// });
// }
// };

// const loadProteinData = code => {
// if (code) {
// let url = new URL(`${base_url}/api/proteins/?code=${code}`);
// let onCancel = () => {};
// return api({
// url,
// onCancel
// }).then(response => {
// return response.data.results;
// });
// } else {
// console.error('Trying to load protein data for unknown molecule protein code.');
// return Promise.resolve();
// }
// };

export const getMolImage = (molId, molType, width, height) => (dispatch, getState) => {
const state = getState();
Expand Down
7 changes: 7 additions & 0 deletions js/components/preview/tags/redux/dispatchActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,13 @@ export const loadMoleculesAndTagsNew = targetId => async (dispatch, getState) =>
} else {
newObject['tags_set'] = [];
}

const maps = {};
maps.diff_info = mol.xmap_fofc_file;
maps.event_info = mol.event_file;
maps.sigmaa_info = mol.xmap_2fofc_file;
newObject['proteinData'] = maps;

allMolecules.push(newObject);
});

Expand Down
12 changes: 6 additions & 6 deletions js/components/target/handleUnrecognisedTarget.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ const HandleUnrecognisedTarget = memo(({ targetUnrecognised, setTargetUnrecognis

if (targetUnrecognised === true) {
if (target_id_list && target_id_list.length === 0) {
modalBody = <h3>The target was not recognised and there are no other available targets.</h3>;
modalBody = <h3>Targets are loading. Please wait.</h3>;
} else {
modalBody = (
<Modal open={targetUnrecognised}>
<h3>
Target was not recognised or you do not have authentication to access target. <br />
Targets are loading. Please wait. <br />
</h3>
{request}
<TargetList key="TARGLIST" />
{/* <TargetList key="TARGLIST" />
<Button
color="primary"
onClick={() => {
Expand All @@ -56,7 +56,7 @@ const HandleUnrecognisedTarget = memo(({ targetUnrecognised, setTargetUnrecognis
style={{position: 'fixed', right: '25px'}}
>
Close
</Button>
</Button> */}
</Modal>
);
}
Expand All @@ -66,10 +66,10 @@ const HandleUnrecognisedTarget = memo(({ targetUnrecognised, setTargetUnrecognis
<Fragment>
<Modal open={targetUnrecognised !== undefined ? targetUnrecognised : false}>
{modalBody}
<Button color="primary" onClick={closeModal}>
{/* <Button color="primary" onClick={closeModal}>
Close
</Button>
<ErrorReport />
<ErrorReport /> */}
</Modal>
</Fragment>
);
Expand Down
Loading

0 comments on commit 6047698

Please sign in to comment.