Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: my page refactor #139

Merged
merged 11 commits into from
Sep 10, 2024
Merged

refactor: my page refactor #139

merged 11 commits into from
Sep 10, 2024

Conversation

gahyuun
Copy link
Member

@gahyuun gahyuun commented Sep 2, 2024

๐Ÿ“Œ ์ž‘์—… ๋‚ด์šฉ

close #138
๋งˆ์ดํŽ˜์ด์ง€์— ์žˆ๋Š” ์—๋Ÿฌ์™€ ๊ฐœ์„  ์‚ฌํ•ญ๋“ค์„ ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค
merge๋Š” ๋ฐฑ์—”๋“œ ์—…๋ฐ์ดํŠธ์™€ ๋™์‹œ์— ์ง„ํ–‰ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค

๊ตฌํ˜„ ๋‚ด์šฉ ๋ฐ ์ž‘์—… ํ–ˆ๋˜ ๋‚ด์—ญ

  • ๋ฏธ์ด์ˆ˜ ๊ณผ๋ชฉ ์‚ญ์ œ ์‹œ ์•ˆ๋‚ด toast๋ฅผ ๋…ธ์ถœ
  • ๊ธฐ์ด์ˆ˜ ๊ณผ๋ชฉ ์ฑ„ํ”Œ ์ ์ˆ˜ 0->0.5๋กœ ๋ณ€๊ฒฝ
  • ๋ชจ๋“  ์‚ฌ์šฉ์ž ์„ฑ์ ํ‘œ ์žฌ์—…๋กœ๋“œ ๋ฌธ๊ตฌ ๋…ธ์ถœ
  • ์บ์‹ฑ์œผ๋กœ ์ธํ•ด ์˜ฌ๋ฐ”๋ฅด์ง€ ์•Š์€ ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ๊ฐ€ ๋…ธ์ถœ๋˜์—ˆ๊ณ  ์ˆ˜์ •
  • ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ๊ฐ€ ์กด์žฌํ•˜์ง€ ์•Š์•˜์„ ๋•Œ UI ๊ตฌํ˜„

๐Ÿค”๋ชจ๋“  ์‚ฌ์šฉ์ž ์„ฑ์ ํ‘œ ์žฌ์—…๋กœ๋“œ ๋ฌธ๊ตฌ ๋…ธ์ถœ

  • ๋ฐฑ์—”๋“œ๊ฐ€ ์ด๋ฒˆ์— ์—…๋ฐ์ดํŠธ ๋˜๋ฉด ์—…๋ฐ์ดํŠธ ์ „ ์„ฑ์ ํ‘œ๋ฅผ ์—…๋กœ๋“œํ–ˆ๋˜ ๋ชจ๋“  ์‚ฌ์šฉ์ž๊ฐ€ ์„ฑ์ ํ‘œ๋ฅผ ์žฌ์—…๋กœ๋“œ๋ฅผ ํ•ด์•ผํ–ˆ๊ณ  ์žฌ์—…๋กœ๋“œ์— ๋Œ€ํ•œ ์•ˆ๋‚ด UI๋ฅผ ๊ตฌํ˜„ํ–ˆ์Šต๋‹ˆ๋‹ค ( ์žฌ์—…๋กœ๋“œ๋ฅผ ์•ˆํ•˜๋ฉด ๋กœ์ง ๋ณ€๊ฒฝ์œผ๋กœ ์ธํ•ด ๊ฒฐ๊ณผ๊ฐ’์ด ์ด์ƒํ•˜๊ฒŒ ๋ณด์ธ๋‹ค๊ณ  ํ•˜๋„ค์š” )
  • ํ๋ฆ„์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค
  1. ์‚ฌ์šฉ์ž๊ฐ€ ๋กœ๊ทธ์ธ
  2. ์—…๋ฐ์ดํŠธ ์ „ ์„ฑ์ ํ‘œ ๋ฏธ์ž…๋ ฅํ•œ ์œ ์ €: grade-upload ํŽ˜์ด์ง€์ด๋™, ์—…๋ฐ์ดํŠธ ํ›„ ์„ฑ์ ํ‘œ ๋ฏธ์ž…๋ ฅํ•œ ์œ ์ €: grade-upload ํŽ˜์ด์ง€ ์ด๋™, ์—…๋ฐ์ดํŠธ ์ „ ์„ฑ์ ํ‘œ ์ž…๋ ฅํ•œ ์œ ์ €: ์•ˆ๋‚ด๋ฌธ ๋…ธ์ถœ ํ›„ grade-upload ํŽ˜์ด์ง€ ์ด๋™, ์—…๋ฐ์ดํŠธ ํ›„ ์„ฑ์ ํ‘œ ์ž…๋ ฅํ•œ ์œ ์ €: my page์ด๋™

9์›” 3์ผ์ด๋ผ๊ณ  ํ‘œ๊ธฐ๋˜์–ด์žˆ๋Š”๋ฐ, ๋‚ ์งœ๋Š” ๋ฐฑ์—”๋“œ ์—…๋ฐ์ดํŠธ ๋‚ ์งœ๋กœ ๋ณ€๊ฒฝ๋  ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.
image

๐Ÿ”Š ๋„์›€์ด ํ•„์š”ํ•œ ๋ถ€๋ถ„

  • ์•ˆ๋‚ด๋ฌธ์€ ํŽ˜์ด์ง€ ์ปดํฌ๋„ŒํŠธ์— ์กด์žฌํ•˜๋Š”๋ฐ ์•ˆ๋‚ด๋ฌธ์„ openํ•˜๋Š” ์ฝ”๋“œ๋Š” Sign-in-Form์— ์กด์žฌํ•ฉ๋‹ˆ๋‹ค. ์ด๋ ‡๊ฒŒ ๋˜๋ฉด ๋„๋ฉ”์ธ ์ปดํฌ๋„ŒํŠธ๊ฐ€ ํŽ˜์ด์ง€ ์ปดํฌ๋„ŒํŠธ๋ฅผ ์•Œ์•„์•ผ ํ•˜๋Š”๊ฑด๋ฐ, ์–ด๋–ป๊ฒŒ ์ˆ˜์ •ํ•˜๋ฉด ์ข‹์„์ง€ ๋ชจ๋ฅด๊ฒ ์Šต๋‹ˆ๋‹ค. ์•ˆ๋‚ด๋ฌธ์ด ๋„๋ฉ”์ธ ์ปดํฌ๋„ŒํŠธ๋ผ๊ณ  ์ƒ๊ฐ๋˜์ง„ ์•Š์•„์„œ์š”!

@gahyuun gahyuun self-assigned this Sep 2, 2024
Copy link
Collaborator

@seonghunYang seonghunYang left a comment

Choose a reason for hiding this comment

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

  • ๋งŽ์€ ์ž‘์—…์ด ์ด๋ค„์กŒ๋„ค์š”! ์ˆ˜๊ณ  ๋งŽ์œผ์…จ์Šต๋‹ˆ๋‹ค.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ํŒŒ์ผ ์ด๋ฆ„์„ ์ผ€๋ฐฅ ์ผ€์ด์Šค๋กœ ๋ณ€๊ฒฝํ•˜๋Š”๊ฒŒ ์ข‹๊ฒ ์Šต๋‹ˆ๋‹ค

Copy link
Member Author

Choose a reason for hiding this comment

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

์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค!
f8b52be

Comment on lines 7 to 18
const processChapel = (takenLectures: TakenLectureInfoResponse[]) => {
return takenLectures.map((lecture) => {
return {
id: lecture.id,
year: lecture.year,
semester: lecture.semester,
lectureCode: lecture.lectureCode,
lectureName: lecture.lectureName,
credit: lecture.lectureName === '์ฑ„ํ”Œ' ? 0.5 : lecture.credit,
};
});
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

credit ์™ธ ์†์„ฑ์€ ๋ชจ๋‘ ๊ทธ๋Œ€๋กœ ์‚ฌ์šฉํ•˜๋‹ˆ, ๊ตฌ์กฐ ๋ถ„ํ•ด ํ• ๋‹น์„ ์‚ฌ์šฉํ•˜๋ฉด ์ฝ”๋“œ๊ฐ€ ๋” ๋ณด๊ธฐ ํŽธํ•  ๊ฒƒ ๊ฐ™์•„์š”.

Suggested change
const processChapel = (takenLectures: TakenLectureInfoResponse[]) => {
return takenLectures.map((lecture) => {
return {
id: lecture.id,
year: lecture.year,
semester: lecture.semester,
lectureCode: lecture.lectureCode,
lectureName: lecture.lectureName,
credit: lecture.lectureName === '์ฑ„ํ”Œ' ? 0.5 : lecture.credit,
};
});
};
const processChapel = (takenLectures: TakenLectureInfoResponse[]) => {
return takenLectures.map((lecture) => {
return {
...lecture,
credit: lecture.lectureName === '์ฑ„ํ”Œ' ? 0.5 : lecture.credit,
};
});
};

Copy link
Member Author

Choose a reason for hiding this comment

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

์•Œ๋ ค์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค
f0c4e62

Comment on lines 25 to 27
toast({
title: '๊ณผ๋ชฉ ์‚ญ์ œ์— ์„ฑ๊ณตํ–ˆ์Šต๋‹ˆ๋‹ค',
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

๊ณผ๋ชฉ์„ ์—ฌ๋Ÿฌ ๊ฐœ ์‚ญ์ œํ•˜๋ฉด ์–ด๋–ค ๊ณผ๋ชฉ์ด ์‚ญ์ œ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•˜๊ธฐ ์–ด๋ ค์šธ ๊ฒƒ ๊ฐ™์•„์„œ lectureName์ด๋‚˜ ์ฝ”๋“œ ์ •๋ณด๋ฅผ ID๋กœ ๊ฐ€์ ธ์˜ค๋Š” ๊ฒƒ์ด ์–ด๋ ต์ง€ ์•Š๋‹ค๋ฉด, ํ† ์ŠคํŠธ ๋ฉ”์‹œ์ง€์— ์ถ”๊ฐ€ํ•˜๋Š” ๊ฒƒ๋„ ์ข‹์•„๋ณด์—ฌ์š”.

Copy link
Member Author

Choose a reason for hiding this comment

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

f0c4e62
๊ธฐ์กด delete logic์„ ์ˆ˜์ •ํ•จ์œผ๋กœ์จ ํ•ด๊ฒฐํ–ˆ์Šต๋‹ˆ๋‹ค
์ด์ „์— lecture ์ปดํฌ๋„ŒํŠธ ๊ด€๋ จํ•ด์„œ ์–ด๋–ป๊ฒŒ ๊ตฌํ˜„ํ• ์ง€ ๊ณ ๋ฏผ์„ ๋งŽ์ด ํ–ˆ์–ด์„œ ๊ทธ๋Ÿฐ์ง€ ๊ฐ„๋‹จํ•˜๊ฒŒ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค-!

Comment on lines 11 to 26
<>
<Form
id="๋กœ๊ทธ์ธ"
className="space-y-6"
action={authenticate}
onSuccess={(formState) => {
if (formState?.message === '์žฌ์—…๋กœ๋“œ') open();
}}
>
<Form.TextInput required={true} label="์•„์ด๋””" id="authId" placeholder="์•„์ด๋””๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”" />
<Form.PasswordInput required={true} label="๋น„๋ฐ€๋ฒˆํ˜ธ" id="password" placeholder="๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”" />
<div className="pt-6">
<Form.SubmitButton label="๋กœ๊ทธ์ธ" position="center" variant="primary" />
</div>
</Form>
<UpdateInstruction />
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • useDialog ํ›…์€ ์œ ํ‹ธ ํ›…์ด๋ฏ€๋กœ ๊ณ„์ธต๊ณผ ์ƒ๊ด€์—†์ด ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ œ ์ƒ๊ฐ์—๋Š” UpdateInstriction ์ปดํฌ๋„ŒํŠธ๊ฐ€ ์ด ์œ„์น˜์— ์žˆ์„ ํ•„์š”๋Š” ์—†๋‹ค๊ณ  ๋ด…๋‹ˆ๋‹ค. ํŽ˜์ด์ง€ ์ˆ˜์ค€์— ์œ„์น˜์‹œ์ผœ๋„ useDialog๋กœ ์ผœ๊ณ  ๋‹ซ์„ ์ˆ˜ ์žˆ์œผ๋‹ˆ, ํŽ˜์ด์ง€ ์ปดํฌ๋„ŒํŠธ๋กœ ์˜ฌ๋ ค๋„ ๊ดœ์ฐฎ๋‹ค๊ณ  ์ƒ๊ฐํ•ด์š”.
  • ๋˜ ๋‹ค๋ฅธ ๋ฐฉ๋ฒ•์ด์ž ๊ฐ€์žฅ ์ข‹๋‹ค๊ณ  ์ƒ๊ฐํ•˜๋Š” ๋ฐฉ๋ฒ•์€, Sign-in-form ์ปดํฌ๋„ŒํŠธ๊ฐ€ ์„ฑ๊ณต ์‹œ ์ž‘๋™ํ•˜๋Š” props๋ฅผ ๋ฐ›๊ณ  ํ˜ธ์ถœํ•˜๋Š” ๊ฒ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ํŽ˜์ด์ง€ ์ปดํฌ๋„ŒํŠธ์—์„œ dialog๋ฅผ ์—ฌ๋Š” open ํ•จ์ˆ˜๋ฅผ ํ•ธ๋“ค๋Ÿฌ๋กœ ๋„˜๊ฒจ์ฃผ๋Š” ๊ฑฐ์ฃ . ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด Sign-in-form ์ปดํฌ๋„ŒํŠธ๋Š” ์žฌ์—…๋กœ๋“œ dialog์— ๋Œ€ํ•ด ๋ชจ๋ฅด๊ณ , ํŽ˜์ด์ง€ ์ˆ˜์ค€์—์„œ ์ „๋ถ€ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Copy link
Member

@yougyung yougyung left a comment

Choose a reason for hiding this comment

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

์ˆ˜๊ณ ๋งŽ์œผ์…จ์–ด์š”!

Copy link
Member

Choose a reason for hiding this comment

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

๋กœ๊ทธ์ธ์‹œ์— ๋งŒ๋ฃŒ์œ ์ €์—ฌ๋ถ€๋ฅผ ์‹๋ณ„ํ•˜๋Š”๋งŒํผ SignInPage์— ์œ„์น˜์‹œํ‚ค๋Š” ๊ฒƒ์€ ์–ด๋–จ๊นŒ์š”?
์ œ๊ฐ€ ์ƒ๊ฐํ•˜๋Š” ๋ฐฉ๋ฒ•๋„ ์„ ๋ฐฐ๊ฐ€ ์ƒ๊ฐํ•˜์‹œ๋Š” ๊ทธ๋ฆผ๊ณผ ๋™์ผํ•œ ๊ฒƒ ๊ฐ™์€๋ฐ, ๋ชจ๋‹ฌ์„ ํ‚ค๋Š” ํ•จ์ˆ˜๋ฅผ props๋กœ ์ „๋‹ฌํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ํ†ตํ•ด ๋กœ๊ทธ์ธ ์„ฑ๊ณต์‹œ์— ๋ชจ๋‹ฌ์„ ๋…ธ์ถœํ•˜๋Š” ๋ฐฉ์‹์ด ์ข‹์•„๋ณด์—ฌ์š”. SignUpForm์—์„œ ํ•ด๋‹น ๊ตฌ์กฐ๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์–ด์š”!

@gahyuun
Copy link
Member Author

gahyuun commented Sep 9, 2024

@seonghunYang @yougyung
์˜๊ฒฌ ์ฃผ์‹ ๋Œ€๋กœ signInForm์— ๋ชจ๋‹ฌ ํ‚ค๋Š” ํ•จ์ˆ˜๋ฅผ props๋กœ ์ „๋‹ฌํ•˜์—ฌ ํ•ด๊ฒฐํ–ˆ์Šต๋‹ˆ๋‹ค! ๋‹ค๋งŒ SignInPage์—์„œ ๋ชจ๋‹ฌ์„ open ํ•˜๋Š” ํ•จ์ˆ˜๋ฅผ ๊ตฌํ˜„ํ•˜๊ธฐ์—” SignInPage๊ฐ€ client component๊ฐ€ ๋˜์–ด์•ผ ํ•ด์„œ, SignInFormContainer ๋ผ๋Š” ํŽ˜์ด์ง€ ์ปดํฌ๋„ŒํŠธ๋ฅผ ๋”ฐ๋กœ ๊ตฌํ˜„ํ–ˆ์Šต๋‹ˆ๋‹ค
next๋Š” ์„œ๋ฒ„ ์ปดํฌ๋„ŒํŠธ์™€ ํด๋ผ์ด์–ธํŠธ ์ปดํฌ๋„ŒํŠธ๋ฅผ ๊ตฌ๋ถ„ํ•˜๋‹ค๋ณด๋‹ˆ,๊ฐ์‹ธ๋Š” ์ปดํฌ๋„ŒํŠธ๋“ค์ด ์ƒ๊ฒจ๋‚˜๋Š” ์ ์ด ์•„์‰ฝ๋„ค์š”

์˜๊ฒฌ์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค~
62d9865

  • ์ถ”๊ฐ€์ ์œผ๋กœ isExpiredUser๋Š” return false๋กœ ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค ํ•ด๋‹น PR์ด ๋นจ๋ฆฌ ๋จธ์ง€๋˜๋ฉด ์ข‹๊ฒ ๋Š”๋ฐ ๋ฐฑ์—”๋“œ ์—…๋ฐ์ดํŠธ๊ฐ€ ์–ธ์ œ ๋งˆ๋ฌด๋ฆฌ๊ฐ€ ๋ ์ง€ ๋ชจ๋ฅด๊ฒ ์–ด์„œ,. ใ… ใ…  ์ผ๋‹จ return false๋กœ ํ•˜๊ณ  ๋จธ์ง€๋ฅผ ํ•œ ๋‹ค์Œ์— ๋ฐฑ์—”๋“œ ์—…๋ฐ์ดํŠธ๊ฐ€ ๋˜๋ฉด ์›๋ž˜ ์ฝ”๋“œ๋Œ€๋กœ ์ˆ˜์ •ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

@gahyuun
Copy link
Member Author

gahyuun commented Sep 9, 2024

@seonghunYang @yougyung ์ •ํ™•ํ•œ ์›์ธ์€ ๋ชจ๋ฅด๊ฒ ์œผ๋‚˜ development ๋ชจ๋“œ์ผ๋•Œ ์ฟ ํ‚ค๊ฐ€ ์ž˜ ๋™์ž‘ํ•˜์ง€ ์•Š๋„ค์š” ๊ทธ๋ž˜์„œ ํฌ๋กœ๋งˆํ‹ฑ๋„ ์‹คํŒจํ•˜๋Š” ๊ฒƒ ๊ฐ™์•„์š” ์ด ๋ฌธ์ œ๋Š” ํ•ด๋‹น PR ๋จธ์ง€ ํ›„ ์ƒˆ๋กœ์šด PR์—์„œ ์ž‘์—…ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค!

Copy link
Collaborator

@seonghunYang seonghunYang left a comment

Choose a reason for hiding this comment

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

  • ์ˆ˜๊ณ ํ•˜์…จ์Šต๋‹ˆ๋‹ค

@gahyuun gahyuun merged commit 4f123d7 into main Sep 10, 2024
1 of 3 checks passed
@gahyuun gahyuun deleted the mypage-error/#138 branch September 10, 2024 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mypage error ์ˆ˜์ •
3 participants