|
|
|
@ -1,10 +1,24 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="flex gap-4 items-center"> |
|
|
|
<div class="flex gap-4 items-center"> |
|
|
|
<h2 class="mr-auto" v-text="title" /> |
|
|
|
<h2 |
|
|
|
|
|
|
|
class="mr-auto" |
|
|
|
|
|
|
|
v-text="title" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<BaseButton icon="email-plus" only-icon type="black" @click="goToCompose" /> |
|
|
|
<BaseButton |
|
|
|
|
|
|
|
icon="email-plus" |
|
|
|
|
|
|
|
only-icon |
|
|
|
|
|
|
|
type="black" |
|
|
|
|
|
|
|
@click="goToCompose" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<BaseButton :disabled="isLoading" icon="refresh" only-icon type="black" @click="refreshMessages" /> |
|
|
|
<BaseButton |
|
|
|
|
|
|
|
:disabled="isLoading" |
|
|
|
|
|
|
|
icon="refresh" |
|
|
|
|
|
|
|
only-icon |
|
|
|
|
|
|
|
type="black" |
|
|
|
|
|
|
|
@click="refreshMessages" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<BaseButton |
|
|
|
<BaseButton |
|
|
|
:disabled="0 === selectedItems.length || isLoading" |
|
|
|
:disabled="0 === selectedItems.length || isLoading" |
|
|
|
@ -23,7 +37,11 @@ |
|
|
|
@click="mToggleMessagesList" |
|
|
|
@click="mToggleMessagesList" |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<BaseMenu id="course-messages-list-tmenu" ref="mMessageList" :model="mItemsMarkAs" /> |
|
|
|
<BaseMenu |
|
|
|
|
|
|
|
id="course-messages-list-tmenu" |
|
|
|
|
|
|
|
ref="mMessageList" |
|
|
|
|
|
|
|
:model="mItemsMarkAs" |
|
|
|
|
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<hr /> |
|
|
|
<hr /> |
|
|
|
@ -31,11 +49,26 @@ |
|
|
|
<div class="grid grid-cols-1 md:grid-cols-5 gap-4"> |
|
|
|
<div class="grid grid-cols-1 md:grid-cols-5 gap-4"> |
|
|
|
<div class="space-y-4"> |
|
|
|
<div class="space-y-4"> |
|
|
|
<div class="flex md:flex-col gap-2"> |
|
|
|
<div class="flex md:flex-col gap-2"> |
|
|
|
<BaseButton :label="t('Inbox')" icon="inbox" type="black" @click="showInbox" /> |
|
|
|
<BaseButton |
|
|
|
|
|
|
|
:label="t('Inbox')" |
|
|
|
|
|
|
|
icon="inbox" |
|
|
|
|
|
|
|
type="black" |
|
|
|
|
|
|
|
@click="showInbox" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<BaseButton :label="t('Unread')" icon="email-unread" type="black" @click="showUnread" /> |
|
|
|
<BaseButton |
|
|
|
|
|
|
|
:label="t('Unread')" |
|
|
|
|
|
|
|
icon="email-unread" |
|
|
|
|
|
|
|
type="black" |
|
|
|
|
|
|
|
@click="showUnread" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<BaseButton :label="t('Sent')" icon="sent" type="black" @click="showSent" /> |
|
|
|
<BaseButton |
|
|
|
|
|
|
|
:label="t('Sent')" |
|
|
|
|
|
|
|
icon="sent" |
|
|
|
|
|
|
|
type="black" |
|
|
|
|
|
|
|
@click="showSent" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<BaseButton |
|
|
|
<BaseButton |
|
|
|
v-for="tag in tags" |
|
|
|
v-for="tag in tags" |
|
|
|
@ -84,7 +117,12 @@ |
|
|
|
{{ slotProps.data.title }} |
|
|
|
{{ slotProps.data.title }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<BaseTag v-for="tag in findMyReceiver(slotProps.data)?.tags" :key="tag.id" :label="tag.tag" type="info" /> |
|
|
|
<BaseTag |
|
|
|
|
|
|
|
v-for="tag in findMyReceiver(slotProps.data)?.tags" |
|
|
|
|
|
|
|
:key="tag.id" |
|
|
|
|
|
|
|
:label="tag.tag" |
|
|
|
|
|
|
|
type="info" |
|
|
|
|
|
|
|
/> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</Column> |
|
|
|
</Column> |
|
|
|
<Column :header="t('Send date')"> |
|
|
|
<Column :header="t('Send date')"> |
|
|
|
@ -94,7 +132,12 @@ |
|
|
|
</Column> |
|
|
|
</Column> |
|
|
|
<Column :header="t('Actions')"> |
|
|
|
<Column :header="t('Actions')"> |
|
|
|
<template #body="slotProps"> |
|
|
|
<template #body="slotProps"> |
|
|
|
<BaseButton icon="delete" size="small" type="danger" @click="showDlgConfirmDeleteSingle(slotProps)" /> |
|
|
|
<BaseButton |
|
|
|
|
|
|
|
icon="delete" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
type="danger" |
|
|
|
|
|
|
|
@click="showDlgConfirmDeleteSingle(slotProps)" |
|
|
|
|
|
|
|
/> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</Column> |
|
|
|
</Column> |
|
|
|
</DataTable> |
|
|
|
</DataTable> |
|
|
|
@ -103,35 +146,35 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script setup> |
|
|
|
<script setup> |
|
|
|
import { computed, onMounted, ref } from "vue"; |
|
|
|
import { computed, onMounted, ref } from "vue" |
|
|
|
import { useStore } from "vuex"; |
|
|
|
import { useStore } from "vuex" |
|
|
|
import { useI18n } from "vue-i18n"; |
|
|
|
import { useI18n } from "vue-i18n" |
|
|
|
import { useRoute, useRouter } from "vue-router"; |
|
|
|
import { useRoute, useRouter } from "vue-router" |
|
|
|
import { useRelativeDatetime } from "../../composables/formatDate"; |
|
|
|
import { useRelativeDatetime } from "../../composables/formatDate" |
|
|
|
import BaseButton from "../../components/basecomponents/BaseButton.vue"; |
|
|
|
import BaseButton from "../../components/basecomponents/BaseButton.vue" |
|
|
|
import BaseMenu from "../../components/basecomponents/BaseMenu.vue"; |
|
|
|
import BaseMenu from "../../components/basecomponents/BaseMenu.vue" |
|
|
|
import BaseUserAvatar from "../../components/basecomponents/BaseUserAvatar.vue"; |
|
|
|
import BaseUserAvatar from "../../components/basecomponents/BaseUserAvatar.vue" |
|
|
|
import BaseTag from "../../components/basecomponents/BaseTag.vue"; |
|
|
|
import BaseTag from "../../components/basecomponents/BaseTag.vue" |
|
|
|
import DataTable from "primevue/datatable"; |
|
|
|
import DataTable from "primevue/datatable" |
|
|
|
import Column from "primevue/column"; |
|
|
|
import Column from "primevue/column" |
|
|
|
import { useConfirm } from "primevue/useconfirm"; |
|
|
|
import { useConfirm } from "primevue/useconfirm" |
|
|
|
import { useQuery } from "@vue/apollo-composable"; |
|
|
|
import { useQuery } from "@vue/apollo-composable" |
|
|
|
import { MESSAGE_STATUS_DELETED, MESSAGE_TYPE_INBOX } from "../../components/message/constants"; |
|
|
|
import { MESSAGE_STATUS_DELETED, MESSAGE_TYPE_INBOX } from "../../components/message/constants" |
|
|
|
import { GET_USER_MESSAGE_TAGS } from "../../graphql/queries/MessageTag"; |
|
|
|
import { GET_USER_MESSAGE_TAGS } from "../../graphql/queries/MessageTag" |
|
|
|
import { useNotification } from "../../composables/notification"; |
|
|
|
import { useNotification } from "../../composables/notification" |
|
|
|
import { useMessageRelUserStore } from "../../store/messageRelUserStore" |
|
|
|
import { useMessageRelUserStore } from "../../store/messageRelUserStore" |
|
|
|
|
|
|
|
|
|
|
|
const route = useRoute(); |
|
|
|
const route = useRoute() |
|
|
|
const router = useRouter(); |
|
|
|
const router = useRouter() |
|
|
|
const store = useStore(); |
|
|
|
const store = useStore() |
|
|
|
const { t } = useI18n(); |
|
|
|
const { t } = useI18n() |
|
|
|
|
|
|
|
|
|
|
|
const confirm = useConfirm(); |
|
|
|
const confirm = useConfirm() |
|
|
|
const notification = useNotification(); |
|
|
|
const notification = useNotification() |
|
|
|
|
|
|
|
|
|
|
|
const messageRelUserStore = useMessageRelUserStore() |
|
|
|
const messageRelUserStore = useMessageRelUserStore() |
|
|
|
|
|
|
|
|
|
|
|
const user = computed(() => store.getters["security/getUser"]); |
|
|
|
const user = computed(() => store.getters["security/getUser"]) |
|
|
|
|
|
|
|
|
|
|
|
const mItemsMarkAs = ref([ |
|
|
|
const mItemsMarkAs = ref([ |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -144,15 +187,15 @@ const mItemsMarkAs = ref([ |
|
|
|
return undefined |
|
|
|
return undefined |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
myReceiver.read = true; |
|
|
|
myReceiver.read = true |
|
|
|
|
|
|
|
|
|
|
|
return store.dispatch("messagereluser/update", myReceiver); |
|
|
|
return store.dispatch("messagereluser/update", myReceiver) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
Promise.all(promises) |
|
|
|
Promise.all(promises) |
|
|
|
.then(() => messageRelUserStore.findUnreadCount()) |
|
|
|
.then(() => messageRelUserStore.findUnreadCount()) |
|
|
|
.catch((e) => notification.showErrorNotification(e)) |
|
|
|
.catch((e) => notification.showErrorNotification(e)) |
|
|
|
.finally(() => selectedItems.value = []) |
|
|
|
.finally(() => (selectedItems.value = [])) |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -165,76 +208,76 @@ const mItemsMarkAs = ref([ |
|
|
|
return undefined |
|
|
|
return undefined |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
myReceiver.read = false; |
|
|
|
myReceiver.read = false |
|
|
|
|
|
|
|
|
|
|
|
return store.dispatch("messagereluser/update", myReceiver); |
|
|
|
return store.dispatch("messagereluser/update", myReceiver) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
Promise.all(promises) |
|
|
|
Promise.all(promises) |
|
|
|
.then(() => messageRelUserStore.findUnreadCount()) |
|
|
|
.then(() => messageRelUserStore.findUnreadCount()) |
|
|
|
.catch((e) => notification.showErrorNotification(e)) |
|
|
|
.catch((e) => notification.showErrorNotification(e)) |
|
|
|
.finally(() => selectedItems.value = []) |
|
|
|
.finally(() => (selectedItems.value = [])) |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
]); |
|
|
|
]) |
|
|
|
|
|
|
|
|
|
|
|
const mMessageList = ref(null); |
|
|
|
const mMessageList = ref(null) |
|
|
|
|
|
|
|
|
|
|
|
const mToggleMessagesList = (event) => mMessageList.value.toggle(event); |
|
|
|
const mToggleMessagesList = (event) => mMessageList.value.toggle(event) |
|
|
|
|
|
|
|
|
|
|
|
const dtMessages = ref(null); |
|
|
|
const dtMessages = ref(null) |
|
|
|
const initialRowsPerPage = 10; |
|
|
|
const initialRowsPerPage = 10 |
|
|
|
|
|
|
|
|
|
|
|
const goToCompose = () => { |
|
|
|
const goToCompose = () => { |
|
|
|
router.push({ |
|
|
|
router.push({ |
|
|
|
name: "MessageCreate", |
|
|
|
name: "MessageCreate", |
|
|
|
query: route.query, |
|
|
|
query: route.query, |
|
|
|
}); |
|
|
|
}) |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const { result: messageTagsResult } = useQuery( |
|
|
|
const { result: messageTagsResult } = useQuery( |
|
|
|
GET_USER_MESSAGE_TAGS, |
|
|
|
GET_USER_MESSAGE_TAGS, |
|
|
|
{ user: user.value["@id"] }, |
|
|
|
{ user: user.value["@id"] }, |
|
|
|
{ fetchPolicy: "cache-and-network" } |
|
|
|
{ fetchPolicy: "cache-and-network" }, |
|
|
|
); |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
const tags = computed(() => messageTagsResult.value?.messageTags?.edges.map(({ node }) => node) ?? []); |
|
|
|
const tags = computed(() => messageTagsResult.value?.messageTags?.edges.map(({ node }) => node) ?? []) |
|
|
|
|
|
|
|
|
|
|
|
const items = computed(() => store.getters["message/getRecents"]); |
|
|
|
const items = computed(() => store.getters["message/getRecents"]) |
|
|
|
const isLoading = computed(() => store.getters["message/isLoading"]); |
|
|
|
const isLoading = computed(() => store.getters["message/isLoading"]) |
|
|
|
const totalItems = computed(() => store.getters["message/getTotalItems"]); |
|
|
|
const totalItems = computed(() => store.getters["message/getTotalItems"]) |
|
|
|
|
|
|
|
|
|
|
|
const title = ref(null); |
|
|
|
const title = ref(null) |
|
|
|
|
|
|
|
|
|
|
|
const selectedItems = ref([]); |
|
|
|
const selectedItems = ref([]) |
|
|
|
|
|
|
|
|
|
|
|
const rowClass = (data) => { |
|
|
|
const rowClass = (data) => { |
|
|
|
const myReceiver = findMyReceiver(data); |
|
|
|
const myReceiver = findMyReceiver(data) |
|
|
|
|
|
|
|
|
|
|
|
if (!myReceiver) { |
|
|
|
if (!myReceiver) { |
|
|
|
return []; |
|
|
|
return [] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return [{ "font-semibold": !myReceiver.read }]; |
|
|
|
return [{ "font-semibold": !myReceiver.read }] |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let fetchPayload = { |
|
|
|
let fetchPayload = { |
|
|
|
"order[sendDate]": "desc", |
|
|
|
"order[sendDate]": "desc", |
|
|
|
itemsPerPage: initialRowsPerPage, |
|
|
|
itemsPerPage: initialRowsPerPage, |
|
|
|
page: 1, |
|
|
|
page: 1, |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function loadMessages(reset = true) { |
|
|
|
function loadMessages(reset = true) { |
|
|
|
if (reset) { |
|
|
|
if (reset) { |
|
|
|
store.dispatch("message/resetList"); |
|
|
|
store.dispatch("message/resetList") |
|
|
|
dtMessages.value.resetPage(); |
|
|
|
dtMessages.value.resetPage() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
store.dispatch("message/fetchAll", fetchPayload); |
|
|
|
store.dispatch("message/fetchAll", fetchPayload) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function showInbox() { |
|
|
|
function showInbox() { |
|
|
|
title.value = t("Inbox"); |
|
|
|
title.value = t("Inbox") |
|
|
|
|
|
|
|
|
|
|
|
fetchPayload = { |
|
|
|
fetchPayload = { |
|
|
|
msgType: MESSAGE_TYPE_INBOX, |
|
|
|
msgType: MESSAGE_TYPE_INBOX, |
|
|
|
@ -242,13 +285,13 @@ function showInbox() { |
|
|
|
"order[sendDate]": "desc", |
|
|
|
"order[sendDate]": "desc", |
|
|
|
itemsPerPage: initialRowsPerPage, |
|
|
|
itemsPerPage: initialRowsPerPage, |
|
|
|
page: 1, |
|
|
|
page: 1, |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
loadMessages(); |
|
|
|
loadMessages() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function showInboxByTag(tag) { |
|
|
|
function showInboxByTag(tag) { |
|
|
|
title.value = tag.tag; |
|
|
|
title.value = tag.tag |
|
|
|
|
|
|
|
|
|
|
|
fetchPayload = { |
|
|
|
fetchPayload = { |
|
|
|
msgType: MESSAGE_TYPE_INBOX, |
|
|
|
msgType: MESSAGE_TYPE_INBOX, |
|
|
|
@ -257,13 +300,13 @@ function showInboxByTag(tag) { |
|
|
|
"order[sendDate]": "desc", |
|
|
|
"order[sendDate]": "desc", |
|
|
|
itemsPerPage: initialRowsPerPage, |
|
|
|
itemsPerPage: initialRowsPerPage, |
|
|
|
page: 1, |
|
|
|
page: 1, |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
loadMessages(); |
|
|
|
loadMessages() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function showUnread() { |
|
|
|
function showUnread() { |
|
|
|
title.value = t("Unread"); |
|
|
|
title.value = t("Unread") |
|
|
|
|
|
|
|
|
|
|
|
fetchPayload = { |
|
|
|
fetchPayload = { |
|
|
|
msgType: MESSAGE_TYPE_INBOX, |
|
|
|
msgType: MESSAGE_TYPE_INBOX, |
|
|
|
@ -272,13 +315,13 @@ function showUnread() { |
|
|
|
"receivers.read": false, |
|
|
|
"receivers.read": false, |
|
|
|
itemsPerPage: initialRowsPerPage, |
|
|
|
itemsPerPage: initialRowsPerPage, |
|
|
|
page: 1, |
|
|
|
page: 1, |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
loadMessages(); |
|
|
|
loadMessages() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function showSent() { |
|
|
|
function showSent() { |
|
|
|
title.value = t("Sent"); |
|
|
|
title.value = t("Sent") |
|
|
|
|
|
|
|
|
|
|
|
fetchPayload = { |
|
|
|
fetchPayload = { |
|
|
|
msgType: MESSAGE_TYPE_INBOX, |
|
|
|
msgType: MESSAGE_TYPE_INBOX, |
|
|
|
@ -286,23 +329,23 @@ function showSent() { |
|
|
|
"order[sendDate]": "desc", |
|
|
|
"order[sendDate]": "desc", |
|
|
|
itemsPerPage: initialRowsPerPage, |
|
|
|
itemsPerPage: initialRowsPerPage, |
|
|
|
page: 1, |
|
|
|
page: 1, |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
loadMessages(); |
|
|
|
loadMessages() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function refreshMessages() { |
|
|
|
function refreshMessages() { |
|
|
|
fetchPayload.itemsPerPage = initialRowsPerPage; |
|
|
|
fetchPayload.itemsPerPage = initialRowsPerPage |
|
|
|
fetchPayload.page = 1; |
|
|
|
fetchPayload.page = 1 |
|
|
|
|
|
|
|
|
|
|
|
loadMessages(); |
|
|
|
loadMessages() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function onPage(event) { |
|
|
|
function onPage(event) { |
|
|
|
fetchPayload.page = event.page + 1; |
|
|
|
fetchPayload.page = event.page + 1 |
|
|
|
fetchPayload.itemsPerPage = event.rows; |
|
|
|
fetchPayload.itemsPerPage = event.rows |
|
|
|
|
|
|
|
|
|
|
|
loadMessages(false); |
|
|
|
loadMessages(false) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function onRowClick({ data }) { |
|
|
|
function onRowClick({ data }) { |
|
|
|
@ -311,25 +354,25 @@ function onRowClick({ data }) { |
|
|
|
query: { |
|
|
|
query: { |
|
|
|
id: data["@id"], |
|
|
|
id: data["@id"], |
|
|
|
}, |
|
|
|
}, |
|
|
|
}); |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function findMyReceiver(message) { |
|
|
|
function findMyReceiver(message) { |
|
|
|
const receivers = [...message.receiversTo, ...message.receiversCc]; |
|
|
|
const receivers = [...message.receiversTo, ...message.receiversCc] |
|
|
|
|
|
|
|
|
|
|
|
return receivers.find(({ receiver }) => receiver["@id"] === user.value["@id"]); |
|
|
|
return receivers.find(({ receiver }) => receiver["@id"] === user.value["@id"]) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async function deleteMessage(message) { |
|
|
|
async function deleteMessage(message) { |
|
|
|
if (message.sender["@id"] === user.value["@id"]) { |
|
|
|
if (message.sender["@id"] === user.value["@id"]) { |
|
|
|
message.status = MESSAGE_STATUS_DELETED; |
|
|
|
message.status = MESSAGE_STATUS_DELETED |
|
|
|
|
|
|
|
|
|
|
|
await store.dispatch("message/update", message); |
|
|
|
await store.dispatch("message/update", message) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
const myReceiver = findMyReceiver(message); |
|
|
|
const myReceiver = findMyReceiver(message) |
|
|
|
|
|
|
|
|
|
|
|
if (myReceiver) { |
|
|
|
if (myReceiver) { |
|
|
|
await store.dispatch("messagereluser/del", myReceiver); |
|
|
|
await store.dispatch("messagereluser/del", myReceiver) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -339,13 +382,13 @@ function showDlgConfirmDeleteSingle({ data }) { |
|
|
|
header: t("Confirmation"), |
|
|
|
header: t("Confirmation"), |
|
|
|
message: t(`Are you sure you want to delete "${data.title}"?`), |
|
|
|
message: t(`Are you sure you want to delete "${data.title}"?`), |
|
|
|
accept: async () => { |
|
|
|
accept: async () => { |
|
|
|
await deleteMessage(data); |
|
|
|
await deleteMessage(data) |
|
|
|
|
|
|
|
|
|
|
|
loadMessages(); |
|
|
|
loadMessages() |
|
|
|
|
|
|
|
|
|
|
|
notification.showSuccessNotification(t("Message deleted")); |
|
|
|
notification.showSuccessNotification(t("Message deleted")) |
|
|
|
}, |
|
|
|
}, |
|
|
|
}); |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function showDlgConfirmDeleteMultiple() { |
|
|
|
function showDlgConfirmDeleteMultiple() { |
|
|
|
@ -354,19 +397,19 @@ function showDlgConfirmDeleteMultiple() { |
|
|
|
message: t("Are you sure you want to delete the selected items?"), |
|
|
|
message: t("Are you sure you want to delete the selected items?"), |
|
|
|
accept: async () => { |
|
|
|
accept: async () => { |
|
|
|
for (const message of selectedItems.value) { |
|
|
|
for (const message of selectedItems.value) { |
|
|
|
await deleteMessage(message); |
|
|
|
await deleteMessage(message) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
loadMessages(); |
|
|
|
loadMessages() |
|
|
|
|
|
|
|
|
|
|
|
notification.showSuccessNotification(t("Messages deleted")); |
|
|
|
notification.showSuccessNotification(t("Messages deleted")) |
|
|
|
|
|
|
|
|
|
|
|
selectedItems.value = []; |
|
|
|
selectedItems.value = [] |
|
|
|
}, |
|
|
|
}, |
|
|
|
}); |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
onMounted(() => { |
|
|
|
showInbox(); |
|
|
|
showInbox() |
|
|
|
}); |
|
|
|
}) |
|
|
|
</script> |
|
|
|
</script> |