-
Notifications
You must be signed in to change notification settings - Fork 2
Feat: Company Dashboard Enhancements & Member Role Notifications #333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ges and dynamic data fetching - Fetch user profile data from profiles table including avatar_url, first_name, and last_name - Add UserProfile interface to properly type user profile data structure - Implement useEffect hook to load user profile on component mount - Replace hardcoded avatar initials with dynamic data from user profile - Create reusable AvatarContent component to eliminate duplicate avatar rendering logic - Update CompanySidebar to accept avatarUrl and avatarInitial as separate props - Integrate Avatar component from UI library for consistent image display with fallback - Support avatar image display with gradient fallback when image unavailable - Refactor avatar rendering across mobile and desktop sidebar sections to use new component - Improve user profile data consistency by centralizing profile fetching in layout component
- Implement role change email notification when member roles are updated - Add getRoleChangeEmail function with role-specific permissions display - Include member name, company name, old/new role, and changed by information - Send email asynchronously to avoid blocking the API response - Add dashboard link in email for easy access to company settings - Fix email template branding from "CodeUnia" to "Codeunia" for consistency - Include graceful error handling for email delivery failures - Fetch member and requesting user profile information for personalized emails
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. WalkthroughMultiple interrelated features: Role-change email notifications with async sending added to member update endpoint; user profile data refactored to fetch from Supabase; avatar rendering migrated to reusable component; toast notification system migrated from useToast hook to direct sonner API; new role-change email template created. Changes
Sequence DiagramsequenceDiagram
participant Client
participant API as PUT /members/[userId]
participant DB as Database
participant Email as Email Service
participant Cache as Cache Layer
Client->>API: Update member role
API->>DB: Fetch old role & member data
DB-->>API: Member profile
API->>DB: Update role to newRole
DB-->>API: Update confirmed
API->>DB: Fetch requester profile
DB-->>API: Requester profile
rect rgb(100, 150, 200)
Note over API,Email: Async Email Flow (non-blocking)
API->>Email: Send role-change notification
Email-->>API: Email sent (async)
end
API->>Cache: Invalidate member cache
API-->>Client: 200 OK
alt Email fails
Email->>API: Log error (no impact to response)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This pull request introduces key improvements to the Company Dashboard experience, including enhanced user profile visuals and automated email notifications for company member role changes.
✨ What’s New
1. Improved Company Dashboard Profile UI
2. Role Change Notification Emails
🔧 Code Overview
🧪 Testing
Verified profile page renders correctly with avatar support.
Confirmed email notifications are sent for:
Checked dashboard routes and ensured no breakages.
📌 Notes
✅ Ready for Review
This PR is ready for review and requires one approval before merging.
Authored by: @akshay0611
Summary by CodeRabbit
New Features
Bug Fixes
Refactor