mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-14 11:05:41 +00:00
[PUI] Table loading refactor (#6014)
* Pre-commit alterations * Change PK for ID on panels only using ID * Remove '-1' calls to Tables * Remove unused imports
This commit is contained in:
@ -3,9 +3,7 @@ import { Group, LoadingOverlay, Stack, Table } from '@mantine/core';
|
|||||||
import {
|
import {
|
||||||
IconClipboardCheck,
|
IconClipboardCheck,
|
||||||
IconClipboardList,
|
IconClipboardList,
|
||||||
IconCopy,
|
|
||||||
IconDots,
|
IconDots,
|
||||||
IconEdit,
|
|
||||||
IconFileTypePdf,
|
IconFileTypePdf,
|
||||||
IconInfoCircle,
|
IconInfoCircle,
|
||||||
IconList,
|
IconList,
|
||||||
@ -122,7 +120,7 @@ export default function BuildDetail() {
|
|||||||
content: (
|
content: (
|
||||||
<StockItemTable
|
<StockItemTable
|
||||||
params={{
|
params={{
|
||||||
build: build.pk ?? -1,
|
build: id,
|
||||||
is_building: false
|
is_building: false
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@ -135,7 +133,7 @@ export default function BuildDetail() {
|
|||||||
content: (
|
content: (
|
||||||
<StockItemTable
|
<StockItemTable
|
||||||
params={{
|
params={{
|
||||||
consumed_by: build.pk ?? -1
|
consumed_by: id
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
@ -147,7 +145,7 @@ export default function BuildDetail() {
|
|||||||
content: (
|
content: (
|
||||||
<BuildOrderTable
|
<BuildOrderTable
|
||||||
params={{
|
params={{
|
||||||
parent: build.pk ?? -1
|
parent: id
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
@ -160,7 +158,7 @@ export default function BuildDetail() {
|
|||||||
<AttachmentTable
|
<AttachmentTable
|
||||||
endpoint={ApiPaths.build_order_attachment_list}
|
endpoint={ApiPaths.build_order_attachment_list}
|
||||||
model="build"
|
model="build"
|
||||||
pk={build.pk ?? -1}
|
pk={Number(id)}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
@ -177,7 +175,7 @@ export default function BuildDetail() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}, [build]);
|
}, [build, id]);
|
||||||
|
|
||||||
const editBuildOrder = useCallback(() => {
|
const editBuildOrder = useCallback(() => {
|
||||||
let fields = buildOrderFields();
|
let fields = buildOrderFields();
|
||||||
|
@ -49,7 +49,7 @@ export default function CategoryDetail({}: {}) {
|
|||||||
<PartListTable
|
<PartListTable
|
||||||
props={{
|
props={{
|
||||||
params: {
|
params: {
|
||||||
category: category.pk ?? null
|
category: id
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@ -62,7 +62,7 @@ export default function CategoryDetail({}: {}) {
|
|||||||
content: (
|
content: (
|
||||||
<PartCategoryTable
|
<PartCategoryTable
|
||||||
params={{
|
params={{
|
||||||
parent: category.pk ?? null
|
parent: id
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
@ -59,7 +59,7 @@ export default function PurchaseOrderDetail() {
|
|||||||
name: 'line-items',
|
name: 'line-items',
|
||||||
label: t`Line Items`,
|
label: t`Line Items`,
|
||||||
icon: <IconList />,
|
icon: <IconList />,
|
||||||
content: order?.pk && <PurchaseOrderLineItemTable orderId={order.pk} />
|
content: <PurchaseOrderLineItemTable orderId={Number(id)} />
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'received-stock',
|
name: 'received-stock',
|
||||||
@ -81,7 +81,7 @@ export default function PurchaseOrderDetail() {
|
|||||||
<AttachmentTable
|
<AttachmentTable
|
||||||
endpoint={ApiPaths.purchase_order_attachment_list}
|
endpoint={ApiPaths.purchase_order_attachment_list}
|
||||||
model="order"
|
model="order"
|
||||||
pk={order.pk ?? -1}
|
pk={Number(id)}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
@ -91,7 +91,7 @@ export default function PurchaseOrderDetail() {
|
|||||||
icon: <IconNotes />,
|
icon: <IconNotes />,
|
||||||
content: (
|
content: (
|
||||||
<NotesEditor
|
<NotesEditor
|
||||||
url={apiUrl(ApiPaths.purchase_order_list, order.pk)}
|
url={apiUrl(ApiPaths.purchase_order_list, id)}
|
||||||
data={order.notes ?? ''}
|
data={order.notes ?? ''}
|
||||||
allowEdit={true}
|
allowEdit={true}
|
||||||
/>
|
/>
|
||||||
|
@ -41,7 +41,7 @@ export default function ReturnOrderDetail() {
|
|||||||
<AttachmentTable
|
<AttachmentTable
|
||||||
endpoint={ApiPaths.return_order_attachment_list}
|
endpoint={ApiPaths.return_order_attachment_list}
|
||||||
model="order"
|
model="order"
|
||||||
pk={order.pk ?? -1}
|
pk={Number(id)}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
@ -51,7 +51,7 @@ export default function ReturnOrderDetail() {
|
|||||||
icon: <IconNotes />,
|
icon: <IconNotes />,
|
||||||
content: (
|
content: (
|
||||||
<NotesEditor
|
<NotesEditor
|
||||||
url={apiUrl(ApiPaths.return_order_list, order.pk)}
|
url={apiUrl(ApiPaths.return_order_list, id)}
|
||||||
data={order.notes ?? ''}
|
data={order.notes ?? ''}
|
||||||
allowEdit={true}
|
allowEdit={true}
|
||||||
/>
|
/>
|
||||||
|
@ -69,7 +69,7 @@ export default function SalesOrderDetail() {
|
|||||||
<AttachmentTable
|
<AttachmentTable
|
||||||
endpoint={ApiPaths.sales_order_attachment_list}
|
endpoint={ApiPaths.sales_order_attachment_list}
|
||||||
model="order"
|
model="order"
|
||||||
pk={order.pk ?? -1}
|
pk={Number(id)}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
@ -79,7 +79,7 @@ export default function SalesOrderDetail() {
|
|||||||
icon: <IconNotes />,
|
icon: <IconNotes />,
|
||||||
content: (
|
content: (
|
||||||
<NotesEditor
|
<NotesEditor
|
||||||
url={apiUrl(ApiPaths.sales_order_list, order.pk)}
|
url={apiUrl(ApiPaths.sales_order_list, id)}
|
||||||
data={order.notes ?? ''}
|
data={order.notes ?? ''}
|
||||||
allowEdit={true}
|
allowEdit={true}
|
||||||
/>
|
/>
|
||||||
|
@ -38,7 +38,7 @@ export default function Stock() {
|
|||||||
content: (
|
content: (
|
||||||
<StockItemTable
|
<StockItemTable
|
||||||
params={{
|
params={{
|
||||||
location: location.pk ?? null
|
location: id
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
@ -50,7 +50,7 @@ export default function Stock() {
|
|||||||
content: (
|
content: (
|
||||||
<StockLocationTable
|
<StockLocationTable
|
||||||
params={{
|
params={{
|
||||||
parent: location.pk ?? null
|
parent: id
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
@ -111,7 +111,7 @@ export default function StockDetail() {
|
|||||||
<AttachmentTable
|
<AttachmentTable
|
||||||
endpoint={ApiPaths.stock_attachment_list}
|
endpoint={ApiPaths.stock_attachment_list}
|
||||||
model="stock_item"
|
model="stock_item"
|
||||||
pk={stockitem.pk ?? -1}
|
pk={Number(id)}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
@ -121,7 +121,7 @@ export default function StockDetail() {
|
|||||||
icon: <IconNotes />,
|
icon: <IconNotes />,
|
||||||
content: (
|
content: (
|
||||||
<NotesEditor
|
<NotesEditor
|
||||||
url={apiUrl(ApiPaths.stock_item_list, stockitem.pk)}
|
url={apiUrl(ApiPaths.stock_item_list, id)}
|
||||||
data={stockitem.notes ?? ''}
|
data={stockitem.notes ?? ''}
|
||||||
allowEdit={true}
|
allowEdit={true}
|
||||||
/>
|
/>
|
||||||
|
Reference in New Issue
Block a user