feat: Implement user profile preferences for start page, Git identity, and task drawer auto-open, alongside Git server default branch configuration.

This commit is contained in:
2026-03-08 10:19:38 +03:00
parent 12d17ec35e
commit e864a9e08b
30 changed files with 2041 additions and 211 deletions

View File

@@ -1,13 +1,14 @@
# [DEF:backend.src.models.profile:Module]
#
# @TIER: STANDARD
# @SEMANTICS: profile, preferences, persistence, user, dashboard-filter, sqlalchemy
# @PURPOSE: Defines persistent per-user dashboard filter preferences.
# @SEMANTICS: profile, preferences, persistence, user, dashboard-filter, git, ui-preferences, sqlalchemy
# @PURPOSE: Defines persistent per-user profile settings for dashboard filter, Git identity/token, and UX preferences.
# @LAYER: Domain
# @RELATION: DEPENDS_ON -> backend.src.models.auth
# @RELATION: INHERITS_FROM -> backend.src.models.mapping.Base
#
# @INVARIANT: Exactly one preference row exists per user_id.
# @INVARIANT: Sensitive Git token is stored encrypted and never returned in plaintext.
# [SECTION: IMPORTS]
import uuid
@@ -32,6 +33,14 @@ class UserDashboardPreference(Base):
show_only_my_dashboards = Column(Boolean, nullable=False, default=False)
git_username = Column(String, nullable=True)
git_email = Column(String, nullable=True)
git_personal_access_token_encrypted = Column(String, nullable=True)
start_page = Column(String, nullable=False, default="dashboards")
auto_open_task_drawer = Column(Boolean, nullable=False, default=True)
dashboards_table_density = Column(String, nullable=False, default="comfortable")
created_at = Column(DateTime, nullable=False, default=datetime.utcnow)
updated_at = Column(
DateTime,