-
Notifications
You must be signed in to change notification settings - Fork 3
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
feature/196 사용자 닉네임 설정에 제한사항을 건다. #209
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.
밤 늦게까지 고생하셨습니다!!👍
되게 간단하게 생각했는데, 생각보다 구현하려니 복잡하군요.
textfield rules의 결과값에 바로 btn disable을 바인딩할 수 있으면 좋을텐데요...
쉽지 않네요 😢
몇가지 리뷰 남겼으니 확인 부탁드려요 ㅎㅎ🥰
src/test/java/com/grasshouse/dorandoran/member/repository/MemberRepositoryTest.java
Outdated
Show resolved
Hide resolved
rules: { | ||
violated: (newVal) => | ||
!!newVal.match(NICKNAME_REGEX) || | ||
"닉네임은 숫자/한글/영어로 이루어져야 합니다.", | ||
unchanged: (newNickname) => | ||
this.member.nickname !== newNickname || | ||
"새로운 닉네임을 입력해주세요.", | ||
}, |
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 NICKNAME_RULES = {
VIOLATED: {
rule: (newVal) => !!newVal.match(NICKNAME_REGEX),
message: "닉네임은 숫자/한글/영어로 이루어져야 합니다.",
},
UNCHANGED: {
rule: (newVal, oldVal) => newVal !== oldVal,
message: "새로운 닉네임을 입력해주세요.",
},
};
export default {
name: "MemberUpdateModal",
...,
computed: {
rules() {
return Object.values(NICKNAME_RULES).map(
(value) =>
value.rule(this.newNickname, this.member.nickname) || value.message,
);
},
},
...
methods: {
nicknameUpdateDisabled() {
const validation = Object.values(NICKNAME_RULES).filter(
({ rule }) => !rule(this.newNickname, this.member.nickname),
);
return validation.length !== 0;
},
},
이런 방식은 좀 별로려나요...?
앞으로 룰의 추가가 좀 더 쉬워지겠지만, 지금 당장 코드가 좀 복잡하네요ㅠㅠ
좀 더 고민해볼게요!
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/test/java/com/grasshouse/dorandoran/member/repository/MemberRepositoryTest.java
Outdated
Show resolved
Hide resolved
444a51e
to
434ba9a
Compare
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.
수고했어요 예지니어스 👍
rules가 도입되다니 너무 기뻐요!
테코톡과 겹쳐 고생이 많았을 것 같네요. 이만 approve합니다~
import org.springframework.boot.test.context.SpringBootTest; | ||
|
||
@SpringBootTest | ||
public class MemberRepositoryTest { |
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.
엔티티 validation에 관한 테스트는 어떻게 하나 궁금했는데
repository test를 하는 방법이 있군요 👍
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.
고생하셨습니다~
커밋줄수가 1만줄이넘네요 🐰 ㅋㅋㅋ
pull rebase 한번 해주세요~
- 최대 글자 수(15자) 설정 - 글자 수 세어주는 counter 기능 추가
- 사이드바에서 닉네임 11글자까지만 보여주게 한다. - 글/댓글의 프로필사진과 닉네임 간 간격 미세 조정한다.
- :rules 속성으로 밑에 위반 메세지 보여주기 - 제한사항을 어겼을 시 저장 버튼 비활성화
- 오버라이드되는 ma 속성 mx로 수정
- 최대 닉네임 글자 제한 상수명 MAX_NICKNAME_LENGTH 로 리팩토링 - 배열로 변환하는 과정 삭제 - 사이드바에서 잘려서 보여지는 닉네임 변수명 shortenedNickname으로 수정
434ba9a
to
d862d2c
Compare
Resolves #196
리뷰는 월요일까지 부탁드려요 🙌