From 47b767c6ce5c86d4481b1a84508a01b7612aef24 Mon Sep 17 00:00:00 2001 From: skiende74 Date: Thu, 24 Oct 2024 14:05:37 +0900 Subject: [PATCH 1/7] =?UTF-8?q?feat:=20=EB=94=94=ED=8F=B4=ED=8A=B8?= =?UTF-8?q?=EB=B0=A9=EC=9D=B4=EB=A6=84=201=EB=B2=88=EC=A7=B8=EB=B0=A9?= =?UTF-8?q?=EB=B6=80=ED=84=B0=20=EC=8B=9C=EC=9E=91=ED=95=98=EA=B2=8C?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NewChecklist/NewRoomInfoForm/useDefaultRoomName.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/NewChecklist/NewRoomInfoForm/useDefaultRoomName.ts b/frontend/src/components/NewChecklist/NewRoomInfoForm/useDefaultRoomName.ts index 3517d2d8b..c139036d2 100644 --- a/frontend/src/components/NewChecklist/NewRoomInfoForm/useDefaultRoomName.ts +++ b/frontend/src/components/NewChecklist/NewRoomInfoForm/useDefaultRoomName.ts @@ -13,11 +13,13 @@ const useDefaultRoomName = () => { if (!checklistList) return; if (roomName.rawValue !== initialRoomInfo.roomName.rawValue) return; const count = checklistList.filter( - checklist => new Date(checklist.createdAt).getUTCDay() === new Date().getUTCDay(), + checklist => + new Date(checklist.createdAt).getUTCDay() === new Date().getUTCDay() && + checklist.roomName !== '예시용 체크리스트', ).length; const date = new Date(); - roomName.set(`${date.getMonth() + 1}월 ${date.getDate()}일 ${count}번째 방`); + roomName.set(`${date.getMonth() + 1}월 ${date.getDate()}일 ${count + 1}번째 방`); }, [checklistList]); }; From 2c9477749e2d4a2b4476617685482bf87ec9ce37 Mon Sep 17 00:00:00 2001 From: skiende74 Date: Thu, 24 Oct 2024 14:14:44 +0900 Subject: [PATCH 2/7] =?UTF-8?q?feat:=20roomInfoNonvalidated=EB=8F=84=20?= =?UTF-8?q?=EB=A1=9C=EC=BB=AC=EC=8A=A4=ED=86=A0=EB=A6=AC=EC=A7=80=20?= =?UTF-8?q?=EA=B4=80=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/store/roomInfoNonValidatedStore.ts | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/frontend/src/store/roomInfoNonValidatedStore.ts b/frontend/src/store/roomInfoNonValidatedStore.ts index 804f1de3a..7e9ded9f2 100644 --- a/frontend/src/store/roomInfoNonValidatedStore.ts +++ b/frontend/src/store/roomInfoNonValidatedStore.ts @@ -1,4 +1,5 @@ import { createStore } from 'zustand'; +import { persist } from 'zustand/middleware'; import { DEFAULT_POSITION } from '@/constants/map'; import { Position } from '@/types/address'; @@ -21,12 +22,23 @@ const defaultStates = { position: DEFAULT_POSITION, }; -const roomInfoNonValidatedStore = createStore()(set => ({ - ...defaultStates, - actions: { - set: (name, value) => set({ [name]: value }), - resetAll: () => set(defaultStates), - }, -})); +const roomInfoNonValidatedStore = createStore()( + persist( + set => ({ + ...defaultStates, + actions: { + set: (name, value) => set({ [name]: value }), + resetAll: () => set(defaultStates), + }, + }), + { + name: 'roomInfo-nonvalidated', + partialize: store => { + const { actions: _, ...state } = store; + return { ...state }; + }, + }, + ), +); export default roomInfoNonValidatedStore; From 2094e655cde5c3a5d3ef2e38d287356663c8d3d5 Mon Sep 17 00:00:00 2001 From: skiende74 Date: Thu, 24 Oct 2024 14:28:21 +0900 Subject: [PATCH 3/7] =?UTF-8?q?fix:=20=EB=AA=A8=EB=8B=AC=20=ED=8F=AC?= =?UTF-8?q?=EC=BB=A4=EC=8A=A4=ED=8A=B8=EB=9E=A9=EC=9C=BC=EB=A1=9C=EC=9D=B8?= =?UTF-8?q?=ED=95=B4=20=20=EC=9D=B8=ED=92=8B=20=ED=8F=AC=EC=BB=A4=EC=8A=A4?= =?UTF-8?q?=EC=95=88=EB=90=98=EB=8A=94=20=EB=B2=84=EA=B7=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/_common/Modal/Modal.tsx | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/frontend/src/components/_common/Modal/Modal.tsx b/frontend/src/components/_common/Modal/Modal.tsx index 521ca0775..683bb3f29 100644 --- a/frontend/src/components/_common/Modal/Modal.tsx +++ b/frontend/src/components/_common/Modal/Modal.tsx @@ -38,23 +38,26 @@ const Modal = ({ }: ModalProps) => { if (!modalRoot) return null; - return createPortal( - - - {hasDim && {}} hasDim={hasDim} />} - - - {children} - {hasCloseButton && ( - - - - )} - - - - , - modalRoot, + return ( + isOpen && + createPortal( + + + {hasDim && {}} hasDim={hasDim} />} + + + {children} + {hasCloseButton && ( + + + + )} + + + + , + modalRoot, + ) ); }; From 9862d7f32dff65ef4a3c62caa0c01f3562be5e59 Mon Sep 17 00:00:00 2001 From: skiende74 Date: Thu, 24 Oct 2024 14:47:54 +0900 Subject: [PATCH 4/7] =?UTF-8?q?feat:=20=EC=A2=8B=EC=95=84=EC=9A=94?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=20=ED=81=B4=EB=A6=AD=EC=8B=9C=20=ED=85=8C?= =?UTF-8?q?=EB=91=90=EB=A6=AC=20=EC=83=9D=EA=B8=B0=EB=8A=94=20=ED=98=84?= =?UTF-8?q?=EC=83=81=20=ED=95=B4=EA=B2=B0=20(=ED=83=AD=EC=9D=B8=EB=8D=B1?= =?UTF-8?q?=EC=8A=A4=EC=A0=9C=EA=B1=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/_common/Like/LikeButton.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/src/components/_common/Like/LikeButton.tsx b/frontend/src/components/_common/Like/LikeButton.tsx index 02045622a..c91c9c814 100644 --- a/frontend/src/components/_common/Like/LikeButton.tsx +++ b/frontend/src/components/_common/Like/LikeButton.tsx @@ -14,7 +14,7 @@ const LikeButton = ({ isLiked = false, checklistId }: Props) => { const [localIsLiked, setLocalIsLiked] = useState(isLiked); const { mutate: toggleLike, variables, isPending } = useToggleLikeQuery(); - const debouncedIsLiked = useDebounce({ value: localIsLiked, delay: 500 }); + const debouncedIsLiked = useDebounce({ value: localIsLiked, delay: 200 }); useEffect(() => { if (debouncedIsLiked !== isLiked) { @@ -41,7 +41,6 @@ const LikeButton = ({ isLiked = false, checklistId }: Props) => { onClick={handleClickLike} fill={fill ? theme.palette.red500 : 'NONE'} stroke={fill ? theme.palette.red500 : theme.palette.grey500} - tabIndex={1} aria-label="좋아요 버튼" /> ); From 51013cb7c7daa0548e680dbd4def29da51435eb9 Mon Sep 17 00:00:00 2001 From: skiende74 Date: Thu, 24 Oct 2024 15:09:48 +0900 Subject: [PATCH 5/7] =?UTF-8?q?feat:=20ga=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/routers/GoogleAnalytics.tsx | 9 --------- frontend/src/routers/router.tsx | 2 -- 2 files changed, 11 deletions(-) delete mode 100644 frontend/src/routers/GoogleAnalytics.tsx diff --git a/frontend/src/routers/GoogleAnalytics.tsx b/frontend/src/routers/GoogleAnalytics.tsx deleted file mode 100644 index 0f12178dc..000000000 --- a/frontend/src/routers/GoogleAnalytics.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import useGaTracker from '@/hooks/useGaTracker'; - -const GoogleAnalytics = () => { - useGaTracker(); - - return null; -}; - -export default GoogleAnalytics; diff --git a/frontend/src/routers/router.tsx b/frontend/src/routers/router.tsx index 42d51e2d9..e69ba7b22 100644 --- a/frontend/src/routers/router.tsx +++ b/frontend/src/routers/router.tsx @@ -5,7 +5,6 @@ import FooterLayout from '@/components/_common/layout/FooterLayout'; import { ROUTE_PATH } from '@/constants/routePath'; import SignInPage from '@/pages/SignInPage'; import SignUpPage from '@/pages/SignUpPage'; -import GoogleAnalytics from '@/routers/GoogleAnalytics'; const MainPage = React.lazy(() => import('@/pages/MainPage')); const ChecklistListPage = React.lazy(() => import('@/pages/ChecklistListPage')); @@ -24,7 +23,6 @@ const router = createBrowserRouter([ { element: ( - ), From 5d7b806fda54385b17a04d06c54535e566b86979 Mon Sep 17 00:00:00 2001 From: skiende74 Date: Thu, 24 Oct 2024 16:12:15 +0900 Subject: [PATCH 6/7] =?UTF-8?q?feat:=20put=EC=8B=9C=20V1=20API=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/apis/checklist.ts | 2 +- frontend/src/hooks/useTabs.ts | 2 +- frontend/src/types/category.ts | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/frontend/src/apis/checklist.ts b/frontend/src/apis/checklist.ts index 0d16a9c0b..94879fe5e 100644 --- a/frontend/src/apis/checklist.ts +++ b/frontend/src/apis/checklist.ts @@ -40,7 +40,7 @@ export const postChecklist = async (checklist: ChecklistPostForm) => { export const putChecklist = async (id: number, checklist: ChecklistPostForm) => { const mappedRoomInfo = roomInfoApiMapper(checklist.room); const mappedChecklist = { ...checklist, room: mappedRoomInfo }; - const response = await fetcher.put({ url: BASE_URL + ENDPOINT.CHECKLIST_ID(id), body: mappedChecklist }); + const response = await fetcher.put({ url: BASE_URL + ENDPOINT.CHECKLIST_ID_V1(id), body: mappedChecklist }); return response; }; diff --git a/frontend/src/hooks/useTabs.ts b/frontend/src/hooks/useTabs.ts index 71a3359a8..43421269c 100644 --- a/frontend/src/hooks/useTabs.ts +++ b/frontend/src/hooks/useTabs.ts @@ -9,7 +9,7 @@ const useTabs = () => { const getTabs = (categories: Category[]) => { return categories.map(category => ({ id: category.categoryId, - name: category.categoryName as string, + name: category.categoryName, className: findCategoryClassNameByName(category.categoryName), })) as Tab[]; }; diff --git a/frontend/src/types/category.ts b/frontend/src/types/category.ts index 397c5e721..df48b4b85 100644 --- a/frontend/src/types/category.ts +++ b/frontend/src/types/category.ts @@ -4,8 +4,3 @@ export interface Category { categoryId: number; categoryName: CategoryName; } - -// TODO: 방비교 추후를 위해.. -// export interface CategoryScore extends Category { -// score?: number; -// } From 9f4e97648ffcf8408717eead57e5c23b0ad04394 Mon Sep 17 00:00:00 2001 From: skiende74 Date: Thu, 24 Oct 2024 16:37:54 +0900 Subject: [PATCH 7/7] =?UTF-8?q?feat:=20V1=20=EB=B3=80=EA=B2=BD=EC=82=AC?= =?UTF-8?q?=ED=95=AD=EC=97=90=EB=94=B0=EB=9D=BC=20station=EC=9D=84=20?= =?UTF-8?q?=EC=97=86=EC=95=A0=EA=B3=A0=20=EB=B3=B4=EB=83=84.=20&=20?= =?UTF-8?q?=EA=B3=84=EC=95=BD=EA=B8=B0=EA=B0=84=20=EC=B5=9C=EB=8C=80=20100?= =?UTF-8?q?00=EA=B0=9C=EC=9B=94=EB=A1=9C=EC=A0=9C=ED=95=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/hooks/useRoomInfoValidated.ts | 2 +- frontend/src/store/roomInfoStore.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/hooks/useRoomInfoValidated.ts b/frontend/src/hooks/useRoomInfoValidated.ts index 7c0c1c152..d5d8482af 100644 --- a/frontend/src/hooks/useRoomInfoValidated.ts +++ b/frontend/src/hooks/useRoomInfoValidated.ts @@ -19,7 +19,7 @@ const validators: Record = { deposit: [isNumericValidator, nonNegativeValidator], rent: [isNumericValidator, nonNegativeValidator], maintenanceFee: [isNumericValidator, nonNegativeValidator], - contractTerm: [isNumericValidator, nonNegativeValidator], + contractTerm: [isNumericValidator, nonNegativeValidator, inRangeValidator(0, 10000)], type: [], size: [isNumericValidator], floor: [isIntegerValidator, positiveValidator], diff --git a/frontend/src/store/roomInfoStore.ts b/frontend/src/store/roomInfoStore.ts index e3dcd0b2a..ac02ed039 100644 --- a/frontend/src/store/roomInfoStore.ts +++ b/frontend/src/store/roomInfoStore.ts @@ -113,7 +113,9 @@ export const roomInfoApiMapper = (values: Partial) => { occupancyMonth: values.occupancyMonth === 0 ? undefined : values.occupancyMonth, }; - return mapObjUndefinedToNull(result) as Nullable>; + const { station: _, ...resultToSubmit } = result; + + return mapObjUndefinedToNull(resultToSubmit) as Nullable>; }; export default roomInfoStore;