Skip to content

Commit

Permalink
Merge pull request #85 from HGU-WALAB/#78/managerEmail
Browse files Browse the repository at this point in the history
[REQUEST] FEATURE : 관리자는 신청자 목록에서 학생들 이메일 주소를 관람할 수 있다. #78
  • Loading branch information
ohinhyuk authored Oct 23, 2023
2 parents e5cc206 + 8c81bb7 commit 6f91488
Show file tree
Hide file tree
Showing 5 changed files with 233 additions and 342 deletions.
153 changes: 65 additions & 88 deletions histudy-front/src/components/Manager/CreateGroupTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ export default function CreateGroupTable({
};
const TableHead = {
all: [
"이름",
"학번",
"학생 정보",
"희망 1과목",
"희망 2과목",
"희망 3과목",
"함께하고 싶은 친구",
"삭제",
],
};

Expand Down Expand Up @@ -53,6 +53,7 @@ export default function CreateGroupTable({
sx={{
color: "text.secondary",
display: "flex",
justifyContent: "space-between",
py: "20px",

borderColor: "primary.main",
Expand All @@ -62,11 +63,13 @@ export default function CreateGroupTable({
{TableHead[type].map((headElement, index) => (
<Typography
key={index}
sx={{
flexGrow: 1,
width: longWidthColumnNum === index + 1 && "50%",
minWidth: longWidthColumnNum !== index + 1 && "150px",
}}
sx={
{
// flexGrow: 1,
// width: longWidthColumnNum === index + 1 && "50%",
// minWidth: longWidthColumnNum !== index + 1 && "150px",
}
}
>
{headElement}
</Typography>
Expand All @@ -77,64 +80,43 @@ export default function CreateGroupTable({
key={index}
sx={{
display: "flex",
justifyContent: "space-between",
alignItems: "center",
px: "50px",
borderTop: index !== 0 && 1,
// py: "20px",
borderColor: "primary.border",
}}
>
<Box
{/* <Box
sx={{
display: "flex",
alignItems: "center",
flexGrow: 1,
}}
> */}
<Select
sx={{
minWidth: "100px",
color: "text.secondary",
display: "flex",
borderColor: "primary.border",
}}
defaultValue={10}
>
<Box
sx={{
color: "text.secondary",
display: "flex",
flexGrow: 1,
width: "50px",
textOverflow: "ellipsis",
overflowX: "auto",
whiteSpace: "nowrap",
py: "20px",
borderColor: "primary.border",
marginLeft: "55px",
}}
>
{row.name}
</Box>
<MenuItem value={10}>{row.name}</MenuItem>
<MenuItem value={20}>{row.sid}</MenuItem>
<MenuItem value={30}>{row.email}</MenuItem>
</Select>

<Box
{/* <Box
sx={{
color: "text.secondary",
display: "flex",
flexGrow: 1,
// width: "50px",
marginLeft: "70px",
textOverflow: "ellipsis",
overflowX: "auto",
whiteSpace: "nowrap",
py: "20px",
borderColor: "primary.border",
}}
>
{row.sid}
</Box>

<Box
sx={{
color: "text.secondary",
display: "flex",
flexGrow: 1,
marginLeft: "20px",
py: "20px",
borderColor: "primary.border",
gap: "30px",
}}
>
{/* <Select
> */}
{/* <Select
sx={{ width: "170px", color: "text.secondary" }}
value={row.courses.length > 0 ? row.courses[0].name : ""}
>
Expand All @@ -144,55 +126,50 @@ export default function CreateGroupTable({
</MenuItem>
))}
</Select> */}
{row.courses.map((subject, index) => (
<Typography
sx={{
minWidth: "150px",
}}
>
{subject.name} ({subject.prof})
</Typography>
))}
{fillThree(row.courses.length).map((subject, index) => (
<Typography
sx={{
minWidth: "150px",
}}
>
{subject}
</Typography>
))}
{row.courses.map((subject, index) => (
<Box
sx={{
minWidth: "80px",
}}
>
{subject.name} ({subject.prof})
</Box>

))}
{fillThree(row.courses.length).map((subject, index) => (
<Box
sx={{
color: "text.secondary",
display: "flex",
flexGrow: 1,
py: "20px",
borderColor: "primary.border",
minWidth: "80px",
}}
>
<Select
sx={{ width: "170px", color: "text.secondary" }}
value={row.friends.length > 0 ? row.friends[0].name : ""}
>
{row.friends.map((friend, index) => (
<MenuItem key={index} value={friend.name}>
<Typography>
{friend.name}, {friend.sid}
</Typography>
</MenuItem>
))}
</Select>
{subject}
</Box>
</Box>
<IconButton
onClick={() => handleDeleteRow(row.sid)}
))}
{/* </Box> */}

<Box
sx={{
marginRight: "1rem",
color: "text.secondary",
display: "flex",
py: "20px",
ml: "10px",
borderColor: "primary.border",
}}
>
<Select
sx={{ width: "150px", color: "text.secondary" }}
value={row.friends.length > 0 ? row.friends[0].name : ""}
>
{row.friends.map((friend, index) => (
<MenuItem key={index} value={friend.name}>
<Typography>
{friend.name}, {friend.sid}
</Typography>
</MenuItem>
))}
</Select>
</Box>
{/* </Box> */}
<IconButton onClick={() => handleDeleteRow(row.sid)}>
<Cancel />
</IconButton>
</Box>
Expand Down
82 changes: 24 additions & 58 deletions histudy-front/src/components/Manager/GroupTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ export default function GroupTables({
const TableHead = {
group: [
"그룹",
"멤버",
"학생 정보",
"희망 1과목",
"희망 2과목",
"희망 3과목",
"함께하고 싶은 친구",
"수정",
],
};
const [edit, setEdit] = useState([false]);
Expand Down Expand Up @@ -79,9 +80,10 @@ export default function GroupTables({
<Box>
<Box
sx={{
minWidth: "1000px",
maxHeight: "60vh",
overflow: "scroll",
py: "5px",
py: "30px",
border: 1,
backgroundColor: "primary.default",
borderColor: "primary.main",
Expand All @@ -93,19 +95,14 @@ export default function GroupTables({
sx={{
color: "text.secondary",
display: "flex",
py: "20px",
justifyContent: "space-between",
py: "0px",
borderColor: "primary.border",
px: "30px",
px: "50px",
}}
>
{TableHead[type].map((headElement, index) => (
<Typography
key={index}
sx={{
flexGrow: 1,
minWidth: "150px",
}}
>
<Typography key={index} sx={{}}>
{headElement}
</Typography>
))}
Expand Down Expand Up @@ -138,82 +135,54 @@ export default function GroupTables({
sx={{
color: "text.secondary",
display: "flex",
flexGrow: 4,
alignItems: "center",
justifyContent: "space-between",
gap: "10px",
px: "10px",
borderBottom: 1,
borderColor: "primary.border",
}}
>
<Box
key="Group"
sx={{
color: "text.secondary",
display: "flex",
flexGrow: 1,
width: "150px",
borderBottom: 1,
marginTop: "20px",
width: "50px",
py: "20px",
borderColor: "primary.border",
}}
>
<Typography>Group{row.tag}</Typography>
</Box>
<Box
<Select
sx={{
minWidth: "100px",
color: "text.secondary",
display: "flex",
flexGrow: 1,
borderBottom: 1,
py: "20px",
marginTop: "20px",
width: "150px",
borderColor: "primary.border",
}}
defaultValue={10}
>
{index > 0 && ", "}
<Typography>{student.name},</Typography>
<Typography>{student.sid}</Typography>
</Box>
<MenuItem value={10}>{student.name}</MenuItem>
<MenuItem value={20}>{student.sid}</MenuItem>
<MenuItem value={30}>{student.email}</MenuItem>
</Select>
<Box
sx={{
color: "text.secondary",
display: "flex",
flexGrow: 1,
py: "20px",
borderBottom: 1,
borderColor: "primary.border",
alignItems: "center",
gap: "20px",
}}
>
{/* <Select
sx={{ width: "170px", color: "text.secondary" }}
value={
student.courses.length > 0
? student.courses[0].name
: ""
}
>
{student.courses.map((subject, index) => (
<MenuItem key={index} value={subject.name}>
<Typography>{subject.name}</Typography>
</MenuItem>
))}
</Select> */}
{student.courses.map((subject, index) => (
<Typography
sx={{
minWidth: "150px",
}}
>
<Typography sx={{ width: "120px" }}>
{subject.name} ({subject.prof})
</Typography>
))}
{fillThree(student.courses.length).map(
(subject, index) => (
<Typography
sx={{
minWidth: "150px",
}}
>
<Typography sx={{ minWidth: "120px" }}>
{subject}
</Typography>
)
Expand All @@ -223,9 +192,7 @@ export default function GroupTables({
sx={{
color: "text.secondary",
display: "flex",
flexGrow: 1,
py: "20px",
borderBottom: 1,
borderColor: "primary.border",
}}
>
Expand All @@ -251,7 +218,6 @@ export default function GroupTables({
color: "text.secondary",
display: "flex",
// flexGrow: 1,
borderBottom: 1,
borderColor: "primary.border",
}}
>
Expand Down
Loading

0 comments on commit 6f91488

Please sign in to comment.