From 2625cae649660e6e8a1ff8de3cb0dc09f1dc4b49 Mon Sep 17 00:00:00 2001 From: Jeong-Ag Date: Fri, 20 Sep 2024 21:46:32 +0900 Subject: [PATCH 01/16] =?UTF-8?q?fix(member):=20=EC=97=85=EB=A1=9C?= =?UTF-8?q?=EB=93=9C=20=ED=8C=8C=EC=9D=BC=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/common/Image/Image.tsx | 11 ++++- .../ActivityNoticeModal.tsx | 1 + .../WeeklyActivityCard/WeeklyActivityCard.tsx | 49 ++++++++++--------- .../GroupAssignmentPage.tsx | 3 +- 4 files changed, 39 insertions(+), 25 deletions(-) diff --git a/apps/member/src/components/common/Image/Image.tsx b/apps/member/src/components/common/Image/Image.tsx index 18b2b2ce..408bc50f 100644 --- a/apps/member/src/components/common/Image/Image.tsx +++ b/apps/member/src/components/common/Image/Image.tsx @@ -1,13 +1,15 @@ import { SyntheticEvent, useCallback, useState } from 'react'; -import { cn } from '@clab-platforms/utils'; +import { cn, createURL } from '@clab-platforms/utils'; +import { SERVER_BASE_URL } from '@constants/api'; import { NOT_FOUND_IMG } from '@constants/path'; interface ImageProps extends React.ImgHTMLAttributes { width?: string; height?: string; overflow?: boolean; + isFile?: boolean; } type Status = 'loading' | 'error' | 'loaded'; @@ -19,6 +21,7 @@ const Image = ({ overflow, className, onClick, + isFile, ...rest }: ImageProps) => { const [status, setStatus] = useState('loading'); @@ -26,6 +29,12 @@ const Image = ({ const _width = width ?? 'w-full'; const _height = height ?? 'h-full'; + if (isFile) { + if (!src?.startsWith(SERVER_BASE_URL)) { + src = createURL(SERVER_BASE_URL, src); + } + } + const handleLoad = useCallback(() => { setStatus('loaded'); }, []); diff --git a/apps/member/src/components/group/ActivityNoticeSection/ActivityNoticeModal.tsx b/apps/member/src/components/group/ActivityNoticeSection/ActivityNoticeModal.tsx index 87447c4c..5f53e7d0 100644 --- a/apps/member/src/components/group/ActivityNoticeSection/ActivityNoticeModal.tsx +++ b/apps/member/src/components/group/ActivityNoticeSection/ActivityNoticeModal.tsx @@ -24,6 +24,7 @@ export const ActivityNoticeModal = ({ alt={file.originalFileName} height="w-[300px]" className="object-cover" + isFile /> ) : (

{content}

-
- {isParticipant && ( -
-

첨부 파일

- {files?.map((file) => ( -
- {isImageFile(file.fileUrl) ? ( - {file.originalFileName} - ) : ( - - )} -
- ))} -
+ {isParticipant && Boolean(files?.length) && ( + <> +
+
+

첨부 파일

+ {files?.map((file) => ( +
+ {isImageFile(file.fileUrl) ? ( + {file.originalFileName} + ) : ( + + )} +
+ ))} +
+ )} {assignments?.map( ({ diff --git a/apps/member/src/pages/GroupAssignmentPage/GroupAssignmentPage.tsx b/apps/member/src/pages/GroupAssignmentPage/GroupAssignmentPage.tsx index d55fb4cf..d38cba4a 100644 --- a/apps/member/src/pages/GroupAssignmentPage/GroupAssignmentPage.tsx +++ b/apps/member/src/pages/GroupAssignmentPage/GroupAssignmentPage.tsx @@ -77,6 +77,7 @@ const GroupAssignmentPage = () => { height="w-[300px]" className="object-cover" key={file.fileUrl} + isFile /> ) : ( { {isLeader ? ( - + ) : ( <> Date: Fri, 20 Sep 2024 21:51:25 +0900 Subject: [PATCH 02/16] =?UTF-8?q?refactor(member):=20=EC=84=A0=ED=83=9D=20?= =?UTF-8?q?=EB=A9=A4=EB=B2=84=20=EC=8A=B9=EC=9D=B8=20=EC=98=88=EC=99=B8?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20=EC=B6=94=EA=B0=80,=20=EC=A7=80=EC=9B=90?= =?UTF-8?q?=EC=9E=90=20=EC=97=86=EB=8A=94=20=EA=B2=BD=EC=9A=B0=EC=97=94=20?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=20=ED=91=9C=EC=8B=9C=20X?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ActivityParticipantEditor.tsx | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/apps/member/src/components/group/ActivityParticipantEditor/ActivityParticipantEditor.tsx b/apps/member/src/components/group/ActivityParticipantEditor/ActivityParticipantEditor.tsx index 5c61b142..6e8a137d 100644 --- a/apps/member/src/components/group/ActivityParticipantEditor/ActivityParticipantEditor.tsx +++ b/apps/member/src/components/group/ActivityParticipantEditor/ActivityParticipantEditor.tsx @@ -19,6 +19,7 @@ import { GROUP_MESSAGE } from '@constants/message'; import { ACTIVITY_MEMBER_ROLE, ACTIVITY_MEMBER_STATE } from '@constants/state'; import useModal from '@hooks/common/useModal'; import { usePagination } from '@hooks/common/usePagination'; +import useToast from '@hooks/common/useToast'; import { useActivityGroupApplication, useActivityGroupApplicationMutation, @@ -62,6 +63,7 @@ function getRoleColor(state: ActivityMemberRoleType): BadgeColorVariant { const ActivityParticipantEditor = ({ groupId, }: ActivityParticipantEditorProps) => { + const toast = useToast(); const [mode, setMode] = useState(false); const { page, size, handlePageChange } = usePagination({ defaultSize: 10 }); const { openModal, closeModal } = useModal(); @@ -132,11 +134,16 @@ const ActivityParticipantEditor = ({ const changeList = selectedMember .filter((member) => member.status === true) .map((member) => member.memberId); - + if (!changeList.length) { + return toast({ + state: 'error', + message: '선택된 멤버가 없어요', + }); + } openModal({ content: ( { activityGroupApplicationMutate({ activityGroupId: groupId, @@ -153,11 +160,13 @@ const ActivityParticipantEditor = ({ return (
- - setMode(!mode)}> - 선택 - - + {!(applyMemberList.items.length === 1) && ( + + setMode(!mode)}> + 선택 + + + )} {applyMemberList.items.length === 1 ? ( From c965520aa88cc0e99986d2fbf2870afd67808e8a Mon Sep 17 00:00:00 2001 From: Jeong-Ag Date: Fri, 20 Sep 2024 21:59:22 +0900 Subject: [PATCH 03/16] =?UTF-8?q?refactor(member):=20=EA=B8=80=EC=9E=90?= =?UTF-8?q?=EC=88=98=20=EC=A0=9C=ED=95=9C=20=EC=B6=94=EA=B0=80,=20?= =?UTF-8?q?=ED=99=9C=EB=8F=99=20=EC=B9=B4=ED=85=8C=EA=B3=A0=EB=A6=AC=20?= =?UTF-8?q?=ED=95=9C=EA=B8=80=EB=A1=9C=20=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ActivityAssignmentEditor.tsx | 14 ++++++++++++-- .../ActivityPostEditor/ActivityPostEditor.tsx | 19 ++++++++++++++++--- .../ActivityInfoModal.tsx | 7 ++++++- .../modal/ActivityBoardEditModal.tsx | 15 ++++++++++++++- 4 files changed, 48 insertions(+), 7 deletions(-) diff --git a/apps/member/src/components/group/ActivityAssignmentEditor/ActivityAssignmentEditor.tsx b/apps/member/src/components/group/ActivityAssignmentEditor/ActivityAssignmentEditor.tsx index b17f8762..8dd2db99 100644 --- a/apps/member/src/components/group/ActivityAssignmentEditor/ActivityAssignmentEditor.tsx +++ b/apps/member/src/components/group/ActivityAssignmentEditor/ActivityAssignmentEditor.tsx @@ -3,6 +3,7 @@ import { useRef, useState } from 'react'; import { Button, Grid, Input } from '@clab-platforms/design-system'; import { Section } from '@components/common/Section'; +import TextCounting from '@components/common/TextCounting/TextCounting'; import Textarea from '@components/common/Textarea/Textarea'; import { FORM_DATA_KEY } from '@constants/api'; @@ -42,11 +43,17 @@ const ActivityAssignmentEditor = ({ parentId, activityGroupId }: Props) => { const formData = new FormData(); const files = uploaderRef.current?.files; - if (!board.title || !board.content || !board.dueDateTime) + if (!board.title || !board.content || !board.dueDateTime) { return toast({ state: 'error', message: '제목, 내용, 종료 일시는 필수 입력 요소입니다.', }); + } else if (board.content.length > ACTIVITY_GROUP_CONTENT_MAX_LENGTH) { + return toast({ + state: 'error', + message: `내용은 ${ACTIVITY_GROUP_CONTENT_MAX_LENGTH}자 이내로 작성해주세요.`, + }); + } if (files) { Array.from(files).forEach((file) => { formData.append(FORM_DATA_KEY, file); @@ -87,10 +94,13 @@ const ActivityAssignmentEditor = ({ parentId, activityGroupId }: Props) => { label="내용" placeholder="내용을 입력해주세요." className="w-full" - maxLength={200} value={board.content} onChange={handlePostChange} /> + ACTIVITY_GROUP_CONTENT_MAX_LENGTH) { + return toast({ + state: 'error', + message: `내용은 ${ACTIVITY_GROUP_CONTENT_MAX_LENGTH}자 이내로 작성해주세요.`, + }); } + if (files?.length) { Array.from(files).forEach((file) => { formData.append(FORM_DATA_KEY, file); @@ -128,10 +138,13 @@ const ActivityPostEditor = ({ label="내용" placeholder="내용을 입력해주세요." className="w-full" - maxLength={200} value={post.content} onChange={handlePostChange} /> +
- {category} + + {toKoreaActivityGroupCategory(category as ActivityGroupCategoryType)} + {name} {subject} diff --git a/apps/member/src/components/modal/ActivityBoardEditModal.tsx b/apps/member/src/components/modal/ActivityBoardEditModal.tsx index a7684fc4..db787d3d 100644 --- a/apps/member/src/components/modal/ActivityBoardEditModal.tsx +++ b/apps/member/src/components/modal/ActivityBoardEditModal.tsx @@ -5,10 +5,14 @@ import { cn } from '@clab-platforms/utils'; import File from '@components/common/File/File'; import Modal from '@components/common/Modal/Modal'; +import TextCounting from '@components/common/TextCounting/TextCounting'; import Textarea from '@components/common/Textarea/Textarea'; import { FORM_DATA_KEY } from '@constants/api'; -import { ACTIVITY_BOARD_CATEGORY_STATE } from '@constants/state'; +import { + ACTIVITY_BOARD_CATEGORY_STATE, + ACTIVITY_GROUP_CONTENT_MAX_LENGTH, +} from '@constants/state'; import useModal from '@hooks/common/useModal'; import useToast from '@hooks/common/useToast'; import { useActivityGroupBoardPatchMutation } from '@hooks/queries'; @@ -56,6 +60,11 @@ export const ActivityBoardEditModal = ({ prevData, groupId }: Props) => { state: 'error', message: '제목과 내용을 입력해주세요.', }); + } else if (board.content.length > ACTIVITY_GROUP_CONTENT_MAX_LENGTH) { + return toast({ + state: 'error', + message: `내용은 ${ACTIVITY_GROUP_CONTENT_MAX_LENGTH}자 이내로 작성해주세요.`, + }); } if (files?.length) { Array.from(files).forEach((file) => { @@ -98,6 +107,10 @@ export const ActivityBoardEditModal = ({ prevData, groupId }: Props) => { onChange={handleBoardChange} placeholder={board.content} /> + Date: Fri, 20 Sep 2024 22:02:19 +0900 Subject: [PATCH 04/16] =?UTF-8?q?refactor(member):=20=EC=A0=9C=EC=B6=9C?= =?UTF-8?q?=EB=AC=BC=20=EC=A1=B0=ED=9A=8C=EC=97=90=EC=84=9C=20=EC=A7=80?= =?UTF-8?q?=EB=82=9C=20=EC=A0=9C=EC=B6=9C=20=EC=8B=9C=EA=B0=84=20=ED=91=9C?= =?UTF-8?q?=EC=8B=9C=EB=90=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ActivityAssignmentEditor.tsx | 15 +++++++++- .../AssignmentListSection.tsx | 29 +++++++++++++++---- .../AssignmentUploadSection.tsx | 10 ++----- .../modal/ActivityBoardEditModal.tsx | 23 +++++++++++++++ apps/member/src/utils/date.ts | 23 +++++++++++++++ 5 files changed, 85 insertions(+), 15 deletions(-) diff --git a/apps/member/src/components/group/ActivityAssignmentEditor/ActivityAssignmentEditor.tsx b/apps/member/src/components/group/ActivityAssignmentEditor/ActivityAssignmentEditor.tsx index 8dd2db99..e6fae4a1 100644 --- a/apps/member/src/components/group/ActivityAssignmentEditor/ActivityAssignmentEditor.tsx +++ b/apps/member/src/components/group/ActivityAssignmentEditor/ActivityAssignmentEditor.tsx @@ -7,9 +7,14 @@ import TextCounting from '@components/common/TextCounting/TextCounting'; import Textarea from '@components/common/Textarea/Textarea'; import { FORM_DATA_KEY } from '@constants/api'; -import { ACTIVITY_BOARD_CATEGORY_STATE } from '@constants/state'; +import { + ACTIVITY_BOARD_CATEGORY_STATE, + ACTIVITY_GROUP_CONTENT_MAX_LENGTH, +} from '@constants/state'; import useToast from '@hooks/common/useToast'; import { useActivityGroupBoardMutation, useMyProfile } from '@hooks/queries'; +import { isDateValid, toKoreaISOString } from '@utils/date'; +import dayjs from 'dayjs'; interface Props { parentId: number; @@ -54,6 +59,14 @@ const ActivityAssignmentEditor = ({ parentId, activityGroupId }: Props) => { message: `내용은 ${ACTIVITY_GROUP_CONTENT_MAX_LENGTH}자 이내로 작성해주세요.`, }); } + + if (isDateValid(board.dueDateTime, toKoreaISOString(String(dayjs())))) { + return toast({ + state: 'error', + message: '종료 일시는 현재 일시 이후로 선택해주세요.', + }); + } + if (files) { Array.from(files).forEach((file) => { formData.append(FORM_DATA_KEY, file); diff --git a/apps/member/src/components/group/AssignmentListSection/AssignmentListSection.tsx b/apps/member/src/components/group/AssignmentListSection/AssignmentListSection.tsx index 57cffc44..16cba4da 100644 --- a/apps/member/src/components/group/AssignmentListSection/AssignmentListSection.tsx +++ b/apps/member/src/components/group/AssignmentListSection/AssignmentListSection.tsx @@ -1,6 +1,7 @@ import { useParams } from 'react-router-dom'; import { Button, Table } from '@clab-platforms/design-system'; +import { cn } from '@clab-platforms/utils'; import File from '@components/common/File/File'; import { Section } from '@components/common/Section'; @@ -13,16 +14,24 @@ import { useActivityGroupBoardByParent, useActivityGroupMemberList, } from '@hooks/queries'; -import { formattedDate, toKoreaISOString } from '@utils/date'; +import { + calOverDate, + formattedDate, + isDateValid, + toKoreaISOString, +} from '@utils/date'; import type { ActivityBoardType } from '@type/activity'; import AssignmentFeedbackModal from './AssignmentFeedbackModal'; -const AssignmentListSection = () => { +interface AssignmentListSectionProps { + dueDate: string; +} + +const AssignmentListSection = ({ dueDate }: AssignmentListSectionProps) => { const { id, assignmentId } = useParams(); const { openModal } = useModal(); - if (!assignmentId || !id) { throw new Error(GROUP_MESSAGE.NO_ACTIVITY); } @@ -72,9 +81,17 @@ const AssignmentListSection = () => { {item.memberId} {item.memberName} - - {item.files - ? formattedDate(toKoreaISOString(item.updatedAt)) + + {item.updatedAt + ? isDateValid(dueDate, toKoreaISOString(item.updatedAt)) + ? calOverDate(dueDate, toKoreaISOString(item.updatedAt)) + : formattedDate(toKoreaISOString(item.updatedAt)) : '-'} diff --git a/apps/member/src/components/group/AssignmentUploadSection/AssignmentUploadSection.tsx b/apps/member/src/components/group/AssignmentUploadSection/AssignmentUploadSection.tsx index 948378f5..20c0916d 100644 --- a/apps/member/src/components/group/AssignmentUploadSection/AssignmentUploadSection.tsx +++ b/apps/member/src/components/group/AssignmentUploadSection/AssignmentUploadSection.tsx @@ -122,16 +122,10 @@ const AssignmentUploadSection = ({ 종료 일시 - {isDateValid( - dueDateTime, - toKoreaISOString(dayjs().format('YYYY.MM.DD')), - ) + {isDateValid(dueDateTime, String(dayjs())) ? '제출 기한이 지났습니다' : formattedDate(dueDateTime)} diff --git a/apps/member/src/components/modal/ActivityBoardEditModal.tsx b/apps/member/src/components/modal/ActivityBoardEditModal.tsx index db787d3d..9ac589bf 100644 --- a/apps/member/src/components/modal/ActivityBoardEditModal.tsx +++ b/apps/member/src/components/modal/ActivityBoardEditModal.tsx @@ -16,6 +16,8 @@ import { import useModal from '@hooks/common/useModal'; import useToast from '@hooks/common/useToast'; import { useActivityGroupBoardPatchMutation } from '@hooks/queries'; +import { isDateValid } from '@utils/date'; +import dayjs from 'dayjs'; import type { ActivityBoardType } from '@type/activity'; import type { ResponseFile } from '@type/api'; @@ -66,6 +68,17 @@ export const ActivityBoardEditModal = ({ prevData, groupId }: Props) => { message: `내용은 ${ACTIVITY_GROUP_CONTENT_MAX_LENGTH}자 이내로 작성해주세요.`, }); } + + if ( + prevData.category === ACTIVITY_BOARD_CATEGORY_STATE.ASSIGNMENT && + isDateValid(board.dueDateTime, String(dayjs())) + ) { + return toast({ + state: 'error', + message: '종료 일시는 현재 일시 이후로 선택해주세요.', + }); + } + if (files?.length) { Array.from(files).forEach((file) => { formData.append(FORM_DATA_KEY, file); @@ -116,6 +129,16 @@ export const ActivityBoardEditModal = ({ prevData, groupId }: Props) => { uploaderRef={uploaderRef} handleDeleteFileClick={handleDeleteFileClick} /> + {!uploadedFile && + prevData?.files?.map((file) => ( +
+ +
+ ))} {prevData.category === ACTIVITY_BOARD_CATEGORY_STATE.ASSIGNMENT && ( Date: Fri, 20 Sep 2024 22:04:46 +0900 Subject: [PATCH 05/16] =?UTF-8?q?refactor(member):=20=EC=A2=85=EB=A3=8C?= =?UTF-8?q?=EB=90=9C=20=ED=99=9C=EB=8F=99=20=EC=83=81=EC=84=B8=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=A0=91=EA=B7=BC=20=EC=A0=9C=ED=95=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/member/src/constants/message.ts | 1 + .../src/pages/GroupDetailPage/GroupDetailPage.tsx | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/member/src/constants/message.ts b/apps/member/src/constants/message.ts index 4360282a..fe9d9bec 100644 --- a/apps/member/src/constants/message.ts +++ b/apps/member/src/constants/message.ts @@ -19,6 +19,7 @@ export const GROUP_MESSAGE = { NO_END_ACTIVITY: '종료된 활동 그룹이 없어요.', NO_PROGRESSING_ACTIVITY: '진행중인 활동 그룹이 없어요.', NO_PARTICIPANT: '활동 멤버가 없어요.', + END_ACTIVITY: '종료된 활동 그룹이에요.', } as const; export const LIBRARY_MESSAGE = { diff --git a/apps/member/src/pages/GroupDetailPage/GroupDetailPage.tsx b/apps/member/src/pages/GroupDetailPage/GroupDetailPage.tsx index dde83029..eb90501a 100644 --- a/apps/member/src/pages/GroupDetailPage/GroupDetailPage.tsx +++ b/apps/member/src/pages/GroupDetailPage/GroupDetailPage.tsx @@ -11,7 +11,7 @@ import WeeklyActivitySection from '@components/group/WeeklyActivitySection/Weekl import { TABLE_HEAD } from '@constants/head'; import { GROUP_MESSAGE } from '@constants/message'; import { PATH, PATH_FINDER } from '@constants/path'; -import { ACTIVITY_MEMBER_STATE } from '@constants/state'; +import { ACTIVITY_MEMBER_STATE, ACTIVITY_STATE } from '@constants/state'; import useModal from '@hooks/common/useModal'; import { useMyProfile } from '@hooks/queries'; import { useActivityGroup } from '@hooks/queries/activity/useActivityGroup'; @@ -26,13 +26,15 @@ const GroupDetailPage = () => { const { data: myProfile } = useMyProfile(); const { data } = useActivityGroup(+id); - const isParticipant = data.groupMembers.some( - (member) => member.memberId === myProfile.id, - ); + if (data.status === ACTIVITY_STATE.END) + throw new Error(GROUP_MESSAGE.END_ACTIVITY); const acceptedParticipant = data.groupMembers.filter( (member) => member.status === ACTIVITY_MEMBER_STATE.ACCEPTED, ); + const isParticipant = acceptedParticipant.some( + (member) => member.memberId === myProfile.id, + ); const handleApplicationClick = () => { openModal({ From 8258343531bb962441e8a5c53e24b03371b182f0 Mon Sep 17 00:00:00 2001 From: Jeong-Ag Date: Fri, 20 Sep 2024 22:07:18 +0900 Subject: [PATCH 06/16] =?UTF-8?q?refactor(member):=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=EB=84=A4=EC=9D=B4=EC=85=98=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ManageActivitySection/ManageActivitySection.tsx | 6 +++--- apps/member/src/constants/key.ts | 12 ++++++++++++ .../activity/useActivityGroupDeleteMutation.ts | 7 ++++--- .../hooks/queries/activity/useActivityGroupMember.ts | 2 +- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/apps/member/src/components/manage/ManageActivitySection/ManageActivitySection.tsx b/apps/member/src/components/manage/ManageActivitySection/ManageActivitySection.tsx index 20c49c2e..50315d71 100644 --- a/apps/member/src/components/manage/ManageActivitySection/ManageActivitySection.tsx +++ b/apps/member/src/components/manage/ManageActivitySection/ManageActivitySection.tsx @@ -88,7 +88,7 @@ const ManageActivitySection = () => { {groupData.items.length ? ( groupData.items.map(({ leaders, name, subject, id }, index) => ( - {index + 1} + {index + 1 + page * 6} {name} {subject} @@ -132,7 +132,7 @@ const ManageActivitySection = () => { {groupData.items.length ? ( groupData.items.map(({ leaders, name, subject, id }, index) => ( - {index + 1} + {index + 1 + page * 6} {name} {subject} @@ -176,7 +176,7 @@ const ManageActivitySection = () => { {groupData.items.length ? ( groupData.items.map(({ leaders, name, subject, id }, index) => ( - {index + 1} + {index + 1 + page * 6} {name} {subject} diff --git a/apps/member/src/constants/key.ts b/apps/member/src/constants/key.ts index 0de1b0ed..148b291c 100644 --- a/apps/member/src/constants/key.ts +++ b/apps/member/src/constants/key.ts @@ -93,6 +93,18 @@ export const ACTIVITY_QUERY_KEY = { ...ACTIVITY_QUERY_KEY.STATUSES(), status, ], + STATUSES_PAGES: (status: ActivityGroupStatusType) => [ + ...ACTIVITY_QUERY_KEY.STATUS(status), + 'pages', + ], + STATUS_PAGE: ( + status: ActivityGroupStatusType, + pagination: WithPaginationParams, + ) => [...ACTIVITY_QUERY_KEY.STATUSES_PAGES(status), pagination], + CATEGORY_PAGE: ( + category: CommunityCategoryType, + pagination: WithPaginationParams, + ) => [...BOARD_QUERY_KEY.CATEGORY_PAGES(category), pagination], APPLICATION: (id: number) => [...ACTIVITY_QUERY_KEY.APPLICATIONS(), id], BOARD: ({ id, category, parent = false }: BoardParams) => [ ...ACTIVITY_QUERY_KEY.BOARDS(), diff --git a/apps/member/src/hooks/queries/activity/useActivityGroupDeleteMutation.ts b/apps/member/src/hooks/queries/activity/useActivityGroupDeleteMutation.ts index 3903e051..235a306f 100644 --- a/apps/member/src/hooks/queries/activity/useActivityGroupDeleteMutation.ts +++ b/apps/member/src/hooks/queries/activity/useActivityGroupDeleteMutation.ts @@ -27,9 +27,10 @@ export function useActivityGroupDeleteMutation() { }); } const queryKeys = [ - ACTIVITY_QUERY_KEY.STATUS(ACTIVITY_STATE.END), - ACTIVITY_QUERY_KEY.STATUS(ACTIVITY_STATE.PROGRESSING), - ACTIVITY_QUERY_KEY.STATUS(ACTIVITY_STATE.WAITING), + ACTIVITY_QUERY_KEY.STATUSES(), + ACTIVITY_QUERY_KEY.STATUSES_PAGES(ACTIVITY_STATE.END), + ACTIVITY_QUERY_KEY.STATUSES_PAGES(ACTIVITY_STATE.PROGRESSING), + ACTIVITY_QUERY_KEY.STATUSES_PAGES(ACTIVITY_STATE.WAITING), ACTIVITY_QUERY_KEY.DETAIL(data), ]; diff --git a/apps/member/src/hooks/queries/activity/useActivityGroupMember.ts b/apps/member/src/hooks/queries/activity/useActivityGroupMember.ts index 8ca7d9f4..0c42c6bc 100644 --- a/apps/member/src/hooks/queries/activity/useActivityGroupMember.ts +++ b/apps/member/src/hooks/queries/activity/useActivityGroupMember.ts @@ -20,7 +20,7 @@ export function useActivityGroupMember({ size = 99, }: Params = {}) { return useSuspenseQuery({ - queryKey: ACTIVITY_QUERY_KEY.STATUS(status), + queryKey: ACTIVITY_QUERY_KEY.STATUS_PAGE(status, { page, size }), queryFn: () => getActivityGroupByStatus(status, page, size), }); } From 017ebad699593f9ae2152e8bc6b7b14b16dae9ae Mon Sep 17 00:00:00 2001 From: Jeong-Ag Date: Fri, 20 Sep 2024 22:09:24 +0900 Subject: [PATCH 07/16] =?UTF-8?q?style(member):=20=EB=B2=84=ED=8A=BC?= =?UTF-8?q?=EB=A7=88=EB=8B=A4=20=EB=AA=A8=EB=8B=AC=EC=B0=BD=20message=20?= =?UTF-8?q?=EB=8B=A4=EB=A5=B4=EA=B2=8C=20=EC=A0=81=EC=9A=A9,=20=ED=99=9C?= =?UTF-8?q?=EB=8F=99=20=EC=83=81=EC=84=B8=20=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=95=84=EC=9B=83=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ActivityDetailSection.tsx | 2 +- .../ManageActivitySection.tsx | 37 ++++++++++++++----- apps/member/src/types/activity.ts | 2 +- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/apps/member/src/components/group/ActivityDetailSection/ActivityDetailSection.tsx b/apps/member/src/components/group/ActivityDetailSection/ActivityDetailSection.tsx index 3f270134..42d896fd 100644 --- a/apps/member/src/components/group/ActivityDetailSection/ActivityDetailSection.tsx +++ b/apps/member/src/components/group/ActivityDetailSection/ActivityDetailSection.tsx @@ -25,7 +25,7 @@ const ActivityDetailSection = ({ data }: ActivityDetailSectionProps) => { alt={data.name} className="rounded-lg border object-cover" /> -
+

{data.name}

{data.content}

diff --git a/apps/member/src/components/manage/ManageActivitySection/ManageActivitySection.tsx b/apps/member/src/components/manage/ManageActivitySection/ManageActivitySection.tsx index 50315d71..fe20fd47 100644 --- a/apps/member/src/components/manage/ManageActivitySection/ManageActivitySection.tsx +++ b/apps/member/src/components/manage/ManageActivitySection/ManageActivitySection.tsx @@ -19,7 +19,7 @@ import { useActivityGroupStatusMutation, } from '@hooks/queries'; -import type { ActivityGroupStatusType } from '@type/activity'; +import type { ActivityGroupStatusType, LeaderType } from '@type/activity'; import { ActivityInfoModal } from './ActivityInfoModal'; @@ -52,11 +52,13 @@ const ManageActivitySection = () => { const handleApproveButtonClick = ( id: number, status: ActivityGroupStatusType, + name: string, + leaders: Array, ) => { openModal({ content: ( { activityGroupStatusMutate({ activityGroupId: id, @@ -68,11 +70,16 @@ const ManageActivitySection = () => { ), }); }; - const handleRejectButtonClick = (id: number) => { + const handleRejectButtonClick = ( + id: number, + name: string, + leaders: Array, + text?: string, + ) => { openModal({ content: ( { activityGroupDeleteMutate(id); }} @@ -104,14 +111,21 @@ const ManageActivitySection = () => { - handleApproveButtonClick(id, ACTIVITY_STATE.PROGRESSING) + handleApproveButtonClick( + id, + ACTIVITY_STATE.PROGRESSING, + name, + leaders, + ) } > 승인 handleRejectButtonClick(id)} + onClick={() => + handleRejectButtonClick(id, name, leaders, '거절') + } > 거절 @@ -147,14 +161,19 @@ const ManageActivitySection = () => { handleRejectButtonClick(id)} + onClick={() => handleRejectButtonClick(id, name, leaders)} > 삭제 - handleApproveButtonClick(id, ACTIVITY_STATE.END) + handleApproveButtonClick( + id, + ACTIVITY_STATE.END, + name, + leaders, + ) } > 종료 @@ -191,7 +210,7 @@ const ManageActivitySection = () => { handleRejectButtonClick(id)} + onClick={() => handleRejectButtonClick(id, name, leaders)} > 삭제 diff --git a/apps/member/src/types/activity.ts b/apps/member/src/types/activity.ts index a4bd3da2..9ab69192 100644 --- a/apps/member/src/types/activity.ts +++ b/apps/member/src/types/activity.ts @@ -18,7 +18,7 @@ export type ActivityMemberRoleType = (typeof ACTIVITY_MEMBER_ROLE)[keyof typeof ACTIVITY_MEMBER_ROLE]; export type ActivityGroupStatusType = (typeof ACTIVITY_STATE)[keyof typeof ACTIVITY_STATE]; -type LeaderType = { +export type LeaderType = { id: string; name: string; }; From 845ded98ee20edab8577d2c2c5fccd8ade1aeacc Mon Sep 17 00:00:00 2001 From: Jeong-Ag Date: Fri, 20 Sep 2024 22:10:52 +0900 Subject: [PATCH 08/16] =?UTF-8?q?fix(member):=20endpoint=20=EC=98=A4?= =?UTF-8?q?=ED=83=80=20=EC=88=98=EC=A0=95,=20=EA=B3=B5=EC=A7=80=EC=82=AC?= =?UTF-8?q?=ED=95=AD=20=EC=B6=94=EA=B0=80=20=ED=9B=84=20=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=20input=20=EC=B4=88=EA=B8=B0=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../group/ActivityNoticeEditor/ActivityNoticeEditor.tsx | 9 ++++++++- .../src/components/modal/ActivityBoardEditModal.tsx | 4 ++++ apps/member/src/constants/api.ts | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/member/src/components/group/ActivityNoticeEditor/ActivityNoticeEditor.tsx b/apps/member/src/components/group/ActivityNoticeEditor/ActivityNoticeEditor.tsx index f6038bb0..17b33366 100644 --- a/apps/member/src/components/group/ActivityNoticeEditor/ActivityNoticeEditor.tsx +++ b/apps/member/src/components/group/ActivityNoticeEditor/ActivityNoticeEditor.tsx @@ -65,7 +65,14 @@ const ActivityNoticeEditor = ({ groupId, data }: ActivityNoticeEditorProps) => { body: notice, files: files?.length ? formData : undefined, }, - { onSuccess: () => setNotice(defaultNotice) }, + { + onSuccess: () => { + setNotice(defaultNotice); + if (uploaderRef.current) { + uploaderRef.current.value = ''; + } + }, + }, ); }; diff --git a/apps/member/src/components/modal/ActivityBoardEditModal.tsx b/apps/member/src/components/modal/ActivityBoardEditModal.tsx index 9ac589bf..ca181984 100644 --- a/apps/member/src/components/modal/ActivityBoardEditModal.tsx +++ b/apps/member/src/components/modal/ActivityBoardEditModal.tsx @@ -52,7 +52,11 @@ export const ActivityBoardEditModal = ({ prevData, groupId }: Props) => { }; const handleDeleteFileClick = () => { setUploadedFile(null); + if (uploaderRef.current) { + uploaderRef.current.value = ''; + } }; + const handleEditButtonClick = () => { const formData = new FormData(); const files = uploaderRef.current?.files; diff --git a/apps/member/src/constants/api.ts b/apps/member/src/constants/api.ts index c3acc6f9..1c5a8c9e 100644 --- a/apps/member/src/constants/api.ts +++ b/apps/member/src/constants/api.ts @@ -70,7 +70,7 @@ export const END_POINT = { UPLOADEDFILE_ACTIVITY_NOTICE: (groupId: number) => `/v1/files/notices/${groupId}`, UPLOADEDFILE_ACTIVITY_ASSIGNMENT: (groupId: number) => - `/v1/files/assignment/${groupId}`, + `/v1/files/assignments/${groupId}`, // -- 활동그룹 멤버 ACTIVITY_GROUP_MEMBER: (id: number) => `/v1/activity-group/member/${id}`, ACTIVITY_GROUP_MEMBER_MY: `/v1/activity-group/member/my`, From 34b35950a72c70775394b02f0e1d4a6b7936befb Mon Sep 17 00:00:00 2001 From: Jeong-Ag Date: Sat, 21 Sep 2024 15:17:37 +0900 Subject: [PATCH 09/16] =?UTF-8?q?style(member):=20safari=20=EB=B8=8C?= =?UTF-8?q?=EB=9D=BC=EC=9A=B0=EC=A0=80=EC=97=90=EC=84=9C=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=20=EA=B9=A8=EC=A7=80=EB=8A=94=20=ED=98=84?= =?UTF-8?q?=EC=83=81=20=EB=B3=B4=EC=99=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/member/src/components/group/GroupCard/GroupCard.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/member/src/components/group/GroupCard/GroupCard.tsx b/apps/member/src/components/group/GroupCard/GroupCard.tsx index 7c3108e1..a9f4ce2a 100644 --- a/apps/member/src/components/group/GroupCard/GroupCard.tsx +++ b/apps/member/src/components/group/GroupCard/GroupCard.tsx @@ -86,7 +86,6 @@ const GroupCard = ({ {name}
From ff9e2c62e06c84ac665ab0411caa312bc5ff4dd0 Mon Sep 17 00:00:00 2001 From: Jeong-Ag Date: Sat, 21 Sep 2024 15:19:01 +0900 Subject: [PATCH 10/16] =?UTF-8?q?refactor(member):=20mode=EC=97=90=20?= =?UTF-8?q?=EB=94=B0=EB=A5=B8=20=ED=8E=98=EC=9D=B4=EC=A7=80=EB=84=A4?= =?UTF-8?q?=EC=9D=B4=EC=85=98=20=EC=B4=88=EA=B8=B0=ED=99=94,=20=ED=99=95?= =?UTF-8?q?=EC=9D=B8=20=EB=AA=A8=EB=8B=AC=EC=B0=BD=20=EB=AC=B8=EA=B5=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ManageActivitySection/ManageActivitySection.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/member/src/components/manage/ManageActivitySection/ManageActivitySection.tsx b/apps/member/src/components/manage/ManageActivitySection/ManageActivitySection.tsx index fe20fd47..485cdc7e 100644 --- a/apps/member/src/components/manage/ManageActivitySection/ManageActivitySection.tsx +++ b/apps/member/src/components/manage/ManageActivitySection/ManageActivitySection.tsx @@ -1,4 +1,5 @@ -import { useState } from 'react'; +import { useEffect, useState } from 'react'; +import { useNavigate } from 'react-router-dom'; import { Menubar, Table } from '@clab-platforms/design-system'; @@ -24,6 +25,7 @@ import type { ActivityGroupStatusType, LeaderType } from '@type/activity'; import { ActivityInfoModal } from './ActivityInfoModal'; const ManageActivitySection = () => { + const navigate = useNavigate(); const [mode, setMode] = useState( ACTIVITY_STATE.WAITING, ); @@ -54,11 +56,12 @@ const ManageActivitySection = () => { status: ActivityGroupStatusType, name: string, leaders: Array, + text: string, ) => { openModal({ content: ( { activityGroupStatusMutate({ activityGroupId: id, @@ -89,6 +92,10 @@ const ManageActivitySection = () => { }); }; + useEffect(() => { + navigate(''); + }, [mode, navigate]); + const renderMode = { WAITING: ( @@ -116,6 +123,7 @@ const ManageActivitySection = () => { ACTIVITY_STATE.PROGRESSING, name, leaders, + '승인', ) } > @@ -173,6 +181,7 @@ const ManageActivitySection = () => { ACTIVITY_STATE.END, name, leaders, + '종료', ) } > From 6e721b930ca4c6df35811121ab062185aa9ca1aa Mon Sep 17 00:00:00 2001 From: Jeong-Ag Date: Sat, 21 Sep 2024 15:28:08 +0900 Subject: [PATCH 11/16] =?UTF-8?q?style(member):=20=EC=84=A0=ED=83=9D?= =?UTF-8?q?=EB=90=9C=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=AA=85=ED=99=95?= =?UTF-8?q?=ED=95=98=EA=B2=8C=20=ED=99=95=EC=9D=B8=ED=95=A0=20=EC=88=98=20?= =?UTF-8?q?=EC=9E=88=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/group/GroupCreateSection/GroupCreateSection.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/member/src/components/group/GroupCreateSection/GroupCreateSection.tsx b/apps/member/src/components/group/GroupCreateSection/GroupCreateSection.tsx index 6f188bcb..ad8f281e 100644 --- a/apps/member/src/components/group/GroupCreateSection/GroupCreateSection.tsx +++ b/apps/member/src/components/group/GroupCreateSection/GroupCreateSection.tsx @@ -242,7 +242,8 @@ const GroupCreateSection = () => { className={cn( 'rounded-md object-cover transition duration-300 ease-in-out hover:scale-110 hover:cursor-pointer hover:opacity-50', { - 'opacity-50': inputs.imageUrl === photoItem.urls['full'], + 'border-4 border-red-500': + inputs.imageUrl === photoItem.urls['full'], }, )} /> From fb86fdc1309f6c63e1fa181e5aeca60530a24a6b Mon Sep 17 00:00:00 2001 From: Jeong-Ag Date: Sat, 21 Sep 2024 15:51:53 +0900 Subject: [PATCH 12/16] =?UTF-8?q?refactor(member):=20=ED=99=9C=EB=8F=99=20?= =?UTF-8?q?=EC=BF=BC=EB=A6=AC=ED=82=A4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/member/src/constants/key.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/member/src/constants/key.ts b/apps/member/src/constants/key.ts index 148b291c..5af71385 100644 --- a/apps/member/src/constants/key.ts +++ b/apps/member/src/constants/key.ts @@ -82,8 +82,8 @@ export const ACTIVITY_QUERY_KEY = { MY_ASSIGNMENTS: () => [...ACTIVITY_QUERY_KEY.MY(), 'assignment'], PHOTOS: () => [...ACTIVITY_QUERY_KEY.ALL, 'photos'], DETAILS: () => [...ACTIVITY_QUERY_KEY.ALL, 'details'], - STATUSES: () => [...BOARD_QUERY_KEY.ALL, 'statuses'], - APPLICATIONS: () => [...BOOK_QUERY_KEY.ALL, 'applications'], + STATUSES: () => [...ACTIVITY_QUERY_KEY.ALL, 'statuses'], + APPLICATIONS: () => [...ACTIVITY_QUERY_KEY.ALL, 'applications'], BOARDS: () => [...ACTIVITY_QUERY_KEY.ALL, 'boards'], MEMBERS: () => [...ACTIVITY_QUERY_KEY.ALL, 'members'], MY_APPLIED: () => [...ACTIVITY_QUERY_KEY.MY(), 'applied'], @@ -101,10 +101,6 @@ export const ACTIVITY_QUERY_KEY = { status: ActivityGroupStatusType, pagination: WithPaginationParams, ) => [...ACTIVITY_QUERY_KEY.STATUSES_PAGES(status), pagination], - CATEGORY_PAGE: ( - category: CommunityCategoryType, - pagination: WithPaginationParams, - ) => [...BOARD_QUERY_KEY.CATEGORY_PAGES(category), pagination], APPLICATION: (id: number) => [...ACTIVITY_QUERY_KEY.APPLICATIONS(), id], BOARD: ({ id, category, parent = false }: BoardParams) => [ ...ACTIVITY_QUERY_KEY.BOARDS(), From 965d42f38a7220c009e25d037098fba0fdf88876 Mon Sep 17 00:00:00 2001 From: Jeong-Ag Date: Sat, 21 Sep 2024 16:08:51 +0900 Subject: [PATCH 13/16] =?UTF-8?q?fix(member):=20=EB=B3=80=EA=B2=BD?= =?UTF-8?q?=EB=90=9C=20modal=20=EA=B5=AC=EC=A1=B0=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ActivityParticipantEditor.tsx | 10 +++++----- .../ActivityPostEditor/ActivityPostEditor.tsx | 6 +++--- .../AssignmentListSection.tsx | 6 +++--- .../ManageActivitySection.tsx | 14 +++++++------- .../components/modal/ActivityBoardEditModal.tsx | 8 ++++---- .../src/pages/GroupDetailPage/GroupDetailPage.tsx | 6 +++--- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/apps/member/src/components/group/ActivityParticipantEditor/ActivityParticipantEditor.tsx b/apps/member/src/components/group/ActivityParticipantEditor/ActivityParticipantEditor.tsx index 6e8a137d..0289baa2 100644 --- a/apps/member/src/components/group/ActivityParticipantEditor/ActivityParticipantEditor.tsx +++ b/apps/member/src/components/group/ActivityParticipantEditor/ActivityParticipantEditor.tsx @@ -17,7 +17,7 @@ import { CheckConfirmModal } from '@components/modal'; import { TABLE_HEAD } from '@constants/head'; import { GROUP_MESSAGE } from '@constants/message'; import { ACTIVITY_MEMBER_ROLE, ACTIVITY_MEMBER_STATE } from '@constants/state'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; import { usePagination } from '@hooks/common/usePagination'; import useToast from '@hooks/common/useToast'; import { @@ -66,7 +66,7 @@ const ActivityParticipantEditor = ({ const toast = useToast(); const [mode, setMode] = useState(false); const { page, size, handlePageChange } = usePagination({ defaultSize: 10 }); - const { openModal, closeModal } = useModal(); + const { open, close } = useModal(); const { activityGroupApplicationMutate } = useActivityGroupApplicationMutation(); const { data: applyMemberList } = useActivityGroupApplication({ @@ -84,7 +84,7 @@ const ActivityParticipantEditor = ({ })), ); const handleOpenModal = (name: string, content: string) => { - openModal({ + open({ title: '📝 ' + name, content: content, }); @@ -140,7 +140,7 @@ const ActivityParticipantEditor = ({ message: '선택된 멤버가 없어요', }); } - openModal({ + open({ content: ( ), }); diff --git a/apps/member/src/components/group/ActivityPostEditor/ActivityPostEditor.tsx b/apps/member/src/components/group/ActivityPostEditor/ActivityPostEditor.tsx index 155e35f1..84bfb688 100644 --- a/apps/member/src/components/group/ActivityPostEditor/ActivityPostEditor.tsx +++ b/apps/member/src/components/group/ActivityPostEditor/ActivityPostEditor.tsx @@ -13,7 +13,7 @@ import { ACTIVITY_BOARD_CATEGORY_STATE, ACTIVITY_GROUP_CONTENT_MAX_LENGTH, } from '@constants/state.ts'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal.ts'; import useToast from '@hooks/common/useToast'; import { useActivityGroupBoardDeleteMutation, @@ -44,7 +44,7 @@ const ActivityPostEditor = ({ assignments, }: ActivityPostEditorProps) => { const toast = useToast(); - const { openModal } = useModal(); + const { open } = useModal(); const [post, setPost] = useState(defaultPost); const [editAssignment, setEditAssignment] = useState( Array.from({ length: activities.length }, () => false), @@ -108,7 +108,7 @@ const ActivityPostEditor = ({ activityGroupBoardDeleteMutate(activityGroupBoardId); }; const handleEditWeeklyClick = (prevData: ActivityBoardType) => - openModal({ + open({ title: '수정하기', custom: , }); diff --git a/apps/member/src/components/group/AssignmentListSection/AssignmentListSection.tsx b/apps/member/src/components/group/AssignmentListSection/AssignmentListSection.tsx index 16cba4da..fa9a33f4 100644 --- a/apps/member/src/components/group/AssignmentListSection/AssignmentListSection.tsx +++ b/apps/member/src/components/group/AssignmentListSection/AssignmentListSection.tsx @@ -9,7 +9,7 @@ import { Section } from '@components/common/Section'; import { TABLE_HEAD } from '@constants/head'; import { GROUP_MESSAGE } from '@constants/message'; import { ACTIVITY_MEMBER_ROLE, ACTIVITY_MEMBER_STATE } from '@constants/state'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; import { useActivityGroupBoardByParent, useActivityGroupMemberList, @@ -31,7 +31,7 @@ interface AssignmentListSectionProps { const AssignmentListSection = ({ dueDate }: AssignmentListSectionProps) => { const { id, assignmentId } = useParams(); - const { openModal } = useModal(); + const { open } = useModal(); if (!assignmentId || !id) { throw new Error(GROUP_MESSAGE.NO_ACTIVITY); } @@ -59,7 +59,7 @@ const AssignmentListSection = ({ dueDate }: AssignmentListSectionProps) => { groupId: number, assignmentId: number, ) => { - return openModal({ + return open({ custom: ( { const [mode, setMode] = useState( ACTIVITY_STATE.WAITING, ); - const { openModal, closeModal } = useModal(); + const { open, close } = useModal(); const { page, size, handlePageChange } = usePagination({ defaultSize: 6, sectionName: 'activity', @@ -43,7 +43,7 @@ const ManageActivitySection = () => { }); const handleInfoButtonClick = (groupId: number) => { - return openModal({ + return open({ title: '그룹 정보', content: , }); @@ -58,7 +58,7 @@ const ManageActivitySection = () => { leaders: Array, text: string, ) => { - openModal({ + open({ content: ( { activityGroupStatus: status, }); }} - handleClose={closeModal} + handleClose={close} /> ), }); @@ -79,14 +79,14 @@ const ManageActivitySection = () => { leaders: Array, text?: string, ) => { - openModal({ + open({ content: ( { activityGroupDeleteMutate(id); }} - handleClose={closeModal} + handleClose={close} /> ), }); diff --git a/apps/member/src/components/modal/ActivityBoardEditModal.tsx b/apps/member/src/components/modal/ActivityBoardEditModal.tsx index ca181984..138f8148 100644 --- a/apps/member/src/components/modal/ActivityBoardEditModal.tsx +++ b/apps/member/src/components/modal/ActivityBoardEditModal.tsx @@ -13,7 +13,7 @@ import { ACTIVITY_BOARD_CATEGORY_STATE, ACTIVITY_GROUP_CONTENT_MAX_LENGTH, } from '@constants/state'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; import useToast from '@hooks/common/useToast'; import { useActivityGroupBoardPatchMutation } from '@hooks/queries'; import { isDateValid } from '@utils/date'; @@ -33,7 +33,7 @@ interface FileUploaderProps { } export const ActivityBoardEditModal = ({ prevData, groupId }: Props) => { - const { closeModal } = useModal(); + const { close } = useModal(); const toast = useToast(); const [board, setBoard] = useState(prevData); @@ -101,7 +101,7 @@ export const ActivityBoardEditModal = ({ prevData, groupId }: Props) => { }, files: files?.length ? formData : undefined, }); - closeModal(); + close(); }; return ( @@ -162,7 +162,7 @@ export const ActivityBoardEditModal = ({ prevData, groupId }: Props) => { > 변경 - + 취소 diff --git a/apps/member/src/pages/GroupDetailPage/GroupDetailPage.tsx b/apps/member/src/pages/GroupDetailPage/GroupDetailPage.tsx index eb90501a..8d0138a2 100644 --- a/apps/member/src/pages/GroupDetailPage/GroupDetailPage.tsx +++ b/apps/member/src/pages/GroupDetailPage/GroupDetailPage.tsx @@ -12,14 +12,14 @@ import { TABLE_HEAD } from '@constants/head'; import { GROUP_MESSAGE } from '@constants/message'; import { PATH, PATH_FINDER } from '@constants/path'; import { ACTIVITY_MEMBER_STATE, ACTIVITY_STATE } from '@constants/state'; -import useModal from '@hooks/common/useModal'; +import { useModal } from '@hooks/common/useModal'; import { useMyProfile } from '@hooks/queries'; import { useActivityGroup } from '@hooks/queries/activity/useActivityGroup'; const GroupDetailPage = () => { const { id } = useParams(); const navigate = useNavigate(); - const { openModal } = useModal(); + const { open } = useModal(); if (!id) throw new Error(GROUP_MESSAGE.NO_ACTIVITY); @@ -37,7 +37,7 @@ const GroupDetailPage = () => { ); const handleApplicationClick = () => { - openModal({ + open({ title: '참여자 목록', content: (
From 3e9adf3b3014ff3a6f68da6ae9ddb3cf37ed5244 Mon Sep 17 00:00:00 2001 From: Gwansik Kim Date: Sat, 21 Sep 2024 16:41:34 +0900 Subject: [PATCH 14/16] Create modern-panthers-eat.md --- .changeset/modern-panthers-eat.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/modern-panthers-eat.md diff --git a/.changeset/modern-panthers-eat.md b/.changeset/modern-panthers-eat.md new file mode 100644 index 00000000..487c0fb1 --- /dev/null +++ b/.changeset/modern-panthers-eat.md @@ -0,0 +1,5 @@ +--- +"@clab-platforms/member": patch +--- + +refactor(member): 활동 3차 QA 피드백 반영 From c97385708f449486eca7543cf39a4b1a828d0a1d Mon Sep 17 00:00:00 2001 From: gwansikk Date: Sat, 21 Sep 2024 19:27:56 +0900 Subject: [PATCH 15/16] =?UTF-8?q?refactor(member):=20=EA=B4=80=EB=A6=AC?= =?UTF-8?q?=EC=9E=90=20=ED=8E=98=EC=9D=B4=EC=A7=80=20UI=20=EA=B0=9C?= =?UTF-8?q?=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../support/SupportHistorySection.tsx | 34 ++++++++---- apps/member/src/constants/head.ts | 9 ---- .../ManagePage/components/CalendarSection.tsx | 52 +++++++++---------- 3 files changed, 48 insertions(+), 47 deletions(-) diff --git a/apps/member/src/components/support/SupportHistorySection.tsx b/apps/member/src/components/support/SupportHistorySection.tsx index f2a614ba..c8993d39 100644 --- a/apps/member/src/components/support/SupportHistorySection.tsx +++ b/apps/member/src/components/support/SupportHistorySection.tsx @@ -1,10 +1,10 @@ import { Table } from '@clab-platforms/design-system'; +import ActionButton from '@components/common/ActionButton/ActionButton'; import Pagination from '@components/common/Pagination/Pagination'; import Section from '@components/common/Section/Section'; import MembershipStatusBadge from '@components/membership/MembershipStatusBadge/MembershipStatusBadge'; -import { TABLE_HEAD } from '@constants/head'; import { ROLE_LEVEL } from '@constants/state'; import { usePagination } from '@hooks/common/usePagination'; import { useMembershipInfoModal } from '@hooks/modal/useMembershipInfoModal'; @@ -12,6 +12,8 @@ import { useMembershipFee, useMyProfile } from '@hooks/queries'; import { formattedDate } from '@utils/date'; import { formatMemberName } from '@utils/string'; +import { type MembershipFeeType } from '@type/membershipFee'; + const TITLE = '신쳥 내역'; interface Props { @@ -40,6 +42,13 @@ export function SupportHistorySection({ size, }); + const handleInfoClick = (data: MembershipFeeType) => { + open({ + data: data, + hasPermission: myProfile.roleLevel >= ROLE_LEVEL.SUPER, + }); + }; + return (
-
+
{membershipFee.items.map((membership) => ( - open({ - data: membership, - hasPermission: myProfile.roleLevel >= ROLE_LEVEL.SUPER, - }) - } + onClick={() => handleInfoClick(membership)} > {membership.id} - + {formatMemberName(membership.memberName, membership.memberId)} {membership.category} - {formatMemberName(membership.memberName, membership.memberId)} + {formattedDate(membership.createdAt)} + + { + e.stopPropagation(); + handleInfoClick(membership); + }} + > + 정보 + + ))}
diff --git a/apps/member/src/constants/head.ts b/apps/member/src/constants/head.ts index 0e4f94b5..9e54543c 100644 --- a/apps/member/src/constants/head.ts +++ b/apps/member/src/constants/head.ts @@ -18,7 +18,6 @@ export const TABLE_HEAD = { '기능', ] as const, ACTIVITY_GROUP_BOARD: ['번호', '제목', '작성일', '기능'] as const, - SUPPORT_HISTORY: ['번호', '상태', '구분', '요청자', '신청일'] as const, BOOK_LOAN_RECORD: ['대여자', '대여일', '반납 예정일', '상태'] as const, COMMUNITY_DETAIL: ['번호', '제목', '작성자', '작성일'] as const, BOOK_LOAN_RECORDS_OVERDUE: [ @@ -29,14 +28,6 @@ export const TABLE_HEAD = { '연체일수', '기능', ] as const, - CALENDAR_SCHEDULE: [ - '번호', - '제목', - '시작일', - '종료일', - '중요도', - '기능', - ] as const, CALENDAR_TABLE: ['날짜', '일정'] as const, APPLY_TABLE: [ '번호', diff --git a/apps/member/src/pages/ManagePage/components/CalendarSection.tsx b/apps/member/src/pages/ManagePage/components/CalendarSection.tsx index 7001cffd..0885b5cf 100644 --- a/apps/member/src/pages/ManagePage/components/CalendarSection.tsx +++ b/apps/member/src/pages/ManagePage/components/CalendarSection.tsx @@ -15,7 +15,6 @@ import Pagination from '@components/common/Pagination/Pagination'; import { Section } from '@components/common/Section'; import Textarea from '@components/common/Textarea/Textarea'; -import { TABLE_HEAD } from '@constants/head'; import { PATH } from '@constants/path'; import { usePagination } from '@hooks/common/usePagination'; import useToast from '@hooks/common/useToast'; @@ -23,7 +22,6 @@ import { useView } from '@hooks/common/useView'; import { useDeleteModal } from '@hooks/modal/useDeleteModal'; import { useSchedule } from '@hooks/queries'; import { formattedDate, now } from '@utils/date'; -import { toPriorityText } from '@utils/string'; import { useScheduleDeleteMutation } from '../hooks/useScheduleDeleteMutation'; import { useScheduleMutation } from '../hooks/useScheduleMutation'; @@ -57,32 +55,30 @@ export function CalendarSection() { const renderView = { view: ( - - {data.items.map( - ({ id, title, startDateTime, endDateTime, priority }) => ( - navigate(PATH.CALENDER)} - > - {id} - - {toDecodeHTMLEntities(title)} - - {formattedDate(startDateTime)} - {formattedDate(endDateTime)} - {toPriorityText(priority)} - - handleDeleteButtonClick(e, id)} - > - 삭제 - - - - ), - )} +
+ {data.items.map(({ id, title, startDateTime, endDateTime }) => ( + navigate(PATH.CALENDER)} + > + {id} + + {toDecodeHTMLEntities(title)} + + {formattedDate(startDateTime)} + {formattedDate(endDateTime)} + + + handleDeleteButtonClick(e, id)} + > + 삭제 + + + + ))}
), add: handleViewClick('view')} />, From 54c22ff5c4d72d9a27b8bbceec3739bbf44f895b Mon Sep 17 00:00:00 2001 From: Jeong-Ag Date: Sat, 21 Sep 2024 21:20:43 +0900 Subject: [PATCH 16/16] =?UTF-8?q?refactor(member):=20=EB=B6=88=ED=95=84?= =?UTF-8?q?=EC=9A=94=ED=95=9C=20=EC=BF=BC=EB=A6=AC=ED=82=A4=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20=EB=B0=8F=20=EC=BD=94=EB=93=9C=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ActivityParticipantEditor/ActivityParticipantEditor.tsx | 5 ++++- apps/member/src/components/modal/ActivityBoardEditModal.tsx | 6 +----- .../src/pages/GroupAssignmentPage/GroupAssignmentPage.tsx | 2 +- .../ManagePage/hooks/useActivityGroupDeleteMutation.ts | 4 ---- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/apps/member/src/components/group/ActivityParticipantEditor/ActivityParticipantEditor.tsx b/apps/member/src/components/group/ActivityParticipantEditor/ActivityParticipantEditor.tsx index 0289baa2..1431a2cd 100644 --- a/apps/member/src/components/group/ActivityParticipantEditor/ActivityParticipantEditor.tsx +++ b/apps/member/src/components/group/ActivityParticipantEditor/ActivityParticipantEditor.tsx @@ -162,7 +162,10 @@ const ActivityParticipantEditor = ({ {!(applyMemberList.items.length === 1) && ( - setMode(!mode)}> + setMode((prev) => !prev)} + > 선택 diff --git a/apps/member/src/components/modal/ActivityBoardEditModal.tsx b/apps/member/src/components/modal/ActivityBoardEditModal.tsx index 138f8148..f7ac696c 100644 --- a/apps/member/src/components/modal/ActivityBoardEditModal.tsx +++ b/apps/member/src/components/modal/ActivityBoardEditModal.tsx @@ -136,11 +136,7 @@ export const ActivityBoardEditModal = ({ prevData, groupId }: Props) => { {!uploadedFile && prevData?.files?.map((file) => (
- +
))} {prevData.category === ACTIVITY_BOARD_CATEGORY_STATE.ASSIGNMENT && ( diff --git a/apps/member/src/pages/GroupAssignmentPage/GroupAssignmentPage.tsx b/apps/member/src/pages/GroupAssignmentPage/GroupAssignmentPage.tsx index a73d7051..26bd591c 100644 --- a/apps/member/src/pages/GroupAssignmentPage/GroupAssignmentPage.tsx +++ b/apps/member/src/pages/GroupAssignmentPage/GroupAssignmentPage.tsx @@ -94,7 +94,7 @@ const GroupAssignmentPage = () => {
{isLeader ? ( - + ) : ( <>