fix: remove truncation from description display in various components
This commit is contained in:
parent
3fe74bf166
commit
175decfa22
@ -120,7 +120,7 @@ export function createTransactionColumns(
|
|||||||
accessorKey: 'description',
|
accessorKey: 'description',
|
||||||
header: () => <span>Keterangan</span>,
|
header: () => <span>Keterangan</span>,
|
||||||
cell: ({ row }) => (
|
cell: ({ row }) => (
|
||||||
<span className="block max-w-[200px] truncate">
|
<span className="block max-w-[200px]">
|
||||||
{row.getValue('description') as string}
|
{row.getValue('description') as string}
|
||||||
</span>
|
</span>
|
||||||
),
|
),
|
||||||
|
|||||||
@ -17,6 +17,7 @@ export type EmployeeAdvance = {
|
|||||||
formatted_created_at: string;
|
formatted_created_at: string;
|
||||||
employee: {
|
employee: {
|
||||||
user: {
|
user: {
|
||||||
|
id: number;
|
||||||
user_profile: {
|
user_profile: {
|
||||||
full_name: string;
|
full_name: string;
|
||||||
};
|
};
|
||||||
@ -63,12 +64,13 @@ type CreateColumnsParams = {
|
|||||||
handleApprove: (employeeAdvance: EmployeeAdvance) => void;
|
handleApprove: (employeeAdvance: EmployeeAdvance) => void;
|
||||||
handlePay: (employeeAdvance: EmployeeAdvance) => void;
|
handlePay: (employeeAdvance: EmployeeAdvance) => void;
|
||||||
can: (permission: string) => boolean;
|
can: (permission: string) => boolean;
|
||||||
|
authUserId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createEmployeeAdvanceColumns(
|
export function createEmployeeAdvanceColumns(
|
||||||
params: CreateColumnsParams,
|
params: CreateColumnsParams,
|
||||||
): ColumnDef<EmployeeAdvance>[] {
|
): ColumnDef<EmployeeAdvance>[] {
|
||||||
const { handleEdit, handleDeleteClick, handleApprove, handlePay, can } =
|
const { handleEdit, handleDeleteClick, handleApprove, handlePay, can, authUserId } =
|
||||||
params;
|
params;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
@ -162,7 +164,10 @@ export function createEmployeeAdvanceColumns(
|
|||||||
{
|
{
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
icon: <Pencil className="h-4 w-4" />,
|
icon: <Pencil className="h-4 w-4" />,
|
||||||
show: can('employee_advances.update'),
|
show:
|
||||||
|
can('employee_advances.update') &&
|
||||||
|
employeeAdvance.status === 'pending' &&
|
||||||
|
employeeAdvance.employee?.user?.id === authUserId,
|
||||||
onClick: () => handleEdit(employeeAdvance),
|
onClick: () => handleEdit(employeeAdvance),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -170,7 +175,10 @@ export function createEmployeeAdvanceColumns(
|
|||||||
icon: (
|
icon: (
|
||||||
<Trash2 className="h-4 w-4 text-destructive" />
|
<Trash2 className="h-4 w-4 text-destructive" />
|
||||||
),
|
),
|
||||||
show: can('employee_advances.delete'),
|
show:
|
||||||
|
can('employee_advances.delete') &&
|
||||||
|
employeeAdvance.status === 'pending' &&
|
||||||
|
employeeAdvance.employee?.user?.id === authUserId,
|
||||||
onClick: () =>
|
onClick: () =>
|
||||||
handleDeleteClick(employeeAdvance),
|
handleDeleteClick(employeeAdvance),
|
||||||
},
|
},
|
||||||
|
|||||||
@ -42,7 +42,7 @@ export function createExpenseColumns(
|
|||||||
accessorKey: 'description',
|
accessorKey: 'description',
|
||||||
header: () => <span>Keterangan</span>,
|
header: () => <span>Keterangan</span>,
|
||||||
cell: ({ row }) => (
|
cell: ({ row }) => (
|
||||||
<span className="block max-w-[200px] truncate">
|
<span className="block max-w-[200px]">
|
||||||
{row.getValue('description') as string}
|
{row.getValue('description') as string}
|
||||||
</span>
|
</span>
|
||||||
),
|
),
|
||||||
|
|||||||
@ -182,7 +182,7 @@ export function createPayrollColumns(
|
|||||||
{adj.type === 'bonus' ? '+' : '-'}{' '}
|
{adj.type === 'bonus' ? '+' : '-'}{' '}
|
||||||
{formatCurrency(adj.amount)}
|
{formatCurrency(adj.amount)}
|
||||||
</span>
|
</span>
|
||||||
<span className="max-w-[100px] truncate text-muted-foreground">
|
<span className="max-w-[100px] text-muted-foreground">
|
||||||
{adj.description}
|
{adj.description}
|
||||||
</span>
|
</span>
|
||||||
{payroll.status === 'unpaid' && (
|
{payroll.status === 'unpaid' && (
|
||||||
|
|||||||
@ -41,7 +41,7 @@ export function createCustomerColumns(
|
|||||||
accessorKey: 'address',
|
accessorKey: 'address',
|
||||||
header: () => <span>Alamat</span>,
|
header: () => <span>Alamat</span>,
|
||||||
cell: ({ row }) => (
|
cell: ({ row }) => (
|
||||||
<span className="block max-w-[200px] truncate">
|
<span className="block max-w-[200px]">
|
||||||
{(row.getValue('address') as string) ?? '-'}
|
{(row.getValue('address') as string) ?? '-'}
|
||||||
</span>
|
</span>
|
||||||
),
|
),
|
||||||
|
|||||||
@ -41,7 +41,7 @@ export function createSupplierColumns(
|
|||||||
accessorKey: 'address',
|
accessorKey: 'address',
|
||||||
header: () => <span>Alamat</span>,
|
header: () => <span>Alamat</span>,
|
||||||
cell: ({ row }) => (
|
cell: ({ row }) => (
|
||||||
<span className="block max-w-[200px] truncate">
|
<span className="block max-w-[200px]">
|
||||||
{(row.getValue('address') as string) ?? '-'}
|
{(row.getValue('address') as string) ?? '-'}
|
||||||
</span>
|
</span>
|
||||||
),
|
),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user