2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-06 12:01:41 +00:00

Refactor detail pages which display status

This commit is contained in:
Oliver Walters
2024-12-28 16:39:19 +11:00
parent 60a777f7ac
commit a731afc4fe
6 changed files with 41 additions and 6 deletions

View File

@@ -103,10 +103,19 @@ export default function BuildDetail() {
},
{
type: 'status',
name: 'status_custom_key',
name: 'status',
label: t`Status`,
model: ModelType.build
},
{
type: 'status',
name: 'status_custom_key',
label: t`Custom Status`,
model: ModelType.build,
icon: 'status',
hidden:
!build.status_custom_key || build.status_custom_key == build.status
},
{
type: 'text',
name: 'reference',

View File

@@ -141,9 +141,18 @@ export default function PurchaseOrderDetail() {
},
{
type: 'status',
name: 'status_custom_key',
name: 'status',
label: t`Status`,
model: ModelType.purchaseorder
},
{
type: 'status',
name: 'status_custom_key',
label: t`Custom Status`,
model: ModelType.purchaseorder,
icon: 'status',
hidden:
!order.status_custom_key || order.status_custom_key == order.status
}
];

View File

@@ -115,6 +115,15 @@ export default function ReturnOrderDetail() {
name: 'status',
label: t`Status`,
model: ModelType.returnorder
},
{
type: 'status',
name: 'status_custom_key',
label: t`Custom Status`,
model: ModelType.returnorder,
icon: 'status',
hidden:
!order.status_custom_key || order.status_custom_key == order.status
}
];

View File

@@ -120,11 +120,19 @@ export default function SalesOrderDetail() {
copy: true
},
{
icon: 'status',
type: 'status',
name: 'status_custom_key',
name: 'status',
label: t`Status`,
model: ModelType.salesorder
},
{
type: 'status',
name: 'status_custom_key',
label: t`Custom Status`,
model: ModelType.salesorder,
icon: 'status',
hidden:
!order.status_custom_key || order.status_custom_key == order.status
}
];

View File

@@ -137,8 +137,7 @@ export default function StockDetail() {
name: 'status',
type: 'status',
label: t`Status`,
model: ModelType.stockitem,
icon: 'status'
model: ModelType.stockitem
},
{
name: 'status_custom_key',

View File

@@ -284,5 +284,6 @@ test('Build Order - Filters', async ({ page }) => {
await page.getByText('1 - 1 / 1').waitFor();
await page.getByRole('cell', { name: 'BO0023' }).click();
await page.getByText('On Hold').first().waitFor();
await page.getByText('Pending Approval').first().waitFor();
});