fix: issue description was not rendering in the issue create/edit modal (#4122)

This commit is contained in:
guru_sainath 2024-04-04 17:24:16 +05:30 committed by GitHub
parent b4cc58d5dd
commit 3742ea91bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 31 additions and 28 deletions

View File

@ -461,34 +461,36 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
/> />
)} )}
</div> </div>
<Controller {data?.description_html && watch("description_html") && (
name="description_html" <Controller
control={control} name="description_html"
render={({ field: { value, onChange } }) => ( control={control}
<RichTextEditorWithRef render={({ field: { value, onChange } }) => (
cancelUploadImage={fileService.cancelUpload} <RichTextEditorWithRef
uploadFile={fileService.getUploadFileFunction(workspaceSlug as string)} cancelUploadImage={fileService.cancelUpload}
deleteFile={fileService.getDeleteImageFunction(workspaceId)} uploadFile={fileService.getUploadFileFunction(workspaceSlug as string)}
restoreFile={fileService.getRestoreImageFunction(workspaceId)} deleteFile={fileService.getDeleteImageFunction(workspaceId)}
ref={editorRef} restoreFile={fileService.getRestoreImageFunction(workspaceId)}
debouncedUpdatesEnabled={false} ref={editorRef}
value={ debouncedUpdatesEnabled={false}
!value || value === "" || (typeof value === "object" && Object.keys(value).length === 0) value={
? watch("description_html") !value || value === "" || (typeof value === "object" && Object.keys(value).length === 0)
: value ? watch("description_html")
} : value
initialValue={data?.description_html} }
customClassName="min-h-[7rem] border-custom-border-100" initialValue={data?.description_html}
onChange={(description: any, description_html: string) => { customClassName="min-h-[7rem] border-custom-border-100"
onChange(description_html); onChange={(description: any, description_html: string) => {
handleFormChange(); onChange(description_html);
}} handleFormChange();
mentionHighlights={mentionHighlights} }}
mentionSuggestions={mentionSuggestions} mentionHighlights={mentionHighlights}
tabIndex={getTabIndex("description_html")} mentionSuggestions={mentionSuggestions}
/> tabIndex={getTabIndex("description_html")}
)} />
/> )}
/>
)}
</Fragment> </Fragment>
)} )}
</div> </div>

View File

@ -75,6 +75,7 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer((prop
const { createIssue, updateIssue } = useIssuesActions(storeType); const { createIssue, updateIssue } = useIssuesActions(storeType);
const fetchIssueDetail = async (issueId: string | undefined) => { const fetchIssueDetail = async (issueId: string | undefined) => {
setDescription(undefined);
if (!workspaceSlug) return; if (!workspaceSlug) return;
if (!projectId || issueId === undefined) { if (!projectId || issueId === undefined) {