From bd639f33bb56e536f05d16cc9ef1c268e0df9091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=98=84=EC=A1=B0?= Date: Thu, 19 Sep 2024 15:06:16 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=EB=B3=80=EA=B2=BD=EB=90=9C=20=EC=BF=BC?= =?UTF-8?q?=EB=A6=AC=EC=97=90=20=EB=94=B0=EB=A5=B8=20=EB=B3=80=EA=B2=BD,?= =?UTF-8?q?=20Eslint=20=EB=93=B1=20=EC=97=90=EB=9F=AC=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdminMemberManageForm.tsx | 4 +- .../components/AdminMemberManage/index.tsx | 6 +-- .../components/AdminProjectSidebar/index.tsx | 6 +-- .../src/components/OAuthCallback/index.tsx | 2 +- .../src/components/ReviewDetail/index.tsx | 9 ++-- frontend/src/components/ReviewList/index.tsx | 4 +- .../WorkspaceBrowseLayout/index.tsx | 6 +-- .../WorkspaceLabelBar/index.stories.tsx | 46 ------------------- .../src/components/WorkspaceLayout/index.tsx | 11 +++-- frontend/src/pages/WorkspaceBrowseDetail.tsx | 9 ++-- 10 files changed, 30 insertions(+), 73 deletions(-) delete mode 100644 frontend/src/components/WorkspaceLabelBar/index.stories.tsx diff --git a/frontend/src/components/AdminMemberManage/AdminMemberManageForm.tsx b/frontend/src/components/AdminMemberManage/AdminMemberManageForm.tsx index 1bf1ee8..8fe7c5d 100644 --- a/frontend/src/components/AdminMemberManage/AdminMemberManageForm.tsx +++ b/frontend/src/components/AdminMemberManage/AdminMemberManageForm.tsx @@ -6,7 +6,7 @@ import { Form, FormControl, FormField, FormItem, FormMessage } from '../ui/form' import { Input } from '../ui/input'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select'; import { ProjectMemberResponse } from '@/types'; -import { useUpdateProjectMemberPrivilege } from '@/hooks/useProjectHooks'; +import useUpdateProjectMemberPrivilegeQuery from '@/queries/projects/useUpdateProjectMemberPrivilegeQuery'; type Role = 'ADMIN' | 'MANAGER' | 'EDITOR' | 'VIEWER'; @@ -37,7 +37,7 @@ interface AdminMemberManageFormProps { export default function AdminMemberManageForm({ members }: AdminMemberManageFormProps) { const { projectId } = useParams<{ projectId: string }>(); - const { mutate: updatePrivilege } = useUpdateProjectMemberPrivilege(); + const { mutate: updatePrivilege } = useUpdateProjectMemberPrivilegeQuery(); const form = useForm({ resolver: zodResolver(formSchema), diff --git a/frontend/src/components/AdminMemberManage/index.tsx b/frontend/src/components/AdminMemberManage/index.tsx index e428b00..3748aa3 100644 --- a/frontend/src/components/AdminMemberManage/index.tsx +++ b/frontend/src/components/AdminMemberManage/index.tsx @@ -1,9 +1,9 @@ import { useState } from 'react'; import AdminMemberManageForm from './AdminMemberManageForm'; import { useParams } from 'react-router-dom'; -import useProjectMembersQuery from '@/queries/useProjectMembersQuery'; +import useProjectMembersQuery from '@/queries/projects/useProjectMembersQuery'; import useAuthStore from '@/stores/useAuthStore'; -import { useAddProjectMember } from '@/hooks/useProjectHooks'; +import useAddProjectMemberQuery from '@/queries/projects/useAddProjectMemberQuery'; import MemberAddModal from '../MemberAddModal'; import { MemberAddFormValues } from '../MemberAddModal/MemberAddForm'; @@ -13,7 +13,7 @@ export default function AdminMemberManage() { const memberId = profile?.id || 0; const { data: members = [] } = useProjectMembersQuery(Number(projectId), memberId); - const addProjectMember = useAddProjectMember(); + const addProjectMember = useAddProjectMemberQuery(); const [, setInviteModalOpen] = useState(false); diff --git a/frontend/src/components/AdminProjectSidebar/index.tsx b/frontend/src/components/AdminProjectSidebar/index.tsx index dc46d87..d31838a 100644 --- a/frontend/src/components/AdminProjectSidebar/index.tsx +++ b/frontend/src/components/AdminProjectSidebar/index.tsx @@ -1,8 +1,8 @@ import { ResizablePanel, ResizableHandle } from '../ui/resizable'; import { useNavigate, useParams } from 'react-router-dom'; import { SquarePen } from 'lucide-react'; -import useProjectListQuery from '@/queries/useProjectListQuery'; -import { useCreateProject } from '@/hooks/useProjectHooks'; +import useProjectListQuery from '@/queries/projects/useProjectListQuery'; +import useCreateProjectQuery from '@/queries/projects/useCreateProjectQuery'; import { ProjectRequest } from '@/types'; import useAuthStore from '@/stores/useAuthStore'; import ProjectCreateModal from '../ProjectCreateModal'; @@ -17,7 +17,7 @@ export default function AdminProjectSidebar(): JSX.Element { const projects = projectsResponse?.workspaceResponses ?? []; - const createProject = useCreateProject(); + const createProject = useCreateProjectQuery(); const handleCreateProject = (data: ProjectRequest) => { createProject.mutate({ diff --git a/frontend/src/components/OAuthCallback/index.tsx b/frontend/src/components/OAuthCallback/index.tsx index bc97a45..a72535d 100644 --- a/frontend/src/components/OAuthCallback/index.tsx +++ b/frontend/src/components/OAuthCallback/index.tsx @@ -1,4 +1,4 @@ -import { useHandleOAuthCallback } from '@/hooks/useOAuthCallbackHooks'; +import useHandleOAuthCallback from '@/hooks/useOAuthCallbackHooks'; import { useNavigate } from 'react-router-dom'; import { useEffect } from 'react'; import useAuthStore from '@/stores/useAuthStore'; diff --git a/frontend/src/components/ReviewDetail/index.tsx b/frontend/src/components/ReviewDetail/index.tsx index a4d005a..c9dc42d 100644 --- a/frontend/src/components/ReviewDetail/index.tsx +++ b/frontend/src/components/ReviewDetail/index.tsx @@ -1,5 +1,6 @@ -import useReviewDetailQuery from '@/queries/useReviewDetailQuery'; -import { useUpdateReview, useDeleteReview } from '@/hooks/useReviewHooks'; +import useReviewDetailQuery from '@/queries/reviews/useReviewDetailQuery'; +import useUpdateReviewQuery from '@/queries/reviews/useUpdateReviewQuery'; +import useDeleteReviewQuery from '@/queries/reviews/useDeleteReviewQuery'; import { useParams } from 'react-router-dom'; export default function ReviewDetail() { @@ -7,8 +8,8 @@ export default function ReviewDetail() { const memberId = 1; const { data: reviewDetail } = useReviewDetailQuery(Number(projectId), Number(reviewId), memberId); - const updateReview = useUpdateReview(); - const deleteReview = useDeleteReview(); + const updateReview = useUpdateReviewQuery(); + const deleteReview = useDeleteReviewQuery(); const handleUpdate = () => { updateReview.mutate({ diff --git a/frontend/src/components/ReviewList/index.tsx b/frontend/src/components/ReviewList/index.tsx index b55a38b..1736420 100644 --- a/frontend/src/components/ReviewList/index.tsx +++ b/frontend/src/components/ReviewList/index.tsx @@ -1,8 +1,8 @@ import { useState } from 'react'; import ReviewItem from './ReviewItem'; import ReviewSearchInput from './ReviewSearchInput'; -import useReviewByStatusQuery from '@/queries/useReviewByStatusQuery'; -import useProjectQuery from '@/queries/useProjectQuery'; +import useReviewByStatusQuery from '@/queries/reviews/useReviewByStatusQuery'; +import useProjectQuery from '@/queries/projects/useProjectQuery'; import useAuthStore from '@/stores/useAuthStore'; import { useParams } from 'react-router-dom'; diff --git a/frontend/src/components/WorkspaceBrowseLayout/index.tsx b/frontend/src/components/WorkspaceBrowseLayout/index.tsx index ed2c682..d5def81 100644 --- a/frontend/src/components/WorkspaceBrowseLayout/index.tsx +++ b/frontend/src/components/WorkspaceBrowseLayout/index.tsx @@ -4,8 +4,8 @@ import Header from '../Header'; import useAuthStore from '@/stores/useAuthStore'; import WorkSpaceCreateModal from '../WorkSpaceCreateModal'; import { WorkspaceRequest, WorkspaceResponse } from '@/types'; -import useWorkspaceListQuery from '@/queries/useWorkspaceListQuery'; -import { useCreateWorkspace } from '@/hooks/useWorkspaceHooks'; +import useWorkspaceListQuery from '@/queries/workspaces/useWorkspaceListQuery'; +import useCreateWorkspaceQuery from '@/queries/workspaces/useCreateWorkspaceQuery'; export default function WorkspaceBrowseLayout() { const { profile, isLoggedIn } = useAuthStore(); @@ -19,7 +19,7 @@ export default function WorkspaceBrowseLayout() { }, [isLoggedIn, memberId, navigate]); const { data: workspacesResponse } = useWorkspaceListQuery(memberId ?? 0); - const createWorkspace = useCreateWorkspace(); + const createWorkspace = useCreateWorkspaceQuery(); const handleCreateWorkspace = (data: WorkspaceRequest) => { createWorkspace.mutate({ diff --git a/frontend/src/components/WorkspaceLabelBar/index.stories.tsx b/frontend/src/components/WorkspaceLabelBar/index.stories.tsx deleted file mode 100644 index f768e44..0000000 --- a/frontend/src/components/WorkspaceLabelBar/index.stories.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import '@/index.css'; -import { Meta } from '@storybook/react'; -import WorkspaceLabelBar from '.'; -import { Label } from '@/types'; - -const meta: Meta = { - title: 'Workspace/WorkspaceLabelBar', - component: WorkspaceLabelBar, - parameters: { - layout: 'fullscreen', - }, -}; - -export default meta; - -const labels: Label[] = [ - { - id: 1, - name: 'Label 1', - color: '#FFaa33', - type: 'rect', - coordinates: [], - }, - { - id: 2, - name: 'Label 2', - color: '#aaFF55', - type: 'rect', - coordinates: [], - }, - { - id: 3, - name: 'Label 3', - color: '#77aaFF', - type: 'rect', - coordinates: [], - }, -]; - -export const Default = () => { - return ( -
- -
- ); -}; diff --git a/frontend/src/components/WorkspaceLayout/index.tsx b/frontend/src/components/WorkspaceLayout/index.tsx index c437475..daa53b5 100644 --- a/frontend/src/components/WorkspaceLayout/index.tsx +++ b/frontend/src/components/WorkspaceLayout/index.tsx @@ -1,14 +1,15 @@ import { useEffect, useState } from 'react'; import { useParams, Outlet } from 'react-router-dom'; import Header from '../Header'; -import { Project } from '@/types'; -import { ResizablePanelGroup, ResizablePanel } from '../ui/resizable'; +import { Label, Project } from '@/types'; +import { ResizablePanelGroup } from '../ui/resizable'; +// import { ResizablePanel } from '../ui/resizable'; import WorkspaceSidebar from '../WorkspaceSidebar'; import useAuthStore from '@/stores/useAuthStore'; import useCanvasStore from '@/stores/useCanvasStore'; -import useFolderQuery from '@/queries/useFolderQuery'; -import useWorkspaceQuery from '@/queries/useWorkspaceQuery'; -import useProjectListQuery from '@/queries/useProjectListQuery'; +import useFolderQuery from '@/queries/folders/useFolderQuery'; +import useWorkspaceQuery from '@/queries/workspaces/useWorkspaceQuery'; +import useProjectListQuery from '@/queries/projects/useProjectListQuery'; const mockLabels: Label[] = [ { diff --git a/frontend/src/pages/WorkspaceBrowseDetail.tsx b/frontend/src/pages/WorkspaceBrowseDetail.tsx index 60833e7..269398c 100644 --- a/frontend/src/pages/WorkspaceBrowseDetail.tsx +++ b/frontend/src/pages/WorkspaceBrowseDetail.tsx @@ -4,9 +4,9 @@ import { Smile } from 'lucide-react'; import ProjectCreateModal from '../components/ProjectCreateModal'; import useAuthStore from '@/stores/useAuthStore'; import { ProjectResponse, ProjectRequest } from '@/types'; -import useProjectListQuery from '@/queries/useProjectListQuery'; -import useWorkspaceQuery from '@/queries/useWorkspaceQuery'; -import { useCreateProject } from '@/hooks/useProjectHooks'; +import useProjectListQuery from '@/queries/projects/useProjectListQuery'; +import useWorkspaceQuery from '@/queries/workspaces/useWorkspaceQuery'; +import useCreateProjectQuery from '@/queries/projects/useCreateProjectQuery'; import { webPath } from '@/router'; export default function WorkspaceBrowseDetail() { @@ -18,7 +18,8 @@ export default function WorkspaceBrowseDetail() { const { data: workspaceData } = useWorkspaceQuery(workspaceId, memberId); const { data: projectsResponse, isError } = useProjectListQuery(workspaceId, memberId); - const createProject = useCreateProject(); + + const createProject = useCreateProjectQuery(); const handleCreateProject = (data: ProjectRequest) => { createProject.mutate({