chore: Allow more filetypes in uploads (#3557)

- Allowing the ability to upload more common file types like zip, Docx etc
- Fallback for image bubble when the image URL isn't available

fixes: #3270

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Nithin David <1277421+nithindavid@users.noreply.github.com>
This commit is contained in:
Sojan Jose 2021-12-20 23:50:37 +05:30 committed by GitHub
parent 76e8acd3c6
commit 6fe5484119
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 99 additions and 20 deletions

View file

@ -1,7 +1,7 @@
<template>
<file-upload
:size="4096 * 2048"
accept="image/*, application/pdf, audio/mpeg, video/mp4, audio/ogg, text/csv"
:accept="allowedFileTypes"
@input-file="onFileUpload"
>
<button class="icon-button flex items-center justify-center">
@ -15,7 +15,10 @@
import FileUpload from 'vue-upload-component';
import Spinner from 'shared/components/Spinner.vue';
import { checkFileSizeLimit } from 'shared/helpers/FileHelper';
import { MAXIMUM_FILE_UPLOAD_SIZE } from 'shared/constants/messages';
import {
MAXIMUM_FILE_UPLOAD_SIZE,
ALLOWED_FILE_TYPES,
} from 'shared/constants/messages';
import { BUS_EVENTS } from 'shared/constants/busEvents';
import FluentIcon from 'shared/components/FluentIcon/Index.vue';
export default {
@ -33,6 +36,9 @@ export default {
fileUploadSizeLimit() {
return MAXIMUM_FILE_UPLOAD_SIZE;
},
allowedFileTypes() {
return ALLOWED_FILE_TYPES;
},
},
methods: {
getFileType(fileType) {