Remove Filter/Format Amount #23

Merged
ameye merged 1 commits from adjust_page_items into master 2024-05-17 15:40:44 +00:00
4 changed files with 160 additions and 68 deletions
@@ -1,6 +1,6 @@
import { KTIcon } from "../../../../../../_digifi/helpers";
import { useListView } from "../../core/ListViewProvider";
import { UsersListFilter } from "./UsersListFilter";
import { KTIcon } from '../../../../../../_digifi/helpers';
import { useListView } from '../../core/ListViewProvider';
import { UsersListFilter } from './UsersListFilter';
const UsersListToolbar = () => {
const { setItemIdForUpdate } = useListView();
@@ -13,7 +13,7 @@ const UsersListToolbar = () => {
className="d-flex justify-content-end"
data-kt-user-table-toolbar="base"
>
<UsersListFilter />
{/* <UsersListFilter /> */}
{/* begin::Export */}
{/* <button type='button' className='btn btn-light-primary me-3'>
@@ -1,57 +1,103 @@
import {Column} from 'react-table'
import {UserInfoCell} from './UserInfoCell'
import { PaymentMonthCell } from './UserLastLoginCell'
import {AgentCell} from './AgentCell'
import {UserActionsCell} from './UserActionsCell'
import {UserSelectionCell} from './UserSelectionCell'
import {UserCustomHeader} from './UserCustomHeader'
import {UserSelectionHeader} from './UserSelectionHeader'
import {User} from '../../../core/_models'
import { AddedCell } from './AddedCell'
import { Column } from 'react-table';
import { UserInfoCell } from './UserInfoCell';
import { PaymentMonthCell } from './UserLastLoginCell';
import { AgentCell } from './AgentCell';
import { UserActionsCell } from './UserActionsCell';
import { UserSelectionCell } from './UserSelectionCell';
import { UserCustomHeader } from './UserCustomHeader';
import { UserSelectionHeader } from './UserSelectionHeader';
import { User } from '../../../core/_models';
import { AddedCell } from './AddedCell';
const formatNumberWithCommas = (number: string): string => {
return number.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
};
const usersColumns: ReadonlyArray<Column<User>> = [
{
Header: (props) => <UserSelectionHeader tableProps={props} />,
id: 'selection',
Cell: ({...props}) => <UserSelectionCell id={props.data[props.row.index].uid} />,
},
{
Header: (props) => <UserCustomHeader tableProps={props} title='Name' className='min-w-125px' />,
id: 'firstname',
Cell: ({...props}) => <UserInfoCell user={props.data[props.row.index]} />,
},
{
Header: (props) => <UserCustomHeader tableProps={props} title='Amount' className='min-w-125px' />,
accessor: 'loan_amount',
Cell: ({ ...props }) => (
<UserSelectionCell id={props.data[props.row.index].uid} />
),
},
{
Header: (props) => (
<UserCustomHeader tableProps={props} title='Payment Terms' className='min-w-125px' />
<UserCustomHeader
tableProps={props}
title="Name"
className="min-w-125px"
/>
),
id: 'firstname',
Cell: ({ ...props }) => <UserInfoCell user={props.data[props.row.index]} />,
},
{
Header: (props) => (
<UserCustomHeader
tableProps={props}
title="Amount"
className="min-w-125px"
/>
),
accessor: 'loan_amount',
Cell: ({ row, data }) =>
formatNumberWithCommas(data[row.index].loan_amount || '0'),
},
{
Header: (props) => (
<UserCustomHeader
tableProps={props}
title="Payment Terms"
className="min-w-125px"
/>
),
id: 'payment_month',
Cell: ({...props}) => <PaymentMonthCell payment_month={props.data[props.row.index].payment_month} />,
Cell: ({ ...props }) => (
<PaymentMonthCell
payment_month={props.data[props.row.index].payment_month}
/>
),
},
{
Header: (props) => (
<UserCustomHeader tableProps={props} title='Agent' className='min-w-125px' />
<UserCustomHeader
tableProps={props}
title="Agent"
className="min-w-125px"
/>
),
id: 'sales_agent',
Cell: ({...props}) => <AgentCell agent={props.data[props.row.index].sales_agent} />,
Cell: ({ ...props }) => (
<AgentCell agent={props.data[props.row.index].sales_agent} />
),
},
{
Header: (props) => (
<UserCustomHeader tableProps={props} title='Added' className='min-w-125px' />
<UserCustomHeader
tableProps={props}
title="Added"
className="min-w-125px"
/>
),
id: 'added',
Cell: ({...props}) => <AddedCell added={props.data[props.row.index].added} />,
Cell: ({ ...props }) => (
<AddedCell added={props.data[props.row.index].added} />
),
},
{
Header: (props) => (
<UserCustomHeader tableProps={props} title='Actions' className='text-end min-w-100px' />
<UserCustomHeader
tableProps={props}
title="Actions"
className="text-end min-w-100px"
/>
),
id: 'actions',
Cell: ({...props}) => <UserActionsCell id={props.data[props.row.index].uid} />,
Cell: ({ ...props }) => (
<UserActionsCell id={props.data[props.row.index].uid} />
),
},
]
];
export {usersColumns}
export { usersColumns };
@@ -1,6 +1,6 @@
import { KTIcon } from "../../../../../../_digifi/helpers";
import { useListView } from "../../core/ListViewProvider";
import { UsersListFilter } from "./UsersListFilter";
import { KTIcon } from '../../../../../../_digifi/helpers';
import { useListView } from '../../core/ListViewProvider';
import { UsersListFilter } from './UsersListFilter';
const UsersListToolbar = () => {
const { setItemIdForUpdate } = useListView();
@@ -13,7 +13,7 @@ const UsersListToolbar = () => {
className="d-flex justify-content-end"
data-kt-user-table-toolbar="base"
>
<UsersListFilter />
{/* <UsersListFilter /> */}
{/* begin::Export */}
{/* <button type='button' className='btn btn-light-primary me-3'>
@@ -1,57 +1,103 @@
import {Column} from 'react-table'
import {UserInfoCell} from './UserInfoCell'
import { PaymentMonthCell } from './UserLastLoginCell'
import {AgentCell} from './AgentCell'
import {UserActionsCell} from './UserActionsCell'
import {UserSelectionCell} from './UserSelectionCell'
import {UserCustomHeader} from './UserCustomHeader'
import {UserSelectionHeader} from './UserSelectionHeader'
import {User} from '../../../core/_models'
import { AddedCell } from './AddedCell'
import { Column } from 'react-table';
import { UserInfoCell } from './UserInfoCell';
import { PaymentMonthCell } from './UserLastLoginCell';
import { AgentCell } from './AgentCell';
import { UserActionsCell } from './UserActionsCell';
import { UserSelectionCell } from './UserSelectionCell';
import { UserCustomHeader } from './UserCustomHeader';
import { UserSelectionHeader } from './UserSelectionHeader';
import { User } from '../../../core/_models';
import { AddedCell } from './AddedCell';
const formatNumberWithCommas = (number: string): string => {
return number.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
};
const usersColumns: ReadonlyArray<Column<User>> = [
{
Header: (props) => <UserSelectionHeader tableProps={props} />,
id: 'selection',
Cell: ({...props}) => <UserSelectionCell id={props.data[props.row.index].uid} />,
},
{
Header: (props) => <UserCustomHeader tableProps={props} title='Name' className='min-w-125px' />,
id: 'firstname',
Cell: ({...props}) => <UserInfoCell user={props.data[props.row.index]} />,
},
{
Header: (props) => <UserCustomHeader tableProps={props} title='Amount' className='min-w-125px' />,
accessor: 'loan_amount',
Cell: ({ ...props }) => (
<UserSelectionCell id={props.data[props.row.index].uid} />
),
},
{
Header: (props) => (
<UserCustomHeader tableProps={props} title='Payment Terms' className='min-w-125px' />
<UserCustomHeader
tableProps={props}
title="Name"
className="min-w-125px"
/>
),
id: 'firstname',
Cell: ({ ...props }) => <UserInfoCell user={props.data[props.row.index]} />,
},
{
Header: (props) => (
<UserCustomHeader
tableProps={props}
title="Amount"
className="min-w-125px"
/>
),
accessor: 'loan_amount',
Cell: ({ row, data }) =>
formatNumberWithCommas(data[row.index].loan_amount || '0'),
},
{
Header: (props) => (
<UserCustomHeader
tableProps={props}
title="Payment Terms"
className="min-w-125px"
/>
),
id: 'payment_month',
Cell: ({...props}) => <PaymentMonthCell payment_month={props.data[props.row.index].payment_month} />,
Cell: ({ ...props }) => (
<PaymentMonthCell
payment_month={props.data[props.row.index].payment_month}
/>
),
},
{
Header: (props) => (
<UserCustomHeader tableProps={props} title='Agent' className='min-w-125px' />
<UserCustomHeader
tableProps={props}
title="Agent"
className="min-w-125px"
/>
),
id: 'sales_agent',
Cell: ({...props}) => <AgentCell agent={props.data[props.row.index].sales_agent} />,
Cell: ({ ...props }) => (
<AgentCell agent={props.data[props.row.index].sales_agent} />
),
},
{
Header: (props) => (
<UserCustomHeader tableProps={props} title='Added' className='min-w-125px' />
<UserCustomHeader
tableProps={props}
title="Added"
className="min-w-125px"
/>
),
id: 'added',
Cell: ({...props}) => <AddedCell added={props.data[props.row.index].added} />,
Cell: ({ ...props }) => (
<AddedCell added={props.data[props.row.index].added} />
),
},
{
Header: (props) => (
<UserCustomHeader tableProps={props} title='Actions' className='text-end min-w-100px' />
<UserCustomHeader
tableProps={props}
title="Actions"
className="text-end min-w-100px"
/>
),
id: 'actions',
Cell: ({...props}) => <UserActionsCell id={props.data[props.row.index].uid} />,
Cell: ({ ...props }) => (
<UserActionsCell id={props.data[props.row.index].uid} />
),
},
]
];
export {usersColumns}
export { usersColumns };