2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-04-15 07:48:51 +00:00

[UI] Default table filters (#11405)

* Support "default filters" for table views

- User overrides apply in preference
- Only when there is no stored value (null)

* Correctly handle partially constructed filters

- Reverse lookup on available filter set

* Add default filters for order tables

* Default filters for company tables

* More default filters

* Add some more default filters

* Bump CHANGELOG

* build fix

* Tweaks for playwright testing

* Tweak playwright test

* Improve test flexibility
This commit is contained in:
Oliver
2026-02-23 19:46:17 +11:00
committed by GitHub
parent d48643319c
commit cef5d4d9c0
33 changed files with 331 additions and 53 deletions

View File

@@ -723,6 +723,8 @@ test('Build Order - External', async ({ browser }) => {
await navigate(page, 'manufacturing/build-order/26/details');
await loadTab(page, 'External Orders');
await clearTableFilters(page);
await page.getByRole('cell', { name: 'PO0017' }).waitFor();
await page.getByRole('cell', { name: 'PO0018' }).waitFor();
});

View File

@@ -15,21 +15,28 @@ test('Company', async ({ browser }) => {
await navigate(page, 'company/1/details');
await page.getByLabel('Details').getByText('DigiKey Electronics').waitFor();
await page.getByRole('cell', { name: 'https://www.digikey.com/' }).waitFor();
await loadTab(page, 'Supplied Parts');
await page
.getByRole('cell', { name: 'RR05P100KDTR-ND', exact: true })
.waitFor();
await loadTab(page, 'Purchase Orders');
await clearTableFilters(page);
await page.getByRole('cell', { name: 'Molex connectors' }).first().waitFor();
await loadTab(page, 'Stock Items');
await page
.getByRole('cell', { name: 'Blue plastic enclosure' })
.first()
.waitFor();
await loadTab(page, 'Contacts');
await page.getByRole('cell', { name: 'jimmy.mcleod@digikey.com' }).waitFor();
await loadTab(page, 'Addresses');
await page.getByRole('cell', { name: 'Carla Tunnel' }).waitFor();
await loadTab(page, 'Attachments');
await loadTab(page, 'Notes');

View File

@@ -66,14 +66,16 @@ test('Parts - Tabs', async ({ browser }) => {
});
test('Parts - Manufacturer Parts', async ({ browser }) => {
const page = await doCachedLogin(browser, { url: 'part/84/suppliers' });
const page = await doCachedLogin(browser, { url: 'part/84/' });
// Load the "suppliers" tab
await loadTab(page, 'Suppliers');
await page.getByText('Hammond Manufacturing').click();
await loadTab(page, 'Parameters');
await loadTab(page, 'Suppliers');
await loadTab(page, 'Attachments');
// Wait for manufacturer part page to load
await page.getByText('1551ACLR - 1551ACLR').waitFor();
await loadTab(page, 'Parameters');
await loadTab(page, 'Attachments');
});
test('Parts - Supplier Parts', async ({ browser }) => {

View File

@@ -25,6 +25,14 @@ test('Purchasing - Index', async ({ browser }) => {
await showCalendarView(page);
await showTableView(page);
// Check default filters are applied
// By default, only outstanding orders are visible
await page.getByText(/1 - \d+ \/ \d+/).waitFor();
// Clearing the filters, more orders should be visible
await clearTableFilters(page);
await page.getByText(/1 - 1\d \/ 1\d/).waitFor();
// Suppliers tab
await loadTab(page, 'Suppliers');
await showParametricView(page);

View File

@@ -33,7 +33,7 @@ test('Exporting - Orders', async ({ browser }) => {
await page.getByText('Process completed successfully').waitFor();
// Download list of purchase order items
await page.getByRole('cell', { name: 'PO0011' }).click();
await page.getByRole('cell', { name: 'PO0014' }).click();
await loadTab(page, 'Line Items');
await openExportDialog(page);
await page.getByRole('button', { name: 'Export', exact: true }).click();

View File

@@ -62,7 +62,7 @@ test('Printing - Report Printing', async ({ browser }) => {
await loadTab(page, 'Purchase Orders');
await activateTableView(page);
await page.getByRole('cell', { name: 'PO0009' }).click();
await page.getByRole('cell', { name: 'PO0013' }).click();
// Select "print report"
await page.getByLabel('action-menu-printing-actions').click();