Skip to content

Commit 12424b4

Browse files
authored
Merge pull request #68 from nuon-dev/main
새가족 입력 항목 추가 및 출석 현황 모바일에서 보기 쉽도록 수정
2 parents 206517f + f0f0c0e commit 12424b4

9 files changed

Lines changed: 277 additions & 28 deletions

File tree

client/src/app/admin/components/Header/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export default function AdminHeader() {
6363
path: "/admin/soon/attendance",
6464
type: "menu",
6565
},
66+
/*
6667
{
6768
title: "AI로 데이터 분석",
6869
icon: <AutoAwesomeIcon fontSize="small" />,
@@ -71,7 +72,7 @@ export default function AdminHeader() {
7172
},
7273
{
7374
type: "divider",
74-
},
75+
},*/
7576
/* Todo: 지울지, 유지할지 결정 필요
7677
{
7778
title: "워십 콘테스트",

client/src/app/admin/soon/attendance/AttendanceTable.tsx

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface AttendanceTableProps {
1313
leaders: User[]
1414
getAttendUserCount: (
1515
attendDataList: AttendData[],
16-
worshipScheduleId: number
16+
worshipScheduleId: number,
1717
) => { count: number; attend: number }
1818
}
1919

@@ -24,6 +24,7 @@ export default function AttendanceTable({
2424
leaders,
2525
getAttendUserCount,
2626
}: AttendanceTableProps) {
27+
const isMobile = window.innerWidth < 600
2728
return (
2829
<Box sx={{ p: 2 }}>
2930
{/* 출석 테이블 제목 */}
@@ -52,10 +53,10 @@ export default function AttendanceTable({
5253
>
5354
<Box
5455
sx={{
55-
width: 150,
56-
minWidth: 150,
57-
maxWidth: 150,
58-
p: 1.5,
56+
width: isMobile ? 104 : 150,
57+
minWidth: isMobile ? 104 : 150,
58+
maxWidth: isMobile ? 104 : 150,
59+
p: isMobile ? 0.2 : 1.5,
5960
borderRight: "1px solid #e0e0e0",
6061
display: "flex",
6162
flexDirection: "column",
@@ -89,7 +90,7 @@ export default function AttendanceTable({
8990
{worshipScheduleMapList.map((worshipSchedule) => {
9091
const { attend, count } = getAttendUserCount(
9192
attendDataList,
92-
worshipSchedule.id
93+
worshipSchedule.id,
9394
)
9495
const percentage =
9596
count > 0 ? Math.round((attend / count) * 100) : 0
@@ -98,10 +99,10 @@ export default function AttendanceTable({
9899
<Box
99100
key={worshipSchedule.id}
100101
sx={{
101-
width: 98,
102-
minWidth: 98,
103-
maxWidth: 98,
104-
p: 1.5,
102+
width: isMobile ? 85 : 98,
103+
minWidth: isMobile ? 85 : 98,
104+
maxWidth: isMobile ? 85 : 98,
105+
p: isMobile ? 0.2 : 1.5,
105106
borderRight: "1px solid #e0e0e0",
106107
display: "flex",
107108
flexDirection: "column",
@@ -135,34 +136,31 @@ export default function AttendanceTable({
135136
bgcolor: isLeader
136137
? "#e3f2fd"
137138
: isDeputyLeader
138-
? "#f3e5f5"
139-
: "white",
139+
? "#f3e5f5"
140+
: "white",
140141
borderBottom: "1px solid #e0e0e0",
141142
"&:hover": {
142143
bgcolor: isLeader
143144
? "#bbdefb"
144145
: isDeputyLeader
145-
? "#e1bee7"
146-
: "#f5f5f5",
146+
? "#e1bee7"
147+
: "#f5f5f5",
147148
},
148149
}}
149150
>
150151
<Box
151152
sx={{
152-
width: 150,
153-
minWidth: 150,
154-
maxWidth: 150,
155-
p: 1.5,
153+
width: isMobile ? 104 : 150,
154+
minWidth: isMobile ? 104 : 150,
155+
maxWidth: isMobile ? 104 : 150,
156+
p: isMobile ? 0.2 : 1.5,
156157
borderRight: "1px solid #e0e0e0",
157158
display: "flex",
158159
alignItems: "center",
159160
justifyContent: "center",
160161
}}
161162
>
162163
<Stack direction="row" alignItems="center" spacing={1}>
163-
{isLeader && (
164-
<StarIcon sx={{ fontSize: 16, color: "#1976d2" }} />
165-
)}
166164
{isDeputyLeader && (
167165
<StarBorderIcon sx={{ fontSize: 16, color: "#7b1fa2" }} />
168166
)}
@@ -183,15 +181,15 @@ export default function AttendanceTable({
183181
const attendData = attendDataList.find(
184182
(data) =>
185183
data.user.id === user.id &&
186-
data.worshipSchedule.id === worshipSchedule.id
184+
data.worshipSchedule.id === worshipSchedule.id,
187185
)
188186
return (
189187
<Box
190188
key={worshipSchedule.id}
191189
sx={{
192-
width: 114,
193-
minWidth: 114,
194-
maxWidth: 114,
190+
width: isMobile ? 80 : 114,
191+
minWidth: isMobile ? 80 : 114,
192+
maxWidth: isMobile ? 80 : 114,
195193
p: "4px",
196194
borderRight: "1px solid #e0e0e0",
197195
display: "flex",

client/src/app/leader/attendance/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default function SoonAttendance() {
7070
<CardContent sx={{ textAlign: "center", py: 4 }}>
7171
<EventNoteIcon sx={{ fontSize: 48, mb: 2, opacity: 0.9 }} />
7272
<Typography variant="h4" fontWeight="bold" gutterBottom>
73-
출석 관리 {selectedScheduleId}
73+
출석 관리
7474
</Typography>
7575
<Typography variant="body1" sx={{ opacity: 0.9 }}>
7676
순원들의 출석을 관리해보세요

client/src/app/leader/newcomer/management/NewcomerForm.tsx

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ interface Newcomer {
1212
phone: string | null
1313
gender: "man" | "woman" | "" | null
1414
status?: "NORMAL" | "PROMOTED" | "PENDING" | "DELETED"
15+
address?: string | null
16+
occupation?: string | null
17+
visitPath?: string | null
18+
registrationMotivation?: string | null
19+
faithLevel?: "초신자" | "세례" | "입교" | "학습" | null
20+
previousChurch?: string | null
21+
carNumber?: string | null
1522
newcomerManager?: {
1623
id: string
1724
user: { id: string; name: string }
@@ -206,6 +213,108 @@ export default function NewcomerForm({
206213
</TextField>
207214
</Stack>
208215

216+
<Stack direction="row" alignItems="center" gap="12px">
217+
<Box width="80px" textAlign="right">
218+
주소 :
219+
</Box>
220+
<TextField
221+
value={selectedNewcomer.address || ""}
222+
onChange={(e) => onDataChange("address", e.target.value)}
223+
variant="outlined"
224+
size="small"
225+
sx={{ flex: 1 }}
226+
/>
227+
</Stack>
228+
229+
<Stack direction="row" alignItems="center" gap="12px">
230+
<Box width="80px" textAlign="right">
231+
신분 :
232+
</Box>
233+
<TextField
234+
value={selectedNewcomer.occupation || ""}
235+
onChange={(e) => onDataChange("occupation", e.target.value)}
236+
variant="outlined"
237+
size="small"
238+
placeholder="학생-학교/전공, 직장인-계열/분야 등"
239+
sx={{ flex: 1 }}
240+
/>
241+
</Stack>
242+
243+
<Stack direction="row" alignItems="center" gap="12px">
244+
<Box width="80px" textAlign="right">
245+
방문경로 :
246+
</Box>
247+
<TextField
248+
value={selectedNewcomer.visitPath || ""}
249+
onChange={(e) => onDataChange("visitPath", e.target.value)}
250+
variant="outlined"
251+
size="small"
252+
sx={{ flex: 1 }}
253+
/>
254+
</Stack>
255+
256+
<Stack direction="row" alignItems="center" gap="12px">
257+
<Box width="80px" textAlign="right">
258+
등록계기 :
259+
</Box>
260+
<TextField
261+
value={selectedNewcomer.registrationMotivation || ""}
262+
onChange={(e) =>
263+
onDataChange("registrationMotivation", e.target.value)
264+
}
265+
variant="outlined"
266+
size="small"
267+
sx={{ flex: 1 }}
268+
/>
269+
</Stack>
270+
271+
<Stack direction="row" alignItems="center" gap="12px">
272+
<Box width="80px" textAlign="right">
273+
신앙생활 :
274+
</Box>
275+
<TextField
276+
select
277+
value={selectedNewcomer.faithLevel || ""}
278+
onChange={(e) => onDataChange("faithLevel", e.target.value)}
279+
variant="outlined"
280+
size="small"
281+
sx={{ flex: 1 }}
282+
>
283+
<MenuItem value="">선택</MenuItem>
284+
<MenuItem value="초신자">초신자</MenuItem>
285+
<MenuItem value="학습">학습</MenuItem>
286+
<MenuItem value="세례">세례</MenuItem>
287+
<MenuItem value="입교">입교</MenuItem>
288+
</TextField>
289+
</Stack>
290+
291+
<Stack direction="row" alignItems="center" gap="12px">
292+
<Box width="80px" textAlign="right">
293+
전 출석교회 :
294+
</Box>
295+
<TextField
296+
value={selectedNewcomer.previousChurch || ""}
297+
onChange={(e) => onDataChange("previousChurch", e.target.value)}
298+
variant="outlined"
299+
size="small"
300+
placeholder="교회명 / 담임목사님 성함"
301+
sx={{ flex: 1 }}
302+
/>
303+
</Stack>
304+
305+
<Stack direction="row" alignItems="center" gap="12px">
306+
<Box width="80px" textAlign="right">
307+
차량번호 :
308+
</Box>
309+
<TextField
310+
value={selectedNewcomer.carNumber || ""}
311+
onChange={(e) => onDataChange("carNumber", e.target.value)}
312+
variant="outlined"
313+
size="small"
314+
sx={{ flex: 1 }}
315+
/>
316+
</Stack>
317+
209318
<Stack direction="row" alignItems="center" gap="12px">
210319
<Box width="80px" textAlign="right">
211320
담당자 :

client/src/app/leader/newcomer/management/page.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ interface Newcomer {
3434
deletedAt?: string | null
3535
pendingDate?: string | null
3636
promotionDate?: string | null
37+
address: string | null
38+
occupation: string | null
39+
visitPath: string | null
40+
registrationMotivation: string | null
41+
faithLevel: "초신자" | "세례" | "입교" | "학습" | null
42+
previousChurch: string | null
43+
carNumber: string | null
3744
}
3845

3946
interface Manager {
@@ -55,6 +62,13 @@ const emptyNewcomer: Newcomer = {
5562
deletedAt: null,
5663
pendingDate: null,
5764
promotionDate: null,
65+
address: null,
66+
occupation: null,
67+
visitPath: null,
68+
registrationMotivation: null,
69+
faithLevel: null,
70+
previousChurch: null,
71+
carNumber: null,
5872
}
5973

6074
export default function NewcomerManagement() {
@@ -120,6 +134,15 @@ export default function NewcomerManagement() {
120134
guiderId: selectedNewcomer.guider?.id || null,
121135
assignmentId: selectedNewcomer.assignment?.id || null,
122136
status: selectedNewcomer.status,
137+
pendingDate: selectedNewcomer.pendingDate,
138+
promotionDate: selectedNewcomer.promotionDate,
139+
address: selectedNewcomer.address,
140+
occupation: selectedNewcomer.occupation,
141+
visitPath: selectedNewcomer.visitPath,
142+
registrationMotivation: selectedNewcomer.registrationMotivation,
143+
faithLevel: selectedNewcomer.faithLevel,
144+
previousChurch: selectedNewcomer.previousChurch,
145+
carNumber: selectedNewcomer.carNumber,
123146
})
124147
notification.success("새신자 정보가 수정되었습니다.")
125148
} else {
@@ -129,6 +152,13 @@ export default function NewcomerManagement() {
129152
gender: selectedNewcomer.gender,
130153
phone: selectedNewcomer.phone,
131154
newcomerManagerId: selectedNewcomer.newcomerManager?.id || null,
155+
address: selectedNewcomer.address,
156+
occupation: selectedNewcomer.occupation,
157+
visitPath: selectedNewcomer.visitPath,
158+
registrationMotivation: selectedNewcomer.registrationMotivation,
159+
faithLevel: selectedNewcomer.faithLevel,
160+
previousChurch: selectedNewcomer.previousChurch,
161+
carNumber: selectedNewcomer.carNumber,
132162
})
133163
notification.success("새신자가 추가되었습니다.")
134164
}

server/src/entity/newcomer/newcomer.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from "typeorm"
1212
import { User } from "../user"
1313
import { Community } from "../community"
14-
import { NewcomerStatus } from "../types"
14+
import { NewcomerStatus, FaithLevel } from "../types"
1515
import { NewcomerEducation } from "./newcomerEducation"
1616
import { NewcomerManager } from "./newcomerManager"
1717

@@ -32,6 +32,31 @@ export class Newcomer {
3232
@Column({ nullable: true })
3333
phone: string // 연락처
3434

35+
@Column({ nullable: true })
36+
address: string // 주소
37+
38+
@Column({ nullable: true })
39+
occupation: string // 신분(학생-학교/전공, 대학원생-학교/전공, 취업준비-준비계열/분야, 직장인-계열/분야)
40+
41+
@Column({ nullable: true })
42+
visitPath: string // 방문경로
43+
44+
@Column({ nullable: true })
45+
registrationMotivation: string // 등록계기
46+
47+
@Column({
48+
type: "enum",
49+
enum: FaithLevel,
50+
nullable: true,
51+
})
52+
faithLevel: FaithLevel // 신앙생활(초신자, 세례, 입교, 학습)
53+
54+
@Column({ nullable: true })
55+
previousChurch: string // 전 출석교회/담임목사님 성함
56+
57+
@Column({ nullable: true })
58+
carNumber: string // 차량번호
59+
3560
@ManyToOne(() => User)
3661
@JoinColumn({ name: "guiderId" })
3762
guider: User // 인도자

server/src/entity/types.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,10 @@ export enum NewcomerStatus {
7373
DELETED = "DELETED",
7474
PENDING = "PENDING",
7575
}
76+
77+
export enum FaithLevel {
78+
BEGINNER = "초신자",
79+
BAPTIZED = "세례",
80+
CONFIRMED = "입교",
81+
LEARNING = "학습",
82+
}

0 commit comments

Comments
 (0)