WeKnora/frontend/src
sunmh 47d95cd720 feat(invitation): add auto-accept switch for inviting registered users
Add a global tenant switch (tenant.auto_accept_invitation /
WEKNORA_TENANT_AUTO_ACCEPT_INVITATION, default false). When enabled,
inviting an already-registered user adds them to the tenant as an
active member immediately, instead of creating a pending invitation
the invitee must accept from their inbox.

Backend:
- CreateInvitation reads the switch and, when on, calls the new shared
  addMemberAndRespond helper (extracted from TenantMemberHandler.AddMember)
  to persist the member and write the HTTP response. Both call sites
  share it so the sentinel->status mapping can't drift apart.
- Register the setting in the system_setting registry (bool, default
  false).
- Expose the switch as capabilities.auto_accept_invitation on
  GET /auth/me, so the SPA can adapt the invite popup without calling
  the super-admin settings API.
- Cover enabled/disabled, already-a-member, unknown email, owner role
  rejection, and nil member service with unit tests.

Frontend:
- The invite popup adapts to the mode. With auto-accept, the form
  submits directly (button reads "Send", no "confirm invitation" step)
  and refreshes the member roster silently (no toast; the new row is
  the feedback). The classic two-step flow is unchanged when off.
- Fix capabilities hydration: refreshFromAuthMe (the only reader of
  /auth/me capabilities) was invoked solely from the invitation-token
  flow, so on page reload can_create_tenant and auto_accept_invitation
  stayed at their initial false. Trigger it from initFromStorage once a
  token is restored so deployment switches are reconciled with the live
  server.
2026-08-10 15:04:29 +08:00
..
api feat(invitation): add auto-accept switch for inviting registered users 2026-08-10 15:04:29 +08:00
assets feat(frontend): polish shared space settings and join preview UI 2026-07-23 20:32:29 +08:00
components feat: 增加自动添加标签的功能 2026-08-07 15:01:01 +08:00
composables feat(files): add message-scoped proxy for shared-agent chat images 2026-08-07 18:10:16 +08:00
config feat(frontend): refine user settings menu 2026-07-28 11:16:13 +08:00
directives feat(frontend): enhance chat image handling and typewriter effect 2026-06-18 18:42:16 +08:00
hooks feat(knowledge): show uploaded folder structure as a sidebar tree 2026-08-04 20:45:29 +08:00
i18n feat: 邀请链接在 invite_only 模式下改为登录后加入空间 2026-08-10 14:57:38 +08:00
router feat(auth): support tenantless provisioning and gated self-service workspace creation 2026-07-13 18:13:51 +08:00
stores feat(invitation): add auto-accept switch for inviting registered users 2026-08-10 15:04:29 +08:00
types fix(chunking): align preview with parent-child splitting / 修复预览与父子分块不一致 2026-08-05 15:09:14 +08:00
utils feat(files): add message-scoped proxy for shared-agent chat images 2026-08-07 18:10:16 +08:00
views feat(invitation): add auto-accept switch for inviting registered users 2026-08-10 15:04:29 +08:00
wailsjs feat: implement automatic update checking and downloading functionality in the desktop app, enhancing user experience with seamless updates and corresponding UI settings 2026-04-11 18:51:16 +08:00
App.vue feat: 邀请链接在 invite_only 模式下改为登录后加入空间 2026-08-10 14:57:38 +08:00
embed-main.ts feat(embed): add widget, visitor chat, and management UI (#1657) 2026-06-12 23:10:39 +08:00
main.ts fix(frontend): load complete TDesign styles 2026-07-20 19:52:30 +08:00