Compare commits
2 Commits
08ec3e1f9b
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c9e13f87b | |||
| 9508106d4f |
+7
-12
@@ -4,13 +4,14 @@ namespace KTXM\Mail;
|
|||||||
|
|
||||||
use KTXF\Event\DeliveryMode;
|
use KTXF\Event\DeliveryMode;
|
||||||
use KTXF\Event\EventListenerRegistrarInterface;
|
use KTXF\Event\EventListenerRegistrarInterface;
|
||||||
use KTXF\Module\ModuleBrowserInterface;
|
use KTXF\Module\Configuration\BrowserModuleContextInterface;
|
||||||
|
use KTXF\Module\Configuration\ModuleContextInterface;
|
||||||
use KTXF\Module\ModuleInstanceAbstract;
|
use KTXF\Module\ModuleInstanceAbstract;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mail Module - Email Client
|
* Mail Module - Email Client
|
||||||
*/
|
*/
|
||||||
class Module extends ModuleInstanceAbstract implements ModuleBrowserInterface
|
class Module extends ModuleInstanceAbstract
|
||||||
{
|
{
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
@@ -79,16 +80,10 @@ class Module extends ModuleInstanceAbstract implements ModuleBrowserInterface
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function registerBI(): array
|
public function configure(ModuleContextInterface $context): void
|
||||||
{
|
{
|
||||||
return [
|
if ($context instanceof BrowserModuleContextInterface) {
|
||||||
'handle' => $this->handle(),
|
$context->registerModule($this, 'Mail', 'static/module.mjs');
|
||||||
'namespace' => 'Mail',
|
}
|
||||||
'version' => $this->version(),
|
|
||||||
'label' => $this->label(),
|
|
||||||
'author' => $this->author(),
|
|
||||||
'description' => $this->description(),
|
|
||||||
'boot' => 'static/module.mjs',
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref, watch } from 'vue'
|
import { computed, ref, watch } from 'vue'
|
||||||
import { useUser } from '@KTXC'
|
import { usePreviewStore, useUser } from '@KTXC'
|
||||||
import { useMailUiStore } from '@/stores/mailUiStore'
|
import { useMailUiStore } from '@/stores/mailUiStore'
|
||||||
import type { EntityObject, MessageObject } from '@MailManager/models'
|
import type { EntityObject, MessageObject } from '@MailManager/models'
|
||||||
import { SecurityLevel } from '@/utile/emailSanitizer'
|
import { SecurityLevel } from '@/utile/emailSanitizer'
|
||||||
@@ -29,6 +29,7 @@ const emit = defineEmits<{
|
|||||||
|
|
||||||
// User settings
|
// User settings
|
||||||
const { getSetting } = useUser()
|
const { getSetting } = useUser()
|
||||||
|
const previewStore = usePreviewStore()
|
||||||
const mailUiStore = useMailUiStore()
|
const mailUiStore = useMailUiStore()
|
||||||
|
|
||||||
// Security overrides
|
// Security overrides
|
||||||
@@ -65,6 +66,7 @@ const effectiveSecurityLevel = computed(() => {
|
|||||||
// Preview state
|
// Preview state
|
||||||
const previewDialog = computed(() => mediaViewerComponent('dialog'))
|
const previewDialog = computed(() => mediaViewerComponent('dialog'))
|
||||||
const previewItems = computed<MediaViewerItem[]>(() => {
|
const previewItems = computed<MediaViewerItem[]>(() => {
|
||||||
|
if (!previewStore.availability.storage) return []
|
||||||
const attachments = message.value?.attachments ?? []
|
const attachments = message.value?.attachments ?? []
|
||||||
const items: MediaViewerItem[] = []
|
const items: MediaViewerItem[] = []
|
||||||
attachments.forEach((attachment, index) => {
|
attachments.forEach((attachment, index) => {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
|
import { usePreviewStore } from '@KTXC'
|
||||||
import RecipientDetails from '@/components/common/RecipientDetails.vue'
|
import RecipientDetails from '@/components/common/RecipientDetails.vue'
|
||||||
import { formatFileSize } from '@/utile/format'
|
import { formatFileSize } from '@/utile/format'
|
||||||
import { mediaViewerCanDisplay, mediaViewerComponent } from '@/services/mediaViewer'
|
import { mediaViewerCanDisplay, mediaViewerComponent } from '@/services/mediaViewer'
|
||||||
@@ -27,7 +28,9 @@ const emit = defineEmits<{
|
|||||||
}>()
|
}>()
|
||||||
|
|
||||||
const mailUiStore = useMailUiStore()
|
const mailUiStore = useMailUiStore()
|
||||||
const previewPopover = computed(() => mediaViewerComponent('popover'))
|
const previewStore = usePreviewStore()
|
||||||
|
const previewsAvailable = computed(() => previewStore.availability.storage)
|
||||||
|
const previewPopover = computed(() => previewsAvailable.value ? mediaViewerComponent('popover') : null)
|
||||||
|
|
||||||
const message = computed(() => {
|
const message = computed(() => {
|
||||||
return props.entity?.properties ?? null
|
return props.entity?.properties ?? null
|
||||||
@@ -48,7 +51,7 @@ const attachmentItems = computed<AttachmentItem[]>(() =>
|
|||||||
)
|
)
|
||||||
|
|
||||||
const isPreviewable = (attachment: MessagePartInterface): boolean => {
|
const isPreviewable = (attachment: MessagePartInterface): boolean => {
|
||||||
return mediaViewerCanDisplay(attachment.type)
|
return previewsAvailable.value && mediaViewerCanDisplay(attachment.type)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleAttachmentClick = (attachment: MessagePartInterface, index: number): void => {
|
const handleAttachmentClick = (attachment: MessagePartInterface, index: number): void => {
|
||||||
|
|||||||
Reference in New Issue
Block a user