fix: create comment card for inbox issues fixed

This commit is contained in:
Palanikannan1437 2024-05-02 15:43:32 +05:30
parent 12b4f74e1d
commit d05ecd8dbc
3 changed files with 10 additions and 1 deletions

View File

@ -31,6 +31,8 @@ export interface ILiteTextEditor {
highlights: () => Promise<IMentionHighlight[]>; highlights: () => Promise<IMentionHighlight[]>;
suggestions?: () => Promise<IMentionSuggestion[]>; suggestions?: () => Promise<IMentionSuggestion[]>;
}; };
id?: string;
tabIndex?: number; tabIndex?: number;
placeholder?: string | ((isFocused: boolean, value: string) => string); placeholder?: string | ((isFocused: boolean, value: string) => string);
} }
@ -48,11 +50,13 @@ const LiteTextEditor = (props: ILiteTextEditor) => {
tabIndex, tabIndex,
mentionHandler, mentionHandler,
placeholder = "Add comment...", placeholder = "Add comment...",
id = "",
} = props; } = props;
const editor = useEditor({ const editor = useEditor({
onChange, onChange,
initialValue, initialValue,
id,
value, value,
editorClassName, editorClassName,
restoreFile: fileHandler.restore, restoreFile: fileHandler.restore,

View File

@ -18,10 +18,11 @@ type TIssueCommentCreate = {
workspaceSlug: string; workspaceSlug: string;
activityOperations: TActivityOperations; activityOperations: TActivityOperations;
showAccessSpecifier?: boolean; showAccessSpecifier?: boolean;
issueId: string;
}; };
export const IssueCommentCreate: FC<TIssueCommentCreate> = (props) => { export const IssueCommentCreate: FC<TIssueCommentCreate> = (props) => {
const { workspaceSlug, projectId, activityOperations, showAccessSpecifier = false } = props; const { workspaceSlug, issueId, projectId, activityOperations, showAccessSpecifier = false } = props;
// refs // refs
const editorRef = useRef<any>(null); const editorRef = useRef<any>(null);
// store hooks // store hooks
@ -71,6 +72,8 @@ export const IssueCommentCreate: FC<TIssueCommentCreate> = (props) => {
control={control} control={control}
render={({ field: { value, onChange } }) => ( render={({ field: { value, onChange } }) => (
<LiteTextEditor <LiteTextEditor
id={"add_comment_" + issueId}
value={"<p></p>"}
workspaceId={workspaceId} workspaceId={workspaceId}
projectId={projectId} projectId={projectId}
workspaceSlug={workspaceSlug} workspaceSlug={workspaceSlug}

View File

@ -146,6 +146,7 @@ export const IssueActivity: FC<TIssueActivity> = observer((props) => {
/> />
{!disabled && ( {!disabled && (
<IssueCommentCreate <IssueCommentCreate
issueId={issueId}
projectId={projectId} projectId={projectId}
workspaceSlug={workspaceSlug} workspaceSlug={workspaceSlug}
activityOperations={activityOperations} activityOperations={activityOperations}
@ -165,6 +166,7 @@ export const IssueActivity: FC<TIssueActivity> = observer((props) => {
/> />
{!disabled && ( {!disabled && (
<IssueCommentCreate <IssueCommentCreate
issueId={issueId}
projectId={projectId} projectId={projectId}
workspaceSlug={workspaceSlug} workspaceSlug={workspaceSlug}
activityOperations={activityOperations} activityOperations={activityOperations}