mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 03:57:52 +00:00
fix: Issues with drag and drop attachments to the editor (#10235)
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
|
import { ref } from 'vue';
|
||||||
import { useUISettings } from 'dashboard/composables/useUISettings';
|
import { useUISettings } from 'dashboard/composables/useUISettings';
|
||||||
import { useKeyboardEvents } from 'dashboard/composables/useKeyboardEvents';
|
import { useKeyboardEvents } from 'dashboard/composables/useKeyboardEvents';
|
||||||
import FileUpload from 'vue-upload-component';
|
import FileUpload from 'vue-upload-component';
|
||||||
@@ -122,6 +123,8 @@ export default {
|
|||||||
const { setSignatureFlagForInbox, fetchSignatureFlagFromUISettings } =
|
const { setSignatureFlagForInbox, fetchSignatureFlagFromUISettings } =
|
||||||
useUISettings();
|
useUISettings();
|
||||||
|
|
||||||
|
const uploadRef = ref(false);
|
||||||
|
|
||||||
const keyboardEvents = {
|
const keyboardEvents = {
|
||||||
'Alt+KeyA': {
|
'Alt+KeyA': {
|
||||||
action: () => {
|
action: () => {
|
||||||
@@ -143,6 +146,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
setSignatureFlagForInbox,
|
setSignatureFlagForInbox,
|
||||||
fetchSignatureFlagFromUISettings,
|
fetchSignatureFlagFromUISettings,
|
||||||
|
uploadRef,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -262,6 +266,7 @@ export default {
|
|||||||
@click="toggleEmojiPicker"
|
@click="toggleEmojiPicker"
|
||||||
/>
|
/>
|
||||||
<FileUpload
|
<FileUpload
|
||||||
|
ref="uploadRef"
|
||||||
v-tooltip.top-end="$t('CONVERSATION.REPLYBOX.TIP_ATTACH_ICON')"
|
v-tooltip.top-end="$t('CONVERSATION.REPLYBOX.TIP_ATTACH_ICON')"
|
||||||
input-id="conversationAttachment"
|
input-id="conversationAttachment"
|
||||||
:size="4096 * 4096"
|
:size="4096 * 4096"
|
||||||
@@ -350,7 +355,7 @@ export default {
|
|||||||
/>
|
/>
|
||||||
<transition name="modal-fade">
|
<transition name="modal-fade">
|
||||||
<div
|
<div
|
||||||
v-show="$refs.uploadRef && $refs.uploadRef.dropActive"
|
v-show="uploadRef && uploadRef.dropActive"
|
||||||
class="fixed top-0 bottom-0 left-0 right-0 z-20 flex flex-col items-center justify-center w-full h-full gap-2 text-slate-900 dark:text-slate-50 bg-modal-backdrop-light dark:bg-modal-backdrop-dark"
|
class="fixed top-0 bottom-0 left-0 right-0 z-20 flex flex-col items-center justify-center w-full h-full gap-2 text-slate-900 dark:text-slate-50 bg-modal-backdrop-light dark:bg-modal-backdrop-dark"
|
||||||
>
|
>
|
||||||
<fluent-icon icon="cloud-backup" size="40" />
|
<fluent-icon icon="cloud-backup" size="40" />
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
|
import { ref } from 'vue';
|
||||||
// constants & helpers
|
// constants & helpers
|
||||||
import { ALLOWED_FILE_TYPES } from 'shared/constants/messages';
|
import { ALLOWED_FILE_TYPES } from 'shared/constants/messages';
|
||||||
import { ExceptionWithMessage } from 'shared/helpers/CustomErrors';
|
import { ExceptionWithMessage } from 'shared/helpers/CustomErrors';
|
||||||
@@ -62,8 +63,14 @@ export default {
|
|||||||
const { fetchSignatureFlagFromUISettings, setSignatureFlagForInbox } =
|
const { fetchSignatureFlagFromUISettings, setSignatureFlagForInbox } =
|
||||||
useUISettings();
|
useUISettings();
|
||||||
const v$ = useVuelidate();
|
const v$ = useVuelidate();
|
||||||
|
const uploadAttachment = ref(false);
|
||||||
|
|
||||||
return { fetchSignatureFlagFromUISettings, setSignatureFlagForInbox, v$ };
|
return {
|
||||||
|
fetchSignatureFlagFromUISettings,
|
||||||
|
setSignatureFlagForInbox,
|
||||||
|
v$,
|
||||||
|
uploadAttachment,
|
||||||
|
};
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -558,7 +565,7 @@ export default {
|
|||||||
|
|
||||||
<transition v-if="isEmailOrWebWidgetInbox" name="modal-fade">
|
<transition v-if="isEmailOrWebWidgetInbox" name="modal-fade">
|
||||||
<div
|
<div
|
||||||
v-show="$refs.uploadAttachment && $refs.uploadAttachment.dropActive"
|
v-show="uploadAttachment && uploadAttachment.dropActive"
|
||||||
class="absolute top-0 bottom-0 left-0 right-0 z-30 flex flex-col items-center justify-center w-full h-full gap-2 bg-white/80 dark:bg-slate-700/80"
|
class="absolute top-0 bottom-0 left-0 right-0 z-30 flex flex-col items-center justify-center w-full h-full gap-2 bg-white/80 dark:bg-slate-700/80"
|
||||||
>
|
>
|
||||||
<fluent-icon icon="cloud-backup" size="40" />
|
<fluent-icon icon="cloud-backup" size="40" />
|
||||||
|
|||||||
Reference in New Issue
Block a user