Auto commit: 2026-01-08T12:26:11.799Z
This commit is contained in:
parent
66ae691b92
commit
4110081df9
@ -33,12 +33,23 @@ const menuAside: MenuAsideItem[] = [
|
|||||||
permissions: 'READ_PERMISSIONS'
|
permissions: 'READ_PERMISSIONS'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
href: '/leads/leads-list',
|
|
||||||
label: 'Leads',
|
label: 'Leads',
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
icon: 'mdiAccountMultiple' in icon ? icon['mdiAccountMultiple' as keyof typeof icon] : icon.mdiTable ?? icon.mdiTable,
|
icon: 'mdiAccountMultiple' in icon ? icon['mdiAccountMultiple' as keyof typeof icon] : icon.mdiTable ?? icon.mdiTable,
|
||||||
permissions: 'READ_LEADS'
|
permissions: 'READ_LEADS',
|
||||||
|
menu: [
|
||||||
|
{
|
||||||
|
href: '/leads/list',
|
||||||
|
label: 'Leads List',
|
||||||
|
permissions: 'READ_LEADS',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
href: '/leads/kanban',
|
||||||
|
label: 'Kanban',
|
||||||
|
permissions: 'READ_LEADS',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
href: '/projects/projects-list',
|
href: '/projects/projects-list',
|
||||||
|
|||||||
64
frontend/src/pages/leads/kanban.tsx
Normal file
64
frontend/src/pages/leads/kanban.tsx
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
import { mdiChartTimelineVariant } from '@mdi/js'
|
||||||
|
import Head from 'next/head'
|
||||||
|
import React, { ReactElement } from 'react'
|
||||||
|
import CardBox from '../../components/CardBox'
|
||||||
|
import LayoutAuthenticated from '../../layouts/Authenticated'
|
||||||
|
import SectionMain from '../../components/SectionMain'
|
||||||
|
import SectionTitleLineWithButton from '../../components/SectionTitleLineWithButton'
|
||||||
|
import { getPageTitle } from '../../config'
|
||||||
|
import BaseButton from '../../components/BaseButton'
|
||||||
|
import { useAppSelector } from '../../stores/hooks'
|
||||||
|
import { hasPermission } from '../../helpers/userPermissions'
|
||||||
|
import KanbanBoard from '../../components/KanbanBoard/KanbanBoard'
|
||||||
|
import Link from 'next/link'
|
||||||
|
import { deleteItem, update } from '../../stores/leads/leadsSlice'
|
||||||
|
|
||||||
|
const LeadsKanbanPage = () => {
|
||||||
|
const { currentUser } = useAppSelector((state) => state.auth)
|
||||||
|
const hasCreatePermission = currentUser && hasPermission(currentUser, 'CREATE_LEADS')
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{ id: 'New', label: 'New' },
|
||||||
|
{ id: 'Contacted', label: 'Contacted' },
|
||||||
|
{ id: 'Qualified', label: 'Qualified' },
|
||||||
|
{ id: 'Proposal', label: 'Proposal' },
|
||||||
|
{ id: 'Converted', label: 'Converted' },
|
||||||
|
{ id: 'Lost', label: 'Lost' },
|
||||||
|
]
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Head>
|
||||||
|
<title>{getPageTitle('Leads Kanban')}</title>
|
||||||
|
</Head>
|
||||||
|
<SectionMain>
|
||||||
|
<SectionTitleLineWithButton icon={mdiChartTimelineVariant} title="Leads Kanban" main>
|
||||||
|
{''}
|
||||||
|
</SectionTitleLineWithButton>
|
||||||
|
|
||||||
|
<CardBox className="mb-6" cardBoxClassName="flex flex-wrap">
|
||||||
|
{hasCreatePermission && <BaseButton className={'mr-3'} href={'/leads/leads-new'} color="info" label="New Item" />}
|
||||||
|
<div className="md:inline-flex items-center ms-auto">
|
||||||
|
<Link href={'/leads/list'}>Switch to List</Link>
|
||||||
|
</div>
|
||||||
|
</CardBox>
|
||||||
|
|
||||||
|
<KanbanBoard
|
||||||
|
columns={columns}
|
||||||
|
entityName="leads"
|
||||||
|
columnFieldName="stage"
|
||||||
|
showFieldName="name"
|
||||||
|
deleteThunk={deleteItem}
|
||||||
|
updateThunk={update}
|
||||||
|
filtersQuery={'&orderBy=createdAt&orderDirection=asc'}
|
||||||
|
/>
|
||||||
|
</SectionMain>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
LeadsKanbanPage.getLayout = function getLayout(page: ReactElement) {
|
||||||
|
return <LayoutAuthenticated permission={'READ_LEADS'}>{page}</LayoutAuthenticated>
|
||||||
|
}
|
||||||
|
|
||||||
|
export default LeadsKanbanPage
|
||||||
@ -117,7 +117,7 @@ const LeadsTablesPage = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='md:inline-flex items-center ms-auto'>
|
<div className='md:inline-flex items-center ms-auto'>
|
||||||
<Link href={'/leads/leads-table'}>Switch to Table</Link>
|
<Link href={'/leads/kanban'}>Switch to Kanban</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</CardBox>
|
</CardBox>
|
||||||
Loading…
x
Reference in New Issue
Block a user