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">
|
<div className="absolute top-1.5 right-1.5 z-10 opacity-0 group-hover/card:opacity-100">
|
||||||
{type && !isNotAllowed && (
|
{type && !isNotAllowed && (
|
||||||
<CustomMenu width="auto" ellipsis>
|
<CustomMenu width="auto" ellipsis>
|
||||||
<CustomMenu.MenuItem onClick={handleCopyText}>Copy issue link</CustomMenu.MenuItem>
|
|
||||||
<CustomMenu.MenuItem onClick={editIssue}>Edit</CustomMenu.MenuItem>
|
<CustomMenu.MenuItem onClick={editIssue}>Edit</CustomMenu.MenuItem>
|
||||||
{type !== "issue" && removeIssue && (
|
{type !== "issue" && removeIssue && (
|
||||||
<CustomMenu.MenuItem onClick={removeIssue}>
|
<CustomMenu.MenuItem onClick={removeIssue}>
|
||||||
@ -211,6 +210,7 @@ export const SingleBoardIssue: React.FC<Props> = ({
|
|||||||
<CustomMenu.MenuItem onClick={() => handleDeleteIssue(issue)}>
|
<CustomMenu.MenuItem onClick={() => handleDeleteIssue(issue)}>
|
||||||
Delete permanently
|
Delete permanently
|
||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
|
<CustomMenu.MenuItem onClick={handleCopyText}>Copy issue link</CustomMenu.MenuItem>
|
||||||
</CustomMenu>
|
</CustomMenu>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -195,7 +195,6 @@ export const SingleListIssue: React.FC<Props> = ({
|
|||||||
)}
|
)}
|
||||||
{type && !isNotAllowed && (
|
{type && !isNotAllowed && (
|
||||||
<CustomMenu width="auto" ellipsis>
|
<CustomMenu width="auto" ellipsis>
|
||||||
<CustomMenu.MenuItem onClick={handleCopyText}>Copy issue link</CustomMenu.MenuItem>
|
|
||||||
<CustomMenu.MenuItem onClick={editIssue}>Edit</CustomMenu.MenuItem>
|
<CustomMenu.MenuItem onClick={editIssue}>Edit</CustomMenu.MenuItem>
|
||||||
{type !== "issue" && removeIssue && (
|
{type !== "issue" && removeIssue && (
|
||||||
<CustomMenu.MenuItem onClick={removeIssue}>
|
<CustomMenu.MenuItem onClick={removeIssue}>
|
||||||
@ -205,6 +204,7 @@ export const SingleListIssue: React.FC<Props> = ({
|
|||||||
<CustomMenu.MenuItem onClick={() => handleDeleteIssue(issue)}>
|
<CustomMenu.MenuItem onClick={() => handleDeleteIssue(issue)}>
|
||||||
Delete permanently
|
Delete permanently
|
||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
|
<CustomMenu.MenuItem onClick={handleCopyText}>Copy issue link</CustomMenu.MenuItem>
|
||||||
</CustomMenu>
|
</CustomMenu>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -117,8 +117,6 @@ export const IssueForm: FC<IssueFormProps> = ({
|
|||||||
...defaultValues,
|
...defaultValues,
|
||||||
...initialData,
|
...initialData,
|
||||||
project: projectId,
|
project: projectId,
|
||||||
assignees_list: initialData?.assignees ?? [],
|
|
||||||
labels_list: initialData?.labels ?? [],
|
|
||||||
});
|
});
|
||||||
}, [initialData, reset, projectId]);
|
}, [initialData, reset, projectId]);
|
||||||
|
|
||||||
@ -276,7 +274,7 @@ export const IssueForm: FC<IssueFormProps> = ({
|
|||||||
/>
|
/>
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="labels_list"
|
name="labels"
|
||||||
render={({ field: { value, onChange } }) => (
|
render={({ field: { value, onChange } }) => (
|
||||||
<IssueLabelSelect
|
<IssueLabelSelect
|
||||||
setIsOpen={setLabelModal}
|
setIsOpen={setLabelModal}
|
||||||
@ -301,7 +299,7 @@ export const IssueForm: FC<IssueFormProps> = ({
|
|||||||
</div>
|
</div>
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="assignees_list"
|
name="assignees"
|
||||||
render={({ field: { value, onChange } }) => (
|
render={({ field: { value, onChange } }) => (
|
||||||
<IssueAssigneeSelect projectId={projectId} value={value} onChange={onChange} />
|
<IssueAssigneeSelect projectId={projectId} value={value} onChange={onChange} />
|
||||||
)}
|
)}
|
||||||
|
@ -192,6 +192,8 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = ({
|
|||||||
|
|
||||||
const payload: Partial<IIssue> = {
|
const payload: Partial<IIssue> = {
|
||||||
...formData,
|
...formData,
|
||||||
|
assignees_list: formData.assignees,
|
||||||
|
labels_list: formData.labels,
|
||||||
description: formData.description ?? "",
|
description: formData.description ?? "",
|
||||||
description_html: formData.description_html ?? "<p></p>",
|
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 {
|
export interface IIssue {
|
||||||
assignees: string[] | null;
|
assignees: string[];
|
||||||
assignee_details: IUser[];
|
assignee_details: IUser[];
|
||||||
assignees_list: string[];
|
assignees_list: string[];
|
||||||
attachments: any[];
|
attachments: any[];
|
||||||
|
Loading…
Reference in New Issue
Block a user