Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix bug] Header scroll and card items in the table view | All teams page #3400

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 43 additions & 41 deletions apps/web/app/[locale]/all-teams/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useAtomValue } from 'jotai';
import { fullWidthState } from '@app/stores/fullWidth';
import { withAuthentication } from 'lib/app/authenticator';
import { Breadcrumb, Container } from 'lib/components';
import { MainHeader, MainLayout } from 'lib/layout';
import { MainLayout } from 'lib/layout';
import { useOrganizationAndTeamManagers } from '@app/hooks/features/useOrganizationTeamManagers';
import { useEffect } from 'react';
import { useTranslations } from 'next-intl';
Expand All @@ -18,55 +18,57 @@ import { MemberFilter } from 'lib/features/all-teams/all-team-members-filter';
import { useOrganizationTeams } from '@app/hooks';

function AllTeamsPage() {
const t = useTranslations();
const fullWidth = useAtomValue(fullWidthState);
const view = useAtomValue(allTeamsHeaderTabs);
const { filteredTeams, userManagedTeams } = useOrganizationAndTeamManagers();
const { isTrackingEnabled } = useOrganizationTeams();
const t = useTranslations();
const fullWidth = useAtomValue(fullWidthState);
const view = useAtomValue(allTeamsHeaderTabs);
const { filteredTeams, userManagedTeams } = useOrganizationAndTeamManagers();
const { isTrackingEnabled } = useOrganizationTeams();

const breadcrumb = [
{ title: JSON.parse(t('pages.home.BREADCRUMB')), href: '/' },
{ title: t('common.ALL_TEAMS'), href: '/all-teams' }
];
const breadcrumb = [
{ title: JSON.parse(t('pages.home.BREADCRUMB')), href: '/' },
{ title: t('common.ALL_TEAMS'), href: '/all-teams' }
];

/* If the user is not a manager in any team or if he's
/* If the user is not a manager in any team or if he's
manager in only one team, then redirect him to the home page
*/
if (userManagedTeams.length < 2) return <RedirectUser />;
if (userManagedTeams.length < 2) return <RedirectUser />;

return (
<MainLayout showTimer={isTrackingEnabled} className="items-start">
<MainHeader
fullWidth={fullWidth}
className={'pb-2 pt-10 sticky top-20 z-50'}
>
{/* Breadcrumb */}
<div className="flex flex-row items-start justify-between mb-5">
<Breadcrumb paths={breadcrumb} className="text-sm" />
<div className="flex flex-col items-end gap-2">
<div className="flex items-center justify-center h-10 gap-1 w-max">
<HeaderTabs />
</div>
<MemberFilter />
</div>
</div>
<TeamMemberHeader view={IssuesView.CARDS} />
</MainHeader>
<Container fullWidth={fullWidth} className="flex py-10 pt-20">
<AllTeamsMembers teams={filteredTeams} view={view} />
</Container>
</MainLayout>
);
return (
<MainLayout
showTimer={isTrackingEnabled}
className="items-start"
mainHeaderSlot={
<div className="flex w-full flex-col items-start justify-between">
<div className="w-full flex items-center justify-between py-2 px-4">
<Breadcrumb paths={breadcrumb} className="text-sm" />
<div className="flex self-end items-center gap-2">
<div className="flex items-center justify-center h-10 gap-1 w-max">
<HeaderTabs />
</div>
<MemberFilter />
</div>
</div>

{view == IssuesView.CARDS && <TeamMemberHeader view={IssuesView.CARDS} />}
</div>
}
>
<Container fullWidth={fullWidth} className="mx-auto mt-5">
<AllTeamsMembers teams={filteredTeams} view={view} />
</Container>
</MainLayout>
);
}

function RedirectUser() {
const router = useRouter();
useEffect(() => {
router.push('/');
}, [router]);
return <></>;
const router = useRouter();
useEffect(() => {
router.push('/');
}, [router]);
return <></>;
}

export default withAuthentication(AllTeamsPage, {
displayName: 'AllManagedTeams'
displayName: 'AllManagedTeams'
});
14 changes: 7 additions & 7 deletions apps/web/lib/features/all-teams/users-teams-card/user-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,38 +34,38 @@ export default function UserTeamCard({
className
)}
>
<div className="relative flex items-center w-full m-0">
<div className="relative flex items-center justify-between w-full m-0">
<div className="absolute left-0 cursor-pointer w-fit">
<SixSquareGridIcon className="w-2 max-w-fit text-[#CCCCCC] dark:text-[#4F5662]" />
</div>
{/* User information */}
<div className="relative w-fit">
<div className="relative !w-[27%]">
CREDO23 marked this conversation as resolved.
Show resolved Hide resolved
<MemberInfo member={member} className="!w-fit" />
</div>

<VerticalSeparator />

{/* Task information */}
<div className="flex items-center justify-between flex-initial w-fit min-w-fit">
<div className=" !w-[25%]">
<UserTeamActiveTaskInfo
member={member}
className="flex-initial !w-fit !min-w-full !max-w-[280px]"
/>
</div>

<VerticalSeparator className="ml-2" />
<VerticalSeparator />

{/* Task worked Times */}
<UserTeamActiveTaskTimes member={member} className="!w-fit max-w-fit" />
<UserTeamActiveTaskTimes member={member} className=" !w-[15%]" />

<VerticalSeparator />

{/* Task estimate Info */}
<UserTeamActiveTaskEstimate member={member} className="!w-fit" />
<UserTeamActiveTaskEstimate member={member} className=" !w-[20%]" />

<VerticalSeparator />

<UserTeamActiveTaskTodayWorked member={member} className="!w-fit !max-w-fit" />
<UserTeamActiveTaskTodayWorked member={member} className=" !w-[8%]" />

{/* Card Menu */}
<div className="absolute hidden right-2">
Expand Down
Loading