Skip to content

Commit

Permalink
refactor: create issue modal input fields (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaryan610 authored Feb 21, 2023
1 parent 8d6a357 commit c0263ac
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/app/components/core/board-view/single-issue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}>
Expand All @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion apps/app/components/core/list-view/single-issue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}>
Expand All @@ -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>
Expand Down
6 changes: 2 additions & 4 deletions apps/app/components/issues/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ export const IssueForm: FC<IssueFormProps> = ({
...defaultValues,
...initialData,
project: projectId,
assignees_list: initialData?.assignees ?? [],
labels_list: initialData?.labels ?? [],
});
}, [initialData, reset, projectId]);

Expand Down Expand Up @@ -276,7 +274,7 @@ export const IssueForm: FC<IssueFormProps> = ({
/>
<Controller
control={control}
name="labels_list"
name="labels"
render={({ field: { value, onChange } }) => (
<IssueLabelSelect
setIsOpen={setLabelModal}
Expand All @@ -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} />
)}
Expand Down
2 changes: 2 additions & 0 deletions apps/app/components/issues/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>",
};
Expand Down
2 changes: 1 addition & 1 deletion apps/app/types/issues.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export interface IIssueLink {
}

export interface IIssue {
assignees: string[] | null;
assignees: string[];
assignee_details: IUser[];
assignees_list: string[];
attachments: any[];
Expand Down

1 comment on commit c0263ac

@vercel
Copy link

@vercel vercel bot commented on c0263ac Feb 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

plane-dev – ./apps/app

Please sign in to comment.