Kairul/kal 42 add feedback pages for user to sent a feedback - #100
Conversation
- Add Feedback button to sidebar with gradient green 'new' badge - Create feedback page with two options: Write a Review and Report a Bug - Implement review form with 5-star rating and feedback text - Implement bug report form with title, description, and steps to reproduce - Add MongoDB migration script for feedback_reviews and feedback_bugs collections - Create feedback tRPC router with submitReview, submitBug, getMyBugs endpoints - Show user's submitted bugs with open/closed status on bug report page - Simplified schemas: no status on reviews, no priority on bugs (set internally)
…dback-pages-for-user-to-sent-a-feedback
- Add admin procedures to feedback router (getAllReviews, getAllBugs, updateBugStatus, getStats) - Add Feedback and Bug Reports nav items to kal-admin sidebar - Create Feedback page with reviews table and stats cards - Create Bug Reports page with status filtering and inline status update - Add Select UI component for dropdowns - Change kal-frontend sidebar label from 'Feedback' to 'Review & Bug' - Change success screen button from 'Submit Another' to 'Back'
- Update seed-safe.ts to add only new foods when FORCE_SEED=false - Add Redis cache invalidation to seed-safe.ts - Remove seed.ts (functionality merged into seed-safe.ts) - Update package.json: 'seed' for incremental, 'seed:force' for full reset New behavior: - pnpm seed: adds only new foods (keeps existing IDs) - pnpm seed:force: drops and reseeds everything
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis PR introduces a comprehensive feedback and bug reporting system across the monorepo. It adds a TRPC-based feedback router with user submission and admin management endpoints, a MongoDB migration script for feedback collections, new dashboard pages in both admin and frontend applications for submitting and managing feedback, an enhanced seed script with force-mode capability, and UI components including a select dropdown built on Radix UI primitives. Changes
Sequence Diagram(s)sequenceDiagram
actor User as User
participant FC as FeedbackClient<br/>(Frontend)
participant TRPC as TRPC Router<br/>(Backend)
participant DB as MongoDB<br/>(feedback_reviews/<br/>feedback_bugs)
User->>FC: Selects review or bug<br/>report type
activate FC
FC->>FC: Render form<br/>(rating/feedback or<br/>title/description)
User->>FC: Fills form & submits
FC->>FC: Validate input
Note over FC: Validation success
FC->>TRPC: submitReview(rating,<br/>feedback, userId)
activate TRPC
TRPC->>TRPC: Validate input<br/>(rating 1-5,<br/>feedback 1-2000 chars)
TRPC->>DB: Insert document<br/>with userId & timestamp
activate DB
DB-->>TRPC: Inserted ID
deactivate DB
TRPC-->>FC: Success response<br/>with insertedId
deactivate TRPC
FC->>FC: Set isSubmitted=true<br/>clear forms
FC-->>User: Show success message<br/>with back button
deactivate FC
sequenceDiagram
actor Admin as Admin
participant BP as BugsPage/<br/>FeedbackPage<br/>(Admin Dashboard)
participant TRPC as TRPC Router<br/>(Backend)
participant DB as MongoDB<br/>(feedback_reviews/<br/>feedback_bugs)
Admin->>BP: Open feedback/bugs page
activate BP
BP->>TRPC: getAllReviews() or<br/>getAllBugs(status filter)
activate TRPC
TRPC->>DB: Query collection<br/>with filters/pagination
activate DB
DB-->>TRPC: Return documents<br/>+ total count
deactivate DB
TRPC-->>BP: Public API shapes<br/>+ stats (avgRating,<br/>openBugs, etc.)
deactivate TRPC
BP->>BP: Render table with stats<br/>& status selects
BP-->>Admin: Display reviews/bugs<br/>with pagination
Note over Admin,BP: Admin updates bug status
Admin->>BP: Select new status<br/>in table row
activate BP
BP->>TRPC: updateBugStatus<br/>(bugId, newStatus)
activate TRPC
TRPC->>DB: Update bug doc<br/>set updatedAt,<br/>optionally resolvedAt
activate DB
DB-->>TRPC: Acknowledge
deactivate DB
TRPC->>TRPC: Invalidate<br/>getAllBugs cache
TRPC-->>BP: Success
deactivate TRPC
BP->>TRPC: Re-fetch bugs<br/>(cache miss)
activate TRPC
TRPC->>DB: Query updated docs
activate DB
DB-->>TRPC: Updated list
deactivate DB
TRPC-->>BP: Refreshed data
deactivate TRPC
BP-->>Admin: Display updated table
deactivate BP
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
✨ Finishing touches
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 |
📝 Description
Brief description of what this PR does.
🔗 Related Issue
Fixes #(issue number)
🏷️ Type of Change
✅ Checklist
dev(notmain)pnpm lint:fixpnpm typecheck📸 Screenshots (if applicable)
Add screenshots to help explain your changes.
🧪 How to Test
Steps to test this PR:
📝 Additional Notes
Any additional information reviewers should know.
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.