-
Notifications
You must be signed in to change notification settings - Fork 1
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
채팅 입력 글자수 제한 #363
채팅 입력 글자수 제한 #363
Conversation
✅ Deploy Preview for biseo-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
const validated = useMemo(() => input.value.trim().length > 0, [input.value]); | ||
|
||
/** @constant 클라이언트와 서버에서 사용하는 채팅 메시지의 최대 길이를 지정합니다. */ | ||
const maxMessageLength = 500; |
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에 저장할 수 있으면 좋겠다고 생각했습니다!
const textAreaScrollStyle = css` | ||
${scroll.y} | ||
${scrollBar} | ||
overflow-y: scroll; |
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.
overflow: scroll
대신 overflow: auto
를 사용하면 스크롤바가 보일 때와 보이지 않을 때 텍스트 영역의 너비가 달라집니다.
@@ -7,7 +7,7 @@ import { Message } from "./common"; | |||
* description | |||
*/ | |||
export const Send = z.object({ | |||
message: z.string().min(1), | |||
message: z.string().min(1).max(500), |
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.
클라이언트가 채팅을 보내는 이벤트에서는 이 chat.Send
스키마에 따라 입력값 검증이 이루어집니다.
content: z.string().min(1), | ||
resolution: z.string().min(1), | ||
choices: z.array(z.string().min(1)).min(1), | ||
title: z.string().min(1).max(255), |
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.
mysql에서 string 자료형의 길이는 [0, 255]입니다.
https://dev.mysql.com/doc/refman/8.0/en/string-type-syntax.html
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.
그래서 max 255였군용
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.
좋아요! 코멘트도 친절하게 달아주다니 조아
templateName: z.string().min(1).max(255), | ||
title: z.string().min(1).max(255), | ||
content: z.string().min(1).max(255), | ||
resolution: z.string().min(1).max(255), | ||
choices: z.array(z.string().min(1).max(255)), |
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.
우와 추가했습니다! 감사합니다!
#375
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.
오왕 완전 수고하셨습니다!!
코멘트까지 상세하게 달아주셔서 감사해요 :)
content: z.string().min(1), | ||
resolution: z.string().min(1), | ||
choices: z.array(z.string().min(1)).min(1), | ||
title: z.string().min(1).max(255), |
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.
그래서 max 255였군용
Summary
It fixes #242, fixes #228
아래 이벤트들에 대해 string 길이 검증(min: 1, max: 255)을 적용했습니다. (backend min(1) validation이 잘 안됨 #242)
chat.send
admin.agenda.create
agenda.template.create
user.tag.create
채팅 입력 창에 최대 글자 수(500자)와 최대 높이(30%)를 설정하고, 줄이 길어지는 경우 스크롤을 추가했습니다. ([채팅] 글이 아주 길어서 입력창이 채팅창을 가득 채우는 경우 스크롤 불가 & 채팅에 입력이 안됨 #228)
::-webkit-scrollbar
css 의사 요소은 크로미엄만 지원)Further issues