diff --git a/adminfront/src/features/roles/RoleCreatePage.tsx b/adminfront/src/features/roles/RoleCreatePage.tsx deleted file mode 100644 index 20037871..00000000 --- a/adminfront/src/features/roles/RoleCreatePage.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { ChevronLeft } from "lucide-react"; -import { Link } from "react-router-dom"; -import { Button } from "../../components/ui/button"; - -function RoleCreatePage() { - return ( -
-
- - - Back to list - -

새 역할 추가

-

- 새로운 사용자 역할을 정의하고 권한을 할당합니다. -

-
- -
-

- 역할 생성 폼이 여기에 구현될 예정입니다. -

- -
-
- ); -} - -export default RoleCreatePage; diff --git a/adminfront/src/features/roles/RoleDetailPage.tsx b/adminfront/src/features/roles/RoleDetailPage.tsx deleted file mode 100644 index 404b98ba..00000000 --- a/adminfront/src/features/roles/RoleDetailPage.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { ChevronLeft } from "lucide-react"; -import { Link, useParams } from "react-router-dom"; -import { Button } from "../../components/ui/button"; - -function RoleDetailPage() { - const { id } = useParams(); - - return ( -
-
- - - Back to list - -

역할 상세

-

역할 ID: {id}

-
- -
-

- 역할 상세 정보 및 권한 편집 화면이 여기에 구현될 예정입니다. -

- -
-
- ); -} - -export default RoleDetailPage; diff --git a/adminfront/src/features/roles/RoleListPage.tsx b/adminfront/src/features/roles/RoleListPage.tsx deleted file mode 100644 index c89a5469..00000000 --- a/adminfront/src/features/roles/RoleListPage.tsx +++ /dev/null @@ -1,172 +0,0 @@ -import { useMutation, useQuery } from "@tanstack/react-query"; -import type { AxiosError } from "axios"; -import { Plus, RefreshCw, Shield, Trash2 } from "lucide-react"; -import { Link, useNavigate } from "react-router-dom"; -import { Badge } from "../../components/ui/badge"; -import { Button } from "../../components/ui/button"; -import { - Card, - CardContent, - CardDescription, - CardHeader, - CardTitle, -} from "../../components/ui/card"; -import { - Table, - TableBody, - TableCell, - TableHead, - TableHeader, - TableRow, -} from "../../components/ui/table"; -import { deleteRole, fetchRoles } from "../../lib/adminApi"; - -function RoleListPage() { - const navigate = useNavigate(); - const query = useQuery({ - queryKey: ["roles", { limit: 50, offset: 0 }], - queryFn: () => fetchRoles(50, 0), - }); - - const deleteMutation = useMutation({ - mutationFn: (id: string) => deleteRole(id), - onSuccess: () => { - query.refetch(); - }, - }); - - const errorMsg = (query.error as AxiosError<{ error?: string }>)?.response - ?.data?.error; - const fallbackError = - !errorMsg && query.isError ? "역할 목록 조회에 실패했습니다." : null; - - const items = query.data?.items ?? []; - - const handleDelete = (id: string, name: string) => { - if (!window.confirm(`역할 "${name}"을 삭제할까요?`)) { - return; - } - deleteMutation.mutate(id); - }; - - return ( -
-
-
-
- Roles - / - List -
-

역할 및 권한 (RBAC)

-

- 사용자에게 부여할 역할과 해당 역할의 세부 권한을 관리합니다. -

-
-
- - -
-
- - - -
- Role Management - - 총 {query.data?.total ?? 0}개 역할 정의됨 - -
- RBAC -
- - {(errorMsg || fallbackError) && ( -
- {errorMsg ?? fallbackError} -
- )} - - - - - ROLE NAME - DESCRIPTION - PERMISSIONS - ACTIONS - - - - {query.isLoading && ( - - 로딩 중... - - )} - {!query.isLoading && items.length === 0 && ( - - 정의된 역할이 없습니다. - - )} - {items.map((role) => ( - - -
- - {role.name} -
-
- {role.description} - -
- {role.permissions.map((p) => ( - - {p} - - ))} -
-
- -
- - -
-
-
- ))} -
-
-
-
-
- ); -} - -export default RoleListPage;