[WIKI-637] fix: work item description version history (#7725)
* fix: work item description version history * chore: add key to the editor
This commit is contained in:
parent
b68d2ca921
commit
88f194ca8e
2 changed files with 8 additions and 4 deletions
|
|
@ -131,13 +131,14 @@ export const DescriptionVersionsModal: React.FC<Props> = observer((props) => {
|
|||
{/* End header */}
|
||||
{/* Version description */}
|
||||
<div className="mt-4 pb-4">
|
||||
{activeVersionDescription ? (
|
||||
{activeVersionId && activeVersionDescription ? (
|
||||
<RichTextEditor
|
||||
key={activeVersionId}
|
||||
editable={false}
|
||||
containerClassName="p-0 !pl-0 border-none"
|
||||
editorClassName="pl-0"
|
||||
id={activeVersionId ?? ""}
|
||||
initialValue={activeVersionDescription ?? "<p></p>"}
|
||||
id={activeVersionId}
|
||||
initialValue={activeVersionDescription}
|
||||
projectId={projectId}
|
||||
ref={editorRef}
|
||||
workspaceId={workspaceId}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,9 @@ export const DescriptionVersionsRoot: React.FC<Props> = observer((props) => {
|
|||
const versionsCount = versions?.length ?? 0;
|
||||
const activeVersionDetails = versions?.find((version) => version.id === activeVersionId);
|
||||
const activeVersionIndex = versions?.findIndex((version) => version.id === activeVersionId);
|
||||
const activeVersionDescription = activeVersionResponse
|
||||
? (activeVersionResponse.description_html ?? "<p></p>")
|
||||
: undefined;
|
||||
|
||||
const handleNavigation = useCallback(
|
||||
(direction: "prev" | "next") => {
|
||||
|
|
@ -64,7 +67,7 @@ export const DescriptionVersionsRoot: React.FC<Props> = observer((props) => {
|
|||
return (
|
||||
<>
|
||||
<DescriptionVersionsModal
|
||||
activeVersionDescription={activeVersionResponse?.description_html ?? "<p></p>"}
|
||||
activeVersionDescription={activeVersionDescription}
|
||||
activeVersionDetails={activeVersionDetails}
|
||||
handleClose={() => {
|
||||
setIsModalOpen(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue