forked from github/plane
refactor: create issue modal input fields (#310)
This commit is contained in:
parent
8d6a357a7f
commit
c0263acb8a
@ -201,7 +201,6 @@ export const SingleBoardIssue: React.FC<Props> = ({
|
||||
<div className="absolute top-1.5 right-1.5 z-10 opacity-0 group-hover/card:opacity-100">
|
||||
{type && !isNotAllowed && (
|
||||
<CustomMenu width="auto" ellipsis>
|
||||
<CustomMenu.MenuItem onClick={handleCopyText}>Copy issue link</CustomMenu.MenuItem>
|
||||
<CustomMenu.MenuItem onClick={editIssue}>Edit</CustomMenu.MenuItem>
|
||||
{type !== "issue" && removeIssue && (
|
||||
<CustomMenu.MenuItem onClick={removeIssue}>
|
||||
@ -211,6 +210,7 @@ export const SingleBoardIssue: React.FC<Props> = ({
|
||||
<CustomMenu.MenuItem onClick={() => handleDeleteIssue(issue)}>
|
||||
Delete permanently
|
||||
</CustomMenu.MenuItem>
|
||||
<CustomMenu.MenuItem onClick={handleCopyText}>Copy issue link</CustomMenu.MenuItem>
|
||||
</CustomMenu>
|
||||
)}
|
||||
</div>
|
||||
|
@ -195,7 +195,6 @@ export const SingleListIssue: React.FC<Props> = ({
|
||||
)}
|
||||
{type && !isNotAllowed && (
|
||||
<CustomMenu width="auto" ellipsis>
|
||||
<CustomMenu.MenuItem onClick={handleCopyText}>Copy issue link</CustomMenu.MenuItem>
|
||||
<CustomMenu.MenuItem onClick={editIssue}>Edit</CustomMenu.MenuItem>
|
||||
{type !== "issue" && removeIssue && (
|
||||
<CustomMenu.MenuItem onClick={removeIssue}>
|
||||
@ -205,6 +204,7 @@ export const SingleListIssue: React.FC<Props> = ({
|
||||
<CustomMenu.MenuItem onClick={() => handleDeleteIssue(issue)}>
|
||||
Delete permanently
|
||||
</CustomMenu.MenuItem>
|
||||
<CustomMenu.MenuItem onClick={handleCopyText}>Copy issue link</CustomMenu.MenuItem>
|
||||
</CustomMenu>
|
||||
)}
|
||||
</div>
|
||||
|
@ -117,8 +117,6 @@ export const IssueForm: FC<IssueFormProps> = ({
|
||||
...defaultValues,
|
||||
...initialData,
|
||||
project: projectId,
|
||||
assignees_list: initialData?.assignees ?? [],
|
||||
labels_list: initialData?.labels ?? [],
|
||||
});
|
||||
}, [initialData, reset, projectId]);
|
||||
|
||||
@ -276,7 +274,7 @@ export const IssueForm: FC<IssueFormProps> = ({
|
||||
/>
|
||||
<Controller
|
||||
control={control}
|
||||
name="labels_list"
|
||||
name="labels"
|
||||
render={({ field: { value, onChange } }) => (
|
||||
<IssueLabelSelect
|
||||
setIsOpen={setLabelModal}
|
||||
@ -301,7 +299,7 @@ export const IssueForm: FC<IssueFormProps> = ({
|
||||
</div>
|
||||
<Controller
|
||||
control={control}
|
||||
name="assignees_list"
|
||||
name="assignees"
|
||||
render={({ field: { value, onChange } }) => (
|
||||
<IssueAssigneeSelect projectId={projectId} value={value} onChange={onChange} />
|
||||
)}
|
||||
|
@ -192,6 +192,8 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = ({
|
||||
|
||||
const payload: Partial<IIssue> = {
|
||||
...formData,
|
||||
assignees_list: formData.assignees,
|
||||
labels_list: formData.labels,
|
||||
description: formData.description ?? "",
|
||||
description_html: formData.description_html ?? "<p></p>",
|
||||
};
|
||||
|
2
apps/app/types/issues.d.ts
vendored
2
apps/app/types/issues.d.ts
vendored
@ -55,7 +55,7 @@ export interface IIssueLink {
|
||||
}
|
||||
|
||||
export interface IIssue {
|
||||
assignees: string[] | null;
|
||||
assignees: string[];
|
||||
assignee_details: IUser[];
|
||||
assignees_list: string[];
|
||||
attachments: any[];
|
||||
|
Loading…
Reference in New Issue
Block a user