feat: Added max length validation in file upload modal in file description#1037
Open
srijnabhargav wants to merge 4 commits intoRocketChat:developfrom
Open
feat: Added max length validation in file upload modal in file description#1037srijnabhargav wants to merge 4 commits intoRocketChat:developfrom
srijnabhargav wants to merge 4 commits intoRocketChat:developfrom
Conversation
| import TypingUsers from '../TypingUsers/TypingUsers'; | ||
| import useSearchMentionUser from '../../hooks/useSearchMentionUser'; | ||
|
|
||
| const DEFAULT_CHAR_LIMIT = 5000; |
Collaborator
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.
Contributor
Author
|
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) |
Collaborator
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 |
Contributor
Author
|
Addressed the review points @Spiral-Memory please check |
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.
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.