Part1 전소은 week4#168
Open
sobokki wants to merge 10 commits intocodeit-bootcamp-frontend:mainfrom
Hidden character warning
The head ref may contain hidden characters: "part1-\uc804\uc18c\uc740-week4"
Open
Conversation
pocojang
approved these changes
Nov 16, 2023
Comment on lines
+1
to
+3
| const emailInput = document.getElementById("signup-email"); | ||
| const errorMessage = document.getElementById("error-message"); | ||
| const emailRegex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4}$/; |
| @@ -0,0 +1,83 @@ | |||
| const emailInput = document.getElementById("signup-email"); | |||
| const errorMessage = document.getElementById("error-message"); | |||
| const emailRegex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4}$/; | |||
Collaborator
There was a problem hiding this comment.
분리는 잘하셨고요!
불리언을 반환하는 값이라면 isEmailRegex 과 같은 표현으로 바꾸는게 낫지 않을까요?
| const errorMessage = document.getElementById("error-message"); | ||
| const emailRegex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4}$/; | ||
|
|
||
| function showError(input, errorElement, errorMessage) { |
Collaborator
There was a problem hiding this comment.
Suggested change
| function showError(input, errorElement, errorMessage) { | |
| function showError({ input, errorElement, errorMessage }) { |
객체로 받는게 어떨까요!?
Comment on lines
+62
to
+63
| const joinButtons = document.getElementsByTagName("button")[0]; | ||
| const joinMessage = document.getElementsByClassName("join-message")[0]; |
Collaborator
There was a problem hiding this comment.
Suggested change
| const joinButtons = document.getElementsByTagName("button")[0]; | |
| const joinMessage = document.getElementsByClassName("join-message")[0]; | |
| const [joinButtons] = document.getElementsByTagName("button"); | |
| const [joinMessage] = document.getElementsByClassName("join-message"); |
배열 구조 분해 할당을 활용해보세요 :)
Comment on lines
+68
to
+77
|
|
||
| // 이메일 유효성 검사 | ||
| if ( | ||
| (emailInput.value === "" && | ||
| !emailRegex.test(emailInput.value) && | ||
| emailInput.value === "test@codeit.com") || | ||
| !/^(?=.*[a-zA-Z])(?=.*\d)/.test(passwordInput.value) || | ||
| passwordInput.value.length < 8 || | ||
| passwordInput.value !== passwordInputOmt.value | ||
| ) { |
Collaborator
There was a problem hiding this comment.
Suggested change
| // 이메일 유효성 검사 | |
| if ( | |
| (emailInput.value === "" && | |
| !emailRegex.test(emailInput.value) && | |
| emailInput.value === "test@codeit.com") || | |
| !/^(?=.*[a-zA-Z])(?=.*\d)/.test(passwordInput.value) || | |
| passwordInput.value.length < 8 || | |
| passwordInput.value !== passwordInputOmt.value | |
| ) { | |
| const isValidEmail = (emailInput.value === "" && | |
| !emailRegex.test(emailInput.value) && | |
| emailInput.value === "test@codeit.com") || | |
| !/^(?=.*[a-zA-Z])(?=.*\d)/.test(passwordInput.value) || | |
| passwordInput.value.length < 8 || | |
| passwordInput.value !== passwordInputOmt.value | |
| if (isValidEmail) { |
이렇게 뽑아낼 수 있겠죠?!
Collaborator
There was a problem hiding this comment.
week2-1.js이과 코드가 굉장히 비슷한데 어떤 관계일까요..?!
|
|
||
| function showError(input, errorElement, errorMessage) { | ||
| input.classList.add("error"); | ||
| errorElement.innerText = errorMessage; |
Collaborator
There was a problem hiding this comment.
이렇게 메세지를 받아서 공통으로 분리하다니 굉장히 좋은 시도네요!
Comment on lines
+31
to
+34
| const passwordInput = document.getElementById("signup-password"); | ||
| const errorMessage2 = document.getElementById("error-message2"); | ||
| const passwordInputOmt = document.getElementById("signup-password2"); | ||
| const errorMessage2Omt = document.getElementById("error-message2-omt"); |
Collaborator
There was a problem hiding this comment.
이런 선언들은 다 가장 위에 모아놓는게 어때요?!
| <html> | ||
| <head> | ||
| <meta charset="utf-8"> | ||
| <title></title> |
Collaborator
There was a problem hiding this comment.
헛.. 비어있어요!
이정도 태그는 꼭 채워주시는게 좋습니다
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요구사항
기본
[x][기본]이메일 input에서 focus out 할 때, 값이 없을 경우 input에 빨강색 테두리와 아래에 “이메일을 입력해주세요.” 빨강색 에러 메세지가 보이나요?
[x][기본]이메일 input에서 focus out 할 때, 이메일 형식에 맞지 않는 값이 있는 경우 input에 빨강색 테두리와 아래에 “올바른 이메일 주소가 아닙니다.” 빨강색 에러 메세지가 보이나요?
[x][기본]이메일 input에서 focus out 일 때, input 값이 test@codeit.com 일 경우 input에 빨강색 테두리와 아래에 “이미 사용 중인 이메일입니다.” 빨강색 에러 메세지가 보이나요?
[x][기본]비밀번호 input에서 focus out 할 때, 값이 8자 미만으로 있거나 문자열만 있거나 숫자만 있는 경우, input에 빨강색 테두리와 아래에 “비밀번호는 영문, 숫자 조합 8자 이상 입력해 주세요.” 빨강색 에러 메세지가 보이나요?
[x][기본]비밀번호 input과 비밀번호 확인 input의 값이 다른 경우, 비밀번호 확인 input에 빨강색 테두리와 아래에 “비밀번호가 일치하지 않아요.” 빨강색 에러 메세지가 보이나요?
[x][기본]회원가입을 실행할 경우, 문제가 있는 경우 문제가 있는 input에 빨강색 테두리와 에러 메세지가 보이나요?
[x][기본]이외의 유효한 회원가입 시도의 경우, “/folder”로 이동하나요?
[x][기본]이메일: test@codeit.com, 비밀번호: codeit101 으로 로그인 시도할 경우, “/folder” 페이지로 이동하나요?
[x][기본]비밀번호 input에서 focus out 할 때, 값이 없을 경우 아래에 “비밀번호를 입력해주세요.” 에러 메세지가 보이나요?
[][기본]이외의 로그인 시도의 경우 이메일, 비밀번호 input에 빨강색 테두리와 각각의 input아래에 “이메일을 확인해주세요.”, “비밀번호를 확인해주세요.” 빨강색 에러 메세지가 보이나요?
[][기본]회원가입 버튼 클릭 또는 Enter키 입력으로 회원가입 되나요?
[x][기본]이메일, 비밀번호 input에 에러 관련 디자인을 Components 영역의 에러 케이스로 적용했나요?
심화
[][심화]눈 모양 아이콘 클릭시 비밀번호의 문자열이 보이기도 하고, 가려지기도 하나요?
[][심화]비밀번호의 문자열이 가려질 때는 눈 모양 아이콘에는 사선이 그어져있고, 비밀번호의 문자열이 보일 때는 사선이 없는 눈 모양 아이콘이 보이나요?
[][심화]로그인, 회원가입 페이지에 공통적으로 사용하는 로직이 있다면, 반복하지 않고 공통된 로직을 모듈로 분리해 사용했나요?
주요 변경사항
스크린샷
week2.html_signup-email.test.40codeit.com.signup-password.codeit101.signup-password2.codeit101.-.Avast.Secure.Browser.2023-11-13.02-07-36.mp4
week2.html_signup-email.test.40codeit.com.signup-password.codeit101.signup-password2.codeit101.-.Avast.Secure.Browser.2023-11-13.02-07-36.mp4
멘토에게
-심화 부분은 시도했으나 구현이 안됐습니다.
-위 두 가지도 구현이 힘들었습니다.