[WEB-5068] fix: CustomMenu closeOnSelect behavior #7897
This commit is contained in:
parent
89ddd1bf42
commit
3e82984f92
20 changed files with 30 additions and 90 deletions
|
|
@ -223,9 +223,7 @@ export const CycleQuickActions: React.FC<Props> = observer((props) => {
|
|||
return (
|
||||
<CustomMenu.MenuItem
|
||||
key={item.key}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
captureClick({
|
||||
elementName: CYCLE_TRACKER_ELEMENTS.QUICK_ACTIONS,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -83,9 +83,7 @@ export const IssueAttachmentsListItem: FC<TIssueAttachmentsListItem> = observer(
|
|||
|
||||
<CustomMenu ellipsis closeOnSelect placement="bottom-end" disabled={disabled}>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
toggleDeleteAttachmentModal(attachmentId);
|
||||
}}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -50,9 +50,7 @@ export const RelationActionButton: FC<Props> = observer((props) => {
|
|||
return (
|
||||
<CustomMenu.MenuItem
|
||||
key={index}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
handleOnClick(item.key as TIssueRelationTypes);
|
||||
}}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -185,9 +185,7 @@ export const SubIssuesListItem: React.FC<Props> = observer((props) => {
|
|||
<CustomMenu placement="bottom-end" ellipsis>
|
||||
{canEdit && (
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
handleIssueCrudState("update", parentIssueId, { ...issue });
|
||||
toggleCreateIssueModal(true);
|
||||
}}
|
||||
|
|
@ -200,9 +198,7 @@ export const SubIssuesListItem: React.FC<Props> = observer((props) => {
|
|||
)}
|
||||
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
onClick={() => {
|
||||
subIssueOperations.copyLink(workItemLink);
|
||||
}}
|
||||
>
|
||||
|
|
@ -214,9 +210,7 @@ export const SubIssuesListItem: React.FC<Props> = observer((props) => {
|
|||
|
||||
{canEdit && (
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
onClick={() => {
|
||||
if (issue.project_id)
|
||||
subIssueOperations.removeSubIssue(workspaceSlug, issue.project_id, parentIssueId, issue.id);
|
||||
}}
|
||||
|
|
@ -232,9 +226,7 @@ export const SubIssuesListItem: React.FC<Props> = observer((props) => {
|
|||
|
||||
{canEdit && (
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
onClick={() => {
|
||||
handleIssueCrudState("delete", parentIssueId, issue);
|
||||
toggleDeleteIssueModal(issue.id);
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -86,9 +86,7 @@ export const SubIssuesActionButton: FC<Props> = observer((props) => {
|
|||
{optionItems.map((item, index) => (
|
||||
<CustomMenu.MenuItem
|
||||
key={index}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
item.onClick();
|
||||
}}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -95,9 +95,7 @@ export const IssueLinkItem: FC<TIssueLinkItem> = observer((props) => {
|
|||
>
|
||||
<CustomMenu.MenuItem
|
||||
className="flex items-center gap-2"
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
toggleIssueLinkModal(true);
|
||||
}}
|
||||
>
|
||||
|
|
@ -106,9 +104,7 @@ export const IssueLinkItem: FC<TIssueLinkItem> = observer((props) => {
|
|||
</CustomMenu.MenuItem>
|
||||
<CustomMenu.MenuItem
|
||||
className="flex items-center gap-2"
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
linkOperations.remove(linkDetail.id);
|
||||
}}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -175,9 +175,7 @@ export const AllIssueQuickActions: React.FC<IQuickActionProps> = observer((props
|
|||
{item.nestedMenuItems.map((nestedItem) => (
|
||||
<CustomMenu.MenuItem
|
||||
key={nestedItem.key}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.GLOBAL_VIEW });
|
||||
nestedItem.action();
|
||||
}}
|
||||
|
|
@ -213,9 +211,7 @@ export const AllIssueQuickActions: React.FC<IQuickActionProps> = observer((props
|
|||
return (
|
||||
<CustomMenu.MenuItem
|
||||
key={item.key}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.GLOBAL_VIEW });
|
||||
item.action();
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -94,9 +94,7 @@ export const ArchivedIssueQuickActions: React.FC<IQuickActionProps> = observer((
|
|||
return (
|
||||
<CustomMenu.MenuItem
|
||||
key={item.key}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
item.action();
|
||||
captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.ARCHIVED });
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -192,9 +192,7 @@ export const CycleIssueQuickActions: React.FC<IQuickActionProps> = observer((pro
|
|||
{item.nestedMenuItems.map((nestedItem) => (
|
||||
<CustomMenu.MenuItem
|
||||
key={nestedItem.key}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.CYCLE });
|
||||
nestedItem.action();
|
||||
}}
|
||||
|
|
@ -230,9 +228,7 @@ export const CycleIssueQuickActions: React.FC<IQuickActionProps> = observer((pro
|
|||
return (
|
||||
<CustomMenu.MenuItem
|
||||
key={item.key}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.CYCLE });
|
||||
item.action();
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -276,9 +276,7 @@ export const WorkItemDetailQuickActions: React.FC<TWorkItemDetailQuickActionProp
|
|||
{item.nestedMenuItems.map((nestedItem) => (
|
||||
<CustomMenu.MenuItem
|
||||
key={nestedItem.key}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.PROJECT_VIEW });
|
||||
nestedItem.action();
|
||||
}}
|
||||
|
|
@ -314,9 +312,7 @@ export const WorkItemDetailQuickActions: React.FC<TWorkItemDetailQuickActionProp
|
|||
return (
|
||||
<CustomMenu.MenuItem
|
||||
key={item.key}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.PROJECT_VIEW });
|
||||
item.action();
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -191,9 +191,7 @@ export const ModuleIssueQuickActions: React.FC<IQuickActionProps> = observer((pr
|
|||
{item.nestedMenuItems.map((nestedItem) => (
|
||||
<CustomMenu.MenuItem
|
||||
key={nestedItem.key}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.MODULE });
|
||||
nestedItem.action();
|
||||
}}
|
||||
|
|
@ -229,9 +227,7 @@ export const ModuleIssueQuickActions: React.FC<IQuickActionProps> = observer((pr
|
|||
return (
|
||||
<CustomMenu.MenuItem
|
||||
key={item.key}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.MODULE });
|
||||
item.action();
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -192,9 +192,7 @@ export const ProjectIssueQuickActions: React.FC<IQuickActionProps> = observer((p
|
|||
{item.nestedMenuItems.map((nestedItem) => (
|
||||
<CustomMenu.MenuItem
|
||||
key={nestedItem.key}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.PROJECT_VIEW });
|
||||
nestedItem.action();
|
||||
}}
|
||||
|
|
@ -230,9 +228,7 @@ export const ProjectIssueQuickActions: React.FC<IQuickActionProps> = observer((p
|
|||
return (
|
||||
<CustomMenu.MenuItem
|
||||
key={item.key}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.PROJECT_VIEW });
|
||||
item.action();
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -31,9 +31,7 @@ export const WorkspaceDraftIssueQuickActions: React.FC<Props> = observer((props)
|
|||
{MENU_ITEMS.map((item) => (
|
||||
<CustomMenu.MenuItem
|
||||
key={item.key}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
item.action();
|
||||
}}
|
||||
className={cn(
|
||||
|
|
|
|||
|
|
@ -197,9 +197,7 @@ export const ModuleQuickActions: React.FC<Props> = observer((props) => {
|
|||
return (
|
||||
<CustomMenu.MenuItem
|
||||
key={item.key}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
captureClick({
|
||||
elementName: MODULE_TRACKER_ELEMENTS.QUICK_ACTIONS,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -217,9 +217,7 @@ export const PageActions: React.FC<Props> = observer((props) => {
|
|||
return (
|
||||
<CustomMenu.MenuItem
|
||||
key={item.key}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
item.action?.();
|
||||
}}
|
||||
className={cn("flex items-center gap-2", item.className)}
|
||||
|
|
|
|||
|
|
@ -95,9 +95,7 @@ export const ViewQuickActions: React.FC<Props> = observer((props) => {
|
|||
return (
|
||||
<CustomMenu.MenuItem
|
||||
key={item.key}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
captureClick({ elementName: PROJECT_VIEW_TRACKER_ELEMENTS.QUICK_ACTIONS });
|
||||
item.action();
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -185,9 +185,7 @@ export const WorkspaceInvitationsListItem: FC<Props> = observer((props) => {
|
|||
return (
|
||||
<CustomMenu.MenuItem
|
||||
key={item.key}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
item.action();
|
||||
}}
|
||||
className={cn(
|
||||
|
|
|
|||
|
|
@ -61,9 +61,7 @@ export const DefaultWorkspaceViewQuickActions: React.FC<Props> = observer((props
|
|||
return (
|
||||
<CustomMenu.MenuItem
|
||||
key={item.key}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
item.action();
|
||||
}}
|
||||
className={cn(
|
||||
|
|
|
|||
|
|
@ -71,9 +71,7 @@ export const WorkspaceViewQuickActions: React.FC<Props> = observer((props) => {
|
|||
return (
|
||||
<CustomMenu.MenuItem
|
||||
key={item.key}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
captureClick({
|
||||
elementName: GLOBAL_VIEW_TRACKER_ELEMENTS.QUICK_ACTIONS,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -51,9 +51,7 @@ export const GlobalViewListItem: React.FC<Props> = observer((props) => {
|
|||
<div className="flex items-center gap-4">
|
||||
<CustomMenu ellipsis>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
captureClick({
|
||||
elementName: GLOBAL_VIEW_TRACKER_ELEMENTS.LIST_ITEM,
|
||||
});
|
||||
|
|
@ -66,9 +64,7 @@ export const GlobalViewListItem: React.FC<Props> = observer((props) => {
|
|||
</span>
|
||||
</CustomMenu.MenuItem>
|
||||
<CustomMenu.MenuItem
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onClick={() => {
|
||||
captureClick({
|
||||
elementName: GLOBAL_VIEW_TRACKER_ELEMENTS.LIST_ITEM,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue