mirror of
https://github.com/Sea-Haven-Industries/seahaven-ap.git
synced 2026-10-02 06:13:23 +00:00
Merge branch 'feature/invoice-filter-toolbar' into feature/columns-slideover
This commit is contained in:
commit
923c979b4f
3 changed files with 10 additions and 11 deletions
|
|
@ -16,6 +16,8 @@ test.describe("Invoice Processing filters (AP-43)", () => {
|
|||
await page.getByTestId("vendor-filter").fill("Harbor");
|
||||
await expect(page.getByTestId("filter-toggle").locator(".MuiBadge-badge")).toHaveText("2");
|
||||
await expect(grid.locator(".MuiDataGrid-row")).toHaveCount(1);
|
||||
await expect(page.getByTestId("attention-banner")).toContainText("1 invoices require approval");
|
||||
await expect(page.getByTestId("attention-banner")).toContainText(
|
||||
"1 invoices require approval. Show invoices ready to approve.",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -240,10 +240,12 @@ export function DashboardGrids() {
|
|||
<Typography
|
||||
data-testid="attention-banner"
|
||||
variant="body2"
|
||||
color="text.secondary"
|
||||
sx={{ display: "block", mb: 1.5, textAlign: "left" }}
|
||||
sx={{ display: "block", mb: 1.5, color: "primary.main", textAlign: "left" }}
|
||||
>
|
||||
{filteredAttention.length} invoices require approval.
|
||||
{filteredAttention.length} invoices require approval.{" "}
|
||||
<Box component="span" sx={{ textDecoration: "underline" }}>
|
||||
Show invoices ready to approve.
|
||||
</Box>
|
||||
</Typography>
|
||||
) : null}
|
||||
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ function invoiceDateBeforeDue(dueDate: string, index: number): string {
|
|||
}
|
||||
|
||||
/** Keep catalog-derived fields in sync after mock mutations. */
|
||||
function withRefreshedCatalogFields(invoice: MockInvoice, index: number): MockInvoice {
|
||||
function withRefreshedCatalogFields(invoice: MockInvoice): MockInvoice {
|
||||
return {
|
||||
...invoice,
|
||||
actionLabel: actionLabelForStatus(invoice.status),
|
||||
|
|
@ -190,7 +190,6 @@ function enrichInvoice(core: MockInvoiceCore, index: number): MockInvoice {
|
|||
relatedInvoice: null,
|
||||
rowCount: core.lines.length,
|
||||
},
|
||||
index,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -596,7 +595,6 @@ export function updateMockInvoicePayDate(id: string, payDate: string | null): Mo
|
|||
},
|
||||
],
|
||||
},
|
||||
index,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
@ -609,7 +607,7 @@ export function updateMockInvoiceHeader(id: string, patch: MockInvoiceHeaderPatc
|
|||
|
||||
return replaceInvoice(
|
||||
index,
|
||||
withRefreshedCatalogFields({ ...invoiceStore[index], ...patch }, index),
|
||||
withRefreshedCatalogFields({ ...invoiceStore[index], ...patch }),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -626,7 +624,6 @@ export function updateMockInvoiceLines(id: string, lines: MockInvoiceLine[]): Mo
|
|||
...invoiceStore[index],
|
||||
lines: lines.map((line) => ({ ...line })),
|
||||
},
|
||||
index,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
@ -659,7 +656,6 @@ export function addMockInvoiceComment(
|
|||
...current,
|
||||
comments: [...current.comments, nextComment],
|
||||
},
|
||||
index,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
@ -694,7 +690,6 @@ export function transitionMockInvoiceStatus(
|
|||
status,
|
||||
activity: [...current.activity, nextActivity],
|
||||
},
|
||||
index,
|
||||
),
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue