Skip to content

Commit c7c729d

Browse files
[WEB-2283] fix: create issue modal parent select ui (#5980)
* fix: create issue modal parent select ui * chore: code refactor
1 parent 97eb8d4 commit c7c729d

File tree

2 files changed

+63
-57
lines changed

2 files changed

+63
-57
lines changed

web/core/components/inbox/modals/create-modal/issue-properties.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export const InboxIssueProperties: FC<TInboxIssueProperties> = observer((props)
9191
{/* labels */}
9292
<div className="h-7">
9393
<IssueLabelSelect
94-
setIsOpen={() => { }}
94+
setIsOpen={() => {}}
9595
value={data?.label_ids || []}
9696
onChange={(labelIds) => handleData("label_ids", labelIds)}
9797
projectId={projectId}
@@ -171,13 +171,13 @@ export const InboxIssueProperties: FC<TInboxIssueProperties> = observer((props)
171171

172172
{/* add parent */}
173173
{isVisible && (
174-
<>
174+
<div className="h-7">
175175
{selectedParentIssue ? (
176176
<CustomMenu
177177
customButton={
178178
<button
179179
type="button"
180-
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"
180+
className="flex cursor-pointer items-center justify-between gap-1 h-full rounded border-[0.5px] border-custom-border-300 px-2 py-0.5 text-xs hover:bg-custom-background-80"
181181
>
182182
<LayoutPanelTop className="h-3 w-3 flex-shrink-0" />
183183
<span className="whitespace-nowrap">
@@ -188,6 +188,8 @@ export const InboxIssueProperties: FC<TInboxIssueProperties> = observer((props)
188188
</button>
189189
}
190190
placement="bottom-start"
191+
className="h-full w-full"
192+
customButtonClassName="h-full"
191193
tabIndex={getIndex("parent_id")}
192194
>
193195
<>
@@ -208,7 +210,7 @@ export const InboxIssueProperties: FC<TInboxIssueProperties> = observer((props)
208210
) : (
209211
<button
210212
type="button"
211-
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"
213+
className="flex cursor-pointer items-center justify-between gap-1 h-full rounded border-[0.5px] border-custom-border-300 px-2 py-0.5 text-xs hover:bg-custom-background-80"
212214
onClick={() => setParentIssueModalOpen(true)}
213215
>
214216
<LayoutPanelTop className="h-3 w-3 flex-shrink-0" />
@@ -226,7 +228,7 @@ export const InboxIssueProperties: FC<TInboxIssueProperties> = observer((props)
226228
projectId={projectId}
227229
issueId={undefined}
228230
/>
229-
</>
231+
</div>
230232
)}
231233
</div>
232234
);

web/core/components/issues/issue-modal/components/default-properties.tsx

Lines changed: 56 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -262,58 +262,62 @@ export const IssueDefaultProperties: React.FC<TIssueDefaultPropertiesProps> = ob
262262
)}
263263
/>
264264
)}
265-
{parentId ? (
266-
<CustomMenu
267-
customButton={
268-
<button
269-
type="button"
270-
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"
271-
>
272-
{selectedParentIssue?.project_id && (
273-
<IssueIdentifier
274-
projectId={selectedParentIssue.project_id}
275-
issueTypeId={selectedParentIssue.type_id}
276-
projectIdentifier={selectedParentIssue?.project__identifier}
277-
issueSequenceId={selectedParentIssue.sequence_id}
278-
textContainerClassName="text-xs"
279-
/>
280-
)}
281-
</button>
282-
}
283-
placement="bottom-start"
284-
tabIndex={getIndex("parent_id")}
285-
>
286-
<>
287-
<CustomMenu.MenuItem className="!p-1" onClick={() => setParentIssueListModalOpen(true)}>
288-
Change parent issue
289-
</CustomMenu.MenuItem>
290-
<Controller
291-
control={control}
292-
name="parent_id"
293-
render={({ field: { onChange } }) => (
294-
<CustomMenu.MenuItem
295-
className="!p-1"
296-
onClick={() => {
297-
onChange(null);
298-
handleFormChange();
299-
}}
300-
>
301-
Remove parent issue
302-
</CustomMenu.MenuItem>
303-
)}
304-
/>
305-
</>
306-
</CustomMenu>
307-
) : (
308-
<button
309-
type="button"
310-
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"
311-
onClick={() => setParentIssueListModalOpen(true)}
312-
>
313-
<LayoutPanelTop className="h-3 w-3 flex-shrink-0" />
314-
<span className="whitespace-nowrap">Add parent</span>
315-
</button>
316-
)}
265+
<div className="h-7">
266+
{parentId ? (
267+
<CustomMenu
268+
customButton={
269+
<button
270+
type="button"
271+
className="flex cursor-pointer items-center justify-between gap-1 h-full rounded border-[0.5px] border-custom-border-300 px-2 py-0.5 text-xs hover:bg-custom-background-80"
272+
>
273+
{selectedParentIssue?.project_id && (
274+
<IssueIdentifier
275+
projectId={selectedParentIssue.project_id}
276+
issueTypeId={selectedParentIssue.type_id}
277+
projectIdentifier={selectedParentIssue?.project__identifier}
278+
issueSequenceId={selectedParentIssue.sequence_id}
279+
textContainerClassName="text-xs"
280+
/>
281+
)}
282+
</button>
283+
}
284+
placement="bottom-start"
285+
className="h-full w-full"
286+
customButtonClassName="h-full"
287+
tabIndex={getIndex("parent_id")}
288+
>
289+
<>
290+
<CustomMenu.MenuItem className="!p-1" onClick={() => setParentIssueListModalOpen(true)}>
291+
Change parent issue
292+
</CustomMenu.MenuItem>
293+
<Controller
294+
control={control}
295+
name="parent_id"
296+
render={({ field: { onChange } }) => (
297+
<CustomMenu.MenuItem
298+
className="!p-1"
299+
onClick={() => {
300+
onChange(null);
301+
handleFormChange();
302+
}}
303+
>
304+
Remove parent issue
305+
</CustomMenu.MenuItem>
306+
)}
307+
/>
308+
</>
309+
</CustomMenu>
310+
) : (
311+
<button
312+
type="button"
313+
className="flex cursor-pointer items-center justify-between gap-1 h-full rounded border-[0.5px] border-custom-border-300 px-2 py-0.5 text-xs hover:bg-custom-background-80"
314+
onClick={() => setParentIssueListModalOpen(true)}
315+
>
316+
<LayoutPanelTop className="h-3 w-3 flex-shrink-0" />
317+
<span className="whitespace-nowrap">Add parent</span>
318+
</button>
319+
)}
320+
</div>
317321
<Controller
318322
control={control}
319323
name="parent_id"

0 commit comments

Comments
 (0)