Update UI table
This commit is contained in:
parent
ae7d5b6a00
commit
1508152a0a
|
|
@ -20,7 +20,8 @@ export function projectCodeFields(): ApiFormFieldSet {
|
|||
description: {},
|
||||
responsible: {
|
||||
icon: <IconUsers />
|
||||
}
|
||||
},
|
||||
active: {}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import { ApiEndpoints } from '@lib/enums/ApiEndpoints';
|
|||
import { UserRoles } from '@lib/enums/Roles';
|
||||
import { apiUrl } from '@lib/functions/Api';
|
||||
import useTable from '@lib/hooks/UseTable';
|
||||
import type { TableFilter } from '@lib/index';
|
||||
import type { TableColumn } from '@lib/types/Tables';
|
||||
import { projectCodeFields } from '../../forms/CommonForms';
|
||||
import {
|
||||
|
|
@ -19,7 +20,11 @@ import {
|
|||
useEditApiFormModal
|
||||
} from '../../hooks/UseForm';
|
||||
import { useUserState } from '../../states/UserState';
|
||||
import { DescriptionColumn, ResponsibleColumn } from '../ColumnRenderers';
|
||||
import {
|
||||
BooleanColumn,
|
||||
DescriptionColumn,
|
||||
ResponsibleColumn
|
||||
} from '../ColumnRenderers';
|
||||
import { InvenTreeTable } from '../InvenTreeTable';
|
||||
|
||||
/**
|
||||
|
|
@ -37,6 +42,9 @@ export default function ProjectCodeTable() {
|
|||
sortable: true
|
||||
},
|
||||
DescriptionColumn({}),
|
||||
BooleanColumn({
|
||||
accessor: 'active'
|
||||
}),
|
||||
ResponsibleColumn({})
|
||||
];
|
||||
}, []);
|
||||
|
|
@ -89,6 +97,17 @@ export default function ProjectCodeTable() {
|
|||
[user]
|
||||
);
|
||||
|
||||
const tableFilters: TableFilter[] = useMemo(() => {
|
||||
return [
|
||||
{
|
||||
name: 'active',
|
||||
label: t`Active`,
|
||||
description: t`Show active items`,
|
||||
type: 'boolean'
|
||||
}
|
||||
];
|
||||
}, []);
|
||||
|
||||
const tableActions = useMemo(() => {
|
||||
return [
|
||||
<AddItemButton
|
||||
|
|
@ -111,6 +130,7 @@ export default function ProjectCodeTable() {
|
|||
props={{
|
||||
rowActions: rowActions,
|
||||
tableActions: tableActions,
|
||||
tableFilters: tableFilters,
|
||||
enableDownload: true
|
||||
}}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue