Skip to content
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
1 change: 0 additions & 1 deletion app/(protected)/team/(team)/invitations/page.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions app/(protected)/team/(team)/layout.tsx

This file was deleted.

1 change: 0 additions & 1 deletion app/(protected)/team/(team)/members/page.tsx

This file was deleted.

1 change: 0 additions & 1 deletion app/(protected)/team/(team)/roles/page.tsx

This file was deleted.

1 change: 0 additions & 1 deletion app/(protected)/team/(team)/settings/page.tsx

This file was deleted.

15 changes: 15 additions & 0 deletions app/(protected)/team/invitations/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use client';

import { ErrorState } from 'widgets/error-state';

export default function Error({ unstable_retry }: { unstable_retry: () => void }) {
return (
<ErrorState
title="Не удалось загрузить приглашения"
description="Попробуйте обновить блок приглашений. Если ошибка повторится, обновите страницу."
actionLabel="Попробовать снова"
onRetry={() => unstable_retry()}
className="border"
/>
);
}
1 change: 1 addition & 0 deletions app/(protected)/team/invitations/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { InvitationsPage as default } from 'pages/team/invitations';
15 changes: 15 additions & 0 deletions app/(protected)/team/members/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use client';

import { ErrorState } from 'widgets/error-state';

export default function Error({ unstable_retry }: { unstable_retry: () => void }) {
return (
<ErrorState
title="Не удалось загрузить участников команды"
description="Попробуйте обновить блок. Если ошибка повторится, обновите страницу."
actionLabel="Попробовать снова"
onRetry={() => unstable_retry()}
className="border"
/>
);
}
1 change: 1 addition & 0 deletions app/(protected)/team/members/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { MembersPage as default } from 'pages/team/members';
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@

import { ErrorState } from 'widgets/error-state';

export default function Error({
unstable_retry,
}: {
error: Error & { digest?: string };
unstable_retry: () => void;
}) {
export default function Error({ unstable_retry }: { unstable_retry: () => void }) {
return (
<ErrorState
title="Не удалось загрузить доску"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@

import { ErrorState } from 'widgets/error-state';

export default function Error({
unstable_retry,
}: {
error: Error & { digest?: string };
unstable_retry: () => void;
}) {
export default function Error({ unstable_retry }: { unstable_retry: () => void }) {
return (
<ErrorState
title="Не удалось загрузить настройки доски"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@

import { ErrorState } from 'widgets/error-state';

export default function Error({
unstable_retry,
}: {
error: Error & { digest?: string };
unstable_retry: () => void;
}) {
export default function Error({ unstable_retry }: { unstable_retry: () => void }) {
return (
<ErrorState
title="Не удалось загрузить настройки проекта"
Expand Down
7 changes: 1 addition & 6 deletions app/(protected)/team/projects/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@

import { ErrorState } from 'widgets/error-state';

export default function Error({
unstable_retry,
}: {
error: Error & { digest?: string };
unstable_retry: () => void;
}) {
export default function Error({ unstable_retry }: { unstable_retry: () => void }) {
return (
<ErrorState
title="Не удалось загрузить проекты"
Expand Down
2 changes: 1 addition & 1 deletion app/(protected)/team/projects/page.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { ProjectsPage as default } from 'pages/projects';
export { ProjectsPage as default } from 'pages/team/projects';
15 changes: 15 additions & 0 deletions app/(protected)/team/settings/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use client';

import { ErrorState } from 'widgets/error-state';

export default function Error({ unstable_retry }: { unstable_retry: () => void }) {
return (
<ErrorState
title="Не удалось загрузить настройки"
description="Попробуйте обновить блок. Если ошибка повторится, обновите страницу."
actionLabel="Попробовать снова"
onRetry={() => unstable_retry()}
className="border"
/>
);
}
1 change: 1 addition & 0 deletions app/(protected)/team/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { SettingsPage as default } from 'pages/team/settings';
21 changes: 15 additions & 6 deletions app/(protected)/user/(user)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
import { PageLayout } from 'app/layouts/PageLayout';
import { profileTabs } from 'pages/profile';
import { Bell, Settings } from 'lucide-react';
import { routes } from 'shared/config';
import { PageWrapper } from 'widgets/page-wrapper';
import { type TabNavItem, VerticalTabsNav } from 'widgets/tabs-nav';

const tabs: TabNavItem[] = [
{ key: routes.user.profile(), label: 'Общие', icon: <Settings /> },
{ key: routes.user.notifications(), label: 'Уведомления', icon: <Bell /> },
];

export default function ProfileLayout({ children }: { children: React.ReactNode }) {
return (
<PageLayout
<PageWrapper
title="Профиль"
description="Управляйте данными аккаунта, безопасностью и уведомлениями."
tabs={profileTabs}
>
{children}
</PageLayout>
<div className="grid grid-cols-[auto_1fr] gap-2 lg:gap-4">
<VerticalTabsNav className="sticky top-4 z-10 self-start" tabs={tabs} />
{children}
</div>
</PageWrapper>
);
}
15 changes: 15 additions & 0 deletions app/(protected)/user/(user)/notifications/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use client';

import { ErrorState } from 'widgets/error-state';

export default function Error({ unstable_retry }: { unstable_retry: () => void }) {
return (
<ErrorState
title="Не удалось загрузить настройки уведомлений"
description="Попробуйте обновить страницу."
actionLabel="Попробовать снова"
onRetry={() => unstable_retry()}
className="border"
/>
);
}
2 changes: 1 addition & 1 deletion app/(protected)/user/(user)/notifications/page.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { NotificationsPage as default } from 'pages/profile';
export { NotificationsPage as default } from 'pages/user/notifications';
15 changes: 15 additions & 0 deletions app/(protected)/user/(user)/profile/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use client';

import { ErrorState } from 'widgets/error-state';

export default function Error({ unstable_retry }: { unstable_retry: () => void }) {
return (
<ErrorState
title="Не удалось загрузить основые настройки профиля"
description="Попробуйте обновить страницу."
actionLabel="Попробовать снова"
onRetry={() => unstable_retry()}
className="border"
/>
);
}
2 changes: 1 addition & 1 deletion app/(protected)/user/(user)/profile/page.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { MePage as default } from 'pages/profile';
export { UserPage as default } from 'pages/user/profile';
1 change: 0 additions & 1 deletion app/(protected)/user/(user)/security/page.tsx

This file was deleted.

7 changes: 1 addition & 6 deletions app/(protected)/user/teams/@invitations/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@

import { ErrorState } from 'widgets/error-state';

export default function Error({
unstable_retry,
}: {
error: Error & { digest?: string };
unstable_retry: () => void;
}) {
export default function Error({ unstable_retry }: { unstable_retry: () => void }) {
return (
<ErrorState
title="Не удалось загрузить приглашения"
Expand Down
2 changes: 1 addition & 1 deletion app/(protected)/user/teams/@invitations/page.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { InvitationsPage as default } from 'pages/invitations';
export { InvitationsPage as default } from 'pages/user/invitations';
7 changes: 1 addition & 6 deletions app/(protected)/user/teams/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@

import { ErrorState } from 'widgets/error-state';

export default function Error({
unstable_retry,
}: {
error: Error & { digest?: string };
unstable_retry: () => void;
}) {
export default function Error({ unstable_retry }: { unstable_retry: () => void }) {
return (
<ErrorState
title="Не удалось загрузить команды"
Expand Down
2 changes: 1 addition & 1 deletion app/(protected)/user/teams/page.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { TeamsPage as default } from 'pages/teams';
export { TeamsPage as default } from 'pages/user/teams';
1 change: 0 additions & 1 deletion app/public/[teamId]/[projectSlug]/[boardSlug]/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ErrorState } from 'widgets/error-state';
export default function Error({
unstable_retry,
}: {
error: Error & { digest?: string };
unstable_retry: () => void;
}) {
return (
Expand Down
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference types="next/navigation-types/compat/navigation" />
import './.next/types/routes.d.ts';
import './.next/dev/types/routes.d.ts';

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
15 changes: 0 additions & 15 deletions src/app/layouts/PageLayout.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/app/layouts/SidebarLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function SidebarLayout({ children, ...props }: ComponentProps<typeof Side
<SidebarProvider {...props}>
<TeamIdSync />
<AppSidebar />
<SidebarInset className="min-h-screen">
<SidebarInset className="h-screen">
<header className="bg-background sticky top-0 z-50 flex h-14 shrink-0 items-center justify-between gap-2 border-b px-4">
<div className="flex items-center gap-2">
<SidebarTrigger className="-ml-1" />
Expand Down
11 changes: 10 additions & 1 deletion src/entities/auth/api/queries.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { queryOptions } from '@tanstack/react-query';
import { AuthHttp } from './http';
import type { ConnectedOAuthProvidersResponse, OAuthProvider } from '../model/types';
import { authFabricKeys } from '../model/const';
import { AuthHttp } from './http';

export class AuthQueries {
static getOAuthProviders() {
Expand All @@ -15,6 +16,14 @@ export class AuthQueries {
queryKey: authFabricKeys.connectedProviders(),
queryFn: async ({ signal }) => AuthHttp.connectedOAuthProviders(signal),
staleTime: 60_000 * 360 * 24,
select: (data) =>
data.reduce(
(acc, v) => {
acc[v.provider] = v;
return acc;
},
{} as Record<OAuthProvider, ConnectedOAuthProvidersResponse[number]>
),
});
}
}
2 changes: 1 addition & 1 deletion src/entities/auth/model/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const ConnectedOAuthProvidersResponse = z
.object({
email: Email,
avatarUrl: z.string().nullable(),
provider: z.string(),
provider: OAuthProvider,
connectedAt: z.string(),
})
.array();
Expand Down
2 changes: 1 addition & 1 deletion src/entities/user/api/http.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { api } from 'shared/api';
import * as TUser from '../model/types';
import * as SUser from '../model/schemas';
import type * as TUser from '../model/types';

export class UserHttp {
static getUser(signal?: AbortSignal) {
Expand Down
8 changes: 2 additions & 6 deletions src/entities/user/model/schemas.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { DateTimeString, GlobalSuccess } from 'shared/api';
import { PaginatedResponseSchema } from 'shared/api/';
import { z } from 'zod/v4';

export const UserAvatarSchema = z
Expand Down Expand Up @@ -91,14 +90,11 @@ export const ProfileUpdateBody = z.object({
headline: z.string().max(100, 'Должность слишком длинная').nullable().optional(),
location: z.string().max(100, 'Локация слишком длинная').nullable().optional(),
phone: z.string().max(20, 'Номер телефона слишком длинный').nullable().optional(),
gender: z
.enum(['none', 'male', 'female', 'non_binary', 'other', 'prefer_not_to_say'])
.default('none')
.optional(),
gender: z.enum(['none', 'male', 'female', 'non_binary', 'other', 'prefer_not_to_say']).optional(),
vacationStart: z.string().nullable().optional(),
vacationEnd: z.string().nullable().optional(),
vacationMessage: z.string().max(500, 'Сообщение слишком длинное').nullable().optional(),
pronouns: z.enum(['he_him', 'she_her', 'they_them', 'other', 'none']).default('none').optional(),
pronouns: z.enum(['he_him', 'she_her', 'they_them', 'other', 'none']).optional(),
pronounsCustom: z.string().max(50, 'Максимальная длина 50 символов').nullable().optional(),
bio: z.string().max(1000, 'О себе не более 1000 символов').nullable().optional(),
timezone: z.string().max(50).optional(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function OAuthLoginButtonsContent({ className }: OAuthLoginButtonsContent
type="button"
className={data.className}
key={value}
variant={'outline'}
variant="outline"
size="icon"
onClick={() => startOAuth(value)}
>
Expand Down
Loading
Loading