Skip to content

feat: Implemented specialization management in the Add Doctor flow

Rajuldev Vandana requested to merge fix/add-specialization into develop

Overview

Implemented dynamic specialization management in the Add Doctor flow to allow admins to add new specializations dynamically from the frontend instead of relying only on predefined specialization values.

This improves scalability, usability, and specialization management UX in the doctor onboarding flow.


What does this MR do and why?

Previously, the specialization dropdown supported only static predefined values, making it difficult to onboard doctors belonging to new departments/specializations.

This MR introduces a cleaner and more scalable frontend solution where admins can dynamically add new specializations directly from the Add Doctor modal.

The implementation also improves validation, spacing consistency, keyboard interactions, and overall user experience.


Changes Made

  • Added + action button beside specialization dropdown
  • Implemented dynamic specialization addition flow
  • Added keyboard support:
    • Enter → add specialization
    • Escape → cancel input
  • Added i18n translation keys for:
    • New Specialization
    • Add
    • Cancel
  • Added/updated unit tests for specialization flow and validations

Technical Details

  • Dynamic specialization input is conditionally rendered based on UI state.
  • Duplicate validation is handled using normalized lowercase trimmed comparison.
  • Keyboard accessibility added for improved UX.
  • Coverage threshold issues resolved by adding branch-condition tests.

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

Screenshots or Screen Recordings

Before After
Static specialization dropdown only Dynamic specialization addition with validation and improved UX

image

How to Set Up and Validate Locally

  1. Checkout this branch
git checkout fix/add-specialization
Edited by Rajuldev Vandana

Merge request reports

Loading