[WEB-869] chore: fix assignee and parent ui inconsistency in create issue modal. (#4113)

This commit is contained in:
Prateek Shourya 2024-04-03 20:57:44 +05:30 committed by GitHub
parent 1fb8791941
commit 0ab03c963c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -541,7 +541,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
handleFormChange(); handleFormChange();
}} }}
buttonVariant={value?.length > 0 ? "transparent-without-text" : "border-with-text"} buttonVariant={value?.length > 0 ? "transparent-without-text" : "border-with-text"}
buttonClassName={value?.length > 0 ? "hover:bg-transparent px-0" : ""} buttonClassName={value?.length > 0 ? "hover:bg-transparent" : ""}
placeholder="Assignees" placeholder="Assignees"
multiple multiple
tabIndex={getTabIndex("assignee_ids")} tabIndex={getTabIndex("assignee_ids")}
@ -663,33 +663,23 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
)} )}
/> />
)} )}
<CustomMenu {watch("parent_id") ? (
customButton={ <CustomMenu
<button customButton={
type="button" <button
className="flex w-full cursor-pointer items-center justify-between gap-1 rounded border-[0.5px] border-custom-border-300 px-2 py-1 text-xs text-custom-text-200 hover:bg-custom-background-80" type="button"
> className="flex cursor-pointer items-center justify-between gap-1 rounded border-[0.5px] border-custom-border-300 px-2 py-1.5 text-xs hover:bg-custom-background-80"
{watch("parent_id") ? ( >
<div className="flex items-center gap-1 text-custom-text-200"> <LayoutPanelTop className="h-3 w-3 flex-shrink-0" />
<LayoutPanelTop className="h-3 w-3 flex-shrink-0" /> <span className="whitespace-nowrap">
<span className="whitespace-nowrap"> {selectedParentIssue &&
{selectedParentIssue && `${selectedParentIssue.project__identifier}-${selectedParentIssue.sequence_id}`}
`${selectedParentIssue.project__identifier}- </span>
${selectedParentIssue.sequence_id}`} </button>
</span> }
</div> placement="bottom-start"
) : ( tabIndex={getTabIndex("parent_id")}
<div className="flex items-center gap-1 text-custom-text-300"> >
<LayoutPanelTop className="h-3 w-3 flex-shrink-0" />
<span className="whitespace-nowrap">Add parent</span>
</div>
)}
</button>
}
placement="bottom-start"
tabIndex={getTabIndex("parent_id")}
>
{watch("parent_id") ? (
<> <>
<CustomMenu.MenuItem className="!p-1" onClick={() => setParentIssueListModalOpen(true)}> <CustomMenu.MenuItem className="!p-1" onClick={() => setParentIssueListModalOpen(true)}>
Change parent issue Change parent issue
@ -704,12 +694,17 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
Remove parent issue Remove parent issue
</CustomMenu.MenuItem> </CustomMenu.MenuItem>
</> </>
) : ( </CustomMenu>
<CustomMenu.MenuItem className="!p-1" onClick={() => setParentIssueListModalOpen(true)}> ) : (
Select parent Issue <button
</CustomMenu.MenuItem> type="button"
)} className="flex cursor-pointer items-center justify-between gap-1 rounded border-[0.5px] border-custom-border-300 px-2 py-1.5 text-xs hover:bg-custom-background-80"
</CustomMenu> onClick={() => setParentIssueListModalOpen(true)}
>
<LayoutPanelTop className="h-3 w-3 flex-shrink-0" />
<span className="whitespace-nowrap">Add parent</span>
</button>
)}
<Controller <Controller
control={control} control={control}
name="parent_id" name="parent_id"