From 05f00337dfd8966311d928d8a411ac514cd6a033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=98=84=EC=84=B1=ED=95=84?= Date: Sat, 25 Jan 2025 20:20:58 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=95=84=EC=9B=83=20?= =?UTF-8?q?=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/MainContentArea.jsx | 61 ++++++------ .../components/api-tester/APINavigation.jsx | 4 +- .../api-tester/DraggableApiItem.jsx | 98 +++++++++++++------ .../components/api-tester/ScenarioMenuBar.jsx | 4 + .../api-tester/ScenarioNavigation.jsx | 4 +- .../client-views/HTTPClientView.jsx | 54 +++++++--- TestMasterUI/src/hooks/useAPITester.js | 0 TestMasterUI/src/hooks/useLoadTester.js | 0 8 files changed, 147 insertions(+), 78 deletions(-) delete mode 100644 TestMasterUI/src/hooks/useAPITester.js delete mode 100644 TestMasterUI/src/hooks/useLoadTester.js diff --git a/TestMasterUI/src/components/MainContentArea.jsx b/TestMasterUI/src/components/MainContentArea.jsx index 6ebb599..ff280ec 100644 --- a/TestMasterUI/src/components/MainContentArea.jsx +++ b/TestMasterUI/src/components/MainContentArea.jsx @@ -4,6 +4,7 @@ import APITabs from '@/components/api-tester/APITabs'; import {useAPI} from '@/providers/APIProvider.jsx'; import ScenarioNavigation from '@/components/api-tester/ScenarioNavigation.jsx'; import ScenarioEditor from '@/components/api-tester/ScenarioEditor.jsx'; +import {SidebarProvider} from '@/components/ui/sidebar.jsx'; const MainContentArea = ({isApiMode, toggleMode}) => { // Lift tab state up @@ -117,9 +118,9 @@ const APIMode = ({ ); return ( -
-
- {/* APINavigation 고정 */} + +
+
-
+
{apiRequests.length === 0 ? ( renderFallback() // Render fallback when no tabs exist ) : ( @@ -145,40 +146,44 @@ const APIMode = ({ )}
+ ); }; // 시나리오 모드 const ScenarioMode = ({ isApiMode, - onToggleMode, + onToggleMode }) => { - let handleApiSelect = () => {}; + let handleApiSelect = () => { + }; return ( -
-
- + +
+
+ +
+
+ +
+
+ +
-
- -
-
- -
-
+ ); }; - export default MainContentArea; +export default MainContentArea; diff --git a/TestMasterUI/src/components/api-tester/APINavigation.jsx b/TestMasterUI/src/components/api-tester/APINavigation.jsx index acc5a92..9de651b 100644 --- a/TestMasterUI/src/components/api-tester/APINavigation.jsx +++ b/TestMasterUI/src/components/api-tester/APINavigation.jsx @@ -250,7 +250,7 @@ const APINavigation = ({ }; return ( - + <> {side === 'left' && ( @@ -300,7 +300,7 @@ const APINavigation = ({ onSubmit={handleRenameApi} api={apiToRename} /> - + ); }; diff --git a/TestMasterUI/src/components/api-tester/DraggableApiItem.jsx b/TestMasterUI/src/components/api-tester/DraggableApiItem.jsx index 6d6c67e..d558c47 100644 --- a/TestMasterUI/src/components/api-tester/DraggableApiItem.jsx +++ b/TestMasterUI/src/components/api-tester/DraggableApiItem.jsx @@ -69,28 +69,58 @@ const DraggableApiItem = ({ api, collectionId, onApiAction }) => { draggable onDragStart={handleDragStart} onDragEnd={handleDragEnd} - className={`cursor-move transition-colors duration-200 ${ - isDragging ? 'opacity-50 bg-accent' : '' - }`} + className={`cursor-move transition-colors duration-200 ${isDragging ? 'opacity-50 bg-accent' : ''}`} > - { - // Prevent click when dragging ends - if (!isDragging) { - onApiAction.open(collectionId, api.id); - } - }} - className="w-full justify-start gap-2" - asChild - > -
+ {/* {*/} + {/* // Prevent click when dragging ends*/} + {/* if (!isDragging) {*/} + {/* onApiAction.open(collectionId, api.id);*/} + {/* }*/} + {/* }}*/} + {/* className="w-full justify-start gap-2"*/} + {/* asChild*/} + {/*>*/} + {/*
*/} + {/* */} + {/* */} + {/* */} + {/* */} + {/* {api.method && {api.method} }*/} + {/* {api.name}*/} + {/* */} + {/* */} + {/* */} + {/*
*/} + {/*

{api.name}

*/} + {/* {api.path &&

{api.path}

}*/} + {/*
*/} + {/*
*/} + {/*
*/} + {/* e.stopPropagation()}*/} + {/* >*/} + {/* onApiAction.open(collectionId, api.id)}*/} + {/* onRename={() => onApiAction.rename(collectionId, api.id)}*/} + {/* onDelete={() => onApiAction.delete(collectionId, api.id)}*/} + {/* />*/} + {/* */} + {/*
*/} + {/**/} +
+
!isDragging && onApiAction.open(collectionId, api.id)} + className="flex items-center gap-2 flex-1 min-w-0 cursor-pointer" + > - - {api.method && {api.method} } - {api.name} - + + {api.method && {api.method} } + {api.name} +
@@ -99,18 +129,28 @@ const DraggableApiItem = ({ api, collectionId, onApiAction }) => {
- e.stopPropagation()} - > - onApiAction.open(collectionId, api.id)} - onRename={() => onApiAction.rename(collectionId, api.id)} - onDelete={() => onApiAction.delete(collectionId, api.id)} - /> -
- + + + +
+ +
+
+ + onApiAction.open(collectionId, api.id)}> + Open + + + onApiAction.rename(collectionId, api.id)}> + Rename + + onApiAction.delete(collectionId, api.id)}> + Delete + + +
+
); }; diff --git a/TestMasterUI/src/components/api-tester/ScenarioMenuBar.jsx b/TestMasterUI/src/components/api-tester/ScenarioMenuBar.jsx index 5d6f9b5..cc7af09 100644 --- a/TestMasterUI/src/components/api-tester/ScenarioMenuBar.jsx +++ b/TestMasterUI/src/components/api-tester/ScenarioMenuBar.jsx @@ -1,10 +1,14 @@ import {Button} from '@/components/ui/button.jsx'; import {Pause, Play, RotateCcw, Save, SkipForward} from 'lucide-react'; import React from 'react'; +import {SidebarTrigger} from '@/components/ui/sidebar.jsx'; +import {Separator} from '@/components/ui/separator.jsx'; const ScenarioMenuBar = ({ onSave, onStepRun, onFullRun, onPause, onReset }) => { return (
+ + - +
+ +
+ +
+ +
+
+ + +
{/* Request/Response Container */} diff --git a/TestMasterUI/src/hooks/useAPITester.js b/TestMasterUI/src/hooks/useAPITester.js deleted file mode 100644 index e69de29..0000000 diff --git a/TestMasterUI/src/hooks/useLoadTester.js b/TestMasterUI/src/hooks/useLoadTester.js deleted file mode 100644 index e69de29..0000000