fix: show warning if mail manager is missing
Signed-off-by: Sebastian <krupinski01@gmail.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, onMounted, watch } from 'vue'
|
import { ref, computed, onMounted, watch } from 'vue'
|
||||||
import { useDisplay } from 'vuetify'
|
import { useDisplay } from 'vuetify'
|
||||||
|
import { useModuleStore } from '@KTXC/stores/moduleStore'
|
||||||
import { useCollectionsStore } from '@MailManager/stores/collectionsStore'
|
import { useCollectionsStore } from '@MailManager/stores/collectionsStore'
|
||||||
import { useEntitiesStore } from '@MailManager/stores/entitiesStore'
|
import { useEntitiesStore } from '@MailManager/stores/entitiesStore'
|
||||||
import { useServicesStore } from '@MailManager/stores/servicesStore'
|
import { useServicesStore } from '@MailManager/stores/servicesStore'
|
||||||
@@ -17,6 +18,12 @@ import SettingsDialog from '@/components/settings/SettingsDialog.vue'
|
|||||||
// Vuetify display for responsive behavior
|
// Vuetify display for responsive behavior
|
||||||
const display = useDisplay()
|
const display = useDisplay()
|
||||||
|
|
||||||
|
// Check if mail manager is available
|
||||||
|
const moduleStore = useModuleStore()
|
||||||
|
const isMailManagerAvailable = computed(() => {
|
||||||
|
return moduleStore.has('mail_manager') || moduleStore.has('MailManager')
|
||||||
|
})
|
||||||
|
|
||||||
// Snackbar state for notifications
|
// Snackbar state for notifications
|
||||||
const snackbarVisible = ref(false)
|
const snackbarVisible = ref(false)
|
||||||
const snackbarMessage = ref('')
|
const snackbarMessage = ref('')
|
||||||
@@ -50,6 +57,8 @@ const isMobile = computed(() => display.mdAndDown.value)
|
|||||||
|
|
||||||
// Initialize
|
// Initialize
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
if (!isMailManagerAvailable.value) return
|
||||||
|
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
// Load services (accounts)
|
// Load services (accounts)
|
||||||
@@ -77,6 +86,8 @@ onMounted(async () => {
|
|||||||
watch(
|
watch(
|
||||||
[selectedFolder, () => servicesStore.services],
|
[selectedFolder, () => servicesStore.services],
|
||||||
() => {
|
() => {
|
||||||
|
if (!isMailManagerAvailable.value) return
|
||||||
|
|
||||||
mailSync.clearSources()
|
mailSync.clearSources()
|
||||||
|
|
||||||
// Add currently selected folder to sync
|
// Add currently selected folder to sync
|
||||||
@@ -204,7 +215,28 @@ const currentMessages = computed(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="mail-container">
|
<!-- Manager Unavailable -->
|
||||||
|
<div v-if="!isMailManagerAvailable" class="mail-unavailable">
|
||||||
|
<v-alert
|
||||||
|
type="warning"
|
||||||
|
variant="outlined"
|
||||||
|
class="mail-unavailable-alert"
|
||||||
|
>
|
||||||
|
<v-icon size="64" color="warning" class="mb-6">mdi-email-off-outline</v-icon>
|
||||||
|
<h2 class="text-h5 font-weight-bold mb-4">Mail Manager Not Available</h2>
|
||||||
|
<p>
|
||||||
|
The Mail Manager module is not installed or enabled.
|
||||||
|
This module requires the <strong>mail_manager</strong> module to function properly.
|
||||||
|
</p>
|
||||||
|
<p class="mb-0 mt-2">
|
||||||
|
Please contact your system administrator to install and enable the
|
||||||
|
<code>mail_manager</code> module.
|
||||||
|
</p>
|
||||||
|
</v-alert>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Normal UI -->
|
||||||
|
<div v-else class="mail-container">
|
||||||
<!-- Top toolbar -->
|
<!-- Top toolbar -->
|
||||||
<v-app-bar class="mail-toolbar" elevation="0" density="compact">
|
<v-app-bar class="mail-toolbar" elevation="0" density="compact">
|
||||||
<v-app-bar-nav-icon
|
<v-app-bar-nav-icon
|
||||||
@@ -338,6 +370,22 @@ const currentMessages = computed(() => {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.mail-unavailable {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100vh;
|
||||||
|
padding: 48px;
|
||||||
|
text-align: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mail-unavailable-alert {
|
||||||
|
width: 100%;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
.mail-container {
|
.mail-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
Reference in New Issue
Block a user