From 57329b50a2f6517ee655612476d1e2f2b5fb4880 Mon Sep 17 00:00:00 2001 From: J1min Date: Thu, 16 Mar 2023 14:25:50 +0900 Subject: [PATCH 01/79] =?UTF-8?q?Fix:=20=ED=8F=AC=ED=8A=B8=ED=8F=B4?= =?UTF-8?q?=EB=A6=AC=EC=98=A4=20=EC=88=98=EC=A0=95=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/portfolio/edit/index.tsx | 18 +++++++++++++++--- utils/file.ts | 4 ++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/components/portfolio/edit/index.tsx b/components/portfolio/edit/index.tsx index 6d8f624c..f2d11d2b 100644 --- a/components/portfolio/edit/index.tsx +++ b/components/portfolio/edit/index.tsx @@ -56,7 +56,7 @@ export default function PortfolioEdit({ portfolioId }: PortfolioEditProps) { if (editVideoFile) return getFileUidByFileUpload(editVideoFile, openToast); if (videoFileUid && !editVideoFile) return videoFileUid; - return undefined; + return "299ae74e-dbda-4def-a3b0-0939aadd997c.mp4"; }; const getThumbnailFileUid = () => { @@ -72,8 +72,20 @@ export default function PortfolioEdit({ portfolioId }: PortfolioEditProps) { portfolioType: getPortfolioType(), skillList: selectedSkills, contributorIdList: selectedMembers.map((member) => member.memberId), - videoFileUid: await getVideoFileUid(), - thumbnailFileUid: await getThumbnailFileUid(), + videoFileUid: (await getVideoFileUid()) || undefined, + thumbnailFileUid: (await getThumbnailFileUid()) || "ㅇㅇㅇ", + video: undefined, + thumbnail: undefined, + writer: undefined, + scope: undefined, + contributorList: undefined, + bookmarks: undefined, + bookmarkYn: undefined, + followYn: undefined, + views: undefined, + comments: undefined, + recommendStatus: undefined, + createdDate: undefined, }) .then(() => { openToast("수정이 완료되었습니다."); diff --git a/utils/file.ts b/utils/file.ts index 38d194e4..5b6edd14 100644 --- a/utils/file.ts +++ b/utils/file.ts @@ -19,9 +19,9 @@ export const getFileUidByFileUpload = async ( ) => { return httpClient.file .upload(getFormData(file)) - .then(({ data }) => { + .then((r) => { openToast("파일 업로드에 성공하였습니다."); - return data.fileUid; + return r.data.fileUid; }) .catch(() => openToast("파일 업로드에 실패하였습니다.", { type: "danger" }), From f1b5adc950af5adcdcdee427ce2581a57be04322 Mon Sep 17 00:00:00 2001 From: J1min Date: Thu, 16 Mar 2023 14:37:12 +0900 Subject: [PATCH 02/79] =?UTF-8?q?Fix:=20=EC=88=98=EC=A0=95=EC=8B=9C=20port?= =?UTF-8?q?folioType=20=20=EC=A0=95=EC=9D=98=ED=95=98=EB=8A=94=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/portfolio/edit/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/portfolio/edit/index.tsx b/components/portfolio/edit/index.tsx index f2d11d2b..6ccdda8c 100644 --- a/components/portfolio/edit/index.tsx +++ b/components/portfolio/edit/index.tsx @@ -43,7 +43,7 @@ export default function PortfolioEdit({ portfolioId }: PortfolioEditProps) { const onValid: SubmitHandler = async (data) => { const getPortfolioType = (): PortfolioType => { - if (data.portfolioUrl.length > 0 && videoFileUid) { + if (data.portfolioUrl.length > 0 && (videoFileUid || editVideoFile)) { return "ALL"; } if (videoFileUid) { From 078c3be50793f763dcb61fb709f954651a3f0a24 Mon Sep 17 00:00:00 2001 From: J1min Date: Thu, 16 Mar 2023 17:08:58 +0900 Subject: [PATCH 03/79] =?UTF-8?q?Fix:=20=EA=B8=B0=EB=B3=B8=20=EB=8F=99?= =?UTF-8?q?=EC=98=81=EC=83=81=EC=9D=B4=20=EC=B6=94=EA=B0=80=EB=90=98?= =?UTF-8?q?=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/portfolio/edit/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/portfolio/edit/index.tsx b/components/portfolio/edit/index.tsx index 6ccdda8c..985ad8f5 100644 --- a/components/portfolio/edit/index.tsx +++ b/components/portfolio/edit/index.tsx @@ -56,7 +56,7 @@ export default function PortfolioEdit({ portfolioId }: PortfolioEditProps) { if (editVideoFile) return getFileUidByFileUpload(editVideoFile, openToast); if (videoFileUid && !editVideoFile) return videoFileUid; - return "299ae74e-dbda-4def-a3b0-0939aadd997c.mp4"; + return undefined; }; const getThumbnailFileUid = () => { From 118e629bc5241cee112a8bf0b00796d3ff0387bc Mon Sep 17 00:00:00 2001 From: J1min Date: Thu, 16 Mar 2023 17:33:55 +0900 Subject: [PATCH 04/79] =?UTF-8?q?Fix:=20=EC=BC=80=EB=B0=A5=EB=A9=94?= =?UTF-8?q?=EB=89=B4=20=ED=8C=9D=EC=97=85=EC=8B=9C=20=EC=BC=80=EB=B0=A5?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=EC=9D=B4=20=EC=95=88=EA=B0=80=EB=A0=A4?= =?UTF-8?q?=EC=A7=80=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/atoms/CommentContent.tsx | 2 +- components/common/KebabMenu.tsx | 8 ++++---- components/portfolio/edit/index.tsx | 23 ++++------------------- 3 files changed, 9 insertions(+), 24 deletions(-) diff --git a/components/atoms/CommentContent.tsx b/components/atoms/CommentContent.tsx index 326f7b55..d3d88164 100644 --- a/components/atoms/CommentContent.tsx +++ b/components/atoms/CommentContent.tsx @@ -123,7 +123,7 @@ export default function CommentContent({ {comment.deletable && !isEdit && ( - + {comment.editable && ( - + {isOpen && children} ); @@ -33,7 +33,7 @@ function Menu({ children, className = "" }: KebabMenuProps) { return (
    @@ -46,7 +46,7 @@ function Item({ children, className = "", onClick }: KebabItemProps) { return (
  • diff --git a/components/portfolio/edit/index.tsx b/components/portfolio/edit/index.tsx index 985ad8f5..da10fd14 100644 --- a/components/portfolio/edit/index.tsx +++ b/components/portfolio/edit/index.tsx @@ -43,12 +43,9 @@ export default function PortfolioEdit({ portfolioId }: PortfolioEditProps) { const onValid: SubmitHandler = async (data) => { const getPortfolioType = (): PortfolioType => { - if (data.portfolioUrl.length > 0 && (videoFileUid || editVideoFile)) { + if (data.portfolioUrl.length > 0 && (videoFileUid || editVideoFile)) return "ALL"; - } - if (videoFileUid) { - return "VIDEO"; - } + if (videoFileUid) return "VIDEO"; return "URL"; }; @@ -72,20 +69,8 @@ export default function PortfolioEdit({ portfolioId }: PortfolioEditProps) { portfolioType: getPortfolioType(), skillList: selectedSkills, contributorIdList: selectedMembers.map((member) => member.memberId), - videoFileUid: (await getVideoFileUid()) || undefined, - thumbnailFileUid: (await getThumbnailFileUid()) || "ㅇㅇㅇ", - video: undefined, - thumbnail: undefined, - writer: undefined, - scope: undefined, - contributorList: undefined, - bookmarks: undefined, - bookmarkYn: undefined, - followYn: undefined, - views: undefined, - comments: undefined, - recommendStatus: undefined, - createdDate: undefined, + videoFileUid: await getVideoFileUid(), + thumbnailFileUid: await getThumbnailFileUid(), }) .then(() => { openToast("수정이 완료되었습니다."); From 64943bf07be4ae032ed32e3d9db90f7fedf3253c Mon Sep 17 00:00:00 2001 From: J1min Date: Fri, 17 Mar 2023 08:25:59 +0900 Subject: [PATCH 05/79] Refactor: useUser hooks --- hooks/useUser.tsx | 9 +++++---- models/key/index.ts | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hooks/useUser.tsx b/hooks/useUser.tsx index c867ad87..96f09c15 100644 --- a/hooks/useUser.tsx +++ b/hooks/useUser.tsx @@ -1,4 +1,5 @@ import httpClient, { HttpClient } from "@/apis/httpClient"; +import KEY from "@/models/key"; import { Storage } from "@/models/storage"; import { emptyUser, userState } from "@/store"; import { Member } from "@/types/member.interface"; @@ -18,9 +19,9 @@ const useUser = (options?: UseUserOptions) => { const { data: userInfo, remove, - isFetching, + isLoading, } = useQuery( - ["get userData"], + [KEY.USER], async () => { HttpClient.setAccessToken(); return httpClient.member.self().then((r) => r.data); @@ -39,7 +40,7 @@ const useUser = (options?: UseUserOptions) => { }, [router.query, setUser, userInfo]); useEffect(() => { - if (options?.authorizedPage && !isFetching && !userInfo && !visible) { + if (options?.authorizedPage && !isLoading && !userInfo && !visible) { openModal({ title: "로그인", content: ( @@ -52,7 +53,7 @@ const useUser = (options?: UseUserOptions) => { }, }); } - }, [options, userInfo, isFetching, router, visible, openModal]); + }, [options, userInfo, isLoading, router, visible, openModal]); useEffect(() => { if ( diff --git a/models/key/index.ts b/models/key/index.ts index 44347600..ac2ea922 100644 --- a/models/key/index.ts +++ b/models/key/index.ts @@ -7,6 +7,7 @@ const KEY = { SKILL: "useSkill", COMMENT: "useCommentList", MEMBER: "useMember", + USER: "useUser", }; export default KEY; From 39a7099cb4b243b4fd06eb7b1a075d5d8c67bb68 Mon Sep 17 00:00:00 2001 From: J1min Date: Sat, 18 Mar 2023 10:13:33 +0900 Subject: [PATCH 06/79] =?UTF-8?q?Fix:=20getPortfolioType=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/portfolio/edit/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/portfolio/edit/index.tsx b/components/portfolio/edit/index.tsx index da10fd14..bad0d066 100644 --- a/components/portfolio/edit/index.tsx +++ b/components/portfolio/edit/index.tsx @@ -45,8 +45,8 @@ export default function PortfolioEdit({ portfolioId }: PortfolioEditProps) { const getPortfolioType = (): PortfolioType => { if (data.portfolioUrl.length > 0 && (videoFileUid || editVideoFile)) return "ALL"; - if (videoFileUid) return "VIDEO"; - return "URL"; + if (data.portfolioUrl.length > 0) return "URL"; + return "VIDEO"; }; const getVideoFileUid = () => { From 77086b34c62ba5c728bb5b531264185862ffc5f1 Mon Sep 17 00:00:00 2001 From: J1min Date: Sat, 18 Mar 2023 10:28:05 +0900 Subject: [PATCH 07/79] Feat: add filter type --- types/portfolio.interface.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/types/portfolio.interface.ts b/types/portfolio.interface.ts index c36cb131..b99bbbc1 100644 --- a/types/portfolio.interface.ts +++ b/types/portfolio.interface.ts @@ -82,15 +82,26 @@ export type SortType = | "VIEWS" | "ALL"; export type SortDirectionType = "ASC" | "DESC"; -export type SchoolGradeType = 1 | 2 | 3; +export type SchoolGradeType = 0 | 1 | 2 | 3; +export type PortfolioThemeType = "WEB" | "APP" | "EMBEDDED" | "ROBOT"; +export type SearchType = + | "TITLE" + | "THEME" + | "CREATOR" + | "CONTRIBUTOR" + | "CREATOR_AND_CONTRIBUTOR "; + export interface Filter { search?: string; + searchType?: SearchType; uploadDateType?: UploadDateType; schoolGrade?: SchoolGradeType; + portfolioThemeType?: PortfolioThemeType; sortType?: SortType; sortDirectionType?: SortDirectionType; recommendStatus?: RecommendStatus; } + export type SearchFilterPropertyType = | "uploadDateType" | "schoolGrade" From a8975a04414240d68142c27d106bcc5149b68c60 Mon Sep 17 00:00:00 2001 From: J1min Date: Sat, 18 Mar 2023 13:39:04 +0900 Subject: [PATCH 08/79] =?UTF-8?q?Feat:=20403=20=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80,=20=EB=B2=84=ED=8A=BC=20padding=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/403.tsx | 19 +++++++++++++++++++ pages/404.tsx | 2 +- pages/500.tsx | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 pages/403.tsx diff --git a/pages/403.tsx b/pages/403.tsx new file mode 100644 index 00000000..5ef4f27b --- /dev/null +++ b/pages/403.tsx @@ -0,0 +1,19 @@ +import Button from "@/components/atoms/Button"; +import { useRouter } from "next/router"; + +export default function Page500() { + const router = useRouter(); + return ( +
    +

    + 비공개 포트폴리오입니다. +

    + +
    + ); +} diff --git a/pages/404.tsx b/pages/404.tsx index 3f203114..8c99ad0a 100644 --- a/pages/404.tsx +++ b/pages/404.tsx @@ -12,7 +12,7 @@ export default function Page404() {

    죄송합니다. 페이지를 찾을 수 없습니다.

    이 페이지는 삭제되었거나 URL이 변경되었을 수 있습니다.