-
Notifications
You must be signed in to change notification settings - Fork 31
feat: set date to today by click today text(fix #87) #88
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
feat: set date to today by click today text(fix #87) #88
Conversation
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.
리뷰 완료합니다. 수고하셨습니다.
src/js/datepicker/index.js
Outdated
* @param {Event} ev An event object | ||
* @private | ||
*/ | ||
_todayClickHandler: function() { |
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.
핸들러가 _on~~
으로 시작해서 이것도 맞추는게 좋겠습니다.
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.
_onClickTodayHandler
면 되겠네요
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.
_onClickTodayHandler
으로 핸들러 명 수정 했습니다.
test/calendar/header.spec.js
Outdated
@@ -11,6 +11,7 @@ var CLASS_NAME_NEXT_MONTH_BTN = constants.CLASS_NAME_NEXT_MONTH_BTN; | |||
var CLASS_NAME_NEXT_YEAR_BTN = constants.CLASS_NAME_NEXT_YEAR_BTN; | |||
var CLASS_NAME_PREV_MONTH_BTN = constants.CLASS_NAME_PREV_MONTH_BTN; | |||
var CLASS_NAME_PREV_YEAR_BTN = constants.CLASS_NAME_PREV_YEAR_BTN; | |||
var CLASS_NAME_TITLE_TODAY = 'tui-calendar-title-today'; |
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.
위쪽에 변수로 선언된거에는 .
가 앞에 붙어있네요. 이런거는 어떤 형태로든 통일이 되도록 만드는게 좋겠는데 말이죠.
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.
통일되도록 constants
에서 가져오도록 변경했습니다.
header.on('today', spy); | ||
|
||
clickBtnInHeader(CLASS_NAME_TITLE_TODAY); | ||
expect(spy).toHaveBeenCalled(); |
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.
Today라고 할 수 있는 시점을 모킹하고 임의로 날짜를 변경해본 다음 clickBtnInHeader
를 호출하고 난 뒤 Today 모킹이 출력되는지 보아야겠네요.
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.
위 테스트는 헤더에서 오늘 날짜 텍스트를 클릭했을 때 today 이벤트가 정상적으로 발생하는지만 검증하는 테스트였습니다.
말씀하신 것을 검증하기 위해 데이트픽커에 대해 새 테스트를 작성했습니다.
@@ -91,6 +91,12 @@ | |||
background-color: #f4f4f4 | |||
} | |||
|
|||
.tui-calendar .tui-calendar-title-today:hover { | |||
color: #333; | |||
background-color: #edf4fc; |
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.
hover 배경색이랑 동일한 것 같네요.
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.
데이트 픽커에서 날짜 등을 선택하기 전 hover의 배경색과 동일하게 처리해 클릭 가능함을 알리려 위 색상을 사용했습니다.
혹시 이 버튼을 위한 색상 가이드를 다시 받아야할까요?
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.
리뷰 완료합니다.
src/js/calendar/header.js
Outdated
@@ -24,6 +24,7 @@ var TYPE_YEAR = constants.TYPE_YEAR; | |||
var CLASS_NAME_TITLE_MONTH = 'tui-calendar-title-month'; | |||
var CLASS_NAME_TITLE_YEAR = 'tui-calendar-title-year'; | |||
var CLASS_NAME_TITLE_YEAR_TO_YEAR = 'tui-calendar-title-year-to-year'; | |||
var CLASS_NAME_TITLE_TODAY = '.tui-calendar-title-today'; |
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.
단순히 클래스 네임이라 생각하고 저 그룹과 묶었었는데 실제 사용은 아래의 .
이 붙어있는 그룹과 같이 사용되어서 이에 따른 오해가 발생하지 않도록 위치를 조정하고 이름은 변경했습니다.
src/js/datepicker/index.js
Outdated
* @param {Event} ev An event object | ||
* @private | ||
*/ | ||
_todayClickHandler: function() { |
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.
_onClickTodayHandler
면 되겠네요
test/calendar/header.spec.js
Outdated
@@ -11,6 +11,7 @@ var CLASS_NAME_NEXT_MONTH_BTN = constants.CLASS_NAME_NEXT_MONTH_BTN; | |||
var CLASS_NAME_NEXT_YEAR_BTN = constants.CLASS_NAME_NEXT_YEAR_BTN; | |||
var CLASS_NAME_PREV_MONTH_BTN = constants.CLASS_NAME_PREV_MONTH_BTN; | |||
var CLASS_NAME_PREV_YEAR_BTN = constants.CLASS_NAME_PREV_YEAR_BTN; | |||
var CLASS_NAME_TITLE_TODAY = 'tui-calendar-title-today'; |
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.
위쪽에 변수로 선언된거에는 .
가 앞에 붙어있네요. 이런거는 어떤 형태로든 통일이 되도록 만드는게 좋겠는데 말이죠.
header.on('today', spy); | ||
|
||
clickBtnInHeader(CLASS_NAME_TITLE_TODAY); | ||
expect(spy).toHaveBeenCalled(); |
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.
Today라고 할 수 있는 시점을 모킹하고 임의로 날짜를 변경해본 다음 clickBtnInHeader
를 호출하고 난 뒤 Today 모킹이 출력되는지 보아야겠네요.
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.
리뷰 완료합니다.
Please check if the PR fulfills these requirements
fix #xxx[,#xxx]
, where "xxx" is the issue number)Description
Make today text of title look clickable and If click it, set the date to today on DatePicker.
Thank you for your contribution to TOAST UI product. 🎉 😘 ✨