Skip to content

Commit

Permalink
#1322 updated tooltip of tag info boxes with tag upload name
Browse files Browse the repository at this point in the history
  • Loading branch information
matej-vavrek committed Jun 28, 2024
1 parent 45f4795 commit d808ae7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions js/components/preview/molecule/moleculeView/moleculeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -1357,17 +1357,18 @@ const MoleculeView = memo(
alignItems="center"
// wrap="nowrap"
style={{ height: "100%" }}>
{['CanonSites', 'ConformerSites', 'CrystalformSites', 'Crystalforms', 'Quatassemblies'].map(tagType => {
const tagLabel = tagType === 'ConformerSites' ? getTagType(tagType).tag_prefix.replace(getTagType('CanonSites')?.tag_prefix, '') : getTagType(tagType)?.tag_prefix;
{['CanonSites', 'ConformerSites', 'CrystalformSites', 'Crystalforms', 'Quatassemblies'].map(tagCategory => {
const tagTypeObject = getTagType(tagCategory);
const tagLabel = tagCategory === 'ConformerSites' ? tagTypeObject.tag_prefix.replace(getTagType('CanonSites')?.tag_prefix, '') : tagTypeObject?.tag_prefix;
return <Tooltip
key={`tag-category-${tagType}`}
title={<div style={{ whiteSpace: 'pre-line' }}>{tagType}</div>}
key={`tag-category-${tagCategory}`}
title={<div style={{ whiteSpace: 'pre-line' }}>{tagCategory} - {tagTypeObject.upload_name}</div>}
>
<Grid item xs
className={classNames(classes.contColButtonMenu)}
style={{
backgroundColor: resolveTagBackgroundColor(getTagType(tagType)),
color: resolveTagForegroundColor(getTagType(tagType)),
backgroundColor: resolveTagBackgroundColor(tagTypeObject),
color: resolveTagForegroundColor(tagTypeObject),
fontSize: getFontSize(tagLabel)
}}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@ const ObservationCmpView = memo(
wrap="nowrap">

<Tooltip
title={<div style={{ whiteSpace: 'pre-line' }}>CanonSites</div>}
title={<div style={{ whiteSpace: 'pre-line' }}>CanonSites - {getCanonSitesTag().upload_name}</div>}
>
<Grid item xs
className={classNames(classes.contColMenu, classes.contColButtonMenu)}
Expand All @@ -1602,7 +1602,7 @@ const ObservationCmpView = memo(
{getConformerSites().map((conformerSite, i, sites) =>
<Tooltip
key={conformerSite.id + i}
title={<div style={{ whiteSpace: 'pre-line' }}>ConformerSites</div>}
title={<div style={{ whiteSpace: 'pre-line' }}>ConformerSites - {conformerSite.upload_name}</div>}
>
<Grid item xs className={classNames(classes.contColMenu, classes.contColButtonMenu, {
[classes.smallConformerSite]: sites.length >= 3
Expand Down

0 comments on commit d808ae7

Please sign in to comment.