Skip to content

Commit

Permalink
Merge pull request #72 from HGU-WALAB/#65/hotfix
Browse files Browse the repository at this point in the history
Hotfix : 희망 과목 드롭다운에서 펼쳐놓는 UI로 변경
  • Loading branch information
ohinhyuk authored Sep 13, 2023
2 parents fd7a611 + f752998 commit ac83f53
Show file tree
Hide file tree
Showing 5 changed files with 179 additions and 37 deletions.
39 changes: 36 additions & 3 deletions histudy-front/src/components/Manager/CreateGroupTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,22 @@ export default function CreateGroupTable({
longWidthColumnNum,
data,
}) {
const fillThree = (num) => {
let array = [];
for (var i = 0; i < 3 - num; ++i) {
array.push("");
}
return array;
};
const TableHead = {
all: ["이름", "학번", "희망과목", "함께하고 싶은 친구"],
all: [
"이름",
"학번",
"희망 1과목",
"희망 2과목",
"희망 3과목",
"함께하고 싶은 친구",
],
};

const setIsLoading = useSetRecoilState(isLoadingState);
Expand Down Expand Up @@ -117,9 +131,10 @@ export default function CreateGroupTable({
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 @@ -128,7 +143,25 @@ export default function CreateGroupTable({
<Typography>{subject.name}</Typography>
</MenuItem>
))}
</Select>
</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>
))}
</Box>

<Box
Expand Down
75 changes: 66 additions & 9 deletions histudy-front/src/components/Manager/GroupTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,23 @@ export default function GroupTables({
longWidthColumnNum,
data,
}) {
const fillThree = (num) => {
let array = [];
for (var i = 0; i < 3 - num; ++i) {
array.push("");
}
return array;
};

const TableHead = {
group: ["그룹", "멤버", "희망과목", "함께하고 싶은 친구"],
group: [
"그룹",
"멤버",
"희망 1과목",
"희망 2과목",
"희망 3과목",
"함께하고 싶은 친구",
],
};
const [edit, setEdit] = useState([false]);
const [studentEdit, setStudentEdit] = useState([false]);
Expand Down Expand Up @@ -88,8 +103,7 @@ export default function GroupTables({
key={index}
sx={{
flexGrow: 1,
width: longWidthColumnNum === index + 1 && "30%",
minWidth: longWidthColumnNum !== index + 1 && "150px",
minWidth: "150px",
}}
>
{headElement}
Expand Down Expand Up @@ -133,7 +147,7 @@ export default function GroupTables({
color: "text.secondary",
display: "flex",
flexGrow: 1,
width: "100px",
width: "150px",
borderBottom: 1,
marginTop: "20px",
py: "20px",
Expand All @@ -150,7 +164,7 @@ export default function GroupTables({
borderBottom: 1,
py: "20px",
marginTop: "20px",
// width: "10px",
width: "150px",
borderColor: "primary.border",
}}
>
Expand All @@ -166,9 +180,11 @@ export default function GroupTables({
py: "20px",
borderBottom: 1,
borderColor: "primary.border",
alignItems: "center",
gap: "20px",
}}
>
<Select
{/* <Select
sx={{ width: "170px", color: "text.secondary" }}
value={
student.courses.length > 0
Expand All @@ -181,7 +197,27 @@ export default function GroupTables({
<Typography>{subject.name}</Typography>
</MenuItem>
))}
</Select>
</Select> */}
{student.courses.map((subject, index) => (
<Typography
sx={{
minWidth: "150px",
}}
>
{subject.name} ({subject.prof})
</Typography>
))}
{fillThree(student.courses.length).map(
(subject, index) => (
<Typography
sx={{
minWidth: "150px",
}}
>
{subject}
</Typography>
)
)}
</Box>
<Box
sx={{
Expand Down Expand Up @@ -290,9 +326,10 @@ export default function GroupTables({
py: "20px",
borderBottom: 1,
borderColor: "primary.border",
alignItems: "center",
}}
>
<Select
{/* <Select
sx={{ color: "text.secondary" }}
value={
student.courses.length > 0
Expand All @@ -305,7 +342,27 @@ export default function GroupTables({
<Typography>{subject.name}</Typography>
</MenuItem>
))}
</Select>
</Select> */}
{student.courses.map((subject, index) => (
<Typography
sx={{
minWidth: "150px",
}}
>
{subject.name} ({subject.prof})
</Typography>
))}
{fillThree(student.courses.length).map(
(subject, index) => (
<Typography
sx={{
minWidth: "150px",
}}
>
{subject}
</Typography>
)
)}
</Box>
<Box
sx={{
Expand Down
4 changes: 3 additions & 1 deletion histudy-front/src/components/Manager/StudentListTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ export default function StudentListTable({
>
{row.courses.map((subject, index) => (
<MenuItem key={index} value={subject.name}>
<Typography>{subject.name}</Typography>
<Typography>
{subject.name} ({subject.prof})
</Typography>
</MenuItem>
))}
</Select>
Expand Down
94 changes: 71 additions & 23 deletions histudy-front/src/components/Manager/UnGroupTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,22 @@ export default function UnGroupTable({
longWidthColumnNum,
data,
}) {
const fillThree = (num) => {
let array = [];
for (var i = 0; i < 3 - num; ++i) {
array.push("");
}
return array;
};
const TableHead = {
group: ["그룹", "이름", "희망과목", "함께하고 싶은 친구"],
group: [
"그룹",
"이름",
"희망 1과목",
"희망 2과목",
"희망 3과목",
"함께하고 싶은 친구",
],
};

const [edit, setEdit] = useState([false]);
Expand Down Expand Up @@ -74,9 +88,9 @@ export default function UnGroupTable({
<Typography
key={index}
sx={{
flexGrow: 1,
width: longWidthColumnNum === index + 1 && "50%",
minWidth: longWidthColumnNum !== index + 1 && "150px",
// flexGrow: 1,
// width: longWidthColumnNum === index + 1 && "50%",
minWidth: "150px",
}}
>
{headElement}
Expand Down Expand Up @@ -107,7 +121,7 @@ export default function UnGroupTable({
color: "text.secondary",
display: "flex",
flexGrow: 1,
width: "50px",
minWidth: "100px",
marginLeft: "50px",
textOverflow: "ellipsis",
overflowX: "auto",
Expand All @@ -123,13 +137,14 @@ export default function UnGroupTable({
sx={{
color: "text.secondary",
display: "flex",
flexGrow: 1,
width: "80px",
// flexGrow: 1,
width: "150px",
textOverflow: "ellipsis",
overflowX: "auto",
// overflowX: "auto",
whiteSpace: "nowrap",
py: "20px",
borderColor: "primary.border",
// justifyContent: "center",
}}
>
{row.name},{row.sid}
Expand All @@ -143,18 +158,27 @@ export default function UnGroupTable({
marginLeft: "20px",
py: "20px",
borderColor: "primary.border",
gap: "20px",
}}
>
<Select
sx={{ width: "170px", color: "text.secondary" }}
value={row.courses.length > 0 ? row.courses[0].name : ""}
>
{row.courses.map((subject, index) => (
<MenuItem key={index} value={subject.name}>
<Typography>{subject.name}</Typography>
</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>
))}
</Box>

<Box
Expand Down Expand Up @@ -232,7 +256,9 @@ export default function UnGroupTable({
color: "text.secondary",
display: "flex",
flexGrow: 1,
width: "50px",
width: "120px",
marginLeft: "50px",

textOverflow: "ellipsis",
overflowX: "auto",
whiteSpace: "nowrap",
Expand All @@ -243,7 +269,7 @@ export default function UnGroupTable({
{row.name},
<TextField
sx={{
width: "50px",
width: "100px",
"& input": {
height: "10px",
},
Expand All @@ -260,12 +286,15 @@ export default function UnGroupTable({
color: "text.secondary",
display: "flex",
flexGrow: 1,
marginLeft: "20px",
marginLeft: "40px",

py: "20px",
// width: "10px",
borderColor: "primary.border",
gap: "20px",
}}
>
<Select
{/* <Select
sx={{ width: "170px", color: "text.secondary" }}
value={row.courses.length > 0 ? row.courses[0].name : ""}
>
Expand All @@ -274,7 +303,26 @@ export default function UnGroupTable({
<Typography>{subject.name}</Typography>
</MenuItem>
))}
</Select>
</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>
))}
</Box>

<Box
Expand Down
4 changes: 3 additions & 1 deletion histudy-front/src/pages/Manager/ManageStudent.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ export default function ManageStudent() {
Name: student.name,
Number: student.sid,
Group: student.group,
Courses: student.courses.map((subject) => subject.name).join(", "),
Courses: student.courses
.map((subject) => subject.name + `(${subject.prof})`)
.join(", "),
Friends: student.friends.map((friend) => friend.name).join(", "),
}));
}
Expand Down

0 comments on commit ac83f53

Please sign in to comment.