Skip to content

Commit

Permalink
FE support for poses (#425)
Browse files Browse the repository at this point in the history
* #1403 fixed timer when services are not available

* #1389 applied tag.hidden logic, reduced autohide time for tags toasts to 5 seconds

* Squashed commit of the following:

commit 7511b57
Author: Boris Kovar <[email protected]>
Date:   Tue Apr 23 08:27:24 2024 +0200

    - finished #1348

commit 6074d79
Author: Boris Kovar <[email protected]>
Date:   Wed Apr 17 09:50:06 2024 +0200

    - #1348 - fixed cases when all pdbs are missing

commit 49f0ae8
Author: Boris Kovar <[email protected]>
Date:   Wed Apr 10 13:41:50 2024 +0200

    - checkpoint

commit 13a315e
Author: Boris Kovar <[email protected]>
Date:   Wed Apr 3 12:30:06 2024 +0200

    - checkpoint

commit a5b8cca
Merge: 34b75f7 756a25b
Author: Boris Kovar <[email protected]>
Date:   Mon Mar 25 12:24:01 2024 +0100

    Merge branch '#1348' of https://github.com/m2ms/fragalysis-frontend into #1348

commit 34b75f7
Author: Boris Kovar <[email protected]>
Date:   Tue Mar 12 12:35:21 2024 +0100

    - latest backend

commit 1308cb2
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit 1ee15e7
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit a033b68
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit 7149081
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit 623de4f
Author: Boris Kovar <[email protected]>
Date:   Tue Mar 12 09:48:51 2024 +0100

    - using official backend version

commit eec204c
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 12:16:45 2024 +0100

    - checkpoint

commit dbc93a7
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 10:27:08 2024 +0100

    - checkpoint

commit b933243
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit 4a0e171
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit 634ed03
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit 6e65fae
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit 1bff7bf
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit 07f21b6
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit 021366e
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit 36f87b4
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit 87e765a
Author: Boris Kovar <[email protected]>
Date:   Tue Mar 12 12:35:21 2024 +0100

    - latest backend

commit 72c94f0
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit 224ca23
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit 36f03f8
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit 8072920
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit e319056
Author: Boris Kovar <[email protected]>
Date:   Tue Mar 12 09:48:51 2024 +0100

    - using official backend version

commit 187e7f3
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 12:16:45 2024 +0100

    - checkpoint

commit b6aa0a4
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 10:27:08 2024 +0100

    - checkpoint

commit fccf976
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit 965be5e
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit b01cdbf
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit e04fbf2
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit 5d64c26
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit dbb155c
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit b1c0f3c
Author: Boris Kovar <[email protected]>
Date:   Thu Feb 29 10:32:27 2024 +0100

    - checkpoint

commit abc8cc9
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit 2ef004a
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit 756a25b
Merge: f686ef4 f474ff6
Author: Boris Kovar <[email protected]>
Date:   Thu Mar 14 10:00:02 2024 +0100

    Merge branch '#1348' of https://github.com/m2ms/fragalysis-frontend into #1348

commit f686ef4
Author: Boris Kovar <[email protected]>
Date:   Tue Mar 12 12:35:21 2024 +0100

    - latest backend

commit df6209c
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit f5a842f
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit 83ffccc
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit 0ecff35
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit d3a90c7
Author: Boris Kovar <[email protected]>
Date:   Tue Mar 12 09:48:51 2024 +0100

    - using official backend version

commit 50800b9
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 12:16:45 2024 +0100

    - checkpoint

commit 2af18fd
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 10:27:08 2024 +0100

    - checkpoint

commit cd75a27
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit c485389
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit 96296e9
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit 760152b
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit 8a30204
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit 6235e9c
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit e2e46cb
Author: Boris Kovar <[email protected]>
Date:   Thu Feb 29 10:32:27 2024 +0100

    - checkpoint

commit 8176514
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit 6aa5108
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit f474ff6
Merge: 56c0b85 e728f49
Author: Boris Kovar <[email protected]>
Date:   Thu Mar 14 08:30:00 2024 +0100

    Merge branch '#1348' of https://github.com/m2ms/fragalysis-frontend into #1348

    # Conflicts:
    #	js/components/preview/tags/details/tagDetails.js

commit 56c0b85
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit a185933
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit 09c97b5
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit c6d0738
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit 72f36b0
Author: Boris Kovar <[email protected]>
Date:   Thu Feb 29 10:32:27 2024 +0100

    - checkpoint

commit 971799d
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit 1bb5326
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit e728f49
Author: Boris Kovar <[email protected]>
Date:   Tue Mar 12 12:35:21 2024 +0100

    - latest backend

commit 125b8d4
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit 0e41551
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit 8cf43e0
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit d336352
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

commit 2fb59dc
Author: Boris Kovar <[email protected]>
Date:   Tue Mar 12 09:48:51 2024 +0100

    - using official backend version

commit 9439f5d
Author: Boris Kovar <[email protected]>
Date:   Thu Mar 7 13:59:03 2024 +0100

    - partial fix for purple release for #1370

commit 4ff5f94
Author: Boris Kovar <[email protected]>
Date:   Thu Mar 7 10:10:41 2024 +0100

    - implemented #1376
    - also fixed bug in download structures dialog where only first download got added to the dropdown menu

commit 66a98f3
Author: Boris Kovar <[email protected]>
Date:   Wed Mar 6 09:47:12 2024 +0100

    - implemented #1361
    - improvements for #1354

commit 8a193a5
Author: Boris Kovar <[email protected]>
Date:   Tue Mar 5 13:24:11 2024 +0100

    - cleanup for #1354

commit bb3bf3b
Author: Boris Kovar <[email protected]>
Date:   Tue Mar 5 13:21:32 2024 +0100

    - updated message for #1354

commit a3dc819
Author: Boris Kovar <[email protected]>
Date:   Tue Mar 5 13:05:12 2024 +0100

    - first implementation of #1354

commit 4121519
Author: Boris Kovar <[email protected]>
Date:   Tue Mar 5 08:17:49 2024 +0100

    - implemented #1357

commit 4d96ff4
Author: Boris Kovar <[email protected]>
Date:   Mon Mar 4 10:07:06 2024 +0100

    - implemented changes requested in #1326

commit 03158be
Author: Boris Kovar <[email protected]>
Date:   Mon Mar 4 08:45:22 2024 +0100

    - fixed problem with tags not visually updating on observations

commit 8765a3c
Author: matej <[email protected]>
Date:   Mon Feb 26 21:36:12 2024 +0100

    #1341 "pin" edit tag row outside of tag list

commit 6db8b22
Author: Boris Kovar <[email protected]>
Date:   Thu Feb 29 10:32:27 2024 +0100

    - checkpoint

commit 027eaf0
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 12:16:45 2024 +0100

    - checkpoint

commit 7407dbd
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 10:27:08 2024 +0100

    - checkpoint

commit c13628b
Author: Boris Kovar <[email protected]>
Date:   Tue Feb 27 09:23:04 2024 +0100

    - checkpoint

commit e39721c
Author: Boris Kovar <[email protected]>
Date:   Mon Feb 26 08:42:49 2024 +0100

    - checkpoint

* - using official backend now

* Squashed commit of the following:

commit 8fe886a
Author: Boris Kovar <[email protected]>
Date:   Wed May 15 09:00:04 2024 +0200

    Squashed commit of the following:

    commit 6813219
    Author: matej <[email protected]>
    Date:   Mon Apr 29 07:38:30 2024 +0200

        #1261 added icon for "Manage grouping" button

    commit a665ed5
    Author: matej <[email protected]>
    Date:   Sun Apr 28 23:23:25 2024 +0200

        #1261 added buttons into observation dialog for later poses handling

commit 70a5e70
Author: Boris Kovar <[email protected]>
Date:   Mon Apr 29 09:20:46 2024 +0200

    - #1261 - initial implementation

---------

Co-authored-by: matej <[email protected]>
  • Loading branch information
boriskovar-m2ms and matej-vavrek authored May 15, 2024
1 parent 67200eb commit f5b27c6
Show file tree
Hide file tree
Showing 17 changed files with 610 additions and 98 deletions.
48 changes: 48 additions & 0 deletions js/components/preview/molecule/api/poseApi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { api } from '../../../../utils/api';
import { base_url } from '../../../routes/constants';

const POSE_ERROR_LABEL_TRANSLATOR = {
id: 'Identificator of the pose',
display_name: 'Display name of the pose',
canon_site: 'Canonical site of the pose',
compound: 'Compound of the pose',
main_site_observation: 'Main observation of the pose',
site_observations: 'All observations of the pose',
main_site_observation_cmpd_code: 'Main observation compound code'
};

export const updatePoseApi = async pose => {
return api({ url: `${base_url}/api/poses/${pose.id}/`, method: 'PATCH', data: pose });
};

export const createPoseApi = async pose => {
return api({ url: `${base_url}/api/poses/`, method: 'POST', data: pose }).then(response => response.data);
};

export const createPoseErrorMessage = error => {
let result = null;

if (error?.response?.data) {
const fields = Object.keys(error.response.data);
const errorMessages = [];
let i = 0;

fields.forEach(field => {
if (Array.isArray(error.response.data[field])) {
const arrayOfErrors = error.response.data[field];
if (arrayOfErrors.length > 0) {
errorMessages[i++] = `${POSE_ERROR_LABEL_TRANSLATOR[field]}:` + '\n';
}
arrayOfErrors.forEach(errorMsg => {
errorMessages[i++] = errorMsg + '\n';
});
}
});

if (errorMessages) {
result = errorMessages.join('');
}
}

return result;
};
1 change: 0 additions & 1 deletion js/components/preview/molecule/moleculeList.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ export const MoleculeList = memo(({ hideProjects }) => {
const categories = useSelector(state => state.apiReducers.categoryList);

const proteinsHasLoaded = useSelector(state => state.nglReducers.proteinsHasLoaded);
const currentActionList = useSelector(state => state.trackingReducers.current_actions_list);

const [predefinedFilter, setPredefinedFilter] = useState(filter !== undefined ? filter.predefined : DEFAULT_FILTER);

Expand Down
18 changes: 17 additions & 1 deletion js/components/preview/molecule/moleculeView/moleculeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@ const useStyles = makeStyles(theme => ({
textOverflow: 'ellipsis',
lineHeight: '1.45'
},
moleculeTitleLabelMainObs: {
...theme.typography.button,
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
lineHeight: '1.45',
fontWeight: '900',
fontStyle: 'italic'
},
checkbox: {
padding: 0
},
Expand Down Expand Up @@ -367,6 +376,7 @@ const MoleculeView = memo(
const hasAdditionalInformation = I;

const allMolecules = useSelector(state => state.apiReducers.all_mol_lists);
const allPoses = useSelector(state => state.apiReducers.lhs_compounds_list);

//for some reason when tags are changed for this molecule the data are stale so I need to retrieve them from list of all molecules
data = allMolecules.filter(mol => mol.id === data.id)[0];
Expand All @@ -384,6 +394,8 @@ const MoleculeView = memo(

const colourToggle = getRandomColor(data);

const pose = useMemo(() => allPoses.find(p => p.id === data.pose), [allPoses, data]);

const getCalculatedProps = useCallback(
() => [
// { name: moleculeProperty.mw, value: data.mw ?? 0 },
Expand Down Expand Up @@ -1020,7 +1032,11 @@ const MoleculeView = memo(
e.preventDefault();
setNameCopied(moleculeTitle);
}}
className={classes.moleculeTitleLabel}
className={
data.id === pose?.main_site_observation
? classes.moleculeTitleLabelMainObs
: classes.moleculeTitleLabel
}
>
{moleculeTitleTruncated}
</div>
Expand Down
7 changes: 2 additions & 5 deletions js/components/preview/molecule/observationCmpList.js
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ export const ObservationCmpList = memo(({ hideProjects }) => {
let filteredLHSCompoundsList = useMemo(() => {
const compounds = [];
lhsCompoundsList.forEach(compound => {
const molsForCmp = joinedMoleculeLists.some(molecule => molecule.cmpd === compound.origId);
const molsForCmp = joinedMoleculeLists.some(molecule => molecule.cmpd === compound.compound);
if (molsForCmp && compound.associatedObs.some(obs => joinedMoleculeLists.some(mol => mol.id === obs.id))) {
compounds.push(compound);
}
Expand All @@ -712,7 +712,7 @@ export const ObservationCmpList = memo(({ hideProjects }) => {
useEffect(() => {
if (isObservationDialogOpen && observationsForLHSCmp?.length > 0) {
const cmpId = observationsForLHSCmp[0].cmpd;
const cmp = filteredLHSCompoundsList.find(c => c.origId === cmpId);
const cmp = filteredLHSCompoundsList.find(c => c.compound === cmpId);
if (!cmp) {
dispatch(setObservationsForLHSCmp([]));
dispatch(setOpenObservationsDialog(false));
Expand Down Expand Up @@ -1214,9 +1214,6 @@ export const ObservationCmpList = memo(({ hideProjects }) => {
>
{filteredLHSCompoundsList.map((data, index, array) => {
const molsForCmp = data.associatedObs;
// const selected = allSelectedMolecules.some(
// molecule => molecule.cmpd === data.origId && molecule.canon_site_conf === data.canonSiteConf
// );
const selected = allSelectedMolecules.some(molecule =>
data.associatedObs.some(obs => obs.id === molecule.id)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ import {
removeFromMolListToEdit,
setOpenObservationsDialog,
setObservationsForLHSCmp,
setIsLHSCmpTagEdit
setIsLHSCmpTagEdit,
setPoseIdForObservationsDialog
} from '../../../../reducers/selection/actions';
import { moleculeProperty } from '../helperConstants';
import { centerOnLigandByMoleculeID } from '../../../../reducers/ngl/dispatchActions';
Expand Down Expand Up @@ -387,15 +388,23 @@ const ObservationCmpView = memo(
const { getNglView } = useContext(NglContext);
const stage = getNglView(VIEWS.MAJOR_VIEW) && getNglView(VIEWS.MAJOR_VIEW).stage;

const getFirstObservation = useCallback(() => {
const poseIdForObservationsDialog = useSelector(state => state.selectionReducers.poseIdForObservationsDialog);

useEffect(() => {
if (isObservationDialogOpen && poseIdForObservationsDialog === currentID) {
dispatch(setObservationsForLHSCmp(observations));
}
}, [observations, isObservationDialogOpen, dispatch, poseIdForObservationsDialog, currentID]);

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

if (observations && observations.length > 0) {
result = observations[0];
if (observations && observations.length > 0 && data.main_site_observation) {
result = observations.find(o => o.id === data.main_site_observation);
}

return result;
}, [observations]);
}, [data, observations]);

const getAllObservationsSelectedInList = list => {
let result = [];
Expand Down Expand Up @@ -481,7 +490,7 @@ const ObservationCmpView = memo(
const disableMoleculeNglControlButtons =
useSelector(state => state.previewReducers.molecule.disableNglControlButtons[currentID]) || {};

const colourToggle = getRandomColor(getFirstObservation());
const colourToggle = getRandomColor(getMainObservation());

const getCalculatedProps = useCallback(
() => [
Expand Down Expand Up @@ -808,11 +817,11 @@ const ObservationCmpView = memo(

// componentDidMount
useEffect(() => {
const obs = getFirstObservation();
const obs = getMainObservation();
dispatch(getMolImage(obs.id, MOL_TYPE.HIT, imageWidth, imageHeight)).then(i => {
setImg_data(i);
});
}, [data.id, data.smiles, imageHeight, imageWidth, dispatch, getFirstObservation]);
}, [data.id, data.smiles, imageHeight, imageWidth, dispatch, getMainObservation]);

useEffect(() => {
dispatch(getQualityInformation(data));
Expand Down Expand Up @@ -846,7 +855,7 @@ const ObservationCmpView = memo(
// }
dispatch(
withDisabledMoleculeNglControlButton(currentID, 'ligand', async () => {
const firstObs = getFirstObservation();
const firstObs = getMainObservation();
if (firstObs) {
const color = getRandomColor(firstObs);
await dispatch(addLigand(stage, firstObs, color, false, true, skipTracking));
Expand Down Expand Up @@ -898,7 +907,7 @@ const ObservationCmpView = memo(
// }
dispatch(
withDisabledMoleculeNglControlButton(currentID, 'protein', async () => {
const firstObs = getFirstObservation();
const firstObs = getMainObservation();
if (firstObs) {
const color = getRandomColor(firstObs);
await dispatch(addHitProtein(stage, firstObs, color, true, skipTracking));
Expand Down Expand Up @@ -938,7 +947,7 @@ const ObservationCmpView = memo(
const addNewComplex = (skipTracking = false) => {
dispatch(
withDisabledMoleculeNglControlButton(currentID, 'complex', async () => {
const firstObs = getFirstObservation();
const firstObs = getMainObservation();
if (firstObs) {
const color = getRandomColor(firstObs);
await dispatch(addComplex(stage, firstObs, color, skipTracking));
Expand Down Expand Up @@ -977,7 +986,7 @@ const ObservationCmpView = memo(
const addNewSurface = () => {
dispatch(
withDisabledMoleculeNglControlButton(currentID, 'surface', async () => {
const firstObs = getFirstObservation();
const firstObs = getMainObservation();
if (firstObs) {
const color = getRandomColor(firstObs);
await dispatch(addSurface(stage, firstObs, color));
Expand Down Expand Up @@ -1056,7 +1065,7 @@ const ObservationCmpView = memo(
const addNewQuality = () => {
dispatch(
withDisabledMoleculeNglControlButton(currentID, 'ligand', async () => {
const firstObs = getFirstObservation();
const firstObs = getMainObservation();
if (firstObs) {
const color = getRandomColor(firstObs);
await dispatch(addQuality(stage, firstObs, color));
Expand All @@ -1083,7 +1092,7 @@ const ObservationCmpView = memo(
const addNewVector = () => {
dispatch(
withDisabledMoleculeNglControlButton(currentID, 'vector', async () => {
const firstObs = getFirstObservation();
const firstObs = getMainObservation();
if (firstObs) {
await dispatch(addVector(stage, firstObs));
}
Expand Down Expand Up @@ -1185,7 +1194,8 @@ const ObservationCmpView = memo(
const result = e.target.checked;
if (result) {
if (observations?.length > 0) {
dispatch(appendToMolListToEdit(observations[0].id));
const mainObs = getMainObservation();
mainObs && dispatch(appendToMolListToEdit(mainObs.id));
}
// dispatch(appendToObsCmpListToEdit(currentID));
} else {
Expand Down Expand Up @@ -1233,7 +1243,7 @@ const ObservationCmpView = memo(
variant="outlined"
className={classes.myLocationButton}
onClick={() => {
dispatch(centerOnLigandByMoleculeID(stage, getFirstObservation()?.id));
dispatch(centerOnLigandByMoleculeID(stage, getMainObservation()?.id));
}}
disabled={false || !isLigandOn}
>
Expand Down Expand Up @@ -1427,6 +1437,7 @@ const ObservationCmpView = memo(
dispatch(setObservationsForLHSCmp(observations));
}
dispatch(setOpenObservationsDialog(!isObservationDialogOpen));
dispatch(setPoseIdForObservationsDialog(data.id));

if (setRef) {
setRef(ref.current);
Expand Down
Loading

0 comments on commit f5b27c6

Please sign in to comment.