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

CRS-293 Max attachments #577

Merged
merged 6 commits into from Oct 19, 2020
Merged

CRS-293 Max attachments #577

merged 6 commits into from Oct 19, 2020

Conversation

ath92
Copy link

@ath92 ath92 commented Oct 14, 2020

Submit a pull request

CLA

Description of the pull request

Draft: relies on GetStream/react-file-utils#22. Relates to #565

This PR uses channelContext.maxNumberOfFiles to prevent the user from uploading too many files. It does so by doing two things:

  • setting the maxNumberOfFiles prop in ImageDropzone (part of react-file-utils)
  • disabling the file upload button if needed

Other fixes:

  • Removing while uploading no longer throws
  • if channelContext.multipleUploads is set to false, you can now only upload a single file (and its default value is now true)

To do:

  • Get translations for tooltip ("You've reached the maximum number of files")
  • UI indication in ImageDropzone, when attempting to drop more than the allowed number of files (in react-file-utils)

@github-actions
Copy link

github-actions bot commented Oct 14, 2020

Size Change: +6.83 kB (0%)

Total Size: 1.26 MB

Filename Size Change
./dist/browser.full-bundle.js 644 kB +4.52 kB (0%)
./dist/browser.full-bundle.min.js 372 kB +908 B (0%)
./dist/css/index.css 23 kB +36 B (0%)
./dist/i18n/en.json 824 B +34 B (4%)
./dist/i18n/fr.json 1.25 kB +45 B (3%)
./dist/i18n/hi.json 1.43 kB +59 B (4%)
./dist/i18n/it.json 1.19 kB +49 B (4%)
./dist/i18n/nl.json 1.17 kB +54 B (4%)
./dist/i18n/ru.json 1.47 kB +70 B (4%)
./dist/i18n/tr.json 1.19 kB +49 B (4%)
./dist/index.es.js 105 kB +511 B (0%)
./dist/index.js 107 kB +498 B (0%)
ℹ️ View Unchanged
Filename Size Change
./dist/css/index.js 21 B 0 B

compressed-size-action

@ath92 ath92 marked this pull request as ready for review October 15, 2020 14:03
@@ -96,7 +100,7 @@ Channel.propTypes = {
* @param {User} user Target [user object](https://getstream.io/chat/docs/#chat-doc-set-user) which is hovered
*/
onMentionsHover: PropTypes.func,
/** Weather to allow multiple attachment uploads */
Copy link
Contributor

Choose a reason for hiding this comment

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

🤣

@mahboubii mahboubii merged commit 8f25c61 into master Oct 19, 2020
@delete-merged-branch delete-merged-branch bot deleted the max-attachments branch October 19, 2020 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants