refactor: remove doctor dashboard routes and navigation
Overview This MR removes the obsolete doctor dashboard from the frontend.
The problem was that the app still exposed doctor-specific dashboard entry points through the main dashboard tabs, sidebar role navigation, and /doctor dashboard routes. That UI is no longer needed, so this change removes only the doctor dashboard wiring while keeping the rest of the app intact.
What does this MR do and why? The motivation was to stop showing users an outdated dashboard flow and remove unused doctor dashboard routes from the frontend.
The approach was intentionally narrow:
- Remove doctor dashboard routes from the router
- Remove doctor from dashboard-role filtering/navigation
- Remove doctor dashboard tab/content from the main dashboard
- Update the affected dashboard test to match the new behavior
Trade-offs:
- This removes doctor dashboard access entirely from the frontend
- Doctor-related code outside the dashboard flow was left untouched to keep the change focused
Changes Made
- Modified src/App.tsx
- Removed
/doctor - Removed
/doctor/assigned-queue - Removed
/doctor/waiting-queue - Removed
/doctor/medicine-availability
- Removed
- Modified src/components/AppLayout.tsx
- Removed doctor from dashboard role-switching logic
- Removed doctor dashboard menu items from sidebar navigation
- Modified src/pages/DashboardPage.tsx
- Removed doctor from dashboard role filtering
- Removed doctor tab from dashboard tabs
- Removed doctor dashboard action card/content
- Modified tests/pages/DashboardPage.test.tsx
- Updated test expectations to reflect removal of the doctor dashboard
No API, backend, or config changes were made.
Technical Details Root cause:
- The frontend still treated
doctoras an active dashboard role in multiple places - Doctor-specific dashboard routes were still registered
- Tests still expected the removed doctor dashboard UI to exist
How this fix addresses it:
- Removes doctor dashboard routes at the router level
- Removes doctor from the set of roles used for dashboard rendering and sidebar role selection
- Removes doctor-specific dashboard content from the main dashboard page
- Updates tests so automated checks align with the intended UI
Architecture/data flow:
- No new state management was introduced
- No new hooks, components, or utilities were added
- Existing dashboard role derivation logic was simplified rather than replaced
Type of Change
-
🐛 Bug fix (non-breaking change that fixes an issue) -
✨ New feature (non-breaking change that adds functionality) -
💥 Breaking change (fix or feature that would cause existing functionality to change) -
📝 Documentation update -
🎨 UI/UX improvement -
♻ ️ Refactor (no functional changes) -
⚡ Performance improvement -
🧪 Test update -
🔧 Configuration change -
🚨 Security fix
Related Issues / References
- Related to dashboard cleanup / obsolete doctor UI removal
Screenshots or Screen Recordings Before: Doctor dashboard tab, sidebar doctor role/menu, and /doctor dashboard routes existed
After: Doctor dashboard entry points are removed
Responsive table not applicable for this change.
How to Set Up and Validate Locally
- Checkout this branch
- Install dependencies if needed:
bun install
- Start the app:
bun dev
- Validate in the browser:
- Visit
http://localhost:5173/ - Log in with users having
admin,coordinator,volunteer, anddoctorroles - Open the dashboard and confirm there is no doctor dashboard tab
- Open the sidebar and confirm doctor is not shown as a dashboard role/menu section
- Try visiting:
/doctor/doctor/assigned-queue/doctor/waiting-queue/doctor/medicine-availability
- Expected behavior:
- Doctor dashboard entry points should no longer exist
- Admin/coordinator/volunteer dashboard flows should still work normally
No backend changes are needed for validation.
Testing Done
-
Manual testing completed -
Unit tests added/updated
Test Cases Covered:
| Scenario | Expected Result | Status |
|---|---|---|
| Dashboard renders without doctor dashboard actions | Doctor dashboard UI is absent | |
| Admin dashboard still works | Admin actions still render and navigate | |
| Volunteer dashboard still works | Volunteer actions still render and navigate | |
| Coordinator dashboard still works | Coordinator actions still render and navigate | |
| Full automated suite | All tests pass |
Commands run:
bun run build
bun run test:run
Code Quality Checklist Reviewer: Use this checklist to evaluate code quality
Code Standards
-
Code follows project conventions (naming, structure, formatting) -
No console.log() or debugger statements left in changed code -
No unused imports, variables, or functions in changed code -
No duplicate code introduced -
i18n check passed with no hardcoded strings in codebase for i18n support -
TypeScript types remain properly defined in changed code -
ESLint and Prettier checks pass
React Best Practices
-
Components remain single-responsibility -
Hooks follow rules -
State management remains appropriate -
No unnecessary complexity introduced
Component Patterns
-
Existing component patterns preserved -
Responsive behavior preserved -
Accessibility behavior not reduced by this change
API & Data Fetching
-
No API integration changes -
No TanStack Query behavior changed -
No auth interceptor behavior changed
Error Handling
-
No new error-handling regressions introduced in changed code
Documentation
-
README.md updated -
.env.exampleupdated -
CHANGELOG.md updated
Known Limitations / Technical Debt
- Doctor-related non-dashboard pages/components still exist in the codebase, but they are no longer exposed through the dashboard/navigation
- This MR is intentionally scoped to dashboard removal only
Additional Notes
- The change was kept minimal on purpose
- No auth/role-system redesign was included
- One dashboard test needed updating because it still expected the removed doctor UI
MR Acceptance Checklist
-
Acceptance criteria met -
Automated tests passing -
Build passing -
Manual verification completed -
Scope limited to doctor dashboard removal -
No backend dependency -
No TypeScript errors in changed code