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
2 changes: 1 addition & 1 deletion src/app/config/errorBoundary/errors/BackHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const BackHome = () => {
const handleClick = () => {
resetErrorBoundary();
if (isAuthenticated()) {
return navigate('/users');
return navigate('/connections');
}
navigate('/login');
};
Expand Down
11 changes: 1 addition & 10 deletions src/app/config/router/instance.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import { createBrowserRouter, Navigate } from 'react-router-dom';
import { UserDetailPage, UserListPage } from '@pages/user';
import { LoginPage } from '@pages/auth';
import { AuthLayout, ErrorLayout, PrivateLayout } from '@app/layouts';
import { CreateGroupPage, GroupDetailPage, GroupListPage, UpdateGroupPage } from '@pages/group';
Expand Down Expand Up @@ -47,15 +46,7 @@ export const router = createBrowserRouter([
children: [
{
path: '/',
element: <Navigate to="/users" replace />,
},
{
path: '/users',
element: <UserListPage />,
},
{
path: '/users/:id',
element: <UserDetailPage />,
element: <Navigate to="/connections" replace />,
},
{
path: '/groups',
Expand Down
2 changes: 1 addition & 1 deletion src/app/config/router/permissions/authRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import { Navigate } from 'react-router-dom';
import { isAuthenticated } from './utils';

export const AuthRoute = ({ children }: PropsWithChildren) => {
return isAuthenticated() ? <Navigate to="/users" /> : children;
return isAuthenticated() ? <Navigate to="/connections" /> : children;
};
2 changes: 1 addition & 1 deletion src/entities/auth/hooks/useLogin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const useLogin = () => {

const login = (token: string) => {
localStorage.setItem(Storage.ACCESS_TOKEN, token);
navigate('/users');
navigate('/connections');
};

return login;
Expand Down
1 change: 0 additions & 1 deletion src/entities/user/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './api';
export * from './ui';
20 changes: 0 additions & 20 deletions src/entities/user/ui/UserDetailInfo/index.tsx

This file was deleted.

5 changes: 0 additions & 5 deletions src/entities/user/ui/UserDetailInfo/types.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/entities/user/ui/index.ts

This file was deleted.

3 changes: 1 addition & 2 deletions src/features/group/GroupDetailInfo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import { Descriptions } from 'antd';
import { Link } from 'react-router-dom';

import { GroupDetailInfoProps } from './types';

Expand All @@ -17,7 +16,7 @@ export const GroupDetailInfo = ({ group, owner, ...props }: GroupDetailInfoProps
{group.description}
</Descriptions.Item>
<Descriptions.Item label="Owner" span={3}>
<Link to={`/users/${owner.id}`}>{owner.username}</Link>
{owner.username}
</Descriptions.Item>
</Descriptions>
);
Expand Down
24 changes: 0 additions & 24 deletions src/features/user/UserList/constants.tsx

This file was deleted.

17 changes: 0 additions & 17 deletions src/features/user/UserList/index.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/features/user/index.ts

This file was deleted.

24 changes: 0 additions & 24 deletions src/pages/user/UserDetailPage/index.tsx

This file was deleted.

15 changes: 0 additions & 15 deletions src/pages/user/UserListPage/index.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions src/pages/user/index.ts

This file was deleted.

31 changes: 10 additions & 21 deletions src/widgets/layout/Sidebar/constants.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,27 @@
import React from 'react';
import { MenuProps } from 'antd';
import {
MergeCellsOutlined,
OrderedListOutlined,
PullRequestOutlined,
UsergroupAddOutlined,
UserOutlined,
} from '@ant-design/icons';
import { MergeCellsOutlined, OrderedListOutlined, PullRequestOutlined, UsergroupAddOutlined } from '@ant-design/icons';
import { Link } from 'react-router-dom';

export const SIDEBAR_ITEMS: MenuProps['items'] = [
{
key: 'users',
label: <Link to="/users">Users</Link>,
icon: <UserOutlined />,
key: 'connections',
label: <Link to="/connections">Connections</Link>,
icon: <MergeCellsOutlined />,
},
{
key: 'groups',
label: <Link to="/groups">Groups</Link>,
icon: <UsergroupAddOutlined />,
key: 'transfers',
label: <Link to="/transfers">Transfers</Link>,
icon: <PullRequestOutlined />,
},
{
key: 'queues',
label: <Link to="/queues">Queues</Link>,
icon: <OrderedListOutlined />,
},
{
key: 'connections',
label: <Link to="/connections">Connections</Link>,
icon: <MergeCellsOutlined />,
},
{
key: 'transfers',
label: <Link to="/transfers">Transfers</Link>,
icon: <PullRequestOutlined />,
key: 'groups',
label: <Link to="/groups">Groups</Link>,
icon: <UsergroupAddOutlined />,
},
];