diff --git a/app/javascript/dashboard/assets/scss/widgets/_conversation-view.scss b/app/javascript/dashboard/assets/scss/widgets/_conversation-view.scss
index f6965c493..8c65b92e0 100644
--- a/app/javascript/dashboard/assets/scss/widgets/_conversation-view.scss
+++ b/app/javascript/dashboard/assets/scss/widgets/_conversation-view.scss
@@ -17,7 +17,8 @@
}
}
- .image {
+ .image,
+ .video {
cursor: pointer;
position: relative;
@@ -29,17 +30,32 @@
max-width: 85%;
}
+ .modal-video {
+ max-height: 75vh;
+ max-width: 100%;
+ }
+
&::before {
background-image: linear-gradient(-180deg, transparent 3%, $color-heading 130%);
bottom: 0;
content: '';
height: 20%;
left: 0;
- opacity: .8;
+ opacity: 0.8;
position: absolute;
width: 100%;
}
}
+
+ .video {
+ .modal-container {
+ width: auto;
+
+ .modal--close {
+ z-index: var(--z-index-low);
+ }
+ }
+ }
}
.conversations-list-wrap {
diff --git a/app/javascript/dashboard/components/widgets/conversation/Message.vue b/app/javascript/dashboard/components/widgets/conversation/Message.vue
index b3674681a..bd832f4ba 100644
--- a/app/javascript/dashboard/components/widgets/conversation/Message.vue
+++ b/app/javascript/dashboard/components/widgets/conversation/Message.vue
@@ -31,6 +31,11 @@
+
0) {
- const { attachments = [{}] } = this.data;
- const { file_type: fileType } = attachments[0];
- return fileType === 'image';
- }
- return false;
- },
hasText() {
return !!this.data.content;
},
@@ -270,7 +269,8 @@ export default {
return {
bubble: this.isBubble,
'is-private': this.data.private,
- 'is-image': this.hasImageAttachment,
+ 'is-image': this.hasMediaAttachment('image'),
+ 'is-video': this.hasMediaAttachment('video'),
'is-text': this.hasText,
'is-from-bot': this.isSentByBot,
};
@@ -288,6 +288,14 @@ export default {
},
},
methods: {
+ hasMediaAttachment(type) {
+ if (this.hasAttachments && this.data.attachments.length > 0) {
+ const { attachments = [{}] } = this.data;
+ const { file_type: fileType } = attachments[0];
+ return fileType === type;
+ }
+ return false;
+ },
handleContextMenuClick() {
this.showContextMenu = !this.showContextMenu;
},
@@ -315,17 +323,28 @@ export default {