Feature: Support file type messages on widget and dashboard (#659)

- Adds support for file upload

Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
Nithin David Thomas
2020-04-02 12:28:38 +05:30
committed by GitHub
parent 0afa5c297f
commit 7fcd2d0e85
28 changed files with 338 additions and 69 deletions

View File

@@ -24,8 +24,8 @@
@blur="onBlur()"
/>
<file-upload
v-if="!showFileUpload"
accept="image/*"
v-if="showFileUpload"
:size="4096 * 4096"
@input-file="onFileUpload"
>
<i
@@ -105,7 +105,6 @@ export default {
message: '',
isPrivate: false,
showEmojiPicker: false,
showFileUpload: false,
showCannedResponsesList: false,
isUploading: {
audio: false,
@@ -142,6 +141,9 @@ export default {
}
return 10000;
},
showFileUpload() {
return this.channelType === 'Channel::WebWidget';
},
replyButtonLabel() {
if (this.isPrivate) {
return this.$t('CONVERSATION.REPLYBOX.CREATE');
@@ -295,13 +297,7 @@ export default {
onFileUpload(file) {
this.isUploading.image = true;
this.$store
.dispatch('sendAttachment', [
this.currentChat.id,
{
file_type: file.type,
file: file.file,
},
])
.dispatch('sendAttachment', [this.currentChat.id, { file: file.file }])
.then(() => {
this.isUploading.image = false;
this.$emit('scrollToMessage');