Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: 스터디 상세 정보 작성 #56

Merged
merged 102 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from 96 commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
1ae4c49
feat: layout
eugene028 Aug 12, 2024
3c8b5e3
chore: lock 패키지 변경 사항 반영
eugene028 Aug 12, 2024
96dcb69
chore: 중복된 Navbar 컴포넌트 삭제
ghdtjgus76 Aug 12, 2024
10a576b
feat: 개설 스터디 기본 잡기
eugene028 Aug 12, 2024
dcd3e0b
feat: 스터디 개설 페이지 레이아웃
eugene028 Aug 13, 2024
e135d97
chore:패키지 설치
eugene028 Aug 13, 2024
5d35442
fix: 찌그러짐 방지용 minWidth 추가
eugene028 Aug 13, 2024
a77f7e6
feat: 스터디 개설하기 뷰 생성
eugene028 Aug 13, 2024
dcbb5b3
fix: 개설된 스터디로 화면 옮기기
eugene028 Aug 13, 2024
cec09ee
feat: auth 체크용 middleWare 생성
eugene028 Aug 13, 2024
333e298
fix: utils fetcher 함수 export 경로 변경
eugene028 Aug 13, 2024
f122b3d
feat: 스터디 생성하기 페이지 생성
eugene028 Aug 13, 2024
d1b9aa6
fix: router handler 삭제
eugene028 Aug 13, 2024
ab0a88f
fix:로그인 로직 합치기
eugene028 Aug 13, 2024
38dcff3
refactor: api path 상수로 수정
eugene028 Aug 13, 2024
0ccf38f
feat: isAdmin 함수 추가
eugene028 Aug 13, 2024
96dead7
fix: 코드리뷰 반영
eugene028 Aug 13, 2024
beae0f1
fix: admin여부에 따라 스터디 생성 박스 보이지 않도록
eugene028 Aug 13, 2024
329670f
chore: dev 머지
eugene028 Aug 14, 2024
8bbc939
chore: 패키지 설치
eugene028 Aug 14, 2024
30d8e7c
fix: 빌드에러 고치기
eugene028 Aug 14, 2024
9e03318
fix: 고친 로그인 로직 머지
eugene028 Aug 14, 2024
e09a96d
fix: isadmin 판별 로직 미들웨어에서 진행
eugene028 Aug 14, 2024
8efc686
feat: 역할 논리 다시
eugene028 Aug 14, 2024
00020f8
fix: 폴더명 변경
eugene028 Aug 14, 2024
625326e
fix: createStudy 경로 변경
eugene028 Aug 14, 2024
387950c
feat:wow-icons 추가
eugene028 Aug 14, 2024
2c771c5
feat: 기존 브랜치 머지
eugene028 Aug 14, 2024
ca7e7f4
refactor: 컴포넌트 폴더위치 변경
eugene028 Aug 14, 2024
5622e3f
chore:react-hook-form 설치
eugene028 Aug 14, 2024
317d492
feat: 복잡한 UI 설계 react-hook-form
eugene028 Aug 14, 2024
0a4bc8a
feat: 스터디 수강 시작 날짜 지정
eugene028 Aug 14, 2024
5ca5232
chore: dev 머지
eugene028 Aug 16, 2024
dee4824
chore: timepicker 패키지 설치
eugene028 Aug 16, 2024
12c8c0e
feat: 스터디 신청 UI 완성
eugene028 Aug 16, 2024
21fea58
fix: 쓸데없는 콘솔로그 제거
eugene028 Aug 16, 2024
ac11d0a
feat: api 연결
eugene028 Aug 16, 2024
4022961
feat:api 호출 성공시 redirect
eugene028 Aug 16, 2024
2b97234
fix: 캐시 지워서 빌드에러 해결
eugene028 Aug 16, 2024
361cf66
chore: fetcher 테스트
eugene028 Aug 19, 2024
058b69f
chore: dev 브랜치에서 머지
eugene028 Aug 20, 2024
78b414e
chore: 패키지 설치
eugene028 Aug 20, 2024
7b41745
feat: 스터디 리스트 보기 뷰
eugene028 Aug 20, 2024
a7c4c78
fix: api 관련 코드리뷰 반영
eugene028 Aug 20, 2024
1cd3527
fix: 코드리뷰 반영
eugene028 Aug 20, 2024
2cb887e
fix: 메인에서 머지
eugene028 Aug 20, 2024
3c23f8f
fix: navbar 두개인것 고치기
eugene028 Aug 20, 2024
330a19b
feat: Header, 기본 레이아웃 세팅
eugene028 Aug 20, 2024
7b75b58
feat: Header 생성
eugene028 Aug 20, 2024
7ff93ad
feat: 출석 보기
eugene028 Aug 20, 2024
5cf6d7b
fix: 코드리뷰 반영
eugene028 Aug 20, 2024
1e9ac2a
fix: 코드리뷰 반영
eugene028 Aug 20, 2024
6e97e57
fix: 코드리뷰 반영
eugene028 Aug 20, 2024
3bfec83
chore: dev 머지
eugene028 Aug 20, 2024
4be1296
fix: api 추가 및 하드코딩 제거
eugene028 Aug 20, 2024
fa1ac2e
feat: 과제 목록 보기 api 연결
eugene028 Aug 20, 2024
28d73b6
chore: 스터디 리스트 작업 머지
eugene028 Aug 20, 2024
6a963d1
feat: 과제 목록 생성
eugene028 Aug 20, 2024
bfcf60f
feat: 스터디 커리큘럼 생성 기능 및 api 연결
eugene028 Aug 20, 2024
df812ba
chore: 다른 브랜치 작업영역 불러오기
eugene028 Aug 20, 2024
fac8392
feat: 스터디 기본 정보 대시보드
eugene028 Aug 20, 2024
a782db6
fix: 노션 링크 없을 때에 에러페이지 안뜨게끔 수정
eugene028 Aug 21, 2024
caf0c9a
chore: dev 브랜치 conflict 해결
eugene028 Aug 21, 2024
5358390
fix: padwithzero 추가
eugene028 Aug 21, 2024
f57718f
fix: 노션 null 처리 진행
eugene028 Aug 21, 2024
ea1e2f2
chore: dev브랜치에서 머지
eugene028 Aug 23, 2024
6194cdc
fix: 중복 요소 제거
eugene028 Aug 23, 2024
860a788
fix: 코드리뷰 반영 및 모든 mock 데이터 제거
eugene028 Aug 23, 2024
46f2a7e
fix: 필요없는 console 삭제
eugene028 Aug 23, 2024
18e17e5
fix: entity 관리하기 쉽게 분리
eugene028 Aug 23, 2024
1f3765c
feat: 스터디 상세 정보 생성 api 연결
eugene028 Aug 23, 2024
288a926
chore: 다른 작업 영역 브랜치 합치기
eugene028 Aug 23, 2024
e63961a
feat: StudyInfobox 컴포넌트 구성 완료
eugene028 Aug 23, 2024
ca0a063
feat: 스터디 상세 정보 입력 api 연결
eugene028 Aug 23, 2024
aa73bac
fix: timeType 추가
eugene028 Aug 23, 2024
4bf6c7b
fix: type 고치기
eugene028 Aug 23, 2024
51e3dbd
fix: next-cache 쓸데없이 하는 부분 제거
eugene028 Aug 24, 2024
48371e7
feat: 스터디 상세 정보 입력 모달창 생성
eugene028 Aug 26, 2024
47239a9
chore: dev 브랜치에서 머지
eugene028 Aug 26, 2024
b69fc52
fix: entity 분리한거 합치기
eugene028 Aug 26, 2024
bc2c4e0
chore: dev 브랜치 머지
eugene028 Aug 27, 2024
769e433
fix: 코드리뷰 반영
eugene028 Aug 27, 2024
3209d70
feat: 커스텀 훅으로 로직 분리
eugene028 Aug 27, 2024
57aecd6
fix: 코드리뷰 반영, 빌드에러 해결
eugene028 Aug 27, 2024
1a261cf
fix: 폴더명 수정
eugene028 Aug 27, 2024
6864568
fix: 빌드에러 해결
eugene028 Aug 27, 2024
d90b5e0
fix: 캐시 지우고 폴더명 다시 시도
eugene028 Aug 27, 2024
6b98e0f
fix: 파일명 오류 수정
eugene028 Aug 27, 2024
9adbd95
fix: 빌드 캐시 지우기
eugene028 Aug 27, 2024
5d41af4
fix: 새로운 폴더 생성
eugene028 Aug 27, 2024
d55f99e
fix: 폴더명 다시 되돌림
eugene028 Aug 27, 2024
e3910cb
fix: 폴더명 명확하게 변경
eugene028 Aug 27, 2024
025d11e
fix: 빌드에러 해결
eugene028 Aug 27, 2024
8aa44f3
chore: dev 머지
eugene028 Aug 27, 2024
2954716
fix: sessions로 API 변경, 선언적인 코드로 변경
eugene028 Aug 28, 2024
d3908b7
fix: 세션을커리큘럼으로 바꾸어요
eugene028 Aug 28, 2024
f9bfe68
fix: 스터디 시간 없을 경우 예외처리
eugene028 Aug 28, 2024
5d0f7f7
fix: layout overscroll 처리
eugene028 Aug 28, 2024
9b3a258
fix: query사용 방법 수정
eugene028 Aug 28, 2024
bbd11af
fix: 스타일 수정
eugene028 Aug 28, 2024
78caf3b
fix: 코드리뷰 반영
eugene028 Aug 28, 2024
15b40bf
chore: dev 머지
eugene028 Aug 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions apps/admin/apis/form/createStudyApi.ts
ghdtjgus76 marked this conversation as resolved.
Outdated
Show resolved Hide resolved

This file was deleted.

26 changes: 15 additions & 11 deletions apps/admin/apis/study/createStudyApi.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import { fetcher } from "@wow-class/utils";
import { apiPath } from "constants/apiPath";
import { tags } from "constants/tags";
import type { StudyListApiResponseDto } from "types/dtos/studyList";
import type { CreateStudyApiRequestDto } from "types/dtos/createStudy";
import type { CreateStudyDetailInfoApiRequestDto } from "types/dtos/studyDetailInfo";

export const createStudyApi = {
getStudyList: async () => {
const response = await fetcher.get<StudyListApiResponseDto[]>(
apiPath.studyList,
{
next: { tags: [tags.studyList] },
cache: "force-cache",
}
);
postCreateStudy: async (data: CreateStudyApiRequestDto) => {
const response = await fetcher.post(apiPath.createStudy, data);

return response.data;
return { success: response.ok };
},
postStudyDetailInfo: async (
data: CreateStudyDetailInfoApiRequestDto,
studyId: number
) => {
const response = await fetcher.patch(
`${apiPath.createStudyDetailInfo}/${studyId}`,
data
);
return { success: response.ok };
},
};
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
import { fetcher } from "@wow-class/utils";
import { mentorApiPath } from "constants/apiPath";
import { apiPath, mentorApiPath } from "constants/apiPath";
import { tags } from "constants/tags";
import type { AnnouncementApiResponseDto } from "types/dtos/announcement";
import type { AssignmentApiResponseDto } from "types/dtos/assignmentList";
import type { SessionApiResponseDto } from "types/dtos/sessionList";
import type { CurriculumApiResponseDto } from "types/dtos/curriculumList";
import type { StudyBasicInfoApiResponseDto } from "types/dtos/studyBasicInfo";
import type { StudyAnnouncementType } from "types/entities/study";

export const studyInfoApi = {
import type { StudyListApiResponseDto } from "../../types/dtos/studyList";

export const studyApi = {
getStudyList: async () => {
const response = await fetcher.get<StudyListApiResponseDto[]>(
apiPath.studyList,
{
next: { tags: [tags.studyList] },
}
);

return response.data;
},
getStudyBasicInfo: async (studyId: number) => {
const response = await fetcher.get<StudyBasicInfoApiResponseDto>(
`/common/studies/${studyId}`,
Expand Down Expand Up @@ -36,11 +48,11 @@ export const studyInfoApi = {

return { success: response.ok };
},
getSessionList: async (studyId: number) => {
const response = await fetcher.get<SessionApiResponseDto[]>(
`${mentorApiPath.sessions}?study=${studyId}`,
getCurriculumList: async (studyId: number) => {
const response = await fetcher.get<CurriculumApiResponseDto[]>(
`${mentorApiPath.curriculums}?studyId=${studyId}`,
{
next: { tags: [tags.sessions] },
next: { tags: [tags.curriculums] },
cache: "force-cache",
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { Flex } from "@styled-system/jsx";
import { Modal, Space, Text } from "@wow-class/ui";
import { useModalRoute } from "@wow-class/ui/hooks";
import { studyInfoApi } from "apis/study/studyInfoApi";
import { studyApi } from "apis/study/studyApi";
import { tags } from "constants/tags";
import { useSearchParams } from "next/navigation";
import { revalidateTagByName } from "utils/revalidateTagByName";
Expand All @@ -17,7 +17,7 @@ const AnnouncementDeleteModal = () => {
const { closeModal } = useModalRoute();

const handleClickDeleteButton = async () => {
const result = await studyInfoApi.deleteStudyAnnouncement(
const result = await studyApi.deleteStudyAnnouncement(
Number(studyAnnouncementId)
);
if (result.success) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { Flex } from "@styled-system/jsx";
import { Modal, Space, Text } from "@wow-class/ui";
import { useModalRoute } from "@wow-class/ui/hooks";
import { studyInfoApi } from "apis/study/studyInfoApi";
import { studyApi } from "apis/study/studyApi";
import { tags } from "constants/tags";
import { useSearchParams } from "next/navigation";
import { useState } from "react";
Expand All @@ -25,7 +25,7 @@ const AnnouncementModifyModal = () => {
const { closeModal } = useModalRoute();

const handleClickModifyButton = async () => {
const result = await studyInfoApi.modifyStudyAnnouncement(
const result = await studyApi.modifyStudyAnnouncement(
Number(studyAnnouncementId),
studyAnnouncement
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { css } from "@styled-system/css";
import { Flex } from "@styled-system/jsx";
import { Text } from "@wow-class/ui";
import { studyInfoApi } from "apis/study/studyInfoApi";
import { studyApi } from "apis/study/studyApi";
import { tags } from "constants/tags";
import { useState } from "react";
import type { StudyAnnouncementType } from "types/entities/study";
Expand All @@ -19,7 +19,7 @@ const CreateStudyAnnouncement = ({ studyId }: { studyId: string }) => {
});

const handlePublishAnnouncement = async (studyId: string) => {
const { success } = await studyInfoApi.publishStudyAnnouncement(
const { success } = await studyApi.publishStudyAnnouncement(
parseInt(studyId, 10),
studyAnnouncement
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { css } from "@styled-system/css";
import { Flex } from "@styled-system/jsx";
import { Space, Table, Text } from "@wow-class/ui";
import { studyInfoApi } from "apis/study/studyInfoApi";
import { studyApi } from "apis/study/studyApi";
import { routerPath } from "constants/router/routerPath";
import Image from "next/image";
import Link from "next/link";
Expand All @@ -12,12 +12,12 @@ import TextButton from "wowds-ui/TextButton";
import CreateStudyAnnouncement from "./CreateStudyAnnouncement";

const StudyAnnouncement = async ({ studyId }: { studyId: string }) => {
const announcementList = await studyInfoApi.getStudyAnnouncement(
const announcementList = await studyApi.getStudyAnnouncement(
parseInt(studyId, 10)
);

return (
<section aria-label="session-list">
<section aria-label="curriculum-list">
<Text typo="h2">스터디 공지</Text>
<Space height={24} />
<CreateStudyAnnouncement studyId={studyId} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Space, Text } from "@wow-class/ui";
import { studyInfoApi } from "apis/study/studyInfoApi";
import { studyApi } from "apis/study/studyApi";

import AssignmentListItem from "./AssignmentListItem";

const AssignmentList = async ({ studyId }: { studyId: string }) => {
const assignmentList = await studyInfoApi.getAssignmentList(
const assignmentList = await studyApi.getAssignmentList(
parseInt(studyId, 10)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { cva } from "@styled-system/css";
import { Flex } from "@styled-system/jsx";
import { Table, Text } from "@wow-class/ui";
import { padWithZero, parseISODate } from "@wow-class/utils";
import { studyInfoApi } from "apis/study/studyInfoApi";
import { studyApi } from "apis/study/studyApi";
import { tags } from "constants/tags";
import Link from "next/link";
import type { AssignmentApiResponseDto } from "types/dtos/assignmentList";
Expand All @@ -30,7 +30,7 @@ const AssignmentListItem = ({
const studyDeadline = `종료 : ${year}년 ${month}월 ${day}일 ${padWithZero(hours)}:${padWithZero(minutes)}`;

const handleCancelAssignment = async (studyDetailId: number) => {
const { success } = await studyInfoApi.cancelAssignment(studyDetailId);
const { success } = await studyApi.cancelAssignment(studyDetailId);
if (success) {
window.alert("휴강 처리에 성공했어요.");
revalidateTagByName(tags.assignments);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";
import { Flex } from "@styled-system/jsx";
import { studyInfoApi } from "apis/study/studyInfoApi";
import { studyApi } from "apis/study/studyApi";
import { useRouter } from "next/navigation";
import type { AssignmentStatusType } from "types/entities/study";
import type { StudyAssignmentStatusType } from "types/entities/study";
import Button from "wowds-ui/Button";

const CancelStudyButton = ({
Expand All @@ -12,11 +12,11 @@ const CancelStudyButton = ({
}: {
descriptionLink: string;
studyDetailId: number;
assignmentStatus: AssignmentStatusType;
assignmentStatus: StudyAssignmentStatusType;
}) => {
const router = useRouter();
const handleCancelAssignment = async (studyDetailId: number) => {
const { success } = await studyInfoApi.cancelAssignment(studyDetailId);
const { success } = await studyApi.cancelAssignment(studyDetailId);
if (success) {
console.log("휴강 처리에 성공했어요.");
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Space, Text } from "@wow-class/ui";
import { studyApi } from "apis/study/studyApi";

import CurriculumListItem from "./CurriculumListItem";
import EmptyCurriculumList from "./EmptyCurriculumList";

const CurriculumList = async ({ studyId }: { studyId: string }) => {
const curriculumList = await studyApi.getCurriculumList(
parseInt(studyId, 10)
);

if (curriculumList?.length === 0) {
return <EmptyCurriculumList />;
}

return (
<section aria-label="curriculum-list">
<Text typo="h2">스터디 커리큘럼</Text>
<Space height={24} />
{curriculumList?.map((curriculum) => (
<CurriculumListItem
curriculum={curriculum}
key={`curriculumItem-${curriculum.studyDetailId}`}
/>
))}
</section>
);
};

export default CurriculumList;
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@ import { Flex } from "@styled-system/jsx";
import { Table, Text } from "@wow-class/ui";
import { padWithZero, parseISODate } from "@wow-class/utils";
import type { ComponentProps } from "react";
import type { SessionApiResponseDto } from "types/dtos/sessionList";
import type { CurriculumApiResponseDto } from "types/dtos/curriculumList";
import type { StudyDifficultyType } from "types/entities/study";
import getIsCurrentWeek from "utils/getIsCurrentWeek";
import Tag from "wowds-ui/Tag";

const SessionListItem = ({ session }: { session: SessionApiResponseDto }) => {
const { description = "", period, week, title, difficulty } = session;
const CurriculumListItem = ({
curriculum,
}: {
curriculum: CurriculumApiResponseDto;
}) => {
const { description = "", period, week, title, difficulty } = curriculum;
const { startDate, endDate } = period;
const { month: startMonth, day: startDay } = parseISODate(startDate);
const { month: endMonth, day: endDay } = parseISODate(endDate);

const sessionTimeLine = `${padWithZero(startMonth)}.${padWithZero(startDay)} - ${padWithZero(endMonth)}.${padWithZero(endDay)}`;
const curriculumTimeLine = `${padWithZero(startMonth)}.${padWithZero(startDay)} - ${padWithZero(endMonth)}.${padWithZero(endDay)}`;
const thisWeekAssignment = getIsCurrentWeek(endDate);

return (
Expand Down Expand Up @@ -45,13 +49,13 @@ const SessionListItem = ({ session }: { session: SessionApiResponseDto }) => {
</Flex>
</Table.Left>
<Table.Right>
<Text typo="body1">{sessionTimeLine}</Text>
<Text typo="body1">{curriculumTimeLine}</Text>
</Table.Right>
</Table>
);
};

export default SessionListItem;
export default CurriculumListItem;

const ThisWeekBarStyle = cva({
base: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { Flex } from "@styled-system/jsx";
import { Space, Text } from "@wow-class/ui";
import Image from "next/image";

const EmptySessionList = () => {
const EmptyCurriculumList = () => {
return (
<section aria-label="empty-session-list" style={{ width: "100%" }}>
<section aria-label="empty-curriculum-list" style={{ width: "100%" }}>
<Text typo="h2">스터디 커리큘럼</Text>
<Space height={24} />
<Flex direction="column" width="100%">
<Flex alignItems="center" direction="column" gap="xs">
<Image
alt="empty-session"
alt="empty-curriculum"
height={50}
src="/images/empty.svg"
width={150}
Expand All @@ -24,4 +24,4 @@ const EmptySessionList = () => {
);
};

export default EmptySessionList;
export default EmptyCurriculumList;
Loading
Loading