Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
961e178
feat(aidp): refactor knowledge base list and creation pages
cj2026-bit Sep 28, 2026
5fde1ed
fix(aidp): interpolate card counts and capacity with i18next syntax
cj2026-bit Sep 28, 2026
0bca5ef
refactor(aidp): share pagination and field label rendering
cj2026-bit Sep 28, 2026
2d825e9
test(aidp): cover graph serialization, chunking bounds and create def…
cj2026-bit Sep 28, 2026
9b800b8
Refine AIDP knowledge base page UI
cj2026-bit Sep 29, 2026
85fbbcc
fix(aidp): make ResizableTitleProps compatible with React 19
cj2026-bit Sep 29, 2026
01dad97
fix(aidp): drop the redundant click guard that violated S1082
cj2026-bit Sep 29, 2026
576c194
fix(aidp): use breadcrumbs on the file view and fix the creation brea…
cj2026-bit Sep 29, 2026
73d5553
fix(aidp): redirect locale-less paths so sidebar entries stop crashing
cj2026-bit Sep 29, 2026
72960b2
Merge remote-tracking branch 'origin/develop' into feat-knowledge-bas…
cj2026-bit Sep 29, 2026
c0462c5
fix(aidp): remove middleware.ts, superseded by the develop proxy.ts
cj2026-bit Sep 29, 2026
b9e607f
fix(navigation): prefix sidebar menu paths with the active locale
cj2026-bit Sep 29, 2026
b0fdfe6
fix(aidp): align knowledge overview layout and colors with UCD
cj2026-bit Oct 8, 2026
d14fe5e
fix(aidp): match UCD table density and preserve resized column widths
cj2026-bit Oct 8, 2026
188137d
feat(aidp): complete knowledge base pages and remove safety guard
cj2026-bit Oct 8, 2026
31f001b
Merge commit '0c9ff869c89ff5d1d7abc775a078bc027b5250af' into feat-kno…
cj2026-bit Oct 8, 2026
ab8efd5
fix(aidp): streamline knowledge base creation UI
cj2026-bit Oct 8, 2026
0884fd4
fix(aidp): refine knowledge detail editing
cj2026-bit Oct 8, 2026
60a2f9c
fix(aidp): initialize detail setting form after open
cj2026-bit Oct 8, 2026
96f65f4
fix(aidp): move upload task filter to status column
cj2026-bit Oct 8, 2026
1e83ecf
fix(aidp): include all in task status filter
cj2026-bit Oct 9, 2026
47c8068
fix(aidp): delegate file and upload task pagination to upstream
cj2026-bit Oct 9, 2026
5da49ab
feat(aidp): upload selected files in a shared batch progress drawer
cj2026-bit Oct 9, 2026
6c2eea9
ui(aidp): make upload area open file picker
cj2026-bit Oct 9, 2026
92cf2d8
ui(aidp): compact accessible group display
cj2026-bit Oct 9, 2026
4557609
docs(aidp): add knowledge detail development handoff
cj2026-bit Oct 9, 2026
5ef66bf
feat(aidp): resize adjacent knowledge list columns responsively
cj2026-bit Oct 9, 2026
0cf1f44
fix(aidp): restore widths when dragging back to origin
cj2026-bit Oct 9, 2026
b09867e
docs(aidp): record retrieval metadata investigation
cj2026-bit Oct 9, 2026
53110dc
docs(aidp): record create page tooltip copy
cj2026-bit Oct 9, 2026
2c22d1d
docs(aidp): add graph and retrieval tooltip copy
cj2026-bit Oct 9, 2026
9dd6d28
fix(aidp): align knowledge creation with live API contract
cj2026-bit Oct 9, 2026
e75c8d1
fix(aidp): return full captured Chinese graph prompts in mock
cj2026-bit Oct 9, 2026
f1a9f3e
fix(aidp): default creation sections to collapsed
cj2026-bit Oct 9, 2026
03c7c8e
fix(aidp): simplify knowledge list metadata
cj2026-bit Oct 9, 2026
7bcb0f8
fix(aidp): resolve legacy knowledge base creator
cj2026-bit Oct 9, 2026
7d69d15
refactor(aidp): unify knowledge queries and preserve upload errors
cj2026-bit Oct 10, 2026
5c1ea70
fix(aidp): retain upload progress ring while awaiting response
cj2026-bit Oct 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions backend/database/user_tenant_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
Database operations for user tenant relationship management
"""
import logging
from typing import Any, List, Dict, Optional
from typing import Any, Dict, List, Optional

from sqlalchemy import func, text

from consts.const import (
DEFAULT_TENANT_ID,
MAX_ADMINS_PER_TENANT,
MAX_SUPER_ADMIN_COUNT,
MAX_USERS_PER_TENANT,
)
from consts.exceptions import TenantResourceLimitError
from database.client import as_dict, get_db_session
from database.db_models import TenantGroupInfo, TenantGroupUser, UserTenant
from consts.exceptions import TenantResourceLimitError
from sqlalchemy import func, text


logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -131,17 +133,20 @@ def get_user_tenant_by_user_id(user_id: str) -> Optional[Dict[str, Any]]:
return None


def get_user_email_map(user_ids: List[str]) -> Dict[str, str]:
def get_user_email_map(user_ids: List[str], tenant_id: Optional[str] = None) -> Dict[str, str]:
"""Return active user email addresses keyed by user ID."""
unique_user_ids = list({user_id for user_id in user_ids if user_id})
if not unique_user_ids:
return {}

with get_db_session() as session:
rows = session.query(UserTenant.user_id, UserTenant.user_email).filter(
query = session.query(UserTenant.user_id, UserTenant.user_email).filter(
UserTenant.user_id.in_(unique_user_ids),
UserTenant.delete_flag == "N",
).all()
)
if tenant_id is not None:
query = query.filter(UserTenant.tenant_id == tenant_id)
rows = query.all()

return {
user_id: user_email
Expand Down
Loading
Loading