From 5783e82a2278a1bd1228bc5f0fe26a84e0881920 Mon Sep 17 00:00:00 2001 From: kimnamheeee Date: Mon, 2 Dec 2024 16:03:25 +0900 Subject: [PATCH 1/5] =?UTF-8?q?refactor=20:=20=EC=82=AC=EC=9D=B4=EB=93=9C?= =?UTF-8?q?=EB=B0=94=20=ED=86=A0=EA=B8=80=20=EC=95=84=EC=9D=B4=EC=BD=98=20?= =?UTF-8?q?react=20icons=EB=A1=9C=20=EA=B5=90=EC=B2=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/Sidebar/ToggleButton.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/src/components/Sidebar/ToggleButton.tsx b/client/src/components/Sidebar/ToggleButton.tsx index c4c5fedd..97463513 100644 --- a/client/src/components/Sidebar/ToggleButton.tsx +++ b/client/src/components/Sidebar/ToggleButton.tsx @@ -1,10 +1,10 @@ import { Button } from "@headlessui/react"; -import arrowDown from "@/assets/arrowDown.png"; +import { FaAnglesLeft } from "react-icons/fa6"; export default function ToggleButton({ isSidebarOpen, toggleSidebar }) { const animateOptions = { button: isSidebarOpen ? "left-64" : "left-0", - arrow: isSidebarOpen ? "rotate-90" : "-rotate-90", + arrow: isSidebarOpen ? "rotate-0" : "rotate-180", }; const transitionClasses = { button: "transition-all duration-300", @@ -17,10 +17,9 @@ export default function ToggleButton({ isSidebarOpen, toggleSidebar }) { className={`absolute top-20 h-10 w-10 rounded-r-lg bg-grayscale-600 ${transitionClasses.button} ${animateOptions.button}`} >
- 토글 화살표 - 토글 화살표 +
); From 3e635e1bd0a027f18d6e8eb7240bf091a9e3848b Mon Sep 17 00:00:00 2001 From: kimnamheeee Date: Mon, 2 Dec 2024 16:03:34 +0900 Subject: [PATCH 2/5] =?UTF-8?q?delete=20:=20=EC=82=AC=EC=9A=A9=ED=95=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EC=95=84=EC=9D=B4=EC=BD=98=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/assets/arrowDown.png | Bin 1302 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 client/src/assets/arrowDown.png diff --git a/client/src/assets/arrowDown.png b/client/src/assets/arrowDown.png deleted file mode 100644 index a85f8df135f027f418d8eebbe20e3da5934a077e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1302 zcmV+x1?l>UP)2&(r+uKhm z4mq$auuRO;!@Ik?3Dwl08W4qf_>ue2>-+or!RhJgGbLRIW_nC z`T4m&8jW5kY3%y?y4US?|542-7F-O6!*S6k3P%iwQNW&gBTslklr%DnqV`Bp;C!~M zmn@AKj-$wXF(b!88ae98MbRVomPU>*VR($fN^#WSIST7b9P=<*h{8&7RM1is);x}B z7%fI&r8r7xISOkUM~5K_E5)$}Qxw((_DVA1(Mx+P#h9aj%&tl>VvLDL8aZ+VL@_q2 zl8gMtXNrTFlqm3Iad$Pv!9-FNP;`JR#nCcpQ9$9}N>Uu{kr)N6`y*P4!!xN-z}op3 zDGq-mM*(Ff>ZCXvlO6^5n%d`*syGBhacQFXwdsp|Oa}HrMI78wIG+q`r8w#fDT?XW zQ$^fy?C$RF4+eu*3P@;CK;?5+&HAZt9v+BC@9pjFX)>9(n%d?aUhCG@7EUnk5rfuF zQM5Qm4)bQ8cXoCTq>mhk0wHHv#xhgBZWPn+r3O+QtA!lJ^!ury6vwjAqnQ31{N<@Q50!ec_Zmv!^h?0wM-j08%zc1&kEWSQg}flMw?X{7^VY4sGw> zSr`y&92(!Z(=Z^mIJCZBC)*f#c!7AK%-bA|u2@%v)?WhWVSs=*zBjpIU0K*w*E%vf zUzOx(*q>iT`|%sEVSvUsVmPShWmS@AS1ab}3o$5j^_VKS|GNC~@p06~hPC%F0B;0y zDJbwbVw#WQeN~bd;=BYawn<8@h5;eQ5#!9Y*2931;)r!RBTE<%LL4#AacyPevk2ZW z_Xeq1@V{4mzTq`an_{2%%oYZ4$6=fmUCt06GvWLs9wKJLv#m<<1e}C3zbF~wrKdp5 zDH0;W010u-9;1%}#DoC?;@~3gWGYc%K!kCKJi|_07!Xk$Vo$pi83sfUhv;*0#fAZj z;}Cy>w&*ZGVH`o6wJ$ylaD4L?PQhHtf%V8|S@=QX{%YoFP?tYgfP2Ipg>rq5AVv(U z>Ak=h1$X1Xpu&Iv;|TI@lEH-m0mTvQEk=V30|JO6==;tF8wLoDBlw#U2OS0oj6=m8 zs)G*$1jV7|w&g(_$Jk`HAiSK4SkXYsz3f$l0mI?&(HvFejH8d&KuV}smE@Vj=Y4bd z-20jC3lPNvDWWb6XgLmbQGm)YprtreMgeNW0MBu#jRI7M0iNPe9R;Wl102VpJ_=B? zySmP3G`e@OE1PB6SqxD?6k!13pl0`W8=st<{Gmuhu`0={dGo)GH Date: Mon, 2 Dec 2024 16:11:52 +0900 Subject: [PATCH 3/5] =?UTF-8?q?fix:=20typeORM=20cascade=20=EC=98=B5?= =?UTF-8?q?=EC=85=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api-server/src/modules/mindmap/mindmap.service.ts | 8 -------- BE/libs/entity/src/mindmap.entity.ts | 10 ++++++++-- BE/libs/entity/src/node.entity.ts | 2 +- BE/libs/entity/src/user.entity.ts | 5 ++++- BE/libs/entity/src/user.mindmap.role.ts | 4 ++-- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/BE/apps/api-server/src/modules/mindmap/mindmap.service.ts b/BE/apps/api-server/src/modules/mindmap/mindmap.service.ts index e71d3d60..ecd5f28d 100644 --- a/BE/apps/api-server/src/modules/mindmap/mindmap.service.ts +++ b/BE/apps/api-server/src/modules/mindmap/mindmap.service.ts @@ -95,14 +95,6 @@ export class MindmapService { throw new MindmapException('마인드맵을 찾을 수 없습니다.'); } - if (!nodes) { - return { - title: mindmap.title, - content: mindmap.content, - aiCount: mindmap.aiCount, - connectionId: mindmap.connectionId, - }; - } return { title: mindmap.title, content: mindmap.content, diff --git a/BE/libs/entity/src/mindmap.entity.ts b/BE/libs/entity/src/mindmap.entity.ts index 97516ac7..d70a7273 100644 --- a/BE/libs/entity/src/mindmap.entity.ts +++ b/BE/libs/entity/src/mindmap.entity.ts @@ -28,13 +28,19 @@ export class Mindmap { @Column({ name: 'ai_count', default: 5 }) aiCount: number; - @OneToMany(() => UserMindmapRole, (userMindmapRole) => userMindmapRole.mindmap) + @OneToMany(() => UserMindmapRole, (userMindmapRole) => userMindmapRole.mindmap, { + cascade: true, + onDelete: 'CASCADE', + }) userMindmapRoles: UserMindmapRole[]; @Column({ name: 'connection_id' }) connectionId: string; - @OneToMany(() => Node, (node) => node.mindmap) + @OneToMany(() => Node, (node) => node.mindmap, { + cascade: true, + onDelete: 'CASCADE', + }) nodes: Node[]; @CreateDateColumn({ type: 'timestamp', name: 'create_date' }) diff --git a/BE/libs/entity/src/node.entity.ts b/BE/libs/entity/src/node.entity.ts index 5414c87f..f295af2b 100644 --- a/BE/libs/entity/src/node.entity.ts +++ b/BE/libs/entity/src/node.entity.ts @@ -19,7 +19,7 @@ export class Node { @PrimaryGeneratedColumn() id: number; - @Column({ type: 'varchar', length: 32 }) + @Column({ type: 'varchar', length: 128 }) keyword: string; @Column({ name: 'location_x', type: 'float', default: 0 }) diff --git a/BE/libs/entity/src/user.entity.ts b/BE/libs/entity/src/user.entity.ts index 736b7ce7..cc9ef5cd 100644 --- a/BE/libs/entity/src/user.entity.ts +++ b/BE/libs/entity/src/user.entity.ts @@ -18,6 +18,9 @@ export class User { @CreateDateColumn({ type: 'timestamp', name: 'create_date' }) createDate: Date; - @OneToMany(() => UserMindmapRole, (userMindmapRole) => userMindmapRole.user) + @OneToMany(() => UserMindmapRole, (userMindmapRole) => userMindmapRole.user, { + cascade: true, + onDelete: 'CASCADE', + }) userMindmapRoles: UserMindmapRole[]; } diff --git a/BE/libs/entity/src/user.mindmap.role.ts b/BE/libs/entity/src/user.mindmap.role.ts index f5e17f35..f717cf20 100644 --- a/BE/libs/entity/src/user.mindmap.role.ts +++ b/BE/libs/entity/src/user.mindmap.role.ts @@ -8,11 +8,11 @@ export class UserMindmapRole { @PrimaryGeneratedColumn() id: number; - @ManyToOne(() => User, (user) => user.userMindmapRoles, { onDelete: 'CASCADE', nullable: false }) + @ManyToOne(() => User, (user) => user.userMindmapRoles, { nullable: false }) @JoinColumn({ name: 'user_id' }) user: User; - @ManyToOne(() => Mindmap, (mindmap) => mindmap.userMindmapRoles, { onDelete: 'CASCADE', nullable: false }) + @ManyToOne(() => Mindmap, (mindmap) => mindmap.userMindmapRoles, { nullable: false }) @JoinColumn({ name: 'mindmap_id' }) mindmap: Mindmap; From a29d3786fef9d7abede5d00d782eab67a418e7ab Mon Sep 17 00:00:00 2001 From: adkm12 Date: Mon, 2 Dec 2024 16:19:28 +0900 Subject: [PATCH 4/5] =?UTF-8?q?fix=20:=20=EC=86=8C=ED=94=84=ED=8A=B8=20?= =?UTF-8?q?=EB=94=9C=EB=A6=AC=ED=8A=B8=20=EC=BB=AC=EB=9F=BC=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/libs/entity/src/user.mindmap.role.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BE/libs/entity/src/user.mindmap.role.ts b/BE/libs/entity/src/user.mindmap.role.ts index f717cf20..19ffce12 100644 --- a/BE/libs/entity/src/user.mindmap.role.ts +++ b/BE/libs/entity/src/user.mindmap.role.ts @@ -20,5 +20,5 @@ export class UserMindmapRole { role: Role; @DeleteDateColumn() - deleteAt: Date | null; + deletedAt: Date | null; } From cecb634956ed74746869e42c951ffb5db600bf43 Mon Sep 17 00:00:00 2001 From: kimnamheeee Date: Mon, 2 Dec 2024 16:28:11 +0900 Subject: [PATCH 5/5] =?UTF-8?q?chore=20:=20=EB=8D=94=EC=9D=B4=EC=83=81=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8A=94=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=EC=9A=A9=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/main.tsx | 5 ----- client/src/pages/TestPage.tsx | 40 ----------------------------------- 2 files changed, 45 deletions(-) delete mode 100644 client/src/pages/TestPage.tsx diff --git a/client/src/main.tsx b/client/src/main.tsx index 444e33e9..854f295e 100644 --- a/client/src/main.tsx +++ b/client/src/main.tsx @@ -10,7 +10,6 @@ import Layout from "@/pages/layout"; import MindMap from "@/pages/Mindmap"; import { ErrorBoundary } from "react-error-boundary"; import { useConnectionStore } from "@/store/useConnectionStore"; -import TestPage from "./pages/TestPage"; const router = createBrowserRouter([ { @@ -28,10 +27,6 @@ const router = createBrowserRouter([ path: "/mindmap/:mindMapId", element: , }, - { - path: "/test", - element: , - }, ], }, { diff --git a/client/src/pages/TestPage.tsx b/client/src/pages/TestPage.tsx deleted file mode 100644 index 2ba9a702..00000000 --- a/client/src/pages/TestPage.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { Button, Input } from "@headlessui/react"; -import { useState } from "react"; - -export default function TestPage() { - const [inputValue, setInputValue] = useState(""); // 입력값 상태 관리 - const [responseMessage, setResponseMessage] = useState(""); - - const handleInputChange = (e) => { - setInputValue(e.target.value); // 입력값 업데이트 - }; - - const handleSubmit = async (event: React.FormEvent) => { - event.preventDefault(); // 기본 폼 제출 동작 방지 - - try { - const response = await fetch("https://localhost:5000/api/ai", { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ content: inputValue }), // API에 JSON 데이터로 전송 - }); - - const result = await response.json(); - setResponseMessage(result); - } catch (error) { - console.error(error); - } - }; - - return ( -

-

- - -
- {responseMessage &&

{responseMessage}

} -

- ); -}