refactor: comprehensive consistency review — UI/UX, code quality, functional parity
Fix 19 issues across 3 priority tiers found during full-codebase review: CRITICAL: - Fix undefined --color-secondary CSS variable causing invisible UI elements - Fix Google Photos command templates using nonexistent asset.originalFileName - Fix scheduler template variable docs (tracker_name → schedule_name) - Add missing admin guard on notification template update endpoint HIGH: - Fix 5 hardcoded English strings missing i18n (MultiEntitySelect, actions, settings, TelegramBotTab, users) - Replace 17 raw <button> elements with shared <Button> component - Replace 5 raw error divs with shared <ErrorBanner> component - Refactor webhook handler duplication into shared _dispatch_webhook_event() - Add 30+ provider-specific fields to TrackingConfig TypeScript type - Add default TrackingConfig seeds for immich and google_photos - Add provider-specific command variable docs (Gitea, Planka, NUT, GP, Webhook) MEDIUM: - Replace hardcoded hex colors and Tailwind classes with CSS variable tokens - Remove dead code (unused imports, orphaned check_notification_tracker) - Fix Svelte 5 patterns ($state for _prevProviderId, remove unnecessary as any) - Fix inconsistent POST response shape (targets now returns full response) - Fix Google Photos template dead asset.year branches, clarify album_url docs
This commit is contained in:
@@ -134,10 +134,10 @@ async def get_template_variables(
|
||||
"has_oversized_videos": "Whether any video exceeds the target's size limit (boolean)",
|
||||
"max_video_size": "Target video size limit in bytes (null if no limit)",
|
||||
"max_video_size_mb": "Target video size limit in MB (null if no limit)",
|
||||
# Immich aliases
|
||||
# Provider-specific aliases
|
||||
"album_name": "Alias for collection_name",
|
||||
"album_id": "Alias for collection_id",
|
||||
"album_url": "Alias for collection_url",
|
||||
"album_url": "Alias for collection_url (Immich) or album product URL (Google Photos)",
|
||||
}
|
||||
rename_vars = {
|
||||
**event_vars,
|
||||
@@ -236,7 +236,7 @@ async def get_template_variables(
|
||||
"message_scheduled_message": {
|
||||
"description": "Notification for scheduled message events",
|
||||
"variables": {
|
||||
"tracker_name": "Name of the tracker that fired",
|
||||
"schedule_name": "Name of the schedule that fired",
|
||||
"fire_count": "How many times this tracker has fired",
|
||||
"current_date": "Current date (formatted)",
|
||||
"current_time": "Current time (formatted)",
|
||||
@@ -420,6 +420,8 @@ async def update_config(
|
||||
session: AsyncSession = Depends(get_session),
|
||||
):
|
||||
config = await _get(session, config_id, user.id)
|
||||
if config.user_id == 0 and user.role != "admin":
|
||||
raise HTTPException(status_code=403, detail="Cannot modify system default configs")
|
||||
for field, value in body.model_dump(exclude_unset=True, exclude={"slots"}).items():
|
||||
if value is not None:
|
||||
setattr(config, field, value)
|
||||
|
||||
Reference in New Issue
Block a user