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
1 change: 1 addition & 0 deletions client/src/app/leader/newcomer/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const menuItems = [
{ label: "새신자 등록/조회", path: "/leader/newcomer/management" },
{ label: "교육 현황", path: "/leader/newcomer/education" },
{ label: "섬김이 관리", path: "/leader/newcomer/managers" },
{ label: "주차별 예상 참석", path: "/leader/newcomer/weekly-attendance" },
]

export default function NewcomerLayout({
Expand Down
24 changes: 24 additions & 0 deletions client/src/app/leader/newcomer/management/NewcomerFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ interface NewcomerFilterProps {
setFilterMinYear: (value: string) => void
filterMaxYear: string
setFilterMaxYear: (value: string) => void
filterStatus: string
setFilterStatus: (value: string) => void
clearFilters: () => void
}

Expand All @@ -21,6 +23,8 @@ export default function NewcomerFilter({
setFilterMinYear,
filterMaxYear,
setFilterMaxYear,
filterStatus,
setFilterStatus,
clearFilters,
}: NewcomerFilterProps) {
return (
Expand Down Expand Up @@ -90,6 +94,26 @@ export default function NewcomerFilter({
</TextField>
</Stack>

<Stack direction="row" alignItems="center" gap="12px">
<Box width="60px" fontSize="14px">
상태:
</Box>
<TextField
select
size="small"
value={filterStatus}
onChange={(e) => setFilterStatus(e.target.value)}
variant="outlined"
sx={{ flex: 1 }}
>
<MenuItem value="">전체</MenuItem>
<MenuItem value="NORMAL">활동중</MenuItem>
<MenuItem value="PROMOTED">등반</MenuItem>
<MenuItem value="PENDING">보류</MenuItem>
<MenuItem value="DELETED">삭제</MenuItem>
</TextField>
</Stack>

<Stack direction="row" alignItems="center" gap="12px">
<Box width="60px" fontSize="14px">
생년:
Expand Down
88 changes: 75 additions & 13 deletions client/src/app/leader/newcomer/management/NewcomerForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ interface Newcomer {
yearOfBirth: number | null
phone: string | null
gender: "man" | "woman" | "" | null
status?: "NORMAL" | "PROMOTED" | "PENDING" | "DELETED"
newcomerManager?: {
id: string
user: { id: string; name: string }
Expand All @@ -22,6 +23,8 @@ interface NewcomerFormProps {
onDataChange: (key: string, value: any) => void
onSave: () => void
onDelete: () => void
onPending: () => void
onPromote: () => void
onClear: () => void
managerList: Manager[]
}
Expand All @@ -31,9 +34,26 @@ export default function NewcomerForm({
onDataChange,
onSave,
onDelete,
onPending,
onPromote,
onClear,
managerList,
}: NewcomerFormProps) {
const getStatusLabel = (status?: string) => {
switch (status) {
case "NORMAL":
return "활동중"
case "PROMOTED":
return "등반"
case "PENDING":
return "보류"
case "DELETED":
return "삭제"
default:
return "활동중"
}
}

return (
<Stack
flex={1}
Expand Down Expand Up @@ -61,19 +81,45 @@ export default function NewcomerForm({
{selectedNewcomer.id ? "정보 수정 중.." : "새로 입력 중.."}
</Box>
<Stack direction="row" gap="8px">
{selectedNewcomer.id && (
<Button
variant="outlined"
color="error"
onClick={onDelete}
sx={{
borderRadius: "8px",
textTransform: "none",
px: 2,
}}
>
삭제
</Button>
{selectedNewcomer.id && selectedNewcomer.status !== "DELETED" && (
<>
<Button
variant="outlined"
color="warning"
onClick={onPending}
sx={{
borderRadius: "8px",
textTransform: "none",
px: 2,
}}
>
보류
</Button>
<Button
variant="outlined"
color="success"
onClick={onPromote}
sx={{
borderRadius: "8px",
textTransform: "none",
px: 2,
}}
>
등반
</Button>
<Button
variant="outlined"
color="error"
onClick={onDelete}
sx={{
borderRadius: "8px",
textTransform: "none",
px: 2,
}}
>
삭제
</Button>
</>
)}
<Button
variant="contained"
Expand Down Expand Up @@ -188,6 +234,22 @@ export default function NewcomerForm({
))}
</TextField>
</Stack>

<Stack direction="row" alignItems="center" gap="12px">
<Box width="80px" textAlign="right">
상태 :
</Box>
<Box
sx={{
flex: 1,
p: 1,
fontSize: "14px",
color: "#666",
}}
>
{getStatusLabel(selectedNewcomer.status)}
</Box>
</Stack>
</Stack>
)
}
61 changes: 61 additions & 0 deletions client/src/app/leader/newcomer/management/NewcomerTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ interface Newcomer {
phone: string | null
gender: "man" | "woman" | "" | null
status: string
createdAt: string
deletedAt?: string | null
pendingDate?: string | null
promotionDate?: string | null
}

interface NewcomerTableProps {
Expand All @@ -35,6 +39,21 @@ export default function NewcomerTable({
onSortClick,
onNewcomerSelect,
}: NewcomerTableProps) {
const getStatusLabel = (status?: string) => {
switch (status) {
case "NORMAL":
return "활동중"
case "PROMOTED":
return "등반"
case "PENDING":
return "보류"
case "DELETED":
return "삭제"
default:
return ""
}
}

return (
<Stack
width="50%"
Expand Down Expand Up @@ -85,6 +104,27 @@ export default function NewcomerTable({
전화번호
</TableSortLabel>
</TableCell>
<TableCell>
<TableSortLabel
active={orderProperty === "status"}
direction={direction}
onClick={() => onSortClick("status")}
>
상태
</TableSortLabel>
</TableCell>
<TableCell>
<TableSortLabel
active={orderProperty === "createdAt"}
direction={direction}
onClick={() => onSortClick("createdAt")}
>
등록일
</TableSortLabel>
</TableCell>
<TableCell>보류일</TableCell>
<TableCell>등반일</TableCell>
<TableCell>삭제일</TableCell>
</TableRow>
</TableHead>
<TableBody>
Expand All @@ -108,6 +148,27 @@ export default function NewcomerTable({
: newcomer.yearOfBirth}
</TableCell>
<TableCell>{newcomer.phone || ""}</TableCell>
<TableCell>{getStatusLabel(newcomer.status)}</TableCell>
<TableCell>
{newcomer.createdAt
? new Date(newcomer.createdAt).toLocaleDateString("ko-KR")
: ""}
</TableCell>
<TableCell>
{newcomer.pendingDate
? new Date(newcomer.pendingDate).toLocaleDateString("ko-KR")
: ""}
</TableCell>
<TableCell>
{newcomer.promotionDate
? new Date(newcomer.promotionDate).toLocaleDateString("ko-KR")
: ""}
</TableCell>
<TableCell>
{newcomer.deletedAt
? new Date(newcomer.deletedAt).toLocaleDateString("ko-KR")
: ""}
</TableCell>
</TableRow>
))}
</TableBody>
Expand Down
Loading