Skip to content

Commit

Permalink
Fixed molecule view of inspiration dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Adriána Kohanová committed Nov 9, 2020
1 parent bea0e70 commit fb6878b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
3 changes: 3 additions & 0 deletions js/components/datasets/inspirationDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ export const InspirationDialog = memo(
surface: removeSurface
};

const selectMoleculeSite = moleculeGroupSite => {};

const removeOfAllSelectedTypes = () => {
proteinList?.forEach(moleculeID => {
let foundedMolecule = moleculeList?.find(mol => mol.id === moleculeID);
Expand Down Expand Up @@ -409,6 +411,7 @@ export const InspirationDialog = memo(
previousItemData={previousData}
nextItemData={nextData}
removeOfAllSelectedTypes={removeOfAllSelectedTypes}
selectMoleculeSite={selectMoleculeSite}
/>
);
})}
Expand Down
24 changes: 18 additions & 6 deletions js/components/preview/molecule/moleculeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ const MoleculeView = memo(
isLigandOn || isProteinOn || isComplexOn || isSurfaceOn || isVectorOn ? selected_style : not_selected_style;

const addNewLigand = () => {
selectMoleculeSite(data.site);
if (selectMoleculeSite) {
selectMoleculeSite(data.site);
}
dispatch(addLigand(stage, data, colourToggle));
};

Expand Down Expand Up @@ -376,7 +378,9 @@ const MoleculeView = memo(
};

const addNewProtein = () => {
selectMoleculeSite(data.site);
if (selectMoleculeSite) {
selectMoleculeSite(data.site);
}
dispatch(addHitProtein(stage, data, colourToggle));
};

Expand All @@ -402,7 +406,9 @@ const MoleculeView = memo(
};

const addNewComplex = () => {
selectMoleculeSite(data.site);
if (selectMoleculeSite) {
selectMoleculeSite(data.site);
}
dispatch(addComplex(stage, data, colourToggle));
};

Expand All @@ -427,7 +433,9 @@ const MoleculeView = memo(
};

const addNewSurface = () => {
selectMoleculeSite(data.site);
if (selectMoleculeSite) {
selectMoleculeSite(data.site);
}
dispatch(addSurface(stage, data, colourToggle));
};

Expand All @@ -444,7 +452,9 @@ const MoleculeView = memo(
};

const addNewDensity = () => {
selectMoleculeSite(data.site);
if (selectMoleculeSite) {
selectMoleculeSite(data.site);
}
dispatch(addDensity(stage, data, colourToggle));
};

Expand All @@ -461,7 +471,9 @@ const MoleculeView = memo(
};

const addNewVector = () => {
selectMoleculeSite(data.site);
if (selectMoleculeSite) {
selectMoleculeSite(data.site);
}
dispatch(addVector(stage, data)).catch(error => {
throw new Error(error);
});
Expand Down

0 comments on commit fb6878b

Please sign in to comment.