mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-20 19:16:08 +00:00
feat(mail-ingest): admin card, review mark, inbox events and links, translations
- Admin settings (desktop and phone, self-hosted only): the instance switch,
how mail arrives (IMAP or a signed webhook) with its fields, the address
template, the AI allowance per person and day, a connection test and the
status in counts. Changed fields only are saved; secrets stay masked.
- The review mark of an imported booking takes its mark off: the pill in the
desktop dialog and a row in the phone's transport sheet ('Looks right'),
through the ordinary booking update. Its hint no longer speaks of airports.
- The inbox follows mailInbox:changed and mailInbox:settings, and
?inbox=mail (the 'bookings waiting' notification) opens it.
- mailIngestRepo: the online-only path the views take, answers parsed
against the shared contracts.
- Dropped 'read with AI' and the unused mail-review contract: the server
reads a passing AI failure again on its own.
- mailInbox, mailAdmin and the new reservation, settings and notification
strings in all 28 locales; the pending notice is a plural group.
- The live flight line on the booking cards is one of the card's fields,
full width on the phone; the phone's live card keeps its map to the middle.
- Admin flight and mail cards sit in the left column.
This commit is contained in:
@@ -9,9 +9,17 @@ import apiClient from './client';
|
||||
*/
|
||||
const data = (response: { data: unknown }) => response.data;
|
||||
|
||||
export type MailIngestAction = 'apply' | 'move' | 'file' | 'undo' | 'discard' | 'read-ai';
|
||||
export type MailIngestAction = 'apply' | 'move' | 'file' | 'undo' | 'discard';
|
||||
|
||||
export const mailIngestApi = {
|
||||
// The admin's view: how the import runs, in counts only, and whether the transport reaches its mail now.
|
||||
adminStatus: (): Promise<unknown> => apiClient.get('/admin/mail-ingest/status').then(data),
|
||||
adminTest: (): Promise<unknown> => apiClient.post('/admin/mail-ingest/test', {}).then(data),
|
||||
/** The stored transport fields, passwords masked, from the admin's app settings. */
|
||||
adminSettings: (): Promise<unknown> => apiClient.get('/auth/app-settings').then(data),
|
||||
saveAdminSettings: (patch: Record<string, string | boolean>): Promise<unknown> =>
|
||||
apiClient.put('/auth/app-settings', patch).then(data),
|
||||
|
||||
settings: (): Promise<unknown> => apiClient.get('/mail-ingest/settings').then(data),
|
||||
updateSettings: (body: { enabled?: boolean; ai_enabled?: boolean; auto_add?: boolean }): Promise<unknown> =>
|
||||
apiClient.patch('/mail-ingest/settings', body).then(data),
|
||||
@@ -32,9 +40,6 @@ export const mailIngestApi = {
|
||||
act: (candidateId: number, action: MailIngestAction, body: Record<string, unknown> = {}): Promise<unknown> =>
|
||||
apiClient.post(`/mail-ingest/candidates/${candidateId}/${action}`, body).then(data),
|
||||
|
||||
review: (tripId: number, reservationId: number, fields?: string[]): Promise<unknown> =>
|
||||
apiClient.post(`/trips/${tripId}/reservations/${reservationId}/mail-review`, fields ? { fields } : {}).then(data),
|
||||
|
||||
upload: (file: File): Promise<unknown> => {
|
||||
const form = new FormData();
|
||||
form.append('file', file);
|
||||
|
||||
@@ -23,6 +23,9 @@ export const HANDLED_OUTSIDE_TRIP_STORE = [
|
||||
'tours:visits',
|
||||
// store/flightLiveStore (watchFlightLive, mounted by useFlightLiveSync) merges live flight states.
|
||||
'flight:live',
|
||||
// store/mailIngestStore (watchMailInbox, mounted by Navbar and MMailInboxHost): the open count and the settings card.
|
||||
'mailInbox:changed',
|
||||
'mailInbox:settings',
|
||||
// Collab — Collab/MCollab components + useTripWebSocket's collabFileSync
|
||||
'collab:note:created',
|
||||
'collab:note:updated',
|
||||
@@ -161,9 +164,6 @@ export const HANDLED_OUTSIDE_TRIP_STORE = [
|
||||
export const IGNORED_WS_EVENTS: Partial<Record<TrekWsEventName, string>> = {
|
||||
'todo:assignees':
|
||||
'No screen shows who looks after a todo category (todoApi.getCategoryAssignees has no caller), so there is nothing to refresh.',
|
||||
// The mail import's inbox and settings card come with its client screens, which move these to their listener.
|
||||
'mailInbox:changed': 'No screen shows the mail inbox or its open count yet, so there is nothing to refresh.',
|
||||
'mailInbox:settings': 'No screen shows the mail import settings card yet, so there is nothing to read again.',
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user