fix: module and cycle event propagation (#4280)

This commit is contained in:
Anmol Singh Bhatia 2024-04-24 20:20:41 +05:30 committed by GitHub
parent bc2c97b9c3
commit e60ef36bfe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 235 additions and 225 deletions

View File

@ -149,7 +149,7 @@ export const CyclesBoardCard: FC<ICyclesBoardCard> = observer((props) => {
const daysLeft = findHowManyDaysLeft(cycleDetails.end_date) ?? 0; const daysLeft = findHowManyDaysLeft(cycleDetails.end_date) ?? 0;
return ( return (
<div> <div className="relative">
<Link href={`/${workspaceSlug}/projects/${projectId}/cycles/${cycleDetails.id}`}> <Link href={`/${workspaceSlug}/projects/${projectId}/cycles/${cycleDetails.id}`}>
<div className="flex h-44 w-full flex-col justify-between rounded border border-custom-border-100 bg-custom-background-100 p-4 text-sm hover:shadow-md"> <div className="flex h-44 w-full flex-col justify-between rounded border border-custom-border-100 bg-custom-background-100 p-4 text-sm hover:shadow-md">
<div className="flex items-center justify-between gap-2"> <div className="flex items-center justify-between gap-2">
@ -231,7 +231,11 @@ export const CyclesBoardCard: FC<ICyclesBoardCard> = observer((props) => {
) : ( ) : (
<span className="text-xs text-custom-text-400">No due date</span> <span className="text-xs text-custom-text-400">No due date</span>
)} )}
<div className="z-[5] flex items-center gap-1.5"> </div>
</div>
</div>
</Link>
<div className="absolute right-4 bottom-3.5 z-[5] flex items-center gap-1.5">
{isEditingAllowed && ( {isEditingAllowed && (
<FavoriteStar <FavoriteStar
onClick={(e) => { onClick={(e) => {
@ -245,9 +249,5 @@ export const CyclesBoardCard: FC<ICyclesBoardCard> = observer((props) => {
<CycleQuickActions cycleId={cycleId} projectId={projectId} workspaceSlug={workspaceSlug} /> <CycleQuickActions cycleId={cycleId} projectId={projectId} workspaceSlug={workspaceSlug} />
</div> </div>
</div> </div>
</div>
</div>
</Link>
</div>
); );
}); });

View File

@ -154,7 +154,7 @@ export const CyclesListItem: FC<TCyclesListItem> = observer((props) => {
const daysLeft = findHowManyDaysLeft(cycleDetails.end_date) ?? 0; const daysLeft = findHowManyDaysLeft(cycleDetails.end_date) ?? 0;
return ( return (
<> <div className="relative">
<Link <Link
href={`/${workspaceSlug}/projects/${projectId}/cycles/${cycleDetails.id}`} href={`/${workspaceSlug}/projects/${projectId}/cycles/${cycleDetails.id}`}
onClick={(e) => { onClick={(e) => {
@ -199,6 +199,10 @@ export const CyclesListItem: FC<TCyclesListItem> = observer((props) => {
{renderDate && `${renderFormattedDate(startDate) ?? `_ _`} - ${renderFormattedDate(endDate) ?? `_ _`}`} {renderDate && `${renderFormattedDate(startDate) ?? `_ _`} - ${renderFormattedDate(endDate) ?? `_ _`}`}
</div> </div>
</div> </div>
<span className="h-6 w-52 flex-shrink-0" />
</div>
</Link>
<div className="absolute right-5 bottom-8 z-[5] flex items-center gap-1.5">
<div className="relative flex w-full flex-shrink-0 items-center justify-between gap-2.5 md:w-auto md:flex-shrink-0 md:justify-end"> <div className="relative flex w-full flex-shrink-0 items-center justify-between gap-2.5 md:w-auto md:flex-shrink-0 md:justify-end">
{currentCycle && ( {currentCycle && (
<div <div
@ -250,7 +254,6 @@ export const CyclesListItem: FC<TCyclesListItem> = observer((props) => {
</div> </div>
</div> </div>
</div> </div>
</Link> </div>
</>
); );
}); });

View File

@ -144,6 +144,7 @@ export const ModuleCardItem: React.FC<Props> = observer((props) => {
: "0 Issue"; : "0 Issue";
return ( return (
<div className="relative">
<Link href={`/${workspaceSlug}/projects/${moduleDetails.project_id}/modules/${moduleDetails.id}`}> <Link href={`/${workspaceSlug}/projects/${moduleDetails.project_id}/modules/${moduleDetails.id}`}>
<div className="flex h-44 w-full flex-col justify-between rounded border border-custom-border-100 bg-custom-background-100 p-4 text-sm hover:shadow-md"> <div className="flex h-44 w-full flex-col justify-between rounded border border-custom-border-100 bg-custom-background-100 p-4 text-sm hover:shadow-md">
<div> <div>
@ -212,7 +213,7 @@ export const ModuleCardItem: React.FC<Props> = observer((props) => {
</div> </div>
</Tooltip> </Tooltip>
<div className="flex items-center justify-between"> <div className="flex items-center justify-between py-0.5">
{isDateValid ? ( {isDateValid ? (
<> <>
<span className="text-xs text-custom-text-300"> <span className="text-xs text-custom-text-300">
@ -222,8 +223,11 @@ export const ModuleCardItem: React.FC<Props> = observer((props) => {
) : ( ) : (
<span className="text-xs text-custom-text-400">No due date</span> <span className="text-xs text-custom-text-400">No due date</span>
)} )}
</div>
<div className="z-[5] flex items-center gap-1.5"> </div>
</div>
</Link>
<div className="absolute right-4 bottom-3.5 z-[5] flex items-center gap-1.5">
{isEditingAllowed && ( {isEditingAllowed && (
<FavoriteStar <FavoriteStar
onClick={(e) => { onClick={(e) => {
@ -242,8 +246,5 @@ export const ModuleCardItem: React.FC<Props> = observer((props) => {
)} )}
</div> </div>
</div> </div>
</div>
</div>
</Link>
); );
}); });

View File

@ -135,7 +135,7 @@ export const ModuleListItem: React.FC<Props> = observer((props) => {
const completedModuleCheck = moduleDetails.status === "completed"; const completedModuleCheck = moduleDetails.status === "completed";
return ( return (
<div className="group flex w-full flex-col items-center justify-between gap-5 border-b border-custom-border-100 bg-custom-background-100 px-5 py-6 text-sm hover:bg-custom-background-90 sm:flex-row"> <div className="relative">
<Link <Link
href={`/${workspaceSlug}/projects/${moduleDetails.project_id}/modules/${moduleDetails.id}`} href={`/${workspaceSlug}/projects/${moduleDetails.project_id}/modules/${moduleDetails.id}`}
onClick={(e) => { onClick={(e) => {
@ -143,8 +143,9 @@ export const ModuleListItem: React.FC<Props> = observer((props) => {
openModuleOverview(e); openModuleOverview(e);
} }
}} }}
className="relative flex w-full items-center justify-between gap-3 overflow-hidden"
> >
<div className="group flex w-full flex-col items-center justify-between gap-5 border-b border-custom-border-100 bg-custom-background-100 px-5 py-6 text-sm hover:bg-custom-background-90 sm:flex-row">
<div className="relative flex w-full items-center justify-between gap-3 overflow-hidden">
<div className="relative flex w-full items-center gap-3 overflow-hidden"> <div className="relative flex w-full items-center gap-3 overflow-hidden">
<div className="flex items-center gap-4 truncate"> <div className="flex items-center gap-4 truncate">
<span className="flex-shrink-0"> <span className="flex-shrink-0">
@ -170,6 +171,11 @@ export const ModuleListItem: React.FC<Props> = observer((props) => {
<Info className="h-4 w-4 text-custom-text-400" /> <Info className="h-4 w-4 text-custom-text-400" />
</button> </button>
</div> </div>
</div>
<span className="h-6 w-52 flex-shrink-0" />
</div>
</Link>
<div className="absolute right-5 bottom-8 z-[5] flex items-center gap-1.5">
<div className="flex flex-shrink-0 items-center justify-center"> <div className="flex flex-shrink-0 items-center justify-center">
{moduleStatus && ( {moduleStatus && (
<span <span
@ -183,7 +189,6 @@ export const ModuleListItem: React.FC<Props> = observer((props) => {
</span> </span>
)} )}
</div> </div>
</Link>
<div className="relative flex w-full items-center justify-between gap-2.5 sm:w-auto sm:flex-shrink-0 sm:justify-end "> <div className="relative flex w-full items-center justify-between gap-2.5 sm:w-auto sm:flex-shrink-0 sm:justify-end ">
<div className="text-xs text-custom-text-300"> <div className="text-xs text-custom-text-300">
{renderDate && ( {renderDate && (
@ -231,5 +236,6 @@ export const ModuleListItem: React.FC<Props> = observer((props) => {
</div> </div>
</div> </div>
</div> </div>
</div>
); );
}); });