From db70597755bdee3dc2207b2c6c19770a07c52969 Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 20 Nov 2024 00:01:19 +1100 Subject: [PATCH] Add empty context menu (#8519) * Add empty context menu - For tables without "row actions" - Show an "empty" menu - For UX consistency across all tables * Fix for playwright tests - Recent changes to the demo dataset... * Fix typo --- docs/docs/develop/react-frontend.md | 2 +- src/frontend/src/tables/InvenTreeTable.tsx | 2 ++ src/frontend/tests/pages/pui_part.spec.ts | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/docs/develop/react-frontend.md b/docs/docs/develop/react-frontend.md index 5ca954445d..7b0274cf8e 100644 --- a/docs/docs/develop/react-frontend.md +++ b/docs/docs/develop/react-frontend.md @@ -125,7 +125,7 @@ npx playwright show-report path/to/report ### No Tests Found -If there is any problem in the testing launch sequence, the playwright UI will display the message "No Tests". In this case, an error has occured, likely launching the InvenTree server process (which runs in the background). +If there is any problem in the testing launch sequence, the playwright UI will display the message "No Tests". In this case, an error has occurred, likely launching the InvenTree server process (which runs in the background). To debug this situation, and determine what error needs to be resolved, run the following command: diff --git a/src/frontend/src/tables/InvenTreeTable.tsx b/src/frontend/src/tables/InvenTreeTable.tsx index 7ca2aeca88..72983c132e 100644 --- a/src/frontend/src/tables/InvenTreeTable.tsx +++ b/src/frontend/src/tables/InvenTreeTable.tsx @@ -590,6 +590,8 @@ export function InvenTreeTable>({ disabled: action.disabled })); return showContextMenu(items)(event); + } else { + return showContextMenu([])(event); } }; diff --git a/src/frontend/tests/pages/pui_part.spec.ts b/src/frontend/tests/pages/pui_part.spec.ts index 9ad4f5c6ed..9629e43ec8 100644 --- a/src/frontend/tests/pages/pui_part.spec.ts +++ b/src/frontend/tests/pages/pui_part.spec.ts @@ -112,7 +112,7 @@ test('Parts - Allocations', async ({ page }) => { // Check that the overall allocations are displayed correctly await page.getByText('11 / 825').waitFor(); - await page.getByText('6 / 110').waitFor(); + await page.getByText('5 / 109').waitFor(); // Navigate to the "Allocations" tab await page.getByRole('tab', { name: 'Allocations' }).click();