From bda7d0e7ee75b5ee729bca4f565cc598f7c04b6d Mon Sep 17 00:00:00 2001 From: Piotr Gawron <p.gawron@atcomp.pl> Date: Thu, 5 Dec 2024 11:23:24 +0100 Subject: [PATCH] notes are rendered as HTML --- CHANGELOG | 4 +++- .../Drawer/BioEntityDrawer/BioEntityDrawer.component.tsx | 6 +++++- .../Drawer/ReactionDrawer/ReactionDrawer.component.tsx | 9 ++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 164d4397..a0285e6e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,8 +1,10 @@ minerva-front (18.0.5) stable; urgency=medium * Bug fix: anchor overlays were disappearing after clicking on anchor and outside of the anchor (#319) + * Bug fix: bioEntity HTML notes in the left panel were not rendered as html + (#323) - -- Piotr Gawron <piotr.gawron@uni.lu> Wed, 27 Nov 2024 13:00:00 +0200 + -- Piotr Gawron <piotr.gawron@uni.lu> Thu, 05 Dec 2024 13:00:00 +0200 minerva-front (18.0.4) stable; urgency=medium * Bug fix: link to search result from overview image caused map not to diff --git a/src/components/Map/Drawer/BioEntityDrawer/BioEntityDrawer.component.tsx b/src/components/Map/Drawer/BioEntityDrawer/BioEntityDrawer.component.tsx index 14fc5449..1e54091e 100644 --- a/src/components/Map/Drawer/BioEntityDrawer/BioEntityDrawer.component.tsx +++ b/src/components/Map/Drawer/BioEntityDrawer/BioEntityDrawer.component.tsx @@ -14,6 +14,7 @@ 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 React from 'react'; import { CollapsibleSection } from '../ExportDrawer/CollapsibleSection'; import { AnnotationItem } from './AnnotationItem'; import { AssociatedSubmap } from './AssociatedSubmap'; @@ -73,7 +74,10 @@ export const BioEntityDrawer = (): React.ReactNode => { {bioEntityData.notes && ( <span> <hr className="border-b border-b-divide" /> - <div className="text-sm font-normal">{bioEntityData.notes}</div> + <div + className="text-sm font-normal" + dangerouslySetInnerHTML={{ __html: bioEntityData.notes }} + /> </span> )} {isModificationAvailable && ( diff --git a/src/components/Map/Drawer/ReactionDrawer/ReactionDrawer.component.tsx b/src/components/Map/Drawer/ReactionDrawer/ReactionDrawer.component.tsx index 1423ef7d..f772343e 100644 --- a/src/components/Map/Drawer/ReactionDrawer/ReactionDrawer.component.tsx +++ b/src/components/Map/Drawer/ReactionDrawer/ReactionDrawer.component.tsx @@ -8,6 +8,7 @@ import { useAppSelector } from '@/redux/hooks/useAppSelector'; import { currentDrawerReactionCommentsSelector } from '@/redux/bioEntity/bioEntity.selectors'; import { CommentItem } from '@/components/Map/Drawer/BioEntityDrawer/Comments/CommentItem.component'; import { ZERO } from '@/constants/common'; +import React from 'react'; import { ReferenceGroup } from './ReferenceGroup'; import { ConnectedBioEntitiesList } from './ConnectedBioEntitiesList'; @@ -37,7 +38,13 @@ 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>} + {reaction.notes && ( + <div + className="text-sm font-normal" + dangerouslySetInnerHTML={{ __html: reaction.notes }} + /> + )} + <h3 className="font-semibold">Annotations:</h3> {referencesGrouped.map(group => ( <ReferenceGroup key={group.source} group={group} /> -- GitLab