Skip to content

Commit

Permalink
Partial implementation of #1357 (#415)
Browse files Browse the repository at this point in the history
* - first implementation of #1354

* - updated message for #1354

* - cleanup for #1354

* - implemented #1361
- improvements for #1354

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

* - partial fix for purple release for #1370

* - using official backend version

* - DELETE button disabled for #1357
  • Loading branch information
boriskovar-m2ms authored Mar 13, 2024
1 parent 5862ad9 commit c2ed9a6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 24 deletions.
36 changes: 16 additions & 20 deletions js/components/datasets/datasetMoleculeView/datasetMoleculeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,15 @@ import { centerOnLigandByMoleculeID } from '../../../reducers/ngl/dispatchAction
import { ArrowDownward, ArrowUpward, MyLocation } from '@material-ui/icons';
import { isString } from 'lodash';
import { SvgTooltip } from '../../common';
import { addComplex, addHitProtein, addSurface, getMolImage, removeComplex, removeHitProtein, removeSurface } from '../../preview/molecule/redux/dispatchActions';
import {
addComplex,
addHitProtein,
addSurface,
getMolImage,
removeComplex,
removeHitProtein,
removeSurface
} from '../../preview/molecule/redux/dispatchActions';
import { MOL_TYPE } from '../../preview/molecule/redux/constants';
import {
deselectVectorCompound,
Expand Down Expand Up @@ -1236,13 +1244,7 @@ const DatasetMoleculeView = memo(
wrap="nowrap"
className={classes.fullHeight}
>
<Grid
item
container
justifyContent="flex-start"
direction="row"
wrap="nowrap"
>
<Grid item container justifyContent="flex-start" direction="row" wrap="nowrap">
{filteredScoreProperties &&
datasetID &&
filteredScoreProperties[datasetID] &&
Expand Down Expand Up @@ -1270,21 +1272,15 @@ const DatasetMoleculeView = memo(
null}
</Grid>
)) || (
<Grid item className={classes.rightBorder}>
-
</Grid>
)}
<Grid item className={classes.rightBorder}>
-
</Grid>
)}
</Tooltip>
);
})}
</Grid>
<Grid
item
container
justifyContent="flex-end"
direction="row"
wrap="nowrap"
>
<Grid item container justifyContent="flex-end" direction="row" wrap="nowrap">
{Object.keys(compoundsColors).map(color => {
const colorIncluded = shoppingCartColors?.includes(color);
return (
Expand Down Expand Up @@ -1363,7 +1359,7 @@ const DatasetMoleculeView = memo(
</Tooltip>
)}
{moleculeTooltipOpen && !inSelectedCompoundsList && (
<Tooltip title={"Missing tooltip!"}>
<Tooltip title={'Missing tooltip!'}>
<IconButton className={classes.addToShoppingCartIcon} onClick={handleShoppingCartClick}>
<AddShoppingCartIcon />
</IconButton>
Expand Down
2 changes: 1 addition & 1 deletion js/components/preview/tags/details/newTagDetailRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ const NewTagDetailRow = memo(({ moleculesToEditIds, moleculesToEdit }) => {
onClick={() => deleteTag()}
color="secondary"
variant="contained"
disabled={!DJANGO_CONTEXT.pk}
disabled={!DJANGO_CONTEXT.pk || !comboCategories.some(cc => cc.id === tagToEdit.category)}
size="small"
>
Delete
Expand Down
6 changes: 3 additions & 3 deletions js/components/preview/tags/details/tagDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ const TagDetails = memo(() => {
const moleculesToEditIds = useSelector(state => state.selectionReducers.moleculesToEdit);
const moleculesToEdit =
moleculesToEditIds &&
moleculesToEditIds.length > 0 &&
!(moleculesToEditIds.length === 1 && moleculesToEditIds[0] === null)
moleculesToEditIds.length > 0 &&
!(moleculesToEditIds.length === 1 && moleculesToEditIds[0] === null)
? moleculesToEditIds.map(id => dispatch(getMoleculeForId(id)))
: [];

Expand Down Expand Up @@ -441,7 +441,7 @@ const TagDetails = memo(() => {
</Grid>
</Grid>
</div>
<div ref={elementRef} className={classes.containerExpanded} style={{ height: tagDetailView ? "80%" : "87%" }}>
<div ref={elementRef} className={classes.containerExpanded} style={{ height: tagDetailView ? '80%' : '87%' }}>
{tagDetailView ? (
<>
<div className={classes.container} id="tagName">
Expand Down

0 comments on commit c2ed9a6

Please sign in to comment.