Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/#444' into allfunctionality
Browse files Browse the repository at this point in the history
  • Loading branch information
boriskovar-m2ms committed Nov 10, 2020
2 parents 057a6f5 + 165a485 commit a647db8
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
3 changes: 2 additions & 1 deletion js/components/datasets/crossReferenceDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ const useStyles = makeStyles(theme => ({
},
content: {
overflowY: 'auto',
height: 214
height: 214,
width: 'fit-content'
},
search: {
margin: theme.spacing(1),
Expand Down
12 changes: 11 additions & 1 deletion js/components/datasets/datasetMoleculeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ const useStyles = makeStyles(theme => ({
inheritWidth: {
width: 'inherit'
},
widthOverflow: {
maxWidth: '180px',
overflow: 'hidden'
},
rank: {
fontStyle: 'italic',
fontSize: 7
Expand Down Expand Up @@ -553,7 +557,13 @@ export const DatasetMoleculeView = memo(
</Grid>
<Grid item container className={classes.detailsCol} justify="space-between" direction="row">
{/* Title label */}
<Grid item xs={!showCrossReferenceModal && hideFButton ? 8 : 7} container direction="column">
<Grid
item
xs={!showCrossReferenceModal && hideFButton ? 8 : 7}
container
direction="column"
className={!showCrossReferenceModal && hideFButton ? classes.widthOverflow : ''}
>
<Grid item className={classes.inheritWidth}>
<Tooltip title={moleculeTitle} placement="bottom-start">
<div className={classNames(classes.moleculeTitleLabel, isCheckedToBuy && classes.selectedMolecule)}>
Expand Down
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 a647db8

Please sign in to comment.