create rolelist
This commit is contained in:
@@ -56,6 +56,9 @@ export const Pages = {
|
||||
},
|
||||
users: {
|
||||
list: "/users/list",
|
||||
create: "/users/create",
|
||||
roleList: "/users/roles-all",
|
||||
roleCreate: "/users/roles-add",
|
||||
},
|
||||
ads: {
|
||||
list: "/ads/list",
|
||||
|
||||
+28
-1
@@ -77,7 +77,11 @@
|
||||
"create_customer": "افزودن مشتری",
|
||||
"ticket_list": "لیست تیکت ها",
|
||||
"send_ticket": "ارسال تیکت",
|
||||
"category": "دسته بندی"
|
||||
"category": "دسته بندی",
|
||||
"user_list": "لیست کاربران",
|
||||
"add_user": "افزودن کاربر",
|
||||
"role_list": "لیست نقش ها",
|
||||
"role_create": "افزودن نقش"
|
||||
},
|
||||
"header": {
|
||||
"search": "جستجو"
|
||||
@@ -458,6 +462,29 @@
|
||||
"notif": {
|
||||
"natification": "اعلان ها"
|
||||
},
|
||||
"user": {
|
||||
"users_list": "لیست کاربران",
|
||||
"add_user": "افزودن کاربر",
|
||||
"name": "نام",
|
||||
"title_job": "عنوان شغلی",
|
||||
"email": "ایمیل",
|
||||
"role": "نقش",
|
||||
"submit_user": "ثبت کاربر",
|
||||
"info_user": "اطلاعات کاربر",
|
||||
"family": "نام خانوادگی",
|
||||
"phone_number": "شماره تماس",
|
||||
"password": "رمز عبور",
|
||||
"reapeat_password": "تکرار رمز عبور",
|
||||
"image": "تصویر حساب کاربری",
|
||||
"roles_list": "لیست نقش ها",
|
||||
"add_role": "افزودن نقش",
|
||||
"role_search": "جستجو در نقش ها",
|
||||
"title": "عنوان",
|
||||
"user": "کاربر",
|
||||
"submit_role": "ثبت نقش",
|
||||
"title_role": "عنوان نقش",
|
||||
"permissions": "دسترسی ها"
|
||||
},
|
||||
"profile": {
|
||||
"account_user": "حساب کاربری",
|
||||
"image_profile": "تصویر حساب کاربری",
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
import { FC } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import Button from '../../components/Button'
|
||||
import { TickCircle } from 'iconsax-react'
|
||||
import Input from '../../components/Input'
|
||||
import Select from '../../components/Select'
|
||||
import UploadBoxDraggble from '../../components/UploadBoxDraggble'
|
||||
|
||||
const CreateUser: FC = () => {
|
||||
|
||||
const { t } = useTranslation('global')
|
||||
|
||||
return (
|
||||
<div className='mt-4'>
|
||||
<div className='flex justify-between items-center'>
|
||||
<div>
|
||||
{t('service.cateory_services')}
|
||||
</div>
|
||||
<Button
|
||||
className='w-fit px-8'
|
||||
>
|
||||
<div className='flex gap-2'>
|
||||
<TickCircle
|
||||
className='size-5'
|
||||
color='white'
|
||||
/>
|
||||
<div className='text-sm'>
|
||||
{t('user.submit_user')}
|
||||
</div>
|
||||
</div>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className='flex gap-6 mt-9'>
|
||||
<div className='flex-1 bg-white py-10 xl:px-10 px-5 rounded-3xl'>
|
||||
<div>
|
||||
{t('user.info_user')}
|
||||
</div>
|
||||
|
||||
<div className='rowTwoInput mt-8'>
|
||||
<Input
|
||||
label={t('user.name')}
|
||||
/>
|
||||
<Input
|
||||
label={t('user.family')}
|
||||
/>
|
||||
</div>
|
||||
<div className='rowTwoInput mt-8'>
|
||||
<Input
|
||||
label={t('user.title_job')}
|
||||
/>
|
||||
<Select
|
||||
label={t('user.role')}
|
||||
placeholder={t('select')}
|
||||
items={[
|
||||
{ label: 'Admin', value: 'admin' },
|
||||
{ label: 'User', value: 'user' },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className='rowTwoInput mt-8'>
|
||||
<Input
|
||||
label={t('user.email')}
|
||||
/>
|
||||
<Input
|
||||
label={t('user.phone_number')}
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div className='bg-white p-8 w-sidebar hidden xl:block rounded-3xl overflow-hidden relative'>
|
||||
<Input
|
||||
label={t('user.password')}
|
||||
/>
|
||||
|
||||
<div className='mt-8'>
|
||||
<Input
|
||||
label={t('user.reapeat_password')}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className='mt-8'>
|
||||
<div className='text-sm'>
|
||||
{t('user.image')}
|
||||
</div>
|
||||
<div className='mt-2'>
|
||||
<UploadBoxDraggble
|
||||
label={t('user.image')}
|
||||
onChange={() => null}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default CreateUser
|
||||
@@ -0,0 +1,101 @@
|
||||
import { FC } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import Button from '../../components/Button'
|
||||
import { Add, Eye } from 'iconsax-react'
|
||||
import Select from '../../components/Select'
|
||||
import Input from '../../components/Input'
|
||||
import Td from '../../components/Td'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { Pages } from '../../config/Pages'
|
||||
|
||||
const UsersList: FC = () => {
|
||||
|
||||
const { t } = useTranslation('global')
|
||||
|
||||
return (
|
||||
<div className='mt-4'>
|
||||
<div className='flex w-full justify-between items-center'>
|
||||
<div>
|
||||
{t('user.users_list')}
|
||||
</div>
|
||||
<div>
|
||||
<Button
|
||||
className='px-5'
|
||||
>
|
||||
<div className='flex gap-2'>
|
||||
<Add
|
||||
className='size-5'
|
||||
color='#fff'
|
||||
/>
|
||||
<div>{t('user.add_user')}</div>
|
||||
</div>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className='flex justify-between items-center mt-12'>
|
||||
<div className='flex gap-4'>
|
||||
<Select
|
||||
className='w-36'
|
||||
items={[
|
||||
{ label: 'All', value: 'all' },
|
||||
{ label: 'Active', value: 'active' },
|
||||
{ label: 'Inactive', value: 'inactive' },
|
||||
]}
|
||||
placeholder={t('service.category')}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<Input
|
||||
variant='search'
|
||||
placeholder={t('service.search')}
|
||||
className='bg-white border border-border'
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className='relative overflow-x-auto rounded-3xl mt-9 w-full'>
|
||||
<table className='w-full text-sm '>
|
||||
<thead className='thead'>
|
||||
<tr>
|
||||
<Td text={t('user.name')} />
|
||||
<Td text={t('user.title_job')} />
|
||||
<Td text={t('user.email')} />
|
||||
<Td text={t('user.role')} />
|
||||
<Td text={t('detail')} />
|
||||
<Td text={''} />
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr className='tr'>
|
||||
<Td text='مهرداد مظفری' />
|
||||
<Td text={'کارشناس فنی'} />
|
||||
<Td text={'info@example.com'} />
|
||||
<Td text={'سطح ۱'} />
|
||||
<Td text={''}>
|
||||
<Link to={Pages.ticket.detail + '1'}>
|
||||
<Eye size={20} color='#8C90A3' />
|
||||
</Link>
|
||||
</Td>
|
||||
<Td text={''} />
|
||||
</tr>
|
||||
<tr className='tr'>
|
||||
<Td text='مهرداد مظفری' />
|
||||
<Td text={'کارشناس فنی'} />
|
||||
<Td text={'info@example.com'} />
|
||||
<Td text={'سطح ۱'} />
|
||||
<Td text={''}>
|
||||
<Link to={Pages.ticket.detail + '1'}>
|
||||
<Eye size={20} color='#8C90A3' />
|
||||
</Link>
|
||||
</Td>
|
||||
<Td text={''} />
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default UsersList
|
||||
@@ -0,0 +1,59 @@
|
||||
import { FC } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import Button from '../../components/Button'
|
||||
import { TickCircle } from 'iconsax-react'
|
||||
import Input from '../../components/Input'
|
||||
|
||||
const RoleCreate: FC = () => {
|
||||
|
||||
const { t } = useTranslation('global')
|
||||
|
||||
return (
|
||||
<div className='mt-4'>
|
||||
<div className='flex justify-between items-center'>
|
||||
<div>
|
||||
{t('user.add_role')}
|
||||
</div>
|
||||
<Button
|
||||
className='w-fit px-8'
|
||||
>
|
||||
<div className='flex gap-2'>
|
||||
<TickCircle
|
||||
className='size-5'
|
||||
color='white'
|
||||
/>
|
||||
<div className='text-sm'>
|
||||
{t('user.submit_role')}
|
||||
</div>
|
||||
</div>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className='flex gap-6 mt-9'>
|
||||
<div className='flex-1 bg-white py-10 xl:px-10 px-5 rounded-3xl'>
|
||||
|
||||
<Input
|
||||
label={t('user.title_role')}
|
||||
/>
|
||||
|
||||
<div className='mt-8'>
|
||||
<div className='text-sm'>
|
||||
{t('user.permissions')}
|
||||
</div>
|
||||
|
||||
<div className='mt-5 flex'>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div className='bg-white p-8 w-sidebar hidden xl:block rounded-3xl overflow-hidden relative'>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default RoleCreate
|
||||
@@ -0,0 +1,81 @@
|
||||
import { FC } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import Button from '../../components/Button'
|
||||
import { Add, Eye } from 'iconsax-react'
|
||||
import Input from '../../components/Input'
|
||||
import Td from '../../components/Td'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { Pages } from '../../config/Pages'
|
||||
|
||||
const RolesList: FC = () => {
|
||||
|
||||
const { t } = useTranslation('global')
|
||||
|
||||
return (
|
||||
<div className='mt-4'>
|
||||
<div className='flex w-full justify-between items-center'>
|
||||
<div>
|
||||
{t('user.roles_list')}
|
||||
</div>
|
||||
<div>
|
||||
<Button
|
||||
className='px-5'
|
||||
>
|
||||
<div className='flex gap-2'>
|
||||
<Add
|
||||
className='size-5'
|
||||
color='#fff'
|
||||
/>
|
||||
<div>{t('user.add_role')}</div>
|
||||
</div>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className='flex justify-end items-center mt-12'>
|
||||
<div>
|
||||
<Input
|
||||
variant='search'
|
||||
placeholder={t('user.role_search')}
|
||||
className='bg-white border border-border'
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className='relative overflow-x-auto rounded-3xl mt-9 w-full'>
|
||||
<table className='w-full text-sm '>
|
||||
<thead className='thead'>
|
||||
<tr>
|
||||
<Td text={t('user.title')} />
|
||||
<Td text={t('user.user')} />
|
||||
<Td text={t('detail')} />
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr className='tr'>
|
||||
<Td text='ادمین' />
|
||||
<Td text={'۳ کاربر'} />
|
||||
<Td text={''}>
|
||||
<Link to={Pages.ticket.detail + '1'}>
|
||||
<Eye size={20} color='#8C90A3' />
|
||||
</Link>
|
||||
</Td>
|
||||
</tr>
|
||||
<tr className='tr'>
|
||||
<Td text='ادمین' />
|
||||
<Td text={'۳ کاربر'} />
|
||||
<Td text={''}>
|
||||
<Link to={Pages.ticket.detail + '1'}>
|
||||
<Eye size={20} color='#8C90A3' />
|
||||
</Link>
|
||||
</Td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default RolesList
|
||||
@@ -40,6 +40,10 @@ import MessagesList from '../pages/messages/List'
|
||||
import CriticismsList from '../pages/criticisms/List'
|
||||
import CriticismsDetail from '../pages/criticisms/Detail'
|
||||
import Create from '../pages/annoncement/Create'
|
||||
import UsersList from '../pages/users/List'
|
||||
import CreateUser from '../pages/users/Create'
|
||||
import RolesList from '../pages/users/RolesList'
|
||||
import RoleCreate from '../pages/users/RoleCreate'
|
||||
|
||||
const MainRouter: FC = () => {
|
||||
|
||||
@@ -92,6 +96,10 @@ const MainRouter: FC = () => {
|
||||
<Route path={Pages.customer.list} element={<CustomerList />} />
|
||||
<Route path={Pages.customer.create} element={<CreateCustomer />} />
|
||||
<Route path={Pages.messages.list} element={<MessagesList />} />
|
||||
<Route path={Pages.users.list} element={<UsersList />} />
|
||||
<Route path={Pages.users.create} element={<CreateUser />} />
|
||||
<Route path={Pages.users.roleList} element={<RolesList />} />
|
||||
<Route path={Pages.users.roleCreate} element={<RoleCreate />} />
|
||||
|
||||
</Routes>
|
||||
</div>
|
||||
|
||||
@@ -14,6 +14,7 @@ import TransactionsSubMenu from './components/TransactionsSubMenu'
|
||||
import ReceiptSubMenu from './components/ReceiptSubMenu'
|
||||
import CustomerSubMenu from './components/CustomerSubMenu'
|
||||
import TicketSubMenu from './components/TicketSubMenu'
|
||||
import UsersSubMenu from './components/UsersSubMenu'
|
||||
|
||||
const SideBar: FC = () => {
|
||||
|
||||
@@ -260,7 +261,9 @@ const SideBar: FC = () => {
|
||||
<CustomerSubMenu />
|
||||
: subMenuName === 'tickets' ?
|
||||
<TicketSubMenu />
|
||||
: null
|
||||
: subMenuName === 'users' ?
|
||||
<UsersSubMenu />
|
||||
: null
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
import { Profile } from 'iconsax-react'
|
||||
import { FC } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import SubMenuItem from './SubMenuItem'
|
||||
import { Pages } from '../../config/Pages'
|
||||
|
||||
const UsersSubMenu: FC = () => {
|
||||
|
||||
const { t } = useTranslation('global')
|
||||
|
||||
const isActive = (name: string) => {
|
||||
return location.pathname.includes(name)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='py-12'>
|
||||
<div className='flex gap-3 items-center border-b pb-10 px-6'>
|
||||
<Profile
|
||||
size={24}
|
||||
color='#000'
|
||||
variant='Bold'
|
||||
/>
|
||||
<div className='text-xs'>
|
||||
{t('sidebar.users')}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className='flex flex-col mt-10 gap-4'>
|
||||
<SubMenuItem
|
||||
title={t('submenu.user_list')}
|
||||
isActive={isActive('list')}
|
||||
link={Pages.users.list}
|
||||
/>
|
||||
<SubMenuItem
|
||||
title={t('submenu.add_user')}
|
||||
isActive={isActive('create')}
|
||||
link={Pages.users.create}
|
||||
/>
|
||||
<SubMenuItem
|
||||
title={t('submenu.role_list')}
|
||||
isActive={isActive('all')}
|
||||
link={Pages.users.roleList}
|
||||
/>
|
||||
<SubMenuItem
|
||||
title={t('submenu.role_create')}
|
||||
isActive={isActive('roles-add')}
|
||||
link={Pages.users.roleCreate}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default UsersSubMenu
|
||||
Reference in New Issue
Block a user