mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
[PUI] Add filters for parameteric part table (#7617)
This commit is contained in:
parent
2ebe6e0a8e
commit
5e040c4dc4
@ -22,6 +22,7 @@ export function PassFailButton({
|
||||
variant="filled"
|
||||
radius="lg"
|
||||
size="sm"
|
||||
style={{ maxWidth: '50px' }}
|
||||
>
|
||||
{v ? pass : fail}
|
||||
</Badge>
|
||||
|
@ -22,6 +22,7 @@ import { apiUrl } from '../../states/ApiState';
|
||||
import { useUserState } from '../../states/UserState';
|
||||
import { TableColumn } from '../Column';
|
||||
import { DescriptionColumn, PartColumn } from '../ColumnRenderers';
|
||||
import { TableFilter } from '../Filter';
|
||||
import { InvenTreeTable } from '../InvenTreeTable';
|
||||
import { TableHoverCard } from '../TableHoverCard';
|
||||
|
||||
@ -214,6 +215,26 @@ export default function ParametricPartTable({
|
||||
});
|
||||
}, [user, categoryParmeters.data]);
|
||||
|
||||
const tableFilters: TableFilter[] = useMemo(() => {
|
||||
return [
|
||||
{
|
||||
name: 'active',
|
||||
label: t`Active`,
|
||||
description: t`Show active parts`
|
||||
},
|
||||
{
|
||||
name: 'locked',
|
||||
label: t`Locked`,
|
||||
description: t`Show locked parts`
|
||||
},
|
||||
{
|
||||
name: 'assembly',
|
||||
label: t`Assembly`,
|
||||
description: t`Show assembly parts`
|
||||
}
|
||||
];
|
||||
}, []);
|
||||
|
||||
const tableColumns: TableColumn[] = useMemo(() => {
|
||||
const partColumns: TableColumn[] = [
|
||||
{
|
||||
@ -253,7 +274,8 @@ export default function ParametricPartTable({
|
||||
category_detail: true,
|
||||
parameters: true
|
||||
},
|
||||
modelType: ModelType.part
|
||||
modelType: ModelType.part,
|
||||
tableFilters: tableFilters
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
|
Loading…
Reference in New Issue
Block a user