From d86fa2542a74afd5a77542326e6f8c65edf97c6a Mon Sep 17 00:00:00 2001 From: llddang Date: Wed, 11 Dec 2024 17:22:01 +0900 Subject: [PATCH 01/11] =?UTF-8?q?feat:=20=ED=81=B4=EB=9D=BC=EC=9D=B4?= =?UTF-8?q?=EC=96=B8=ED=8A=B8=EC=9D=98=20=ED=97=A4=EB=8D=94=EC=97=90?= =?UTF-8?q?=EC=84=9C=20'=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0=20?= =?UTF-8?q?=EA=B2=BD=EC=A7=84=EB=8C=80=ED=9A=8C'=EB=A5=BC=20'=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=ED=95=B4=EA=B2=B0=20=EA=B2=BD=EC=A7=84=EB=8C=80?= =?UTF-8?q?=ED=9A=8C'=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #232 --- frontend/src/app/(client)/hackathon/sw-contest/page.tsx | 2 +- frontend/src/data/clientCategory.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/(client)/hackathon/sw-contest/page.tsx b/frontend/src/app/(client)/hackathon/sw-contest/page.tsx index dd5bdb0b..af808783 100644 --- a/frontend/src/app/(client)/hackathon/sw-contest/page.tsx +++ b/frontend/src/app/(client)/hackathon/sw-contest/page.tsx @@ -3,7 +3,7 @@ import PageTitle from '@/components/common/PageTitle'; const Page = () => { return (
- +
개발 중인 기능입니다.
diff --git a/frontend/src/data/clientCategory.ts b/frontend/src/data/clientCategory.ts index 8bfebb47..35aaa357 100644 --- a/frontend/src/data/clientCategory.ts +++ b/frontend/src/data/clientCategory.ts @@ -22,7 +22,7 @@ export const headerInfos: CategoryDto[] = [ inHeader: true, sub: [ { title: '창의융합SW해커톤', url: '/hackathon', key: 'SWHackathon' }, - { title: 'SW문제 해결 경진대회', url: '/hackathon/sw-contest', key: 'problemContest' }, + { title: 'SW문제해결 경진대회', url: '/hackathon/sw-contest', key: 'problemContest' }, ], }, { From 5819b67994758bc2948615cc242453ccd8ac897f Mon Sep 17 00:00:00 2001 From: llddang Date: Wed, 11 Dec 2024 17:22:24 +0900 Subject: [PATCH 02/11] =?UTF-8?q?refactor:=20=EB=8C=80=ED=9A=8C=20?= =?UTF-8?q?=EB=93=B1=EB=A1=9D=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EB=A6=AC?= =?UTF-8?q?=ED=8E=99=ED=86=A0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #232 --- .../src/app/admin/hackathon/register/page.tsx | 19 ++++++++----------- frontend/src/types/common.dto.ts | 2 +- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/frontend/src/app/admin/hackathon/register/page.tsx b/frontend/src/app/admin/hackathon/register/page.tsx index b6010a47..964bdc86 100644 --- a/frontend/src/app/admin/hackathon/register/page.tsx +++ b/frontend/src/app/admin/hackathon/register/page.tsx @@ -1,28 +1,25 @@ 'use client'; -import { useState } from 'react'; import * as Yup from 'yup'; import { Form, Formik } from 'formik'; import PageTitle from '@/components/common/PageTitle'; -import { HackathonDto } from '@/types/common.dto'; import TextInput from '@/components/common/formik/TextInput'; +import ImageUploader from '@/components/common/formik/ImageUploader'; +import { DatePicker } from '@/components/common/formik/DatePicker'; +import MarkdownEditor from '@/components/common/formik/MarkdownEditor'; import AdminHackathonInputSection from '@/components/ui/admin/hackathon/AdminHackathonInputSection'; import { MdImage } from '@react-icons/all-files/md/MdImage'; -import ImageUploader from '@/components/common/formik/ImageUploader'; import { MdTextFields } from '@react-icons/all-files/md/MdTextFields'; import { MdDateRange } from '@react-icons/all-files/md/MdDateRange'; -import MarkdownEditor from '@/components/common/formik/MarkdownEditor'; -import { DatePicker } from '@/components/common/formik/DatePicker'; +import { HackathonDto } from '@/types/common.dto'; export default function HackathonCreatePage() { - const [hackathonInfo, setHackathonInfo] = useState(hackathonInfoInitialValue); - return (
{ setSubmitting(false); @@ -37,10 +34,10 @@ export default function HackathonCreatePage() { inputElement={ } @@ -161,7 +158,7 @@ export default function HackathonCreatePage() { export type HackathonInfo = Omit & { bannerImage: File | null }; const hackathonInfoInitialValue: HackathonInfo = { - name: '', + title: '', content: '', bannerImage: null, applyStartDate: '', diff --git a/frontend/src/types/common.dto.ts b/frontend/src/types/common.dto.ts index 52e12b20..149ce4c7 100644 --- a/frontend/src/types/common.dto.ts +++ b/frontend/src/types/common.dto.ts @@ -171,7 +171,7 @@ interface StudentMemberReferenceDto { export interface HackathonDto { id: number; - name: string; + title: string; content: string; bannerImage: string; applyStartDate: string; From d28e135d18bd547da84a3d21de20dba9f55ae8ab Mon Sep 17 00:00:00 2001 From: llddang Date: Wed, 11 Dec 2024 17:22:41 +0900 Subject: [PATCH 03/11] =?UTF-8?q?feat:=20=ED=95=B4=EC=BB=A4=ED=86=A4=20?= =?UTF-8?q?=EA=B4=80=EB=A6=AC=20=ED=83=80=EC=9E=85=20=EC=A0=95=EC=9D=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #232 --- frontend/src/types/common.dto.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/types/common.dto.ts b/frontend/src/types/common.dto.ts index 149ce4c7..3481e195 100644 --- a/frontend/src/types/common.dto.ts +++ b/frontend/src/types/common.dto.ts @@ -181,6 +181,11 @@ export interface HackathonDto { teamCode: string; } +export interface HackathonManageDto + extends Omit { + isActive: boolean; +} + export type HackathonInformationDto = Omit; export type HackathonOverviewDto = Omit; From 0337661fa29ec1ae4e280440410cd3fcf6d5184e Mon Sep 17 00:00:00 2001 From: llddang Date: Wed, 11 Dec 2024 17:23:06 +0900 Subject: [PATCH 04/11] =?UTF-8?q?feat:=20=EB=93=9C=EB=A1=AD=20=EB=B0=95?= =?UTF-8?q?=EC=8A=A4=20focus=20out=20=EB=90=98=EC=97=88=EC=9D=84=20?= =?UTF-8?q?=EB=95=8C,=20=EB=8B=AB=ED=9E=88=EB=8F=84=EB=A1=9D=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 #232 --- frontend/src/components/common/formik/Dropdown.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/src/components/common/formik/Dropdown.tsx b/frontend/src/components/common/formik/Dropdown.tsx index f793b18d..5724a6da 100644 --- a/frontend/src/components/common/formik/Dropdown.tsx +++ b/frontend/src/components/common/formik/Dropdown.tsx @@ -43,6 +43,9 @@ const Dropdown = ({ isRequired = false, size = 'md', ...props }: DropdownProps) + + )} + +
+ ); +} + +interface AdminHackathonSearchBoxField { + status: number; + keyword: string; +} + +const adminHackathonSearchField = [ + { id: 1, name: '전체' }, + { id: 2, name: '진행중' }, + { id: 3, name: '종료' }, +]; From 64f1e908b5e4363e65f6b2eaa51c5f7516fa97e9 Mon Sep 17 00:00:00 2001 From: llddang Date: Wed, 11 Dec 2024 17:23:52 +0900 Subject: [PATCH 06/11] =?UTF-8?q?feat:=20=ED=95=B4=EC=BB=A4=ED=86=A4=20?= =?UTF-8?q?=ED=85=8C=EC=9D=B4=EB=B8=94=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=20=EB=93=B1=EB=A1=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #232 --- .../hackathon/AdminHackathonManageTable.tsx | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 frontend/src/components/ui/admin/hackathon/AdminHackathonManageTable.tsx diff --git a/frontend/src/components/ui/admin/hackathon/AdminHackathonManageTable.tsx b/frontend/src/components/ui/admin/hackathon/AdminHackathonManageTable.tsx new file mode 100644 index 00000000..460a4453 --- /dev/null +++ b/frontend/src/components/ui/admin/hackathon/AdminHackathonManageTable.tsx @@ -0,0 +1,113 @@ +'use client'; + +import { HackathonManageDto } from '@/types/common.dto'; +import { MdDeleteForever } from '@react-icons/all-files/md/MdDeleteForever'; +import { MdFileDownload } from '@react-icons/all-files/md/MdFileDownload'; +import { MdEdit } from '@react-icons/all-files/md/MdEdit'; +import { useEffect, useState } from 'react'; +import { useRouter } from 'next/navigation'; + +export interface AdminHackathonManageTableProps { + hackathonInfos: HackathonManageDto[]; +} + +export default function AdminHackathonManageTable({ hackathonInfos }: AdminHackathonManageTableProps) { + const [hackathons, setHackathon] = useState([]); + const router = useRouter(); + + function handleActiveStatusClick(hackathonId: number) { + console.log(hackathonId); + // TODO: API 연결 + setHackathon((prev) => + prev.map((hackathon) => + hackathon.id === hackathonId ? { ...hackathon, isActive: !hackathon.isActive } : hackathon, + ), + ); + } + + function handleEditContestClick(hackathonId: number) { + router.push(`/admin/hackathon/${hackathonId}`); + } + + function handleDeleteContestClick(selectedHackathon: HackathonManageDto) { + const willDelete = window.confirm(selectedHackathon.title + '을/를 정말 삭제하겠습니까?'); + if (!willDelete) return; + + // TODO: API 연결 + setHackathon((prev) => + prev.map((hackathon) => (hackathon.id === selectedHackathon.id ? null : hackathon)).filter((v) => v !== null), + ); + } + + function handleDownloadVoteResultClick(hackathonId: number) { + // TODO: API 연결 + console.log(hackathonId, 'clicked'); + } + + useEffect(() => { + setHackathon(hackathonInfos); + }, [hackathonInfos, setHackathon]); + + return ( + + + + + + + + + + + + + + {hackathons.map((hackathon) => { + return ( + + + + + + + + + + ); + })} + +
대회ID대회명대회기간활성 여부대회 수정대회 삭제투표 결과
{hackathon.id}{hackathon.title} + {hackathon.hackathonStartDate} ~ {hackathon.hackathonEndDate} + + + + + + + + +
+ ); +} From 66bdf061f35e2c3cb00ae50e0eac639006c4a764 Mon Sep 17 00:00:00 2001 From: llddang Date: Wed, 11 Dec 2024 17:24:25 +0900 Subject: [PATCH 07/11] =?UTF-8?q?feat:=20=ED=95=B4=EC=BB=A4=ED=86=A4=20?= =?UTF-8?q?=EA=B4=80=EB=A6=AC=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #232 --- frontend/src/app/admin/hackathon/page.tsx | 46 ++++++++++++++++++++++- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/admin/hackathon/page.tsx b/frontend/src/app/admin/hackathon/page.tsx index a42d4efe..be414079 100644 --- a/frontend/src/app/admin/hackathon/page.tsx +++ b/frontend/src/app/admin/hackathon/page.tsx @@ -1,7 +1,49 @@ -export default function ContestListPage() { +import PageTitle from '@/components/common/PageTitle'; +import AdminHackathonManageTable from '@/components/ui/admin/hackathon/AdminHackathonManageTable'; +import AdminHackathonSearchBox from '@/components/ui/admin/hackathon/AdminHackathonSearchBox'; +import { getAuthFromCookie } from '@/lib/utils/auth'; +import { AuthSliceState } from '@/store/auth.slice'; +import { HackathonManageDto } from '@/types/common.dto'; +import { headers } from 'next/headers'; + +export interface HackathonListPageProps { + searchParams?: { [key: string]: string | undefined }; +} + +export default function HackathonListPage({ searchParams }: HackathonListPageProps) { + const headersList = headers(); + const pathname = headersList.get('x-pathname') || ''; + + const auth: AuthSliceState = getAuthFromCookie(); + + const page = searchParams?.page ? parseInt(searchParams.page, 10) : 1; + const keyword = searchParams?.keyword ? searchParams.keyword : ''; + + // TODO: api 연결 + const hackathonInfos: HackathonManageDto[] = [ + { + id: 1, + title: '제 8회 2024-2 PNU SW+X 문제해결 경진대회', + hackathonStartDate: '2024-09-01', + hackathonEndDate: '2024-12-01', + teamCode: '1234', + isActive: false, + }, + { + id: 2, + title: '제 7회 2024-2 PNU SW+X 문제해결 경진대회', + hackathonStartDate: '2024-09-01', + hackathonEndDate: '2024-12-01', + teamCode: '1234', + isActive: false, + }, + ]; + return (
-
개발 중인 기능입니다.
+ + +
); } From d644ae6f9ea84656220af5d0c30bf572dd79e4e1 Mon Sep 17 00:00:00 2001 From: llddang Date: Wed, 11 Dec 2024 17:25:54 +0900 Subject: [PATCH 08/11] =?UTF-8?q?refactor:=20import=20=EA=B5=AC=EB=AC=B8?= =?UTF-8?q?=20=EC=88=9C=EC=84=9C=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #232 --- frontend/src/app/admin/hackathon/page.tsx | 6 ++++-- .../ui/admin/hackathon/AdminHackathonManageTable.tsx | 8 +++++--- .../ui/admin/hackathon/AdminHackathonSearchBox.tsx | 5 +++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/admin/hackathon/page.tsx b/frontend/src/app/admin/hackathon/page.tsx index be414079..bc495485 100644 --- a/frontend/src/app/admin/hackathon/page.tsx +++ b/frontend/src/app/admin/hackathon/page.tsx @@ -1,10 +1,12 @@ +import { headers } from 'next/headers'; + import PageTitle from '@/components/common/PageTitle'; import AdminHackathonManageTable from '@/components/ui/admin/hackathon/AdminHackathonManageTable'; import AdminHackathonSearchBox from '@/components/ui/admin/hackathon/AdminHackathonSearchBox'; + +import { HackathonManageDto } from '@/types/common.dto'; import { getAuthFromCookie } from '@/lib/utils/auth'; import { AuthSliceState } from '@/store/auth.slice'; -import { HackathonManageDto } from '@/types/common.dto'; -import { headers } from 'next/headers'; export interface HackathonListPageProps { searchParams?: { [key: string]: string | undefined }; diff --git a/frontend/src/components/ui/admin/hackathon/AdminHackathonManageTable.tsx b/frontend/src/components/ui/admin/hackathon/AdminHackathonManageTable.tsx index 460a4453..b4cf478b 100644 --- a/frontend/src/components/ui/admin/hackathon/AdminHackathonManageTable.tsx +++ b/frontend/src/components/ui/admin/hackathon/AdminHackathonManageTable.tsx @@ -1,11 +1,13 @@ 'use client'; -import { HackathonManageDto } from '@/types/common.dto'; +import { useEffect, useState } from 'react'; +import { useRouter } from 'next/navigation'; + import { MdDeleteForever } from '@react-icons/all-files/md/MdDeleteForever'; import { MdFileDownload } from '@react-icons/all-files/md/MdFileDownload'; import { MdEdit } from '@react-icons/all-files/md/MdEdit'; -import { useEffect, useState } from 'react'; -import { useRouter } from 'next/navigation'; + +import { HackathonManageDto } from '@/types/common.dto'; export interface AdminHackathonManageTableProps { hackathonInfos: HackathonManageDto[]; diff --git a/frontend/src/components/ui/admin/hackathon/AdminHackathonSearchBox.tsx b/frontend/src/components/ui/admin/hackathon/AdminHackathonSearchBox.tsx index abbe8c22..2f979421 100644 --- a/frontend/src/components/ui/admin/hackathon/AdminHackathonSearchBox.tsx +++ b/frontend/src/components/ui/admin/hackathon/AdminHackathonSearchBox.tsx @@ -1,9 +1,10 @@ 'use client'; +import { useRouter } from 'next/navigation'; +import { Form, Formik } from 'formik'; + import Dropdown from '@/components/common/formik/Dropdown'; import TextInput from '@/components/common/formik/TextInput'; -import { Form, Formik } from 'formik'; -import { useRouter } from 'next/navigation'; interface AdminHackathonSearchBoxProps { count: number; From 185c12a3413b273cc13029552f273cca0d826cca Mon Sep 17 00:00:00 2001 From: llddang Date: Mon, 16 Dec 2024 12:52:50 +0900 Subject: [PATCH 09/11] =?UTF-8?q?feat:=20=ED=95=B4=EC=BB=A4=ED=86=A4=20?= =?UTF-8?q?=EB=AA=A9=EB=A1=9D=20=ED=8E=98=EC=9D=B4=EC=A7=80=EC=97=90=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=EB=84=A4=EC=9D=B4=EC=85=98=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #232 --- frontend/src/app/admin/hackathon/page.tsx | 141 ++++++++++++++++++---- 1 file changed, 120 insertions(+), 21 deletions(-) diff --git a/frontend/src/app/admin/hackathon/page.tsx b/frontend/src/app/admin/hackathon/page.tsx index bc495485..e44171f3 100644 --- a/frontend/src/app/admin/hackathon/page.tsx +++ b/frontend/src/app/admin/hackathon/page.tsx @@ -4,9 +4,10 @@ import PageTitle from '@/components/common/PageTitle'; import AdminHackathonManageTable from '@/components/ui/admin/hackathon/AdminHackathonManageTable'; import AdminHackathonSearchBox from '@/components/ui/admin/hackathon/AdminHackathonSearchBox'; -import { HackathonManageDto } from '@/types/common.dto'; +import { HackathonManagePageableDto } from '@/types/common.dto'; import { getAuthFromCookie } from '@/lib/utils/auth'; import { AuthSliceState } from '@/store/auth.slice'; +import Pagination from '@/components/common/Pagination'; export interface HackathonListPageProps { searchParams?: { [key: string]: string | undefined }; @@ -22,30 +23,128 @@ export default function HackathonListPage({ searchParams }: HackathonListPagePro const keyword = searchParams?.keyword ? searchParams.keyword : ''; // TODO: api 연결 - const hackathonInfos: HackathonManageDto[] = [ - { - id: 1, - title: '제 8회 2024-2 PNU SW+X 문제해결 경진대회', - hackathonStartDate: '2024-09-01', - hackathonEndDate: '2024-12-01', - teamCode: '1234', - isActive: false, - }, - { - id: 2, - title: '제 7회 2024-2 PNU SW+X 문제해결 경진대회', - hackathonStartDate: '2024-09-01', - hackathonEndDate: '2024-12-01', - teamCode: '1234', - isActive: false, - }, - ]; + const hackathonInfos: HackathonManagePageableDto = { + totalPages: hackathonInfoContent.length / 8, + totalElements: hackathonInfoContent.length, + size: 8, + number: page, + pageable: '{"page":1,"size":8}', + numberOfElements: 0, + empty: false, + content: hackathonInfoContent, + }; return (
- - + + +
); } + +const hackathonInfoContent = [ + { + id: 1, + title: '제 8회 2024-2 PNU SW+X 문제해결 경진대회', + hackathonStartDate: '2024-09-01', + hackathonEndDate: '2024-12-01', + teamCode: '1234', + isActive: false, + }, + { + id: 2, + title: '제 7회 2024-2 PNU SW+X 문제해결 경진대회', + hackathonStartDate: '2024-09-01', + hackathonEndDate: '2024-12-01', + teamCode: '1234', + isActive: false, + }, + { + id: 3, + title: '제 7회 2024-2 PNU SW+X 문제해결 경진대회', + hackathonStartDate: '2024-09-01', + hackathonEndDate: '2024-12-01', + teamCode: '1234', + isActive: false, + }, + { + id: 4, + title: '제 7회 2024-2 PNU SW+X 문제해결 경진대회', + hackathonStartDate: '2024-09-01', + hackathonEndDate: '2024-12-01', + teamCode: '1234', + isActive: false, + }, + { + id: 5, + title: '제 7회 2024-2 PNU SW+X 문제해결 경진대회', + hackathonStartDate: '2024-09-01', + hackathonEndDate: '2024-12-01', + teamCode: '1234', + isActive: false, + }, + { + id: 6, + title: '제 7회 2024-2 PNU SW+X 문제해결 경진대회', + hackathonStartDate: '2024-09-01', + hackathonEndDate: '2024-12-01', + teamCode: '1234', + isActive: false, + }, + { + id: 7, + title: '제 7회 2024-2 PNU SW+X 문제해결 경진대회', + hackathonStartDate: '2024-09-01', + hackathonEndDate: '2024-12-01', + teamCode: '1234', + isActive: false, + }, + { + id: 8, + title: '제 7회 2024-2 PNU SW+X 문제해결 경진대회', + hackathonStartDate: '2024-09-01', + hackathonEndDate: '2024-12-01', + teamCode: '1234', + isActive: false, + }, + { + id: 9, + title: '제 7회 2024-2 PNU SW+X 문제해결 경진대회', + hackathonStartDate: '2024-09-01', + hackathonEndDate: '2024-12-01', + teamCode: '1234', + isActive: false, + }, + { + id: 10, + title: '제 7회 2024-2 PNU SW+X 문제해결 경진대회', + hackathonStartDate: '2024-09-01', + hackathonEndDate: '2024-12-01', + teamCode: '1234', + isActive: false, + }, + { + id: 11, + title: '제 7회 2024-2 PNU SW+X 문제해결 경진대회', + hackathonStartDate: '2024-09-01', + hackathonEndDate: '2024-12-01', + teamCode: '1234', + isActive: false, + }, + { + id: 12, + title: '제 7회 2024-2 PNU SW+X 문제해결 경진대회', + hackathonStartDate: '2024-09-01', + hackathonEndDate: '2024-12-01', + teamCode: '1234', + isActive: false, + }, +]; From b81f75406e783756288ca067008c2c1c99331468 Mon Sep 17 00:00:00 2001 From: llddang Date: Mon, 16 Dec 2024 12:53:12 +0900 Subject: [PATCH 10/11] =?UTF-8?q?design:=20table=EC=9D=98=20=EC=B5=9C?= =?UTF-8?q?=EC=86=8C=20height=20=EA=B3=A0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #232 --- .../hackathon/AdminHackathonManageTable.tsx | 122 +++++++++--------- 1 file changed, 62 insertions(+), 60 deletions(-) diff --git a/frontend/src/components/ui/admin/hackathon/AdminHackathonManageTable.tsx b/frontend/src/components/ui/admin/hackathon/AdminHackathonManageTable.tsx index b4cf478b..6575d118 100644 --- a/frontend/src/components/ui/admin/hackathon/AdminHackathonManageTable.tsx +++ b/frontend/src/components/ui/admin/hackathon/AdminHackathonManageTable.tsx @@ -51,65 +51,67 @@ export default function AdminHackathonManageTable({ hackathonInfos }: AdminHacka }, [hackathonInfos, setHackathon]); return ( - - - - - - - - - - - - - - {hackathons.map((hackathon) => { - return ( - - - - - - - - - - ); - })} - -
대회ID대회명대회기간활성 여부대회 수정대회 삭제투표 결과
{hackathon.id}{hackathon.title} - {hackathon.hackathonStartDate} ~ {hackathon.hackathonEndDate} - - - - - - - - -
+
+ + + + + + + + + + + + + + {hackathons.map((hackathon) => { + return ( + + + + + + + + + + ); + })} + +
대회ID대회명대회기간활성 여부대회 수정대회 삭제투표 결과
{hackathon.id}{hackathon.title} + {hackathon.hackathonStartDate} ~ {hackathon.hackathonEndDate} + + + + + + + + +
+
); } From b52236bc182eb512166a8b6e50b0b896e7b3d7cd Mon Sep 17 00:00:00 2001 From: llddang Date: Mon, 16 Dec 2024 12:53:44 +0900 Subject: [PATCH 11/11] =?UTF-8?q?chore:=20=EC=82=AC=EC=9A=A9=ED=95=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=20HackathonDTO=EC=97=90=EC=84=9C?= =?UTF-8?q?=20=EC=86=8D=EC=84=B1=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #232 --- frontend/src/lib/api/server.api.ts | 8 -------- frontend/src/mocks/hackathon.ts | 7 ------- frontend/src/types/common.dto.ts | 21 ++++++++------------- 3 files changed, 8 insertions(+), 28 deletions(-) diff --git a/frontend/src/lib/api/server.api.ts b/frontend/src/lib/api/server.api.ts index 37eaab1f..f8de2007 100644 --- a/frontend/src/lib/api/server.api.ts +++ b/frontend/src/lib/api/server.api.ts @@ -14,7 +14,6 @@ import { MilestoneHistorySortCriteria, SortDirection } from '@/types/milestone'; import { mockHackathonPrize } from '@/mocks/hackathon'; import { removeEmptyField } from '../utils/utils'; -import { BusinessError } from '@/types/error'; export async function getMilestoneHistoriesOfStudent( token: string, @@ -164,13 +163,6 @@ export async function getHackathons(page: number = 0, size: number = 10) { }, ], empty: false, - first: true, - last: false, - sort: { - empty: false, - sorted: false, - unsorted: true, - }, number: 0, pageable: '', pageSize: 6, diff --git a/frontend/src/mocks/hackathon.ts b/frontend/src/mocks/hackathon.ts index 64039405..c375eac0 100644 --- a/frontend/src/mocks/hackathon.ts +++ b/frontend/src/mocks/hackathon.ts @@ -5,13 +5,6 @@ export const mockHackathonTeamPageableData: HackathonTeamPageableDto = { totalElements: 25, size: 10, number: 1, // 현재 페이지 (1 기반 인덱스) - sort: { - empty: false, - sorted: true, - unsorted: false, - }, - first: false, // 현재 페이지가 첫 페이지인지 여부 - last: false, // 현재 페이지가 마지막 페이지인지 여부 pageable: '{"page":1,"size":10}', // 페이지 요청 정보 (JSON 형식) numberOfElements: 10, // 현재 페이지의 항목 수 empty: false, // 현재 페이지가 비어 있는지 여부 diff --git a/frontend/src/types/common.dto.ts b/frontend/src/types/common.dto.ts index 3481e195..338e7261 100644 --- a/frontend/src/types/common.dto.ts +++ b/frontend/src/types/common.dto.ts @@ -3,23 +3,14 @@ import { MilestoneGroup } from '@/data/milestone'; import { TeamMemberRole } from '@/data/hackathon'; import { Milestone } from './milestone'; -interface PageSort { - empty: boolean; - sorted: boolean; - unsorted: boolean; -} - interface Pageable { totalPages: number; totalElements: number; size: number; - number: number; - sort: PageSort; - first: boolean; - last: boolean; - pageable: string; - numberOfElements: number; - empty: boolean; + number: number; // 현재 페이지 (1 기반 인덱스) + pageable: string; // 페이지 요청 정보 (JSON 형식) ex {"page":1,"size":10} + numberOfElements: number; // 현재 페이지의 항목 수 + empty: boolean; // // 현재 페이지가 비어 있는지 여부 } export interface CategoryDto { @@ -186,6 +177,10 @@ export interface HackathonManageDto isActive: boolean; } +export interface HackathonManagePageableDto extends Pageable { + content: HackathonManageDto[]; +} + export type HackathonInformationDto = Omit; export type HackathonOverviewDto = Omit;