Skip to content

Commit

Permalink
Fix: Errors (#2254)
Browse files Browse the repository at this point in the history
* fix: Email Input on Invite Pop Up

* fix: Tasks Tab on Profile Page

* fix: horizontal scroll on Invitation Table

* fix: spell words

* fix: Settings Header Page

* fix: restore AutoCompleteDropdown for emails in Invite
  • Loading branch information
Cedric921 authored Mar 1, 2024
1 parent 561f4a8 commit c12a2b1
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 152 deletions.
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@
"nodesource",
"Koyeb",
"Northflank",
"prebuild"
"prebuild",
"dataToDisplay"
],
"useGitignore": true,
"ignorePaths": [
Expand Down
1 change: 0 additions & 1 deletion apps/web/app/[locale]/page-component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ function MainPage() {
{ title: t(`common.${view}`), href: `/` }
];
const { online } = useNetworkState();
console.log(path, 'path');
useEffect(() => {
if (view == IssuesView.KANBAN && path == '/') {
setView(IssuesView.CARDS);
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/[locale]/profile/[memberId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const Profile = React.memo(function ProfilePage({ params }: { params: { memberId
)}

<Container fullWidth={fullWidth} className="mb-10">
{hook.tab !== 'worked' ? (
{hook.tab !== 'worked' || activityFilter == 'Tasks' ? (
<UserProfileTask profile={profile} tabFiltered={hook} />
) : (
activityScreens[activityFilter] ?? null
Expand Down
42 changes: 20 additions & 22 deletions apps/web/app/[locale]/settings/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,30 @@ const SettingsLayout = ({ children }: { children: JSX.Element }) => {
return <SettingsPersonalSkeleton />;
} else {
return (
<div className="">
<MainLayout
className="items-start pb-1 h-auto w-full"
childrenClassName="flex h-[calc(100vh-_300px)] flex w-full items-start"
>
<div className="flex flex-col">
<div className="pt-12 w-full pb-4 bg-white dark:bg-dark--theme">
<Container fullWidth={fullWidth}>
<div className="flex flex-row items-center justify-start gap-8">
<Link href="/">
<ArrowLeftIcon className="w-6 h-6" />
</Link>
<MainLayout
className="items-start pb-1 overflow-hidden w-full"
childrenClassName="h-[calc(100vh-_300px)] overflow-hidden w-full"
>
<div>
<div className="pt-12 w-full pb-4 bg-white dark:bg-dark--theme">
<Container fullWidth={fullWidth}>
<div className="flex flex-row items-center justify-start gap-8">
<Link href="/">
<ArrowLeftIcon className="w-6 h-6" />
</Link>

<Breadcrumb paths={breadcrumb} className="text-sm" />
</div>
</Container>
</div>
<div className="flex">
<div className="w-96 ml-8">
<LeftSideSettingMenu />
<Breadcrumb paths={breadcrumb} className="text-sm" />
</div>
</Container>
</div>
<div className="flex">
<div className="w-96 ml-8">
<LeftSideSettingMenu />
</div>
<div className="h-[calc(100vh-_186px)] mt-3 p-10 overflow-y-auto w-full">{children}</div>
</div>
<div className="h-[calc(100vh-_186px)] mt-3 p-10 overflow-y-auto w-full">{children}</div>
</MainLayout>
</div>
</div>
</MainLayout>
);
}
};
Expand Down
65 changes: 31 additions & 34 deletions apps/web/app/[locale]/settings/personal/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,37 @@ const Personal = () => {

return (
<>

<Link href={'/settings/team'} className="w-full">
<button className="w-full lg:hidden hover:bg-white rounded-xl border border-dark text-dark p-4 mt-2">
Go to Team settings
</button>
</Link>
<Accordian
title={t('pages.settingsPersonal.HEADING_TITLE')}
className="w-full max-w-[96vw] overflow-y-hidden p-4 mt-8 dark:bg-dark--theme"
id="general"
>
{/* <Text className="text-base font-normal text-center text-gray-400 sm:text-left">
{t('pages.settings.HEADING_DESCRIPTION')}
</Text> */}
<ProfileAvatar />
<PersonalSettingForm />
</Accordian>
<Accordian
title={t('pages.settingsPersonal.DATA_SYNCHRONIZATION')}
className="p-4 mt-4 dark:bg-dark--theme"
id="sync-zone"
>
<SyncZone />
</Accordian>
<Accordian
title={t('pages.settings.DANDER_ZONE')}
className="p-4 mt-4 dark:bg-dark--theme"
isDanger={true}
id="danger-zone"
>
<DangerZone />
</Accordian>


<Link href={'/settings/team'} className="w-full">
<button className="w-full lg:hidden hover:bg-white rounded-xl border border-dark text-dark p-4 mt-2">
Go to Team settings
</button>
</Link>
<Accordian
title={t('pages.settingsPersonal.HEADING_TITLE')}
className="w-full max-w-[96vw] overflow-y-hidden p-4 mt-8 dark:bg-dark--theme"
id="general"
>
{/* <Text className="text-base font-normal text-center text-gray-400 sm:text-left">
{t('pages.settings.HEADING_DESCRIPTION')}
</Text> */}
<ProfileAvatar />
<PersonalSettingForm />
</Accordian>
<Accordian
title={t('pages.settingsPersonal.DATA_SYNCHRONIZATION')}
className="p-4 mt-4 dark:bg-dark--theme"
id="sync-zone"
>
<SyncZone />
</Accordian>
<Accordian
title={t('pages.settings.DANDER_ZONE')}
className="p-4 mt-4 dark:bg-dark--theme"
isDanger={true}
id="danger-zone"
>
<DangerZone />
</Accordian>
</>
);
};
Expand Down
163 changes: 80 additions & 83 deletions apps/web/app/[locale]/settings/team/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,102 +17,99 @@ import { InvitationSetting } from 'lib/settings/invitation-setting';
import { IssuesSettings } from 'lib/settings/issues-settings';
import { MemberSetting } from 'lib/settings/member-setting';


const Team = () => {
const t = useTranslations();
const [user] = useRecoilState(userState);
const { isTeamMember, activeTeam } = useOrganizationTeams();
const { isTeamManager } = useIsMemberManager(user);
return (
<>
{isTeamMember ? (
<>
<Link href={'/settings/personal'} className="w-full">
<button className="w-full lg:hidden hover:bg-white rounded-xl border border-dark text-dark p-4 mt-2">
Go to Personnal settings
</button>
</Link>
{/* General Settings */}
<Accordian
title={t('pages.settingsTeam.HEADING_TITLE')}
className="w-full p-4 mt-8 dark:bg-dark--theme"
id="general-settings"
>
<div className="flex flex-col">
<TeamAvatar disabled={!isTeamManager} bgColor={activeTeam?.color} />
<TeamSettingForm />
</div>
</Accordian>

{isTeamMember ? (
< >
<Link href={'/settings/personal'} className="w-full">
<button className="w-full lg:hidden hover:bg-white rounded-xl border border-dark text-dark p-4 mt-2">
Go to Personnal settings
</button>
</Link>
{/* General Settings */}
<Accordian
title={t('pages.settingsTeam.HEADING_TITLE')}
className="w-full p-4 mt-8 dark:bg-dark--theme"
id="general-settings"
>
<div className="flex flex-col">
<TeamAvatar disabled={!isTeamManager} bgColor={activeTeam?.color} />
<TeamSettingForm />
</div>
</Accordian>

{/* Invitations */}
{isTeamManager ? (
<Accordian
title={t('pages.settingsTeam.INVITATION_HEADING_TITLE')}
className="w-full p-4 mt-4 dark:bg-dark--theme"
id="invitations"
>
<InvitationSetting />
</Accordian>
) : null}

{/* Members */}
{isTeamManager ? (
<Accordian
title={t('pages.settingsTeam.MEMBER_HEADING_TITLE')}
className="w-full p-4 mt-4 dark:bg-dark--theme"
id="member"
>
<MemberSetting />
</Accordian>
) : null}
{/* Invitations */}
{isTeamManager ? (
<Accordian
title={t('pages.settingsTeam.INVITATION_HEADING_TITLE')}
className="w-full p-4 mt-4 dark:bg-dark--theme"
id="invitations"
>
<InvitationSetting />
</Accordian>
) : null}

{isTeamManager && (
<Accordian
title={t('pages.settingsTeam.INTEGRATIONS')}
className="w-full p-4 mt-4 dark:bg-dark--theme"
id="integrations"
>
<IntegrationSetting />
</Accordian>
)}
{/* Members */}
{isTeamManager ? (
<Accordian
title={t('pages.settingsTeam.MEMBER_HEADING_TITLE')}
className="w-full p-4 mt-4 dark:bg-dark--theme"
id="member"
>
<MemberSetting />
</Accordian>
) : null}

{/* Issues Settings */}
<Accordian
title={t('pages.settingsTeam.ISSUES_HEADING_TITLE')}
className="w-full p-4 mt-4 dark:bg-dark--theme"
id="issues-settings"
>
<IssuesSettings />
</Accordian>
{isTeamManager && (
<Accordian
title={t('pages.settingsTeam.INTEGRATIONS')}
className="w-full p-4 mt-4 dark:bg-dark--theme"
id="integrations"
>
<IntegrationSetting />
</Accordian>
)}

{/* TODO */}
{/* Notification Settings */}
{/* <Accordian
title={t('pages.settingsTeam.NOTIFICATION_HEADING_TITLE')}
className="p-4 mt-4 dark:bg-dark--theme"
>
<NotificationSettings />
</Accordian> */}
{/* Issues Settings */}
<Accordian
title={t('pages.settingsTeam.ISSUES_HEADING_TITLE')}
className="w-full p-4 mt-4 dark:bg-dark--theme"
id="issues-settings"
>
<IssuesSettings />
</Accordian>

{/* Danger Zone */}
<Accordian
title={t('pages.settings.DANDER_ZONE')}
className="w-full p-4 mt-4 dark:bg-dark--theme"
isDanger={true}
id="danger-zones"
>
<DangerZoneTeam />
</Accordian>
</>
) : (
<div className="flex flex-col w-full sm:mr-[20px] lg:mr-0">
<Card className="dark:bg-dark--theme p-[32px] mt-[36px]" shadow="bigger">
<NoTeam className="p-5 mt-0 xs:mt-0" />
</Card>
</div>
)}
{/* TODO */}
{/* Notification Settings */}
{/* <Accordian
title={t('pages.settingsTeam.NOTIFICATION_HEADING_TITLE')}
className="p-4 mt-4 dark:bg-dark--theme"
>
<NotificationSettings />
</Accordian> */}

{/* Danger Zone */}
<Accordian
title={t('pages.settings.DANDER_ZONE')}
className="w-full p-4 mt-4 dark:bg-dark--theme"
isDanger={true}
id="danger-zones"
>
<DangerZoneTeam />
</Accordian>
</>
) : (
<div className="flex flex-col w-full sm:mr-[20px] lg:mr-0">
<Card className="dark:bg-dark--theme p-[32px] mt-[36px]" shadow="bigger">
<NoTeam className="p-5 mt-0 xs:mt-0" />
</Card>
</div>
)}
</>
);
};
Expand Down
2 changes: 1 addition & 1 deletion apps/web/lib/features/task/task-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ function TaskCard({

<Divider className="mt-4" />
{/* Task list */}
<ul className="py-6 max-h-56 overflow-scroll">
<ul className="py-6 max-h-56 overflow-auto">
{forParentChildRelationship &&
data?.map((task, i) => {
const last = (datas.filteredTasks?.length || 0) - 1 === i;
Expand Down
5 changes: 3 additions & 2 deletions apps/web/lib/features/user-profile-tasks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export function UserProfileTask({ profile, tabFiltered }: Props) {
profile.member?.running == true ? t.id !== profile.activeUserTeamTask?.id : t
);
const { nextOffset, data } = useInfinityScrolling(otherTasks);
const dataTodisplay = otherTasks.length > 10 ? otherTasks : data;
const dataToDisplay = otherTasks.length < 10 ? otherTasks : data;

// const { total, onPageChange, itemsPerPage, itemOffset, endOffset, setItemsPerPage, currentItems } =
// usePagination(otherTasks);

Expand Down Expand Up @@ -85,7 +86,7 @@ export function UserProfileTask({ profile, tabFiltered }: Props) {
)}

<ul className="flex flex-col gap-6">
{dataTodisplay.map((task, index) => {
{dataToDisplay.map((task, index) => {
return (
<li key={task.id}>
<ObserverComponent isLast={index === data.length - 1} getNextData={nextOffset} />
Expand Down
Loading

0 comments on commit c12a2b1

Please sign in to comment.