feat: mail list font size, remove Termin toolbar, rename Flagge to Markierung with symbol picker
- Mail list: title and subject font text-xs -> text-sm - Remove Termin (create-event) toolbar button - Rename Flagge -> Markierung with select dropdown (star, flag, bookmark, important, question) - Backend: add flag_type column to Mail model + migration 0006 - Backend: flag_type in MailFlagsUpdate schema, update_flags route, mail_to_response - Frontend: flag_type in Mail interface, FlagUpdatePayload, MailList symbol display
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
-- Add flag_type column to mails table for multiple symbol types
|
||||
ALTER TABLE mails ADD COLUMN IF NOT EXISTS flag_type VARCHAR(32);
|
||||
@@ -130,6 +130,7 @@ class Mail(Base, TenantMixin):
|
||||
body_html_sanitized: Mapped[str] = mapped_column(Text, nullable=False, default="")
|
||||
is_seen: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)
|
||||
is_flagged: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)
|
||||
flag_type: Mapped[str | None] = mapped_column(String(32), nullable=True, default=None)
|
||||
is_draft: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)
|
||||
is_answered: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)
|
||||
is_forwarded: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)
|
||||
|
||||
@@ -1290,6 +1290,8 @@ async def update_flags(
|
||||
mail.is_seen = data.is_seen
|
||||
if data.is_flagged is not None:
|
||||
mail.is_flagged = data.is_flagged
|
||||
if data.flag_type is not None:
|
||||
mail.flag_type = data.flag_type if data.flag_type else None
|
||||
if data.is_draft is not None:
|
||||
mail.is_draft = data.is_draft
|
||||
if data.is_answered is not None:
|
||||
|
||||
@@ -145,6 +145,7 @@ class MailForwardRequest(BaseModel):
|
||||
class MailFlagsUpdate(BaseModel):
|
||||
is_seen: bool | None = None
|
||||
is_flagged: bool | None = None
|
||||
flag_type: str | None = None
|
||||
is_draft: bool | None = None
|
||||
is_answered: bool | None = None
|
||||
is_forwarded: bool | None = None
|
||||
@@ -166,6 +167,7 @@ class MailResponse(BaseModel):
|
||||
body_html_sanitized: str
|
||||
is_seen: bool
|
||||
is_flagged: bool
|
||||
flag_type: str | None = None
|
||||
is_draft: bool
|
||||
is_answered: bool
|
||||
is_forwarded: bool
|
||||
|
||||
@@ -1562,6 +1562,7 @@ def mail_to_response(
|
||||
"date": mail.received_at.isoformat() if mail.received_at else (mail.sent_at.isoformat() if mail.sent_at else None),
|
||||
"is_seen": mail.is_seen,
|
||||
"is_flagged": mail.is_flagged,
|
||||
"flag_type": mail.flag_type,
|
||||
"is_draft": mail.is_draft,
|
||||
"is_answered": mail.is_answered,
|
||||
"is_forwarded": mail.is_forwarded,
|
||||
|
||||
Reference in New Issue
Block a user