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

Feature/helper text constants로 빼기 #847 #856

Merged
merged 9 commits into from
Dec 11, 2023

Conversation

jasper200207
Copy link
Collaborator

연관 이슈

작업 요약

Helper Text 및 프론트에서 띄우는 input 관련 에러메세지를 constans로 뺐습니다.

작업 상세 설명

  • helperText.ts 파일을 만들었습니다.

리뷰 요구사항

8분

onlyNumber: '숫자만 입력 가능합니다.',
onlyHttps: 'https:// 로 시작해야 합니다.',
underMinLen: (min: number) => `${min}글자 이상 입력해주세요.` as const,
overMaxLen: (max: number) => `최대 ${max}글자 입력해주세요.` as const,
Copy link
Member

Choose a reason for hiding this comment

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

underMinLen, overMaxLen말고도 minLength, maxLength는 어떨지 의견남깁니당!!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

minLength만 했을 때, 에러인지 명확하지 않아서 under를 붙인거 였는데 이젠 error 객체안에 있으니 상관없을 듯 하네요... 좋은 의견인거 같습니다.

onlyNumber: '숫자만 입력 가능합니다.',
onlyHttps: 'https:// 로 시작해야 합니다.',
underMinLen: (min: number) => `${min}글자 이상 입력해주세요.` as const,
overMaxLen: (max: number) => `최대 ${max}글자 입력해주세요.` as const,
Copy link
Contributor

Choose a reason for hiding this comment

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

image

최대 글자가 넘은 상태라서 더 입력하면 안되다는 표현이 와야 할 것 같은데, 입력해주세요.라는 표현이 조금 어색하게 느껴지네용!

최대 글자수 ${max}자를 초과하였습니다. 라거나.. 또 좋은 표현이 생각 안 나긴 한데 이런 식으로 수정하는 건 어떨까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

최대 글자수 ${max}글자를 초고했습니다. 로 수정하겠습니다!

const SignUp = () => {
const TOTAL_STEPS = 3;
const TOTAL_STEPS = 3;
const stepInfoMsg = {
Copy link
Contributor

Choose a reason for hiding this comment

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

이것도 UPPER_SNAKE_CASE로 하면 어떨까요?

required: `작성자가 아닐 시 ${REQUIRE_ERROR_MSG}`,
required: COMMON.error.required,
Copy link
Contributor

Choose a reason for hiding this comment

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

이건 작성자일 경우에 비밀번호 입력 안 해도 돼서, 별도로 처리해주면 좋을 것 같아요!

Copy link
Collaborator

@mun-kyeong mun-kyeong left a comment

Choose a reason for hiding this comment

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

변수명이 깔끔해서 전달력이 좋은 것 같습니다!! 수고하셨어요 :)

correct: '비밀번호가 일치합니다.',
},
error: {
incorrect: '비밀번호가 일치하지 않습니다.',
Copy link
Collaborator

Choose a reason for hiding this comment

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

이부분 저는 mismatch로 사용햇는데 용어를 통일하는게 좋을까요?

setIsInvalidTitle(true);
}
if (authorTrim.length > 30) {
setAuthorHelperText('저자명은 30자 이내여야 합니다.');
setAuthorHelperText(COMMON.error.maxLength(30));
Copy link
Collaborator

Choose a reason for hiding this comment

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

확실히 이렇게 사용하니까 훨씬 전달력 있는 것 같습니다!!

- 작성자가 이니면 비밀번호가 필요합니다 추가
- maxLength 최대 글자수 글자를 초과했습니다 로 변경
- stepInfoMsg -> STEP_INFO_MESSAGE 로 UPPER_SNAKE_CASE 적용
- #847
Copy link
Contributor

@publdaze publdaze 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

@pipisebastian pipisebastian left a comment

Choose a reason for hiding this comment

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

굿이에용~~

@jasper200207 jasper200207 merged commit e9c8d25 into develop Dec 11, 2023
1 check passed
@jasper200207 jasper200207 deleted the feature/helper_text_constants로_빼기_#847 branch December 11, 2023 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor 리팩토링
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants