[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 */}
|
{/* End header */}
|
||||||
{/* Version description */}
|
{/* Version description */}
|
||||||
<div className="mt-4 pb-4">
|
<div className="mt-4 pb-4">
|
||||||
{activeVersionDescription ? (
|
{activeVersionId && activeVersionDescription ? (
|
||||||
<RichTextEditor
|
<RichTextEditor
|
||||||
|
key={activeVersionId}
|
||||||
editable={false}
|
editable={false}
|
||||||
containerClassName="p-0 !pl-0 border-none"
|
containerClassName="p-0 !pl-0 border-none"
|
||||||
editorClassName="pl-0"
|
editorClassName="pl-0"
|
||||||
id={activeVersionId ?? ""}
|
id={activeVersionId}
|
||||||
initialValue={activeVersionDescription ?? "<p></p>"}
|
initialValue={activeVersionDescription}
|
||||||
projectId={projectId}
|
projectId={projectId}
|
||||||
ref={editorRef}
|
ref={editorRef}
|
||||||
workspaceId={workspaceId}
|
workspaceId={workspaceId}
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,9 @@ export const DescriptionVersionsRoot: React.FC<Props> = observer((props) => {
|
||||||
const versionsCount = versions?.length ?? 0;
|
const versionsCount = versions?.length ?? 0;
|
||||||
const activeVersionDetails = versions?.find((version) => version.id === activeVersionId);
|
const activeVersionDetails = versions?.find((version) => version.id === activeVersionId);
|
||||||
const activeVersionIndex = versions?.findIndex((version) => version.id === activeVersionId);
|
const activeVersionIndex = versions?.findIndex((version) => version.id === activeVersionId);
|
||||||
|
const activeVersionDescription = activeVersionResponse
|
||||||
|
? (activeVersionResponse.description_html ?? "<p></p>")
|
||||||
|
: undefined;
|
||||||
|
|
||||||
const handleNavigation = useCallback(
|
const handleNavigation = useCallback(
|
||||||
(direction: "prev" | "next") => {
|
(direction: "prev" | "next") => {
|
||||||
|
|
@ -64,7 +67,7 @@ export const DescriptionVersionsRoot: React.FC<Props> = observer((props) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<DescriptionVersionsModal
|
<DescriptionVersionsModal
|
||||||
activeVersionDescription={activeVersionResponse?.description_html ?? "<p></p>"}
|
activeVersionDescription={activeVersionDescription}
|
||||||
activeVersionDetails={activeVersionDetails}
|
activeVersionDetails={activeVersionDetails}
|
||||||
handleClose={() => {
|
handleClose={() => {
|
||||||
setIsModalOpen(false);
|
setIsModalOpen(false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue