Skip to content

Commit

Permalink
#1523 #1463 (#457)
Browse files Browse the repository at this point in the history
* #1514 replaced project_id occurrences with project and adjusted functionality with current B/E

* #1514 added target_access_string to /api/download_structures, replaced /api/molgroup with /api/siteobservationgroup, minor fixes

* #1523 adjusted inspiration dialog layout and removed molecular properties headers from it too

* #1463 show "Ascending" instead of "ASC" when there is a possible space for it

* removed unnecessary setter and comments
  • Loading branch information
matej-vavrek authored Oct 16, 2024
1 parent 9916d56 commit b8b61be
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 14 deletions.
8 changes: 4 additions & 4 deletions js/components/datasets/inspirationDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import GroupNglControlButtonsContext from '../preview/molecule/groupNglControlBu

const useStyles = makeStyles(theme => ({
paper: {
width: 472,
height: 294,
width: 505,
// height: 294,
overflowY: 'hidden'
},
molHeader: {
Expand Down Expand Up @@ -382,11 +382,11 @@ export const InspirationDialog = memo(
<>
<Grid container justifyContent="flex-start" direction="row" className={classes.molHeader} wrap="nowrap">
<Grid item container justifyContent="flex-start" direction="row">
{Object.keys(moleculeProperty).map(key => (
{/* {Object.keys(moleculeProperty).map(key => (
<Grid item key={key} className={classes.rightBorder}>
{moleculeProperty[key]}
</Grid>
))}
))} */}
{allSelectedMolecules.length > 0 && (
<Grid item>
<Grid
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 @@ -147,7 +147,7 @@ const useStyles = makeStyles(theme => ({
image: {
border: 'solid 1px',
borderColor: theme.palette.background.divider,
borderStyle: 'solid solid solid none',
borderStyle: 'none none none solid',
position: 'relative'
},
imageMargin: {
Expand Down Expand Up @@ -1203,7 +1203,7 @@ const MoleculeView = memo(
</Grid>
<Grid item container className={classes.detailsCol} justifyContent="space-between" direction="row">
<Grid item container direction="column" alignItems="center" xs>
<Grid item container justifyContent="flex-start" alignItems="center" direction="row">
<Grid item container justifyContent="flex-start" alignItems="center" direction="row" xs>
<Grid item container justifyContent="space-between" direction="column" xs={3}>
{/* Title label */}
<Tooltip title={data.prefix_tooltip ?? '-' + (data.id === pose?.main_site_observation ? " - main observation" : "")} placement="bottom-start">
Expand Down
38 changes: 30 additions & 8 deletions js/components/preview/molecule/observationCmpList.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ const useStyles = makeStyles(theme => ({
//color: theme.palette.black
}
},
selectButton: {
padding: '4px 2px !important'
},
formControl: {
color: 'inherit',
margin: theme.spacing(1),
Expand Down Expand Up @@ -416,10 +419,29 @@ export const ObservationCmpList = memo(({ hideProjects }) => {
const filterRef = useRef();
const tagEditorRef = useRef();
const scrollBarRef = useRef();
const hitNavigatorRef = useRef();
const [tagEditorAnchorEl, setTagEditorAnchorEl] = useState(null);
const [hitNavigatorWidth, setHitNavigatorWidth] = useState(0);

const areLSHCompoundsInitialized = useSelector(state => state.selectionReducers.areLSHCompoundsInitialized);

useEffect(() => {
if (hitNavigatorRef && hitNavigatorRef.current) {

const resizeObserver = new ResizeObserver(() => {
if (hitNavigatorRef.current.offsetWidth !== hitNavigatorWidth) {
setHitNavigatorWidth(hitNavigatorRef.current.offsetWidth);
}
});

resizeObserver.observe(hitNavigatorRef.current);

return function cleanup() {
resizeObserver.disconnect();
}
}
}, [hitNavigatorRef, hitNavigatorWidth]);

if (directDisplay && directDisplay.target) {
target = directDisplay.target;
}
Expand Down Expand Up @@ -1060,7 +1082,7 @@ export const ObservationCmpList = memo(({ hideProjects }) => {
};

return (
<Panel hasHeader title="Hit navigator" headerActions={actions}>
<Panel hasHeader title="Hit navigator" headerActions={actions} ref={hitNavigatorRef}>
<AlertModal
title="Are you sure?"
description={`Loading of ${joinedMoleculeLists?.length} may take a long time`}
Expand Down Expand Up @@ -1200,7 +1222,7 @@ export const ObservationCmpList = memo(({ hideProjects }) => {

{
<Tooltip title={selectAllHitsPressed ? 'Unselect all hits' : 'Select all hits'}>
<Grid item style={{ marginLeft: '5px' }}>
<Grid item style={{ marginLeft: '2px' }} className={classes.selectButton}>
<Button
variant="outlined"
className={classNames(classes.contColButton, {
Expand All @@ -1220,7 +1242,7 @@ export const ObservationCmpList = memo(({ hideProjects }) => {
}
{selectedDisplayHits === true ? (
<Tooltip title={'Unselect displayed hits'}>
<Grid item style={{ marginLeft: '5px' }}>
<Grid item className={classes.selectButton}>
<Button
variant="outlined"
className={classNames(classes.contColButton, {
Expand All @@ -1239,7 +1261,7 @@ export const ObservationCmpList = memo(({ hideProjects }) => {
</Tooltip>
) : (
<Tooltip title={'Select displayed hits'}>
<Grid item style={{ marginLeft: '5px' }}>
<Grid item className={classes.selectButton}>
<Button
variant="outlined"
className={classNames(classes.contColButton, {
Expand All @@ -1258,11 +1280,11 @@ export const ObservationCmpList = memo(({ hideProjects }) => {
</Tooltip>
)}
<Grid style={{ marginTop: '4px' }}>
<Typography variant="caption" className={classes.noOfSelectedHits}>{`Selected: ${allSelectedMolecules ? allSelectedMolecules.length : 0
<Typography variant="caption">{`Selected: ${allSelectedMolecules ? allSelectedMolecules.length : 0
}`}</Typography>
</Grid>
<Grid style={{ marginTop: '4px' }}>
<Typography variant="caption" className={classes.noOfSelectedHits}>Sort by</Typography>
<Typography variant="caption" style={{ paddingLeft: 3 }}>Sort by</Typography>
</Grid>
<Grid style={{ marginTop: '4px', marginLeft: '4px' }}>
<Tooltip title={sortOption ? sortOptions[sortOption].title : "Sort by"}>
Expand All @@ -1283,8 +1305,8 @@ export const ObservationCmpList = memo(({ hideProjects }) => {
</Grid>
<Tooltip title={ascending ? "Ascending" : "Descending"}>
<Grid style={{ marginTop: '4px' }}>
<Checkbox checked={ascending} onChange={handleAscendingChecked} size="small" style={{ padding: 3 }} />
<Typography variant="caption" className={classes.noOfSelectedHits}>ASC</Typography>
<Checkbox checked={ascending} onChange={handleAscendingChecked} size="small" style={{ padding: 0 }} />
<Typography variant="caption">{(selectAllHitsPressed && hitNavigatorWidth > 508) || (!selectAllHitsPressed && hitNavigatorWidth > 491) ? 'Ascending' : 'ASC'}</Typography>
</Grid>
</Tooltip>
</Grid>
Expand Down

0 comments on commit b8b61be

Please sign in to comment.