feat(services): add services menu item to sidebar and update related components
This commit is contained in:
@@ -19,7 +19,6 @@ const NAV_ITEMS: NavItem[] = [
|
|||||||
{ key: 'payment', label: 'مدیریت پرداخت', to: '/admin/my-financial' },
|
{ key: 'payment', label: 'مدیریت پرداخت', to: '/admin/my-financial' },
|
||||||
{ key: 'appointment', label: 'مدیریت نوبت دهی', to: '/admin/appointment-settings' },
|
{ key: 'appointment', label: 'مدیریت نوبت دهی', to: '/admin/appointment-settings' },
|
||||||
{ key: 'insurance', label: 'مدیریت بیمه', to: '/admin/insurance-pricing' },
|
{ key: 'insurance', label: 'مدیریت بیمه', to: '/admin/insurance-pricing' },
|
||||||
{ key: 'services', label: 'خدمات', to: '/admin/clinic-services' },
|
|
||||||
{ key: 'tags', label: 'تگ ها', to: '/admin/tags-settings' },
|
{ key: 'tags', label: 'تگ ها', to: '/admin/tags-settings' },
|
||||||
{ key: 'sms', label: 'پیامک ها', to: '/admin/sms-wallet' },
|
{ key: 'sms', label: 'پیامک ها', to: '/admin/sms-wallet' },
|
||||||
{ key: 'clinic', label: 'مدیریت مطب', to: '/admin/my-clinic' },
|
{ key: 'clinic', label: 'مدیریت مطب', to: '/admin/my-clinic' },
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {
|
import {
|
||||||
CreditCardIcon, UserIcon, CalendarDaysIcon, BuildingOffice2Icon,
|
CreditCardIcon, UserIcon, CalendarDaysIcon, BuildingOffice2Icon,
|
||||||
WrenchScrewdriverIcon, BanknotesIcon, UsersIcon, ShieldCheckIcon,
|
BanknotesIcon, UsersIcon, ShieldCheckIcon,
|
||||||
TagIcon, ChatBubbleLeftRightIcon, UserCircleIcon, UserPlusIcon,
|
TagIcon, ChatBubbleLeftRightIcon, UserCircleIcon, UserPlusIcon,
|
||||||
} from '@heroicons/react/24/outline';
|
} from '@heroicons/react/24/outline';
|
||||||
import PurchaseSubscriptionSidebar from './PurchaseSubscriptionSidebar';
|
import PurchaseSubscriptionSidebar from './PurchaseSubscriptionSidebar';
|
||||||
@@ -24,7 +24,6 @@ export const SETTINGS_MENU: SettingsMenuItem[] = [
|
|||||||
{ key: 'doctor', label: 'مدیریت پزشک', icon: UserIcon, to: '/admin/profile', roles: ['doctor'] },
|
{ key: 'doctor', label: 'مدیریت پزشک', icon: UserIcon, to: '/admin/profile', roles: ['doctor'] },
|
||||||
{ key: 'appointment', label: 'مدیریت نوبت دهی', icon: CalendarDaysIcon, to: '/admin/appointment-settings', roles: ['doctor'] },
|
{ key: 'appointment', label: 'مدیریت نوبت دهی', icon: CalendarDaysIcon, to: '/admin/appointment-settings', roles: ['doctor'] },
|
||||||
{ key: 'clinic', label: 'مدیریت مطب', icon: BuildingOffice2Icon, to: '/admin/my-clinic', roles: ['clinic'] },
|
{ key: 'clinic', label: 'مدیریت مطب', icon: BuildingOffice2Icon, to: '/admin/my-clinic', roles: ['clinic'] },
|
||||||
{ key: 'services', label: 'خدمات', icon: WrenchScrewdriverIcon, to: '/admin/clinic-services' },
|
|
||||||
{ key: 'payment', label: 'مدیریت پرداخت', icon: BanknotesIcon, to: '/admin/my-financial' },
|
{ key: 'payment', label: 'مدیریت پرداخت', icon: BanknotesIcon, to: '/admin/my-financial' },
|
||||||
{ key: 'secretary', label: 'مدیریت منشی', icon: UsersIcon, to: '/admin/my-secretaries' },
|
{ key: 'secretary', label: 'مدیریت منشی', icon: UsersIcon, to: '/admin/my-secretaries' },
|
||||||
{ key: 'staff', label: 'پرسنل', icon: UserPlusIcon, to: '/admin/staff' },
|
{ key: 'staff', label: 'پرسنل', icon: UserPlusIcon, to: '/admin/staff' },
|
||||||
|
|||||||
@@ -41,3 +41,23 @@ describe('Sidebar — expandable نوبتها menu', () => {
|
|||||||
expect(screen.getByText('نوبت های تایید شده')).toBeInTheDocument();
|
expect(screen.getByText('نوبت های تایید شده')).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('Sidebar — خدمات در منوی اصلی (نه تنظیمات)', () => {
|
||||||
|
it('shows خدمات in the clinic main menu linking to /admin/clinic-services', () => {
|
||||||
|
useAuthStore.setState({
|
||||||
|
primaryRole: 'clinic', dbUuid: 'c1', userName: 'کلینیک',
|
||||||
|
availableContexts: [], context: null,
|
||||||
|
} as any);
|
||||||
|
renderWithProviders(<Sidebar />, { route: '/admin/dashboard' });
|
||||||
|
expect(screen.getByText('سرویس ها').closest('a')).toHaveAttribute('href', '/admin/clinic-services');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('shows خدمات in the doctor main menu linking to /admin/clinic-services', () => {
|
||||||
|
useAuthStore.setState({
|
||||||
|
primaryRole: 'doctor', dbUuid: null, userName: 'پزشک',
|
||||||
|
availableContexts: [], context: null,
|
||||||
|
} as any);
|
||||||
|
renderWithProviders(<Sidebar />, { route: '/admin/dashboard' });
|
||||||
|
expect(screen.getByText('سرویس ها').closest('a')).toHaveAttribute('href', '/admin/clinic-services');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import {
|
|||||||
StarIcon,
|
StarIcon,
|
||||||
TagIcon,
|
TagIcon,
|
||||||
UserCircleIcon,
|
UserCircleIcon,
|
||||||
|
WrenchScrewdriverIcon,
|
||||||
UserGroupIcon,
|
UserGroupIcon,
|
||||||
UsersIcon,
|
UsersIcon,
|
||||||
} from "@heroicons/react/24/outline";
|
} from "@heroicons/react/24/outline";
|
||||||
@@ -242,10 +243,15 @@ function buildSections(
|
|||||||
icon: ArchiveBoxIcon,
|
icon: ArchiveBoxIcon,
|
||||||
label: "انبارداری",
|
label: "انبارداری",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
to: "/admin/clinic-services",
|
||||||
|
icon: WrenchScrewdriverIcon,
|
||||||
|
label: "سرویس ها",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// مدیریت بیمه / سرویسها / کیف پول پیامک زیر همین «تنظیمات» است
|
// مدیریت بیمه / کیف پول پیامک زیر همین «تنظیمات» است
|
||||||
// (منوی داخل صفحهٔ اشتراک)، نه در سایدبار اصلی.
|
// (منوی داخل صفحهٔ اشتراک)، نه در سایدبار اصلی.
|
||||||
label: "تنظیمات",
|
label: "تنظیمات",
|
||||||
items: [
|
items: [
|
||||||
@@ -312,10 +318,15 @@ function buildSections(
|
|||||||
icon: ArchiveBoxIcon,
|
icon: ArchiveBoxIcon,
|
||||||
label: "انبارداری",
|
label: "انبارداری",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
to: "/admin/clinic-services",
|
||||||
|
icon: WrenchScrewdriverIcon,
|
||||||
|
label: "سرویس ها",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// مدیریت بیمه / سرویسها / کیف پول پیامک زیر همین «تنظیمات» است
|
// مدیریت بیمه / کیف پول پیامک زیر همین «تنظیمات» است
|
||||||
// (منوی داخل صفحهٔ اشتراک)، نه در سایدبار اصلی.
|
// (منوی داخل صفحهٔ اشتراک)، نه در سایدبار اصلی.
|
||||||
label: "تنظیمات",
|
label: "تنظیمات",
|
||||||
items: [
|
items: [
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import {
|
|||||||
EllipsisHorizontalIcon, CheckCircleIcon, XCircleIcon, ChevronRightIcon,
|
EllipsisHorizontalIcon, CheckCircleIcon, XCircleIcon, ChevronRightIcon,
|
||||||
XMarkIcon, UsersIcon, ClockIcon,
|
XMarkIcon, UsersIcon, ClockIcon,
|
||||||
} from '@heroicons/react/24/outline';
|
} from '@heroicons/react/24/outline';
|
||||||
import SettingsLayout from '../components/layout/SettingsLayout';
|
|
||||||
import { useForm } from 'react-hook-form';
|
import { useForm } from 'react-hook-form';
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
@@ -611,10 +610,8 @@ function ClinicServicesPageInner() {
|
|||||||
|
|
||||||
export default function ClinicServicesPage() {
|
export default function ClinicServicesPage() {
|
||||||
return (
|
return (
|
||||||
<SettingsLayout active="services">
|
|
||||||
<FeatureGate feature="services">
|
<FeatureGate feature="services">
|
||||||
<ClinicServicesPageInner />
|
<ClinicServicesPageInner />
|
||||||
</FeatureGate>
|
</FeatureGate>
|
||||||
</SettingsLayout>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user