-
Notifications
You must be signed in to change notification settings - Fork 0
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
Migrate remaining shapes, Complete shapes migration #44
Conversation
|
|
.tsx -> .ts camelCase -> PascalCase
79bc4a8
to
24a1c34
Compare
|
|
||
export default interface TakenPlannerItem { | ||
id: number; | ||
item_type: 'TAKEN'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
혹시 이 부분은 enum으로 처리하지 않은 이유가 있나요? 여러 파일들 확인해보니 현재 TAKEN, FUTURE, ARBITRARY 중 하나로 사용되고 있고 값 체크 하는 부분도 꽤 있어서요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 제가 놓친 것 같습니다! 수정해서 푸시할게요 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해결했습니다! (6084410) 나머지 코드에서 쓰이는 string들은 리팩토링 진행하면서 차차 enum으로 바꿔가면 좋을 것 같아요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
몇가지 질문들이나 제안들이 있긴 하지만, 전반적으로 좋은 것 같습니다. 수고하셨습니다 :)
@@ -0,0 +1,45 @@ | |||
export enum AdditionalTrackType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 친구는 const를 안하신 이유가 있나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제가 실수로 빠뜨린 것 같습니다... 😂
@@ -0,0 +1,12 @@ | |||
import type Department from '../subject/Department'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
상대 경로 import와 절대 경로 import를 정하는 기준이 궁금합니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
앞으로는 tsconfig.json
에 정의된 대로 alias를 쓸까 생각 중입니다. 슬랙 통해서 다른 분들과 논의해 보겠습니다.
"paths": {
"@/*": ["src/*"]
}
@@ -30,11 +31,10 @@ interface lecture { | |||
class_title: string; | |||
class_title_en: string; | |||
review_total_weight: number; | |||
professors: nestedProfessor; | |||
professors: NestedProfessor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
단순한 궁금증인데, professors는 뭔가 배열이 있을거 같은데 type은 NestedProfessor 네요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LectureShape.js 확인해본 결과 array가 맞습니다. 짚어주셔서 감사합니다. 수정하겠습니다.
@@ -0,0 +1,76 @@ | |||
import type { ItemFocusFrom } from '@/shapes/enum'; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기 new line 이 있는 이유가 있나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
파일명을 변경하기 이전 파일(ItemFocusShape.js)에 newline이 있어서 그런 것 같습니다.
old_code: string; | ||
} | ||
|
||
interface NoneItem { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interface NoneItem extends ItemProtoType { ... }
이런식으로 공통 부분을 프로토타입 인터페이스로 묶어주면 좋을 것 같아요
|
||
interface FromNone { | ||
from: ReviewsFocusFrom.NONE; | ||
lecture?: null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 property는 null | undefined 인건가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
어디에 사용되는지 확인해보겠습니다.
Description
enum.ts
를shapes
폴더 안에 생성했습니다..tsx
확장자를.ts
확장자로 변경하였습니다..ts
파일로 migrate하였습니다.To-do
/shapes/state/timetable/LectureFocusShape.js
에서 사용하던emptyArrayShape
를 대체할 validation을 component 레벨에 추가해야 합니다.