From 76a665fa505846b74df53ab9eaf2dddab0ad09b6 Mon Sep 17 00:00:00 2001 From: pbc1017 Date: Wed, 3 Jan 2024 17:23:32 +0900 Subject: [PATCH] =?UTF-8?q?=EF=B8=8F=F0=9F=92=84=20edit=20my=20activity=20?= =?UTF-8?q?feedback?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/routes/feedback.js | 17 ++++++++++++---- .../activity/ActivityProof/ActivityProof.tsx | 2 +- .../ActivityFeedbackList.tsx | 8 ++++---- .../DashboardClubList/DashboardClubList.tsx | 4 +--- .../admin/DashboardClubList/style.css | 3 +-- .../ActivityAdminDetail.tsx | 20 ------------------- .../ActivityDashboard/ActivityDashboard.tsx | 4 +++- .../ActivityFeedbackScreen.tsx | 12 +++++++++-- 8 files changed, 33 insertions(+), 37 deletions(-) diff --git a/back/routes/feedback.js b/back/routes/feedback.js index 04bc9fb..7ba8ac8 100644 --- a/back/routes/feedback.js +++ b/back/routes/feedback.js @@ -225,6 +225,7 @@ router.get("/my_feedback_activity", async (req, res) => { activity && activity.club ? activity.club.name : "Unknown Club"; const activityName = activity ? activity.title : "Unknown Activity"; const feedbackTypeId = activity ? activity.feedback_type : null; + const activityType = activity ? activity.activity_type_id : null; // Fetch feedback details const feedbackDetail = await ActivityFeedback.findOne({ @@ -246,21 +247,29 @@ router.get("/my_feedback_activity", async (req, res) => { : null; // Fetch executive details - const executiveMember = await Member.findByPk(studentId); + // const executiveMember = await Member.findByPk(studentId); return { activityId: activity ? activity.id : null, clubName, activityName, feedbackMemberName, - executiveMemberName: executiveMember - ? executiveMember.name - : "Unknown Executive", + activityType, feedbackType: feedbackTypeId, }; }) ); + responseArray.sort((a, b) => { + if (a.clubName < b.clubName) { + return -1; + } + if (a.clubName > b.clubName) { + return 1; + } + return 0; + }); + responseArray.sort((a, b) => { if (a.feedbackType < b.feedbackType) { return -1; diff --git a/front/src/components/activity/ActivityProof/ActivityProof.tsx b/front/src/components/activity/ActivityProof/ActivityProof.tsx index 8717985..17cc930 100644 --- a/front/src/components/activity/ActivityProof/ActivityProof.tsx +++ b/front/src/components/activity/ActivityProof/ActivityProof.tsx @@ -19,7 +19,7 @@ export const ActivityProof = ({ fileName, onDelete, }: Props): JSX.Element => { - const isImage = url?.match(/\.(jpeg|jpg|gif|png)$/) != null; + const isImage = url?.match(/\.(jpeg|jpg|gif|png|PNG|JPG|JPE|GIF)$/) != null; const proxyUrl = url ? `${process.env.REACT_APP_BACKEND_URL}/activity/image-proxy?url=${url}` : ""; diff --git a/front/src/components/admin/ActivityFeedbackList/ActivityFeedbackList.tsx b/front/src/components/admin/ActivityFeedbackList/ActivityFeedbackList.tsx index e2537b8..f4a2af8 100644 --- a/front/src/components/admin/ActivityFeedbackList/ActivityFeedbackList.tsx +++ b/front/src/components/admin/ActivityFeedbackList/ActivityFeedbackList.tsx @@ -16,7 +16,7 @@ interface Props { club?: string; activity?: string; doneby?: string; - chargeof?: string; + activityType?: string; state?: number; } @@ -26,8 +26,8 @@ export const ActivityFeedbackList = ({ index = "#", club = "동아리명", activity = "활동명", + activityType = "활동분류", doneby = "검토자", - chargeof = "담당자", state = 1, }: Props): JSX.Element => { const navigate = useNavigate(); @@ -49,10 +49,10 @@ export const ActivityFeedbackList = ({
{activity}
-
{doneby}
+
{activityType}
-
{chargeof}
+
{doneby}
{title === "zero" &&
검토 상태
} diff --git a/front/src/components/admin/DashboardClubList/DashboardClubList.tsx b/front/src/components/admin/DashboardClubList/DashboardClubList.tsx index bc897df..f519f19 100644 --- a/front/src/components/admin/DashboardClubList/DashboardClubList.tsx +++ b/front/src/components/admin/DashboardClubList/DashboardClubList.tsx @@ -71,15 +71,13 @@ export const DashboardClubList = ({ ); if (confirmation) { - setSelectedExecutive(newValue); - // Call POST API here postRequest( "feedback/update_executive", { student_id: newValue, club_id: clubId }, (response) => { console.log("Post request successful", response.data); - alert("검토 담당자 변경이 완료되었습니다."); + setSelectedExecutive(newValue); }, (error) => { console.error("Post request failed", error); diff --git a/front/src/components/admin/DashboardClubList/style.css b/front/src/components/admin/DashboardClubList/style.css index 83c5519..92a2338 100644 --- a/front/src/components/admin/DashboardClubList/style.css +++ b/front/src/components/admin/DashboardClubList/style.css @@ -64,7 +64,6 @@ line-height: normal; margin-top: -1px; position: relative; - height: 100%; } .dashboard-club-list .frame-2 { @@ -78,7 +77,7 @@ padding: 10px; position: relative; width: 110px; - height: 100%; + height: 105%; } .dashboard-club-list .frame-3 { diff --git a/front/src/pages/admin/ActivityAdminDetail/ActivityAdminDetail.tsx b/front/src/pages/admin/ActivityAdminDetail/ActivityAdminDetail.tsx index 983bff9..d870d4c 100644 --- a/front/src/pages/admin/ActivityAdminDetail/ActivityAdminDetail.tsx +++ b/front/src/pages/admin/ActivityAdminDetail/ActivityAdminDetail.tsx @@ -267,26 +267,6 @@ export const ActivityAdminDetail = (): JSX.Element => {
- {/* {typeId < 4 && ( -
-
navigate(`/edit_activity/${id}`)} - style={{ cursor: "pointer" }} - > - 수정 -
- {durationStatus == 1 && ( -
- 삭제 -
- )} -
- )} */} ); diff --git a/front/src/pages/admin/ActivityDashboard/ActivityDashboard.tsx b/front/src/pages/admin/ActivityDashboard/ActivityDashboard.tsx index edfb52c..d6894ca 100644 --- a/front/src/pages/admin/ActivityDashboard/ActivityDashboard.tsx +++ b/front/src/pages/admin/ActivityDashboard/ActivityDashboard.tsx @@ -6,6 +6,7 @@ import { UpperBar } from "components/home/UpperBar"; import "./ActivityDashboard.css"; import { SubTitle } from "components/home/SubTitle"; import { getRequest } from "utils/api"; +import { useExecutiveStatus } from "hooks/useUserPermission"; interface ClubData { clubName: string; @@ -27,6 +28,7 @@ interface DashboardData { } export const ActivityDashboard = (): JSX.Element => { + const { executiveStatuses } = useExecutiveStatus(); const [dashboardData, setDashboardData] = useState({ totalActivities: 0, nonFeedbackTypeOneActivities: 0, @@ -53,7 +55,7 @@ export const ActivityDashboard = (): JSX.Element => { return (
- +
diff --git a/front/src/pages/admin/ActivityFeedbackScreen/ActivityFeedbackScreen.tsx b/front/src/pages/admin/ActivityFeedbackScreen/ActivityFeedbackScreen.tsx index ff66dce..1b6781d 100644 --- a/front/src/pages/admin/ActivityFeedbackScreen/ActivityFeedbackScreen.tsx +++ b/front/src/pages/admin/ActivityFeedbackScreen/ActivityFeedbackScreen.tsx @@ -5,17 +5,19 @@ import { UnderBar } from "components/home/UnderBar"; import "./ActivityFeedbackScreen.css"; import { UpperBar } from "components/home/UpperBar"; import { getRequest } from "utils/api"; +import { useExecutiveStatus } from "hooks/useUserPermission"; interface ActivityFeedbackData { activityId: number; clubName: string; activityName: string; feedbackMemberName: string; - executiveMemberName: string; + activityType: number; feedbackType: number; } export const ActivityFeedbackScreen = (): JSX.Element => { + const { executiveStatuses } = useExecutiveStatus(); const [feedbackActivities, setFeedbackActivities] = useState< ActivityFeedbackData[] >([]); @@ -51,8 +53,14 @@ export const ActivityFeedbackScreen = (): JSX.Element => { index={String(index + 1)} club={activity.clubName} activity={activity.activityName} + activityType={ + activity.activityType === 1 + ? "내부" + : activity.activityType === 2 + ? "외부" + : "비합치" + } doneby={activity.feedbackMemberName} - chargeof={activity.executiveMemberName} state={activity.feedbackType} activity_id={activity.activityId} />