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

Upload media files #61

Merged
merged 31 commits into from
May 24, 2024
Merged

Upload media files #61

merged 31 commits into from
May 24, 2024

Conversation

boukeTracebuzz
Copy link
Contributor

@boukeTracebuzz boukeTracebuzz commented May 10, 2024

This PR adds the possibility to upload files and receive files.
The mime type of the files you can upload are defined here: https://api.parley.nu/clientApi/latest/doc/#operation/PostMedia under de media property.

afbeelding

This also adds 2 new settings:

  • window.parleySettings.runOptions.allowFileUpload, this works the same as the one in v1. It shows/hides the upload button.
  • window.parleySettings.runOptions.allowedMediaTypes, this one is new. It allows you to change the allowed mime types that are used in the upload file dialog. It is an array which can contain a subset of our SUPPORTED_MEDIA_TYPES, other types are not allowed.

The docs are already updated for these 2 settings https://developers.parley.nu/docs/settings-2#runoptions

@Gerben-T Gerben-T marked this pull request as ready for review May 16, 2024 14:15
@Gerben-T Gerben-T changed the title Feature/upload media files Upload media files May 16, 2024
…+ tests

Also fixed an issue with boolean settings. If you supplied `false` as the value, the default value would trigger due to the `value || default` statement. I changed it to check if it is a boolean and if so, it never uses the default.
src/UI/Buttons/UploadMedia.jsx Outdated Show resolved Hide resolved
src/UI/Conversation.jsx Show resolved Hide resolved
src/UI/Conversation.jsx Show resolved Hide resolved
src/UI/Media.jsx Outdated Show resolved Hide resolved
src/UI/Media.jsx Outdated Show resolved Hide resolved
src/UI/Media.jsx Show resolved Hide resolved
src/UI/Media.jsx Outdated Show resolved Hide resolved
src/UI/Media.module.css Outdated Show resolved Hide resolved
src/UI/Media.module.css Show resolved Hide resolved
src/UI/ReplyActions.jsx Show resolved Hide resolved
Switch doesnt work with the `startsWith()` cases
@Gerben-T Gerben-T merged commit 8e0674b into master May 24, 2024
4 checks passed
@Gerben-T Gerben-T deleted the feature/uploadMediaFiles branch May 24, 2024 13:36
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