mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-13 08:21:26 +00:00
[React] PO detail pgae (#5847)
* Factor out common barcode actions * Refactoring more icons * Add PurchaseOrderLineItemTable component * Improve renderer for SupplierPart * Edit line item * Table action column always visible * Create <AddItemButton> component (refactoring) * Table updates - Improve actions column for table - Move "download" button to right hand side * Refactoring button components * More cleanup - Refactor <TableHoverCard> a bit - Add placeholder for "receive items" * Add ProgresBar component * Make table columns switchable by default - set switchable: false to disable * Add project_code column to build table * Fix row actions column for tables without actions * Improve rendering for BuildOrderTable * Cleanup unused imports * Further fixes * Remove another unused import
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { t } from '@lingui/macro';
|
||||
import { Group, Stack, Text } from '@mantine/core';
|
||||
import { Group, Text } from '@mantine/core';
|
||||
import { ReactNode, useMemo } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
@ -35,26 +35,23 @@ function partTableColumns(): TableColumn[] {
|
||||
{
|
||||
accessor: 'IPN',
|
||||
title: t`IPN`,
|
||||
sortable: true,
|
||||
switchable: true
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
accessor: 'units',
|
||||
sortable: true,
|
||||
title: t`Units`,
|
||||
switchable: true
|
||||
title: t`Units`
|
||||
},
|
||||
{
|
||||
accessor: 'description',
|
||||
title: t`Description`,
|
||||
sortable: true,
|
||||
switchable: true
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
accessor: 'category',
|
||||
title: t`Category`,
|
||||
sortable: true,
|
||||
switchable: true,
|
||||
|
||||
render: function (record: any) {
|
||||
// TODO: Link to the category detail page
|
||||
return shortenString({
|
||||
@ -66,7 +63,7 @@ function partTableColumns(): TableColumn[] {
|
||||
accessor: 'total_in_stock',
|
||||
title: t`Stock`,
|
||||
sortable: true,
|
||||
switchable: true,
|
||||
|
||||
render: (record) => {
|
||||
let extra: ReactNode[] = [];
|
||||
|
||||
@ -143,7 +140,7 @@ function partTableColumns(): TableColumn[] {
|
||||
</Group>
|
||||
}
|
||||
title={t`Stock Information`}
|
||||
extra={extra.length > 0 && <Stack spacing="xs">{extra}</Stack>}
|
||||
extra={extra}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -152,7 +149,7 @@ function partTableColumns(): TableColumn[] {
|
||||
accessor: 'price_range',
|
||||
title: t`Price Range`,
|
||||
sortable: false,
|
||||
switchable: true,
|
||||
|
||||
render: function (record: any) {
|
||||
// TODO: Render price range
|
||||
return '-- price --';
|
||||
@ -160,8 +157,7 @@ function partTableColumns(): TableColumn[] {
|
||||
},
|
||||
{
|
||||
accessor: 'link',
|
||||
title: t`Link`,
|
||||
switchable: true
|
||||
title: t`Link`
|
||||
}
|
||||
];
|
||||
}
|
||||
|
Reference in New Issue
Block a user