Skip to content

Commit

Permalink
Merge pull request #944 from academic-relations/dev
Browse files Browse the repository at this point in the history
Merge v2.0.0-RC3
  • Loading branch information
UrWrstNightmare authored Aug 29, 2024
2 parents 7b4350d + 7eaf2b2 commit 4558c98
Show file tree
Hide file tree
Showing 15 changed files with 370 additions and 120 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ import { MySql2Database } from "drizzle-orm/mysql2";
import logger from "@sparcs-clubs/api/common/util/logger";
import { getKSTDate, takeUnique } from "@sparcs-clubs/api/common/util/util";
import { DrizzleAsyncProvider } from "@sparcs-clubs/api/drizzle/drizzle.provider";
import { ClubDelegateD } from "@sparcs-clubs/api/drizzle/schema/club.schema";
import {
Club,
ClubDelegateD,
} from "@sparcs-clubs/api/drizzle/schema/club.schema";
import { Division } from "@sparcs-clubs/api/drizzle/schema/division.schema";
import { File } from "@sparcs-clubs/api/drizzle/schema/file.schema";
import {
Expand Down Expand Up @@ -394,8 +397,10 @@ export class ClubRegistrationRepository {
registrationStatusEnumId:
Registration.registrationApplicationStatusEnumId,
clubId: Registration.clubId,
clubNameKr: Registration.clubNameKr,
clubNameEn: Registration.clubNameEn,
clubNameKr: Club.name_kr,
clubNameEn: Club.name_en,
newClubNameKr: Registration.clubNameKr,
newClubNameEn: Registration.clubNameEn,
representative: {
studentNumber: representative.studentNumber,
name: representative.name,
Expand Down Expand Up @@ -428,6 +433,10 @@ export class ClubRegistrationRepository {
representative,
eq(Registration.studentId, representative.id),
) // 대표자가 없는 학생이라면 잘못된 신청이라는 의미인것 같아서 innerjoin으로 연결시킴.
.leftJoin(
Club,
and(eq(Registration.clubId, Club.id), isNull(Club.deletedAt)),
)
.leftJoin(professor, eq(Registration.professorId, professor.id))
.leftJoin(
File1,
Expand Down Expand Up @@ -522,7 +531,8 @@ export class ClubRegistrationRepository {
id: Registration.id,
registrationTypeEnumId: Registration.registrationApplicationTypeEnumId,
divisionName: Division.name,
clubNameKr: Registration.clubNameKr,
clubNameKr: Club.name_kr,
newClubNameKr: Registration.clubNameKr,
clubId: Registration.clubId,
activityFieldKr: Registration.activityFieldKr,
activityFieldEn: Registration.activityFieldEn,
Expand All @@ -531,6 +541,10 @@ export class ClubRegistrationRepository {
Registration.registrationApplicationStatusEnumId,
})
.from(Registration)
.leftJoin(
Club,
and(eq(Registration.clubId, Club.id), isNull(Club.deletedAt)),
)
.leftJoin(
Division,
and(
Expand Down Expand Up @@ -659,8 +673,10 @@ export class ClubRegistrationRepository {
registrationStatusEnumId:
Registration.registrationApplicationStatusEnumId,
clubId: Registration.clubId,
clubNameKr: Registration.clubNameKr,
clubNameEn: Registration.clubNameEn,
clubNameKr: Club.name_kr,
clubNameEn: Club.name_en,
newClubNameKr: Registration.clubNameKr,
newClubNameEn: Registration.clubNameEn,
representative: {
studentNumber: representative.studentNumber,
name: representative.name,
Expand Down Expand Up @@ -693,6 +709,10 @@ export class ClubRegistrationRepository {
representative,
eq(Registration.studentId, representative.id),
) // 대표자가 없는 학생이라면 잘못된 신청이라는 의미인것 같아서 innerjoin으로 연결시킴.
.leftJoin(
Club,
and(eq(Registration.clubId, Club.id), isNull(Club.deletedAt)),
)
.leftJoin(professor, eq(Registration.professorId, professor.id))
.leftJoin(
File1,
Expand Down Expand Up @@ -886,6 +906,10 @@ export class ClubRegistrationRepository {
Student,
and(eq(Registration.studentId, Student.id), isNull(Student.deletedAt)),
)
.innerJoin(
Club,
and(eq(Registration.clubId, Club.id), isNull(Club.deletedAt)),
)
.innerJoin(
Professor,
and(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,10 @@ export class ClubRegistrationService {
registrationStatusEnumId:
result.registration.registrationApplicationStatusEnumId,
clubId: result.registration.clubId,
clubNameKr: result.registration.clubNameKr,
clubNameEn: result.registration.clubNameEn,
clubNameKr: result.club.name_kr,
clubNameEn: result.club.name_en,
newClubNameKr: result.registration.clubNameKr,
newClubNameEn: result.registration.clubNameEn,
representative: {
studentNumber: result.student.number,
name: result.student.name,
Expand Down
2 changes: 2 additions & 0 deletions packages/interface/src/api/registration/endpoint/apiReg011.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ const responseBodyMap = {
clubId: z.coerce.number().int().min(1).optional(),
clubNameKr: zClubName,
clubNameEn: zClubName,
newClubNameKr: zClubName,
newClubNameEn: zClubName,
representative: z.object({
studentNumber: z.coerce.number().int().min(1),
name: z.string().max(30),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ const responseBodyMap = {
registrationStatusEnumId: z.nativeEnum(RegistrationStatusEnum),
registrationTypeEnumId: z.nativeEnum(RegistrationTypeEnum),
divisionName: z.string().max(128),
clubNameKr: zClubName,
clubNameKr: zClubName.optional(),
newClubNameKr: zClubName,
clubId: z.coerce.number().int().min(1),
activityFieldKr: z.string().max(255),
activityFieldEn: z.string().max(255),
Expand Down
2 changes: 2 additions & 0 deletions packages/interface/src/api/registration/endpoint/apiReg015.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ const responseBodyMap = {
clubId: z.coerce.number().int().min(1).optional(),
clubNameKr: zClubName,
clubNameEn: zClubName,
newClubNameKr: zClubName,
newClubNameEn: zClubName,
representative: z.object({
studentNumber: z.coerce.number().int().min(1),
name: z.string().max(30),
Expand Down
2 changes: 2 additions & 0 deletions packages/interface/src/api/registration/endpoint/apiReg022.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ const responseBodyMap = {
clubId: z.coerce.number().int().min(1).optional(),
clubNameKr: zClubName,
clubNameEn: zClubName,
newClubNameKr: zClubName,
newClubNameEn: zClubName,
representative: z.object({
studentNumber: z.coerce.number().int().min(1),
name: z.string().max(30),
Expand Down
7 changes: 6 additions & 1 deletion packages/web/src/app/my/clubs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import LoginRequired from "@sparcs-clubs/web/common/frames/LoginRequired";
import NotForExecutive from "@sparcs-clubs/web/common/frames/NotForExecutive";
import { useAuth } from "@sparcs-clubs/web/common/providers/AuthContext";
import MyClubsMainFrame from "@sparcs-clubs/web/features/my/clubs/frames/MyClubsMainFrame";
import MyClubsProfessorFrame from "@sparcs-clubs/web/features/my/clubs/frames/MyClubsProfessorFrame";

const MyClubs = () => {
const { isLoggedIn, login, profile } = useAuth();
Expand Down Expand Up @@ -42,7 +43,11 @@ const MyClubs = () => {
]}
title="나의 동아리"
/>
<MyClubsMainFrame />
{profile === "professor" ? (
<MyClubsProfessorFrame />
) : (
<MyClubsMainFrame />
)}
</FlexWrapper>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";

import Link from "next/link";
import { useRouter } from "next/navigation";
import styled from "styled-components";

import Icon from "@sparcs-clubs/web/common/components/Icon";
Expand Down Expand Up @@ -32,19 +32,19 @@ const BreadCrumb: React.FC<BreadCrumbProps> = ({
enableLast = false,
}) => {
const itemsWithMain = [{ name: "메인", path: "/" }, ...items];
const router = useRouter();

return (
<BreadCrumbContainer>
{itemsWithMain.map((item, index) => (
<React.Fragment key={item.name}>
<Link href={item.path} passHref>
<BreadCrumbItem
text={item.name}
disabled={
index === itemsWithMain.length - 1 ? !enableLast : false
}
/>
</Link>
<BreadCrumbItem
text={item.name}
disabled={index === itemsWithMain.length - 1 ? !enableLast : false}
onClick={() => {
router.push(item.path);
}}
/>
{index < itemsWithMain.length - 1 && (
<Icon type="chevron_right" size={20} color={colors.PRIMARY} />
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import AsyncBoundary from "@sparcs-clubs/web/common/components/AsyncBoundary";
import Card from "@sparcs-clubs/web/common/components/Card";
import ThumbnailPreviewList from "@sparcs-clubs/web/common/components/File/ThumbnailPreviewList";
import FlexWrapper from "@sparcs-clubs/web/common/components/FlexWrapper";
import { ListItem } from "@sparcs-clubs/web/common/components/ListItem";
import ProgressCheckSection from "@sparcs-clubs/web/common/components/ProgressCheckSection";
import Tag from "@sparcs-clubs/web/common/components/Tag";
import Typography from "@sparcs-clubs/web/common/components/Typography";
Expand All @@ -13,6 +14,7 @@ import {
RegistrationTypeTagList,
} from "@sparcs-clubs/web/constants/tableTagList";
import PastActivityReportList from "@sparcs-clubs/web/features/manage-club/activity-report/components/PastActivityReportList";
import { FilePreviewContainer } from "@sparcs-clubs/web/features/my/register-club/frames/MyRegisterClubDetailFrame";
import { getRegisterClubProgress } from "@sparcs-clubs/web/features/register-club/constants/registerClubProgress";
import { getActualYear } from "@sparcs-clubs/web/utils/Date/extractDate";
import { getTagDetail } from "@sparcs-clubs/web/utils/getTagDetail";
Expand Down Expand Up @@ -77,105 +79,98 @@ const ClubRegisterDetailFrame: React.FC<ClubRegisterDetail> = ({
<Typography fw="MEDIUM" lh={20} fs={16}>
기본 정보
</Typography>
<Typography lh={20} fs={16}>
{`\u2022 동아리명: ${data?.clubNameKr}`}
</Typography>
<Typography lh={20} fs={16}>
{`\u2022 대표자 이름: ${data?.representative.name}`}
</Typography>
<Typography lh={20} fs={16}>
{`\u2022 대표자 전화번호: ${data?.representative.phoneNumber}`}
</Typography>
<Typography lh={20} fs={16}>
{`\u2022 설립 연도: ${data && getActualYear(data?.foundedAt)}`}
</Typography>
<Typography lh={20} fs={16}>
{`\u2022 소속 분과: ${data && getTagDetail(data?.divisionId, DivisionTypeTagList).text}`}
</Typography>
<Typography lh={20} fs={16}>
{`\u2022 활동 분야 (국문): ${data?.activityFieldKr}`}
</Typography>
<Typography lh={20} fs={16}>
{`\u2022 활동 분야 (영문): ${data?.activityFieldEn}`}
</Typography>
<ListItem>
동아리명 (국문): {data?.clubNameKr ?? data?.newClubNameKr}
</ListItem>
<ListItem>
동아리명 (영문): {data?.clubNameEn ?? data?.newClubNameEn}
</ListItem>
{data?.clubNameKr && (
<ListItem>신규 동아리명 (국문): {data?.newClubNameKr}</ListItem>
)}
{data?.clubNameEn && (
<ListItem>신규 동아리명 (영문): {data?.newClubNameEn}</ListItem>
)}
<ListItem>{`대표자 이름: ${data?.representative.name}`}</ListItem>
<ListItem>
{`대표자 전화번호: ${data?.representative.phoneNumber}`}
</ListItem>
<ListItem>
{`설립 연도: ${data && getActualYear(data?.foundedAt)}`}
</ListItem>
<ListItem>
{`소속 분과: ${data && getTagDetail(data?.divisionId, DivisionTypeTagList).text}`}
</ListItem>
<ListItem>{`활동 분야 (국문): ${data?.activityFieldKr}`}</ListItem>
<ListItem>{`활동 분야 (영문): ${data?.activityFieldEn}`}</ListItem>
</FlexWrapper>
{data?.professor && (
<FlexWrapper gap={12} direction="column">
<Typography fw="MEDIUM" lh={20} fs={16}>
지도교수 정보
</Typography>
<Typography lh={20} fs={16}>
{`\u2022 성함: ${data?.professor?.name}`}
</Typography>
<Typography lh={20} fs={16}>
{`\u2022 직급: ${professorEnumToText(data?.professor?.professorEnumId)}`}
</Typography>
<Typography lh={20} fs={16}>
{`\u2022 이메일: ${data?.professor?.email}`}
</Typography>
<ListItem>{`성함: ${data?.professor?.name}`}</ListItem>
<ListItem>
{`직급: ${professorEnumToText(data?.professor?.professorEnumId)}`}
</ListItem>
<ListItem>{`이메일: ${data?.professor?.email}`}</ListItem>
</FlexWrapper>
)}
<FlexWrapper gap={12} direction="column">
<Typography fw="MEDIUM" lh={20} fs={16}>
동아리 정보
</Typography>
<Typography lh={20} fs={16}>
{`\u2022 분과 정합성: ${data?.divisionConsistency}`}
</Typography>
<Typography lh={20} fs={16}>
{`\u2022 설립 목적: ${data?.foundationPurpose}`}
</Typography>
<Typography lh={20} fs={16}>
{`\u2022 주요 활동 계획: ${data?.activityPlan}`}
</Typography>
<ListItem>{`분과 정합성: ${data?.divisionConsistency}`}</ListItem>
<ListItem>{`설립 목적: ${data?.foundationPurpose}`}</ListItem>
<ListItem>{`주요 활동 계획: ${data?.activityPlan}`}</ListItem>
{data?.activityPlanFile && (
<>
<Typography lh={20} fs={16}>
{`\u2022 활동 계획서`}
</Typography>
<ListItem>활동계획서</ListItem>
{data?.activityPlanFile && (
<ThumbnailPreviewList
fileList={[
{
src: data?.activityPlanFile?.url,
name: data?.activityPlanFile?.name,
},
]}
/>
<FilePreviewContainer>
<ThumbnailPreviewList
fileList={[
{
src: data?.activityPlanFile?.url,
name: data?.activityPlanFile?.name,
},
]}
/>
</FilePreviewContainer>
)}
</>
)}
{data?.clubRuleFile && (
<>
<Typography lh={20} fs={16}>
{`\u2022 동아리 회칙`}
</Typography>
<ListItem>동아리 회칙</ListItem>
{data?.clubRuleFile && (
<ThumbnailPreviewList
fileList={[
{
src: data?.clubRuleFile?.url,
name: data?.clubRuleFile?.name,
},
]}
/>
<FilePreviewContainer>
<ThumbnailPreviewList
fileList={[
{
src: data?.clubRuleFile?.url,
name: data?.clubRuleFile?.name,
},
]}
/>
</FilePreviewContainer>
)}
</>
)}
{data?.externalInstructionFile && (
<>
<Typography lh={20} fs={16}>
{`\u2022 (선택) 외부 강사 지도 계획서`}
</Typography>
<ListItem>(선택) 외부 강사 지도 계획서</ListItem>
{data?.externalInstructionFile && (
<ThumbnailPreviewList
fileList={[
{
src: data?.externalInstructionFile?.url,
name: data?.externalInstructionFile?.name,
},
]}
/>
<FilePreviewContainer>
<ThumbnailPreviewList
fileList={[
{
src: data?.externalInstructionFile?.url,
name: data?.externalInstructionFile?.name,
},
]}
/>
</FilePreviewContainer>
)}
</>
)}
Expand Down
Loading

0 comments on commit 4558c98

Please sign in to comment.