fix(appointments): give the resource strip a way back to the doctor

Returning from a resource to the doctor's own booking meant clicking the doctor
tab in the row above, which nobody found. The resource strip now leads with a
"نوبت‌های خود پزشک" tab that clears the resource, so going in and coming back
happen in the same row.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
hamed
2026-08-03 13:08:31 +03:30
co-authored by Claude Opus 5
parent 8a53299cc9
commit c688f48583
2 changed files with 21 additions and 2 deletions
@@ -140,6 +140,20 @@ describe('AppointmentsPage — پروفایل کلینیک چندپزشکه', ()
expect(screen.queryByRole('button', { name: 'لیزر CO2' })).toBeNull();
});
/** برگشت از منبع به خودِ پزشک باید در همان نوار باشد، نه با کلیک روی تب بالایی. */
it('تب نخستِ نوار منابع، برگشت به نوبت‌دهی خود پزشک است', async () => {
const user = userEvent.setup();
renderWithProviders(<AppointmentsPage />);
await screen.findByText('دکتر محمدی');
await user.click(await screen.findByRole('button', { name: 'لیزر CO2' }));
expect(await screen.findByText(/نوبت‌دهی این منبع سرویسی است/)).toBeInTheDocument();
await user.click(screen.getByRole('button', { name: 'نوبت‌های خود پزشک' }));
expect(screen.queryByText(/نوبت‌دهی این منبع سرویسی است/)).toBeNull();
});
/** باگ گزارش‌شده: نمای منبع نباید اسلاتی باشد. */
it('نمای منبع سرویسی است و تایم‌لاین اسلاتی ندارد', async () => {
const user = userEvent.setup();
+7 -2
View File
@@ -888,9 +888,14 @@ export default function AppointmentsPage() {
(پزشک ناظر)، پس کاربر بین نوبت‌های پزشک و دستگاه‌های تحت نظرش جابه‌جا می‌شود. */}
{supervisedResources.length > 0 && (
<div style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '0 16px', borderBottom: '1px solid var(--border)' }}>
<span style={{ fontSize: 12, color: 'var(--text-3)', flexShrink: 0 }}>منابعِ این پزشک</span>
<span style={{ fontSize: 12, color: 'var(--text-3)', flexShrink: 0 }}>نوبتدهی</span>
{/* تب نخست راهِ بازگشت است: بدون آن، برگشتن از منبع به خودِ پزشک فقط با
کلیک روی تب بالایی ممکن بود و کاربر دنبالش می‌گشت. */}
<DoctorTabs
doctors={supervisedResources.map((r) => ({ uuid: r.uuid, name: r.name }))}
doctors={[
{ uuid: '', name: 'نوبت‌های خود پزشک' },
...supervisedResources.map((r) => ({ uuid: r.uuid, name: r.name })),
]}
selected={selectedResourceUuid}
onSelect={selectResource}
showAll={false}