WeKnora/internal
wizardchen ae7cd02cd6 fix(rbac): polish tenant member UI; add /leave endpoint
Self-review of PR 3's TenantMembers.vue surfaced a handful of real bugs
and a few rough edges. This commit fixes them and adds the self-leave
endpoint that PR 3's design called out as a follow-up.

Frontend bug fixes
- Read err.status (not err.response.status). The axios interceptor in
  utils/request.ts already flattens errors into { status, message,
  ... }, so the original branch-by-status code never matched and every
  4xx fell through to the generic toast. Fixes 404/409 surfacing as
  "userNotFound" / "alreadyMember" / "lastOwner" instead of "Something
  went wrong".
- t-dialog @confirm replaces :on-confirm so the dialog stays open on
  validation failure and on API error. Users can fix and retry without
  retyping the email.
- Drop the t-select revert hack; with :model-value the rendered value
  is already source-of-truth-on-row.role, so no setTimeout dance is
  needed.
- Don't toast "no active tenant" on cold mount; watch the activeTenantId
  ref and load once the auth store hydrates.

Frontend UX additions
- Empty state via t-empty (also covers the search-no-results case).
- Compact role-permissions matrix above the table, mirroring
  OrganizationSettingsModal so Owners can see what each role grants
  before promoting/inviting.
- Search box filtering by username/email (client-side, sufficient for
  expected per-tenant member counts).
- "Leave Tenant" button — visible to any active member except the
  last-Owner case (server still enforces).

Backend
- New POST /tenants/:id/leave route. Calls TenantMemberService.RemoveMember
  with the caller's own user id so non-Owners can quit on their own.
  Gated Viewer+ in the matrix; the existing last-Owner invariant in the
  service still rejects last-Owner self-leave with 409.
- 3 new handler tests cover the happy path, the last-Owner 409 path,
  and the missing-caller-id 401 path (defensive — auth middleware
  always attaches a user, but the test pins the contract).

i18n
- Add tenantMember.permissions / search / leave / empty strings in all
  four locales (en/zh/ko/ru).
2026-05-18 17:28:58 +08:00
..
agent fix(agent): pass reasoning_content back to providers that require it 2026-05-13 12:29:10 +08:00
application fix(rbac): address PR 2 review feedback 2026-05-18 17:28:58 +08:00
assets feat(assets): add ASR test audio file and embed it in the application 2026-04-02 21:27:27 +08:00
common feat: Implement deadlock retry mechanism for chunk creation 2026-04-22 21:17:21 +08:00
config feat(rbac): add tenant_members schema and auth wiring (PR 1 of 3, #1303) 2026-05-18 17:28:58 +08:00
container feat(rbac): tenant member management + invite_only gate (PR 3 of 3, #1303) 2026-05-18 17:28:58 +08:00
database feat(system-info): surface DB migration errors with troubleshooting links 2026-05-14 16:34:50 +08:00
datasource fix(feishu): tolerate partial wiki node listing failures 2026-05-12 17:40:59 +08:00
errors feat(knowledge-base): validate vector store bindings on create, copy, and delete 2026-05-18 15:58:46 +08:00
event feat(agent): human-in-the-loop approval for MCP tool calls (#1173) 2026-05-10 22:57:12 +08:00
handler fix(rbac): polish tenant member UI; add /leave endpoint 2026-05-18 17:28:58 +08:00
im fix(agent): exclude wiki-only KBs from quick-answer (RAG) mode 2026-05-12 16:27:28 +08:00
infrastructure fix(docreader/auth): harden gRPC TLS/Token rollout from #1359 2026-05-16 21:45:56 +08:00
logger feat(knowledge-base): validate vector store bindings on create, copy, and delete 2026-05-18 15:58:46 +08:00
mcp feat(mcp): implement reconnection logic for MCP tool calls and tool listing 2026-03-31 11:57:15 +08:00
middleware test(rbac): cover review gaps from PR 2 self-review 2026-05-18 17:28:58 +08:00
models fix(embedding): repair broken comment in Zhipu embedder 2026-05-17 21:31:54 +08:00
router fix(rbac): polish tenant member UI; add /leave endpoint 2026-05-18 17:28:58 +08:00
runtime chore(runtime): silence gin per-route logs and emit env config banner at startup 2026-05-17 15:27:52 +08:00
sandbox feat: optimize security and deployment of agent skills 2026-02-04 20:08:49 +08:00
searchutil feat(prompt): enhance question rewriting and intent classification in prompt templates 2026-04-16 23:15:02 +08:00
stream feat(redis): add REDIS_USERNAME support for Redis ACL 2026-02-04 19:38:40 +08:00
tracing feat(observability): extend Langfuse tracing across asynq pipeline 2026-04-24 13:16:47 +08:00
types feat(rbac): tenant member management + invite_only gate (PR 3 of 3, #1303) 2026-05-18 17:28:58 +08:00
utils fix(initialization): surface upstream and SSRF errors verbatim in test-connection responses 2026-05-17 15:27:52 +08:00