feat(mail) : allège la barre d'actions du lecteur de mail
Boutons "Créer une tâche" / "Lier à une tâche" réduits (text-xs, padding compact), suppression des actions "Marquer comme non lu" et "Marquer important". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
import type { MailMessageDetailDto, MailAddressDto } from '~/services/dto/mail'
|
||||
import { sanitizeMailHtml } from '~/utils/sanitizeMailHtml'
|
||||
import { useMailService } from '~/services/mail'
|
||||
import { useMailStore } from '~/stores/mail'
|
||||
|
||||
const props = defineProps<{
|
||||
/** Détail complet du message. null = aucun message sélectionné. */
|
||||
@@ -16,7 +15,6 @@ const emit = defineEmits<{
|
||||
}>()
|
||||
|
||||
const { t } = useI18n()
|
||||
const store = useMailStore()
|
||||
const mailService = useMailService()
|
||||
|
||||
const showImages = ref(false)
|
||||
@@ -33,20 +31,6 @@ watch(
|
||||
},
|
||||
)
|
||||
|
||||
async function handleMarkReadToggle(): Promise<void> {
|
||||
if (!props.detail) return
|
||||
const id = props.detail.header.id
|
||||
const currentlyRead = props.detail.header.isRead
|
||||
await store.markRead(id, !currentlyRead)
|
||||
}
|
||||
|
||||
async function handleFlagToggle(): Promise<void> {
|
||||
if (!props.detail) return
|
||||
const id = props.detail.header.id
|
||||
const currentlyFlagged = props.detail.header.isFlagged
|
||||
await store.markFlagged(id, !currentlyFlagged)
|
||||
}
|
||||
|
||||
async function handleDownload(downloadId: string, filename: string): Promise<void> {
|
||||
try {
|
||||
const { data } = await mailService.downloadAttachment(downloadId)
|
||||
@@ -126,7 +110,8 @@ function joinAddresses(addresses: MailAddressDto[]): string {
|
||||
variant="primary"
|
||||
icon-name="material-symbols:add-task-outline"
|
||||
icon-position="left"
|
||||
:icon-size="14"
|
||||
:icon-size="13"
|
||||
button-class="text-xs px-2.5 py-1"
|
||||
@click="emit('createTask', detail.header.id)"
|
||||
/>
|
||||
<MalioButton
|
||||
@@ -134,25 +119,10 @@ function joinAddresses(addresses: MailAddressDto[]): string {
|
||||
variant="secondary"
|
||||
icon-name="material-symbols:link"
|
||||
icon-position="left"
|
||||
:icon-size="14"
|
||||
:icon-size="13"
|
||||
button-class="text-xs px-2.5 py-1"
|
||||
@click="emit('linkTask', detail.header.id)"
|
||||
/>
|
||||
<MalioButton
|
||||
:label="detail.header.isRead ? t('mail.actions.markUnread') : t('mail.actions.markRead')"
|
||||
variant="tertiary"
|
||||
:icon-name="detail.header.isRead ? 'material-symbols:mark-email-unread-outline' : 'material-symbols:mark-email-read-outline'"
|
||||
icon-position="left"
|
||||
:icon-size="14"
|
||||
@click="handleMarkReadToggle"
|
||||
/>
|
||||
<MalioButton
|
||||
:label="detail.header.isFlagged ? t('mail.actions.unflag') : t('mail.actions.flag')"
|
||||
variant="tertiary"
|
||||
:icon-name="detail.header.isFlagged ? 'material-symbols:star' : 'material-symbols:star-outline'"
|
||||
icon-position="left"
|
||||
:icon-size="14"
|
||||
@click="handleFlagToggle"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user