fix: remove truncation from description display in various components

This commit is contained in:
Yoga Pangestu 2026-08-06 11:42:22 +07:00
parent 3fe74bf166
commit 175decfa22
6 changed files with 16 additions and 8 deletions

View File

@ -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>
), ),

View File

@ -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),
}, },

View File

@ -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>
), ),

View File

@ -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' && (

View File

@ -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>
), ),

View File

@ -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>
), ),