Skip to content
Snippets Groups Projects
Commit ab9e350f authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '314-element-or-reaction-notes-are-not-displayed-in-the-left-panel' into 'main'

Resolve "Element or reaction notes are not displayed in the left panel."

See merge request !303
parents 9e1f317f cf12d006
No related branches found
No related tags found
2 merge requests!306Resolve "Allow plugin to hide left panel",!303Resolve "Element or reaction notes are not displayed in the left panel."
Pipeline #97834 passed
minerva-front (18.0.3) stable; urgency=medium
* Bug fix: Molart froze after clicking (#313)
* Bug fix: missing description and modifications added to element and
reaction summary (#314)
-- Piotr Gawron <piotr.gawron@uni.lu> Fri, 08 Nov 2024 13:00:00 +0200
......
......@@ -13,6 +13,7 @@ import { useAppSelector } from '@/redux/hooks/useAppSelector';
import { DrawerHeading } from '@/shared/DrawerHeading';
import { ElementSearchResultType } from '@/types/models';
import { CommentItem } from '@/components/Map/Drawer/BioEntityDrawer/Comments/CommentItem.component';
import { ModificationResidueItem } from '@/components/Map/Drawer/BioEntityDrawer/ModificationResidueItem';
import { CollapsibleSection } from '../ExportDrawer/CollapsibleSection';
import { AnnotationItem } from './AnnotationItem';
import { AssociatedSubmap } from './AssociatedSubmap';
......@@ -42,6 +43,10 @@ export const BioEntityDrawer = (): React.ReactNode => {
const isReferenceAvailable = bioEntityData.references.length > ZERO;
const isCommentAvailable = commentsData.length > ZERO;
const modificationResidues = (
bioEntityData.modificationResidues ? bioEntityData.modificationResidues : []
).filter(modificationResidue => modificationResidue.state && modificationResidue.state !== '');
const isModificationAvailable = modificationResidues.length > ZERO;
return (
<div className="h-calc-drawer" data-testid="bioentity-drawer">
......@@ -62,6 +67,17 @@ export const BioEntityDrawer = (): React.ReactNode => {
Full name: <b className="font-semibold">{bioEntityData.fullName}</b>
</div>
)}
{bioEntityData.notes && <div className="text-sm font-normal">{bioEntityData.notes}</div>}
{isModificationAvailable && (
<h3 className="font-semibold">Post-translational modifications:</h3>
)}
{isModificationAvailable && (
<ul className="ml-5 list-disc">
{modificationResidues.map(residue => (
<ModificationResidueItem key={residue.id} state={residue.state} name={residue.name} />
))}
</ul>
)}
<h3 className="font-semibold">
Annotations:{' '}
{!isReferenceAvailable && <span className="font-normal">No annotations</span>}
......
import { ModificationResidue } from '@/types/models';
type ModificationResidueItemProps = Pick<ModificationResidue, 'state' | 'name'>;
export const ModificationResidueItem = ({
state,
name,
}: ModificationResidueItemProps): JSX.Element => (
<li>
<span>
{state} {name && <span>at position {name}</span>}
</span>
</li>
);
export { ModificationResidueItem } from './ModificationResidueItem.component';
......@@ -37,6 +37,7 @@ export const ReactionDrawer = (): React.ReactNode => {
Type: <b className="font-semibold">{reaction.type}</b>
</div>
<hr className="border-b border-b-divide" />
{reaction.notes && <div className="text-sm font-normal">{reaction.notes}</div>}
<h3 className="font-semibold">Annotations:</h3>
{referencesGrouped.map(group => (
<ReferenceGroup key={group.source} group={group} />
......
......@@ -65,6 +65,7 @@ import { commentSchema } from '@/models/commentSchema';
import { userSchema } from '@/models/userSchema';
import { javaStacktraceSchema } from '@/models/javaStacktraceSchema';
import { oauthSchema } from '@/models/oauthSchema';
import { modificationResiduesSchema } from '@/models/modificationResiduesSchema';
export type Project = z.infer<typeof projectSchema>;
export type OverviewImageView = z.infer<typeof overviewImageView>;
......@@ -123,6 +124,7 @@ export type MarkerSurface = z.infer<typeof markerSurfaceSchema>;
export type MarkerLine = z.infer<typeof markerLineSchema>;
export type MarkerWithPosition = z.infer<typeof markerWithPositionSchema>;
export type Marker = z.infer<typeof markerSchema>;
export type ModificationResidue = z.infer<typeof modificationResiduesSchema>;
export type JavaStacktrace = z.infer<typeof javaStacktraceSchema>;
export type Comment = z.infer<typeof commentSchema>;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment