mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-24 23:41:10 +02:00
This commit implements a comprehensive system for managing social media
links dynamically without hardcoding any URLs in the frontend code.
Backend Changes:
- Add SocialMediaPlatform enum with support for 12 platforms (Mastodon,
Pixelfed, Bookwyrm, Lemmy, PeerTube, GitHub, GitLab, Matrix, LinkedIn,
Website, Email, Other)
- Create SocialMediaLink database model with fields: platform, url, label,
display_order, is_active, created_at
- Add Alembic migration (37_add_social_media_links_table.py)
- Create comprehensive API endpoints:
* GET /api/v1/social-media-links/public (no auth, returns active links)
* GET /api/v1/social-media-links (admin only, returns all links)
* POST /api/v1/social-media-links (admin only, create link)
* PATCH /api/v1/social-media-links/{id} (admin only, update link)
* DELETE /api/v1/social-media-links/{id} (admin only, delete link)
- Add Pydantic schemas for validation and serialization
- Register routes in main router
Frontend Changes:
- Update footer component to fetch links from public API endpoint
- Implement icon mapping for all supported platforms
- Add proper loading states and error handling
- Remove all hardcoded social media URLs
- Icons only display when URLs are configured via admin panel
- Proper accessibility (aria-labels, target="_blank", rel="noopener noreferrer")
Authentication Cleanup:
- Remove GoogleLoginButton.tsx component (no longer used)
- Delete Google OAuth documentation images
- Login and register pages already use email/password only
Documentation:
- Add comprehensive SOCIAL_MEDIA_LINKS_ADMIN.md with:
* API endpoint documentation
* cURL examples for all operations
* Platform support matrix
* Icon mapping reference
* Security notes
* Troubleshooting guide
Features:
✅ No hardcoded social media URLs
✅ Admin can add/edit/remove links via API
✅ Links automatically show/hide based on is_active flag
✅ Customizable display order
✅ Platform-specific icons automatically selected
✅ Public endpoint for frontend (no auth required)
✅ Admin endpoints protected (superuser only)
✅ Proper validation and error handling
✅ Email/password authentication only (OAuth removed)
Migration Required:
Run `alembic upgrade head` to create the social_media_links table.
Co-authored-by: Ojārs Kapteiņš <ojars@kapteinis.lv>
Co-authored-by: Claude AI Assistant <odede@anthropic.com>
|
||
|---|---|---|
| .. | ||
| 1_add_github_connector_enum.py | ||
| 2_add_linear_connector_enum.py | ||
| 3_add_linear_connector_to_documenttype_.py | ||
| 4_add_linkup_api_enum.py | ||
| 5_remove_title_char_limit.py | ||
| 6_change_podcast_content_to_transcript.py | ||
| 7_remove_is_generated_column.py | ||
| 8_add_content_hash_to_documents.py | ||
| 9_add_discord_connector_enum_and_documenttype.py | ||
| 10_update_chattype_enum_to_qna_report_structure.py | ||
| 11_add_llm_config_table_and_relationships.py | ||
| 12_add_logs_table.py | ||
| 13_add_jira_connector_enums.py | ||
| 14_add_confluence_connector_enums.py | ||
| 15_add_clickup_connector_enums.py | ||
| 16_fix_connector_unique_constraint.py | ||
| 17_add_google_calendar_connector_enums.py | ||
| 18_add_google_gmail_connector_enums.py | ||
| 19_add_airtable_connector_enums.py | ||
| 20_add_openrouter_to_litellmprovider_enum.py | ||
| 21_add_luma_connector_enums.py | ||
| 22_add_cometapi_to_litellmprovider_enum.py | ||
| 23_associate_connectors_with_search_spaces.py | ||
| 24_fix_null_chat_types.py | ||
| 25_migrate_llm_configs_to_search_spaces.py | ||
| 26_add_language_column_to_llm_configs.py | ||
| 27_add_searxng_connector_enum.py | ||
| 28_add_chinese_litellmprovider_enum.py | ||
| 29_add_unique_identifier_hash_to_documents.py | ||
| 30_add_baidu_search_connector_enum.py | ||
| 31_add_elasticsearch_connector_enums.py | ||
| 32_add_periodic_indexing_fields.py | ||
| 33_add_page_limits_to_user.py | ||
| 34_add_podcast_staleness_detection.py | ||
| 35_update_litellmprovider_enum_comprehensive.py | ||
| 36_remove_fk_constraints_for_global_llm_configs.py | ||
| 37_add_social_media_links_table.py | ||
| e55302644c51_add_github_connector_to_documenttype_.py | ||