feat: unify doctor title handling and enhance specialty selection
- Implemented a helper function `displayDoctorName` to prepend "دکتر" to doctor names for consistent display across the application. - Updated various components (InviteDoctorModal, DashboardPage, DoctorDetailPage, DoctorsPage, etc.) to utilize the new helper for rendering doctor names. - Modified the DoctorFormPage to automatically add the "دکتر" title in the UI without requiring user input. - Fixed the EditSpecialtyPicker component to allow multiple specialty selections, resolving a UI bug where only one specialty could be selected at a time. - Ensured that the backend strips the "دکتر" title from the name during pre-registration and doctor creation processes. - Added tests for the new functionality, including checks for title handling and specialty selection logic. - Updated API documentation to reflect changes in name handling and display logic.
This commit is contained in:
@@ -8,6 +8,7 @@ use App\DoctorService\Entity\DoctorService;
|
||||
use App\Location\Entity\City;
|
||||
use App\Location\Entity\Province;
|
||||
use App\Shared\Util\DisplayName;
|
||||
use App\Shared\Util\PersianText;
|
||||
use App\Specialty\Entity\Specialty;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
@@ -553,6 +554,8 @@ class Doctor
|
||||
'id' => (string) $this->id,
|
||||
'uuid' => $this->uuid,
|
||||
'name' => $this->name,
|
||||
// نامِ آمادهٔ نمایش با عنوان «دکتر»؛ name خام میماند (برای فرم ویرایش).
|
||||
'display_name' => PersianText::withDoctorTitle($this->name),
|
||||
'gender' => $this->gender,
|
||||
'degree' => $this->degree,
|
||||
'img' => $this->images ?? [],
|
||||
@@ -582,6 +585,8 @@ class Doctor
|
||||
'id' => (string) $this->id,
|
||||
'uuid' => $this->uuid,
|
||||
'name' => $this->name,
|
||||
// نامِ آمادهٔ نمایش با عنوان «دکتر»؛ name خام میماند (برای فرم ویرایش).
|
||||
'display_name' => PersianText::withDoctorTitle($this->name),
|
||||
'gender' => $this->gender,
|
||||
'experience' => $this->getExperience(),
|
||||
'activity_time' => $this->activityTime !== null ? (string) $this->activityTime : null,
|
||||
|
||||
Reference in New Issue
Block a user