mirror of
https://github.com/inventree/InvenTree.git
synced 2026-02-09 08:29:15 -06:00
* Refactor BulkDeleteMixin * Implement BulkUpdateMixin class * Refactor NotificationsTable - Use common bulkdelete operation * Update successMessage * Update metadata constructs * Add bulk-edit support for PartList endpoint * Implement set-category for part table * Cleanup old endpoint * Improve form error handling * Simplify translated text * Add playwright tests * Bump API version * Fix unit tests * Further test updates
61 lines
1.3 KiB
TypeScript
61 lines
1.3 KiB
TypeScript
import { t } from '@lingui/macro';
|
|
import { useMemo } from 'react';
|
|
|
|
import { ApiEndpoints } from '../../enums/ApiEndpoints';
|
|
import type { TableState } from '../../hooks/UseTable';
|
|
import { apiUrl } from '../../states/ApiState';
|
|
import type { TableColumn } from '../Column';
|
|
import { InvenTreeTable } from '../InvenTreeTable';
|
|
import type { RowAction } from '../RowActions';
|
|
|
|
export function NotificationTable({
|
|
params,
|
|
tableState,
|
|
tableActions,
|
|
actions
|
|
}: Readonly<{
|
|
params: any;
|
|
tableState: TableState;
|
|
tableActions: any[];
|
|
actions: (record: any) => RowAction[];
|
|
}>) {
|
|
const columns: TableColumn[] = useMemo(() => {
|
|
return [
|
|
{
|
|
accessor: 'age_human',
|
|
title: t`Age`,
|
|
sortable: true,
|
|
ordering: 'creation'
|
|
},
|
|
{
|
|
accessor: 'category',
|
|
title: t`Category`,
|
|
sortable: true
|
|
},
|
|
{
|
|
accessor: 'name',
|
|
title: t`Notification`
|
|
},
|
|
{
|
|
accessor: 'message',
|
|
title: t`Message`
|
|
}
|
|
];
|
|
}, []);
|
|
|
|
return (
|
|
<InvenTreeTable
|
|
url={apiUrl(ApiEndpoints.notifications_list)}
|
|
tableState={tableState}
|
|
columns={columns}
|
|
props={{
|
|
rowActions: actions,
|
|
tableActions: tableActions,
|
|
enableSelection: true,
|
|
enableBulkDelete: true,
|
|
params: params
|
|
}}
|
|
/>
|
|
);
|
|
}
|