Skip to content

Commit

Permalink
Merge pull request #1398 from academic-relations/1397-add-funding-pat…
Browse files Browse the repository at this point in the history
…hs-for-production-and-update-funding-status-progress-handling

feat: add funding paths and update funding status progress handling
  • Loading branch information
pbc1017 authored Jan 29, 2025
2 parents 33aecd6 + ef7ac18 commit 5a5d132
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 26 deletions.
1 change: 1 addition & 0 deletions packages/web/src/constants/nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { Paths } from "./paths";

const headerPaths: (keyof Paths)[] = [
"CLUBS",
"NOTICE",
"VOTING",
"COMMUNITY",
"SERVICE",
Expand Down
57 changes: 33 additions & 24 deletions packages/web/src/constants/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
* @author andy@sparcs.org (Sangwoo Ye)
*/

import { MeetingEnum } from "@sparcs-clubs/interface/common/enum/meeting.enum";

import { MEETING_PATH } from "../features/meeting/constants";

const externalLinks = {
allClubRepresentativeMeeting:
"https://cafe.naver.com/ArticleList.nhn?search.clubid=26985838&search.menuid=14&search.boardtype=L",
Expand Down Expand Up @@ -52,6 +48,9 @@ export const productionReadyPaths: {
// 활동 보고서
"/manage-club/activity-report",
"/executive/activity-report",
// 지원금
"/manage-club/funding",
// "/executive/funding",
// 동아리 / 회원 등록
"/register-club",
"/my/register-club",
Expand All @@ -66,6 +65,12 @@ export const productionReadyPaths: {
// authority가 "all"을 포함하면 권한 상관 없이 보이는 메뉴
const paths = {
HOME: { name: "홈", path: "/", featureFlag: "DEFAULT", authority: ["all"] },
NOTICE: {
name: "공지사항",
path: "/notice",
authority: ["all"],
featureFlag: "DEFAULT",
},
CLUBS: {
name: "동아리",
featureFlag: "DEFAULT",
Expand All @@ -76,12 +81,6 @@ const paths = {
authority: ["all"],
featureFlag: "DEFAULT",
},
{
name: "공지사항",
path: "/notice",
authority: ["all"],
featureFlag: "DEFAULT",
},
{
name: "나의 동아리",
path: "/my/clubs",
Expand All @@ -107,32 +106,36 @@ const paths = {
name: "의결기구",
featureFlag: "DEFAULT",
sub: [
{
name: "최근 회의",
path: "/meeting",
featureFlag: "NO_RELEASE",
},
// {
// name: "최근 회의",
// path: "/meeting",
// featureFlag: "DEFAULT",
// },
{
name: "전동대회",
path: MEETING_PATH(MeetingEnum.clubRepresentativesCouncilMeeting),
// path: MEETING_PATH(MeetingEnum.clubRepresentativesCouncilMeeting),
path: externalLinks.allClubRepresentativeMeeting,
authority: ["all"],
featureFlag: "DEFAULT",
},
{
name: "확대운영위원회",
path: MEETING_PATH(MeetingEnum.expansiveOperativeCommittee),
// path: MEETING_PATH(MeetingEnum.expansiveOperativeCommittee),
path: externalLinks.expandedOperatingCommittee,
authority: ["all"],
featureFlag: "DEFAULT",
},
{
name: "운영위원회",
path: MEETING_PATH(MeetingEnum.operativeCommittee),
// path: MEETING_PATH(MeetingEnum.operativeCommittee),
path: externalLinks.operatingCommittee,
authority: ["all"],
featureFlag: "DEFAULT",
},
{
name: "분과회의",
path: MEETING_PATH(MeetingEnum.divisionMeeting),
// path: MEETING_PATH(MeetingEnum.divisionMeeting),
path: externalLinks.divisionMeeting,
authority: ["all"],
featureFlag: "DEFAULT",
},
Expand All @@ -144,11 +147,11 @@ const paths = {
featureFlag: "DEFAULT",
// TODO: 임시 링크
sub: [
{
name: "소통채널 안내",
path: "/communication-channel",
featureFlag: "NO_RELEASE",
},
// {
// name: "소통채널 안내",
// path: "/communication-channel",
// featureFlag: "NO_RELEASE",
// },
{
name: "카카오톡 문의하기",
path: externalLinks.kakaotalk,
Expand Down Expand Up @@ -217,6 +220,12 @@ const paths = {
authority: ["executive"],
featureFlag: "DEFAULT",
},
// {
// name: "지원금",
// path: "/executive/funding",
// authority: ["executive"],
// featureFlag: "DEFAULT",
// },
],
authority: ["executive"],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,30 @@ const getFundingProgress = (
},
],
};
// TODO. 운위 승인 필요 케이스 수정 필요
case FundingStatusEnum.Committee:
return {
labels: ["신청 완료", "운위 승인 필요"],
progress: [
{ status: ProgressCheckSectionStatusEnum.Approved, date: undefined },
{
status: ProgressCheckSectionStatusEnum.Pending,
date: commentedAt,
},
],
};
// TODO. 부분 승인 케이스 수정 필요
case FundingStatusEnum.Partial:
return {
labels: ["신청 완료", "동아리 연합회 부분 승인"],
progress: [
{ status: ProgressCheckSectionStatusEnum.Approved, date: undefined },
{
status: ProgressCheckSectionStatusEnum.Approved,
date: commentedAt,
},
],
};
default:
throw new Error("Invalid funding status");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useMemo } from "react";

import { FundingStatusEnum } from "@sparcs-clubs/interface/common/enum/funding.enum";
import { useQueryClient } from "@tanstack/react-query";
import { useParams, useRouter } from "next/navigation";
import { overlay } from "overlay-kit";
Expand Down Expand Up @@ -57,6 +58,11 @@ const FundingDetailFrame: React.FC<FundingDetailFrameProps> = ({ clubId }) => {
};

const openEditModal = () => {
if (funding?.fundingStatusEnum === FundingStatusEnum.Applied) {
router.push(`/manage-club/funding/${id}/edit`);
return;
}

overlay.open(({ isOpen, close }) => (
<Modal isOpen={isOpen}>
<CancellableModalContent
Expand All @@ -68,7 +74,7 @@ const FundingDetailFrame: React.FC<FundingDetailFrameProps> = ({ clubId }) => {
>
지원금 신청 내역을 수정하면 신청 상태가 모두 초기화 됩니다.
<br />
ㄱㅊ?
수정하시겠습니까?
</CancellableModalContent>
</Modal>
));
Expand Down Expand Up @@ -96,7 +102,7 @@ const FundingDetailFrame: React.FC<FundingDetailFrameProps> = ({ clubId }) => {
>
지원금 신청 내역을 삭제하면 복구할 수 없습니다.
<br />
ㄱㅊ?
삭제하시겠습니까?
</CancellableModalContent>
</Modal>
));
Expand Down

0 comments on commit 5a5d132

Please sign in to comment.