Factorizer/Cluster ERP WikiCluster ERP Türkçe
Home / Web app

Reference

Mail and profile screens

Reference for the hand-built screens mail.js, mail-settings.js, profile.js, logs.js, and signup.js, with the endpoints each calls and the permissions it checks.

A few screens of the web app are written by hand instead of being generated from entity metadata: the Mail app, the mail connection screens under Settings, the user profile, the activity and error logs, and the signup entry on the sign-in screen. This page lists what each screen shows, which endpoints it calls, and which permission codes it checks. The server sides are on mail module, logs module, and signup.

Scope and source

  • Defined in: webapp/js/mail.js (renderMail, queueCompose, resetMail), webapp/js/mail-settings.js (renderMailSettings, renderMailProviders, consumeOAuthRedirect), webapp/js/profile.js (renderProfile), webapp/js/logs.js (makeActivityLog, makeErrorLog, resolveErrorMessage), webapp/js/signup.js (wireSignup)
  • Count: 5 files; the endpoint lists below were collected with grep for apiFetch( in each file

Mail app

renderMail(c) is the reading and writing app, opened from the mail app manifest with screen: "mail" (webapp/js/mail.js:646-652, webapp/js/home.js:2427-2428). It shows the folders inbox, sent, drafts, and trash, a message list, a reading pane, and a composer (webapp/js/mail.js:1-14).

Function Call Source
Accounts GET /mail/accounts/ webapp/js/mail.js:144-150
Sync POST /mail/messages/sync?account_id=<id> webapp/js/mail.js:366-375
Read a message, thread, and attachments GET /mail/messages/<id>, /thread, /attachments webapp/js/mail.js:235-259
Attachment content GET /mail/messages/<id>/attachments/<att_id>/content as a blob webapp/js/mail.js:79
Mark read, move to trash POST /mail/messages/<id>/read, /trash webapp/js/mail.js:324, webapp/js/mail.js:336
Drafts POST /mail/messages/drafts, /drafts/<id>/discard, attachment removal webapp/js/mail.js:496, webapp/js/mail.js:541, webapp/js/mail.js:583
Send POST /mail/messages/send webapp/js/mail.js:610
Recipient suggestions GET /parties/channels/all?search=<text>&limit=50, e-mail channels only webapp/js/mail.js:380-390

queueCompose(prefill) stores a subject and body that the app opens as a new draft once its accounts are loaded. The share sheet and the home screen use it (webapp/js/mail.js:27, webapp/js/home.js:4658-4665). With no connected account, the app offers to open Settings › Mail (webapp/js/home.js:4654-4656). resetMail() drops the app's state on logout and on close (webapp/js/mail.js:654, webapp/js/main.js:168, webapp/js/home.js:2546).

Mail settings

renderMailSettings(c) is Settings › Mail (settings.mail). It connects and lists the user's own mail accounts (webapp/js/mail-settings.js:1-9, webapp/js/mail-settings.js:55).

Element Rule Source
Provider availability GET /mail/accounts/providers; on failure only IMAP is offered webapp/js/mail-settings.js:39-49
Connect Shown to holders of mail_account.connect webapp/js/mail-settings.js:69
OAuth connect POST /mail/accounts/oauth/<provider>/start, then the browser goes to the provider and returns to /app with a code webapp/js/mail-settings.js:213, webapp/js/mail-settings.js:304-337
IMAP connect POST /mail/accounts/imap with a domain from GET /mail/domains/?limit=200 webapp/js/mail-settings.js:48-50, webapp/js/mail-settings.js:255
Disconnect DELETE /mail/accounts/<id> webapp/js/mail-settings.js:286
Provider and domain administration Shown to holders of mail_provider.update; opens renderMailProviders and the generic list of mail_domain webapp/js/mail-settings.js:71, webapp/js/mail-settings.js:339-423, webapp/js/home.js:4648-4653

consumeOAuthRedirect() runs at boot. After a successful sign-in it finishes a returning provider redirect and opens Settings › Mail with a result toast; without a session it only clears the redirect parameters (webapp/js/main.js:246-266). The flow is described at mechanism level on mail module.

Profile

renderProfile(c) shows the signed-in user from GET /auth/me, with field labels from the auth.user form metadata and the role section title from the auth.role plural label (webapp/js/profile.js:1-50). It is reached from the profile row at the top of the Settings app (webapp/js/home.js:3576).

Activity and error logs

Screen Call Filters Source
Activity Log (settings.activity_log) GET /logs/activities/ search, HTTP method, success or error status range, date range webapp/js/logs.js:181-215
Error Log (settings.error_log) GET /logs/errors/ and GET /logs/errors/by-trace/<trace_id> search and date range webapp/js/logs.js:353-405

Module and entity names in log rows resolve through metadata (webapp/js/logs.js:1-5). resolveErrorMessage(row) turns a stored error into a localised message and is shared with the assistant screens (webapp/js/logs.js:85, webapp/js/assistant.js:14).

Signup entry

wireSignup() shows the signup button on the sign-in screen only when GET /api/v1/signup/ answers with signup: "open", which happens on a multi-tenant deployment (webapp/js/signup.js:1-7, webapp/js/signup.js:286-292, webapp/js/main.js:225-226). The form collects the company, its mail domain, the first administrator's name, e-mail, and password, and shows the server's notice text for acceptance (webapp/index.html:206-278). The flow, its confirmation step, and country routing are described on signup.

Constraints and validation

  • Permission checks on these screens decide what is shown; the server enforces every permission (webapp/js/api.js:49-55).
  • Browser tests: web-client/_e2e_mail.mjs, web-client/_e2e_mailapp.mjs, web-client/_e2e_mail_drafts.mjs, web-client/_e2e_logs_profile.mjs, web-client/_e2e_tenant_signup.mjs.

Discrepancies

Terms introduced

Term Code identifier Definition Turkish term Source
queued compose queueCompose A prefilled draft handed to the Mail app before it opens. sıradaki taslak webapp/js/mail.js:27
signup entry wireSignup The sign-in screen button that appears only where self-service signup is open. üyelik girişi webapp/js/signup.js:286

Verified against commit 92f8051 on 2026-11-13.

Verified against commit 92f8051 · 2026-11-13