feat: Added max length validation in file upload modal in file description#1037
feat: Added max length validation in file upload modal in file description#1037srijnabhargav wants to merge 7 commits intoRocketChat:developfrom
Conversation
| import TypingUsers from '../TypingUsers/TypingUsers'; | ||
| import useSearchMentionUser from '../../hooks/useSearchMentionUser'; | ||
|
|
||
| const DEFAULT_CHAR_LIMIT = 5000; |
There was a problem hiding this comment.
Probably, the limit is set in the RC server. We have to make sure we read these settings from the RC server instead of hardcoding 5000; we can use this as a fallback though.
|
Hello @Spiral-Memory, I’ve addressed your review comment Could you please check it again |
|
|
||
| const useSettingsStore = create((set) => ({ | ||
| messageLimit: 5000, | ||
| messageLimit: null, // Will be fetched from RC server (Message_MaxAllowedSize) |
There was a problem hiding this comment.
You can set 5000 incase server fails to respond as fallback
| const [isPending, setIsPending] = useState(false); | ||
| const messageRef = useRef(null); | ||
|
|
||
| // Mention UI states |
|
Addressed the review points @Spiral-Memory please check |
|
Hello @Spiral-Memory Resolved Prettier fixed the formatting please check |
| const useSettingsStore = create((set) => ({ | ||
| messageLimit: 5000, | ||
| setMessageLimit: (messageLimit) => set(() => ({ messageLimit })), | ||
| // Default fallback value; will be overridden from RC server (Message_MaxAllowedSize) when available |
There was a problem hiding this comment.
Please remove the comments
Spiral-Memory
left a comment
There was a problem hiding this comment.
LGTM! Please resolve the comments
|
Please resolve lint issues |
c2c36e5 to
c672b8b
Compare
c672b8b to
112809c
Compare
Made-with: Cursor
|
Hello @Spiral-Memory I have resolved all the comments and lint check is also passing , ready to merge. |
Brief Title
Acceptance Criteria fulfillment
Added a 5000-character limit for the file description
Show an alert message when the description exceeds the limit
Display the character counter below the description input (left: alert, right: counter)
Fixes #1036
final1.mp4
PR Test Details
Note: The PR will be ready for live testing at https://rocketchat.github.io/EmbeddedChat/pulls/pr-<pr_number> after approval. Contributors are requested to replace
<pr_number>with the actual PR number.