fix: quick actions dropdown disabled state (#4335)

This commit is contained in:
Aaryan Khandelwal 2024-05-02 16:13:58 +05:30 committed by GitHub
parent 42c4c46939
commit c4229c9d55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 14 additions and 2 deletions

View File

@ -180,6 +180,7 @@ export const CycleQuickActions: React.FC<Props> = observer((props) => {
}, },
item.className item.className
)} )}
disabled={item.disabled}
> >
{item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />} {item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />}
<div> <div>

View File

@ -181,6 +181,7 @@ export const AllIssueQuickActions: React.FC<IQuickActionProps> = observer((props
}, },
item.className item.className
)} )}
disabled={item.disabled}
> >
{item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />} {item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />}
<div> <div>

View File

@ -143,6 +143,7 @@ export const ArchivedIssueQuickActions: React.FC<IQuickActionProps> = observer((
}, },
item.className item.className
)} )}
disabled={item.disabled}
> >
{item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />} {item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />}
<div> <div>

View File

@ -201,6 +201,7 @@ export const CycleIssueQuickActions: React.FC<IQuickActionProps> = observer((pro
}, },
item.className item.className
)} )}
disabled={item.disabled}
> >
{item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />} {item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />}
<div> <div>

View File

@ -127,6 +127,7 @@ export const DraftIssueQuickActions: React.FC<IQuickActionProps> = observer((pro
}, },
item.className item.className
)} )}
disabled={item.disabled}
> >
{item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />} {item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />}
<div> <div>

View File

@ -198,6 +198,7 @@ export const ModuleIssueQuickActions: React.FC<IQuickActionProps> = observer((pr
}, },
item.className item.className
)} )}
disabled={item.disabled}
> >
{item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />} {item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />}
<div> <div>

View File

@ -191,6 +191,7 @@ export const ProjectIssueQuickActions: React.FC<IQuickActionProps> = observer((p
}, },
item.className item.className
)} )}
disabled={item.disabled}
> >
{item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />} {item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />}
<div> <div>

View File

@ -176,6 +176,7 @@ export const ModuleQuickActions: React.FC<Props> = observer((props) => {
}, },
item.className item.className
)} )}
disabled={item.disabled}
> >
{item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />} {item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />}
<div> <div>

View File

@ -104,6 +104,7 @@ export const PageQuickActions: React.FC<Props> = observer((props) => {
item.action(); item.action();
}} }}
className="flex items-center gap-2" className="flex items-center gap-2"
disabled={item.disabled}
> >
{item.icon && <item.icon className="h-3 w-3" />} {item.icon && <item.icon className="h-3 w-3" />}
{item.title} {item.title}

View File

@ -123,14 +123,14 @@ export const ProjectCard: React.FC<Props> = observer((props) => {
action: handleOpenInNewTab, action: handleOpenInNewTab,
title: "Open in new tab", title: "Open in new tab",
icon: ExternalLink, icon: ExternalLink,
shouldRender: project.is_member, shouldRender: project.is_member && !isArchived,
}, },
{ {
key: "copy-link", key: "copy-link",
action: handleCopyText, action: handleCopyText,
title: "Copy link", title: "Copy link",
icon: LinkIcon, icon: LinkIcon,
shouldRender: true, shouldRender: !isArchived,
}, },
{ {
key: "restore", key: "restore",

View File

@ -103,6 +103,7 @@ export const ViewQuickActions: React.FC<Props> = observer((props) => {
}, },
item.className item.className
)} )}
disabled={item.disabled}
> >
{item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />} {item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />}
<div> <div>

View File

@ -104,6 +104,7 @@ export const DefaultWorkspaceViewQuickActions: React.FC<Props> = observer((props
}, },
item.className item.className
)} )}
disabled={item.disabled}
> >
{item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />} {item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />}
<div> <div>

View File

@ -132,6 +132,7 @@ export const WorkspaceViewQuickActions: React.FC<Props> = observer((props) => {
}, },
item.className item.className
)} )}
disabled={item.disabled}
> >
{item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />} {item.icon && <item.icon className={cn("h-3 w-3", item.iconClassName)} />}
<div> <div>