-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix minor issues for executive activity #1394
Fix minor issues for executive activity #1394
Conversation
@@ -248,30 +254,28 @@ const ActivityReportDetailFrame: React.FC<ActivityReportDetailFrameProps> = ({ | |||
labels={ | |||
getActivityReportProgress( | |||
data.activityStatusEnumId, | |||
data.updatedAt, | |||
data.activityStatusEnumId === 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요런거 숫자 말고 인터페이스에 ActivityStatusEnum 사용하면 좋을 것 같아요
@@ -64,6 +65,7 @@ const useGetActivityReportDetail = ( | |||
|
|||
return { | |||
data: memoizedData, | |||
clubId: activityReport?.clubId ?? 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
혹시 요거 memoizedData 에 있는 clubId 그대로 사용하지 않고 따로 뺀 이유가 있나요?
그렇다면 ActivityReportDetailFrame
199 번째 줄의 !("clubId" in data)
이라는 조건을 !clubId 혹은 그냥 아예 지워도 될거 같아요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요거 에러 나는 이유가 data 가 CurrentActivityReport 타입으로 리턴되는데(13번째 줄) CurrentActivityReport에 clubId가 없어서 그런거 같아요 CurrentActivityReport 여기에 clubId 추가하면 어떨까요?_?
@@ -226,6 +228,10 @@ const ActivityReportDetailFrame: React.FC<ActivityReportDetailFrameProps> = ({ | |||
return null; | |||
}; | |||
|
|||
const filteredComments = data.comments.filter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
별거 아니긴 한데 요거 수정페이지 쪽에서도 똑같이 필터하고 있는 것 같고 활동이 승인되었습니다
라는 상수 스트링도 사용하고 있어서 함수로 밖으로 빼는건 어떨까?
data.updatedAt, | ||
data.activityStatusEnumId === 1 | ||
? data.editedAt | ||
: data.commentedAt || data.editedAt, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
홈 뭔가 가독성이 조굼 떨어지는거 같은데 그냥 commentedAt이 있으면 그걸로 없으면 editedAt으로 하면 안되나?
commentedAt 이 있는데 activityStatusEnum이 applied 일 수가 있나?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이미 한 번 검토가 됐는데 다시 수정하면 applied로 바뀌어서 상태가 applied일 때만 editedAt을 보여줘야 하고,
commentedAt은 null이 가능해서 없을 경우에 사용할게 필요해서 updatedAt으로 수정했어
@@ -18,6 +22,12 @@ const useExecutiveApproveActivityReport = (activityId: number) => { | |||
queryClient.invalidateQueries({ | |||
queryKey: activityReportDetailQueryKey("executive", activityId), | |||
}); | |||
queryClient.invalidateQueries({ | |||
queryKey: ["executiveChargedActivities"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요거 딱히 쿼리키 정의된 곳은 없이 사용만 하고 있는거 같은데 요거 뭔가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 #1367 에서 써용
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그 pr에서 쿼리키 수정한 것 같은데 여기도 하는거죠?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
queryKey인 array에서 앞쪽 원소가 동일하면 다 invalidate이 된다고 하네용
테스트도 했음!
cell: info => formatDateTime(info.getValue()), | ||
cell: info => { | ||
const date = info.getValue(); | ||
return date ? formatDateTime(date) : "-"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
물어봤는데 commentedAt 오면은 보여주는게 맞대요
요거 filterActivityComments 함수 파라미터를 optional로 하고 -- 아니면 제가 임시저장 조금 수정하면서 동윤이 pr에 빈객체인지 확인하는 utils 함수 추가했는데 그거로 빈객체인지 체크해도 될거 같아요 |
이거 방금 커밋으로 조금 다르게 해결했는데 이렇게 해도 괜찮을까요? |
오호 오키오키 👍🏻 |
요약 *
It closes #1388
스크린샷
이후 Task *