feat(5.2): add User Preferences API with full-stack implementation
Backend: - Create app/models/user_preference.py with TenantMixin (user_id, key, value JSONB) - Create app/routes/user_preferences.py with GET/PUT/DELETE endpoints + RBAC - Add user_preferences:read/write to CORE_PERMISSIONS - Add user_preferences to legacy role permissions (admin/editor/viewer) - Register route in app/main.py and app/routes/__init__.py - Create alembic migration 0028_user_preferences - Add UserPreference model to conftest.py for test schema - Fix pre-existing conftest seed (Contact industry field removed in migration 0027) Frontend: - Create frontend/src/api/userPreferences.ts with React Query hooks - Create frontend/src/hooks/useUserPreferences.ts syncing with uiStore - Add i18n entries for de.json and en.json Tests: - 13 tests covering CRUD, tenant isolation, CSRF, unauthenticated access - All tests passing
This commit is contained in:
@@ -893,6 +893,20 @@
|
||||
"changes": "Änderungen",
|
||||
"fieldsChanged": "Felder geändert"
|
||||
},
|
||||
"userPreferences": {
|
||||
"title": "Benutzereinstellungen",
|
||||
"saved": "Einstellungen gespeichert",
|
||||
"saveError": "Fehler beim Speichern der Einstellungen",
|
||||
"deleted": "Einstellung gelöscht",
|
||||
"deleteError": "Fehler beim Löschen der Einstellung",
|
||||
"loading": "Einstellungen werden geladen",
|
||||
"theme": "Design",
|
||||
"language": "Sprache",
|
||||
"sidebar": "Seitenleiste",
|
||||
"activeTab": "Aktiver Tab",
|
||||
"sortOrder": "Sortierreihenfolge",
|
||||
"synced": "Einstellungen synchronisiert"
|
||||
},
|
||||
"ai": {
|
||||
"uiControl": {
|
||||
"active": "KI steuert die UI",
|
||||
|
||||
@@ -893,6 +893,20 @@
|
||||
"changes": "Changes",
|
||||
"fieldsChanged": "fields changed"
|
||||
},
|
||||
"userPreferences": {
|
||||
"title": "User Preferences",
|
||||
"saved": "Preferences saved",
|
||||
"saveError": "Failed to save preferences",
|
||||
"deleted": "Preference deleted",
|
||||
"deleteError": "Failed to delete preference",
|
||||
"loading": "Loading preferences",
|
||||
"theme": "Theme",
|
||||
"language": "Language",
|
||||
"sidebar": "Sidebar",
|
||||
"activeTab": "Active Tab",
|
||||
"sortOrder": "Sort Order",
|
||||
"synced": "Preferences synced"
|
||||
},
|
||||
"ai": {
|
||||
"uiControl": {
|
||||
"active": "AI is controlling the UI",
|
||||
|
||||
Reference in New Issue
Block a user