Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions frontend/src/constants/status.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { ApplicationStatus } from '@/types/applicants';

export const AVAILABLE_STATUSES = [
ApplicationStatus.SUBMITTED, // 서류검토 (SUBMITTED 포함)
ApplicationStatus.INTERVIEW_SCHEDULED, // 면접예정
ApplicationStatus.ACCEPTED, // 합격
ApplicationStatus.DECLINED, // 불합격
] as const;
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@ import { Question } from '@/types/application';
import PrevApplicantButton from '@/assets/images/icons/prev_applicant.svg';
import NextApplicantButton from '@/assets/images/icons/next_applicant.svg';
import { useUpdateApplicant } from '@/hooks/queries/applicants/useUpdateApplicant';

const AVAILABLE_STATUSES = [
ApplicationStatus.SUBMITTED, // 서류검토 (SUBMITTED 포함)
ApplicationStatus.INTERVIEW_SCHEDULED, // 면접예정
ApplicationStatus.ACCEPTED, // 합격
ApplicationStatus.DECLINED, // 불합격
] as const;
import { AVAILABLE_STATUSES } from '@/constants/status';

const getStatusColor = (status: ApplicationStatus | undefined): string => {
switch (status) {
Expand Down
38 changes: 10 additions & 28 deletions frontend/src/pages/AdminPage/tabs/ApplicantsTab/ApplicantsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import selectIcon from '@/assets/images/icons/selectArrow.svg';
import deleteIcon from '@/assets/images/icons/applicant_delete.svg';
import selectAllIcon from '@/assets/images/icons/applicant_select_arrow.svg';
import { useUpdateApplicant } from '@/hooks/queries/applicants/useUpdateApplicant';
import { AVAILABLE_STATUSES } from '@/constants/status';

const ApplicantsTab = () => {
const navigate = useNavigate();
Expand Down Expand Up @@ -237,34 +238,15 @@ const ApplicantsTab = () => {
</Styled.StatusSelect>
<Styled.Arrow width={8} height={8} src={selectIcon} />
<Styled.StatusSelectMenu open={statusOpen}>
<Styled.StatusSelectMenuItem
onClick={() => {
updateAllApplicants(ApplicationStatus.SUBMITTED);
}}
>
서류검토
</Styled.StatusSelectMenuItem>
<Styled.StatusSelectMenuItem
onClick={() => {
updateAllApplicants(ApplicationStatus.INTERVIEW_SCHEDULED);
}}
>
면접예정
</Styled.StatusSelectMenuItem>
<Styled.StatusSelectMenuItem
onClick={() => {
updateAllApplicants(ApplicationStatus.ACCEPTED);
}}
>
합격
</Styled.StatusSelectMenuItem>
<Styled.StatusSelectMenuItem
onClick={() => {
updateAllApplicants(ApplicationStatus.DECLINED);
}}
>
불합격
</Styled.StatusSelectMenuItem>
{AVAILABLE_STATUSES.map((status) => (
<Styled.StatusSelectMenuItem
onClick={() => {
updateAllApplicants(status);
}}
>
{mapStatusToGroup(status).label}
</Styled.StatusSelectMenuItem>
))}
Comment on lines +241 to +249
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

React 리스트 key 누락 — 고유 key 추가 필요

.map으로 그리는 메뉴 아이템에 key가 없어 경고 및 재조정 비용이 발생할 수 있습니다. status를 key로 부여하세요.

적용 예시:

-                {AVAILABLE_STATUSES.map((status) => (
-                  <Styled.StatusSelectMenuItem
+                {AVAILABLE_STATUSES.map((status) => (
+                  <Styled.StatusSelectMenuItem
+                    key={status}
                     onClick={() => {
                       updateAllApplicants(status);
                     }}
                   >
                     {mapStatusToGroup(status).label}
                   </Styled.StatusSelectMenuItem>
                 ))}

추가로, 접근성 개선(선택 사항):

-                  <Styled.StatusSelectMenuItem
+                  <Styled.StatusSelectMenuItem
+                    role="menuitem"
+                    tabIndex={0}
                     onClick={() => {
                       updateAllApplicants(status);
                     }}
+                    onKeyDown={(e) => {
+                      if (e.key === 'Enter' || e.key === ' ') {
+                        e.preventDefault();
+                        updateAllApplicants(status);
+                      }
+                    }}
                   >
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{AVAILABLE_STATUSES.map((status) => (
<Styled.StatusSelectMenuItem
onClick={() => {
updateAllApplicants(status);
}}
>
{mapStatusToGroup(status).label}
</Styled.StatusSelectMenuItem>
))}
{AVAILABLE_STATUSES.map((status) => (
<Styled.StatusSelectMenuItem
key={status}
role="menuitem"
tabIndex={0}
onClick={() => {
updateAllApplicants(status);
}}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
updateAllApplicants(status);
}
}}
>
{mapStatusToGroup(status).label}
</Styled.StatusSelectMenuItem>
))}
🤖 Prompt for AI Agents
In frontend/src/pages/AdminPage/tabs/ApplicantsTab/ApplicantsTab.tsx around
lines 241 to 249, the mapped list of Styled.StatusSelectMenuItem elements is
missing a unique key which causes React warnings and render inefficiencies; add
a key prop using the status value (e.g., key={status}) on each mapped item to
ensure uniqueness, and optionally include an accessible role/aria attributes on
the menu items if needed for keyboard/screen-reader support.

</Styled.StatusSelectMenu>
</Styled.SelectWrapper>
<Styled.DeleteButton
Expand Down