2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-06 05:30:56 +00:00

[PUI] Dashboard refactor (#8278)

* Refactor plugin components into <RemoteComponent />

* Clean up footer

* Allow BuildOrder list to be sorted by 'outstanding'

* Fix model name

* Update BuildOrderTable filter

* Add StockItemTable column

* Working towards new dashboard

* Cleanup unused imports

* Updates: Now rendering some custom widgets

* Define icons for model types

* Add icon

* Cleanup / refactor / delete

- Complete transfer of files into new structure

* Follow link for query count widgets

* Add some more widgets to the library

* Remove old dashboard link in header

* Remove feedback widget

* Bump API version

* Remove test widget

* Rename "Home" -> "Dashboard"

* Add some more widgets

* Pass 'editable' property through to widgets

* Cleanup

* Add drawer for selecting new widgets

* Allow different layouts per user on the same machine

* Fixes

* Add ability to *remove* widgets

* Add helpful button

* Add a keyboard shortcut

* Refactoring

* Add backend code for serving custom dashboard items

* Load dashboard items from plugins

* Tweak for dashboard item API query

- Refetch if user changes
- Tweak "loaded" value
- Prevent refetchOnMount

* Add message if no dashboard widgets are displayed

* Refactoring main navigation menu

- Group into sections
- Cleanup / consolidation
- General refactoring

* Remove playground

* Add backend field for storing dashboard layout

* Add extra type definitions for UseInstance

* Manual labels for builtin dashboard items

- Otherwise they will change with translation locale

* Shorten labels for more plugins

* Adjust DashboardMenu

* Reduce stored data

* Add widget filter by text

* Remove back-end settings

* Update playwright tests for dashboard

* Updated tests

* Refactor backend API for fetching plugin features

* Further fixes for back-end code

* More back-end fixes

* Refactor frontend:

- Custom panels
- Custom dashboard items

* Further backend fixes

* Yet more backend fixes

- Improve error handling

* Fix for custom plugin settings rendering

* Enable plugin panels for part index and stock index pages

* Cleanup

* Fix nav menu

* Update typing

* Helper func to return all plugin settings as a dict

* Update API version date

* Fix for UseInstancea

* typing fix

* Tweak layout callbacks

* Pass query parameters through to navigation functions

* Improve custom query display

* Add "news" widget

* Ensure links are prepended with base URL on receipt

* Update NewsWidget

* Bug fix

* Refactor template editor tests

* Refactor unit testing for test_ui_panels

* Unit test for dashboard item API endpoint

* Update comment

* Adjust playwright tests

* More playwright fixes

* Hide barcode scanning options if disabled

* Tweak dashboard widget

* Fix custom panel title

* Update documentation around UIMixin class

* Cleanup

* Additional docs

* Add icon def for 'error' ModelType

* Add error boundary to TemplateEditor component

* Fix so that it works with template editors and previews again

* Tweak error messages

* API unit test fixes

* Unit test fix

* More unit test fixes

* Playwright test tweaks

* Adjust error messages
This commit is contained in:
Oliver
2024-11-02 08:48:29 +11:00
committed by GitHub
parent c4031dba7f
commit 18e5b0df58
85 changed files with 3125 additions and 2126 deletions

View File

@ -2,72 +2,6 @@ import { test } from './baseFixtures.js';
import { baseUrl } from './defaults.js';
import { doQuickLogin } from './login.js';
test('Parts', async ({ page }) => {
await doQuickLogin(page);
await page.goto(`${baseUrl}/home`);
await page.getByRole('tab', { name: 'Parts' }).click();
await page.waitForURL('**/platform/part/category/index/details');
await page.goto(`${baseUrl}/part/category/index/parts`);
await page.getByText('1551ABK').click();
await page.getByRole('tab', { name: 'Allocations' }).click();
await page.getByRole('tab', { name: 'Used In' }).click();
await page.getByRole('tab', { name: 'Pricing' }).click();
await page.getByRole('tab', { name: 'Manufacturers' }).click();
await page.getByRole('tab', { name: 'Suppliers' }).click();
await page.getByRole('tab', { name: 'Purchase Orders' }).click();
await page.getByRole('tab', { name: 'Scheduling' }).click();
await page.getByRole('tab', { name: 'Stock History' }).click();
await page.getByRole('tab', { name: 'Attachments' }).click();
await page.getByRole('tab', { name: 'Notes' }).click();
await page.getByRole('tab', { name: 'Related Parts' }).click();
// Related Parts
await page.getByText('1551ACLR').click();
await page.getByRole('tab', { name: 'Part Details' }).click();
await page.getByRole('tab', { name: 'Parameters' }).click();
await page
.getByRole('tab', { name: 'Part Details' })
.locator('xpath=..')
.getByRole('tab', { name: 'Stock', exact: true })
.click();
await page.getByRole('tab', { name: 'Allocations' }).click();
await page.getByRole('tab', { name: 'Used In' }).click();
await page.getByRole('tab', { name: 'Pricing' }).click();
await page.goto(`${baseUrl}/part/category/index/parts`);
await page.getByText('Blue Chair').click();
await page.getByRole('tab', { name: 'Bill of Materials' }).click();
await page.getByRole('tab', { name: 'Build Orders' }).click();
});
test('Parts - Manufacturer Parts', async ({ page }) => {
await doQuickLogin(page);
await page.goto(`${baseUrl}/part/84/manufacturers`);
await page.getByRole('tab', { name: 'Manufacturers' }).click();
await page.getByText('Hammond Manufacturing').click();
await page.getByRole('tab', { name: 'Parameters' }).click();
await page.getByRole('tab', { name: 'Suppliers' }).click();
await page.getByRole('tab', { name: 'Attachments' }).click();
await page.getByText('1551ACLR - 1551ACLR').waitFor();
});
test('Parts - Supplier Parts', async ({ page }) => {
await doQuickLogin(page);
await page.goto(`${baseUrl}/part/15/suppliers`);
await page.getByRole('tab', { name: 'Suppliers' }).click();
await page.getByRole('cell', { name: 'DIG-84670-SJI' }).click();
await page.getByRole('tab', { name: 'Received Stock' }).click(); //
await page.getByRole('tab', { name: 'Purchase Orders' }).click();
await page.getByRole('tab', { name: 'Pricing' }).click();
await page.getByText('DIG-84670-SJI - R_550R_0805_1%').waitFor();
});
test('Sales', async ({ page }) => {
await doQuickLogin(page);
@ -122,13 +56,13 @@ test('Sales', async ({ page }) => {
test('Scanning', async ({ page }) => {
await doQuickLogin(page);
await page.getByLabel('Homenav').click();
await page.getByLabel('navigation-menu').click();
await page.getByRole('button', { name: 'System Information' }).click();
await page.locator('button').filter({ hasText: 'Dismiss' }).click();
await page.getByRole('link', { name: 'Scanning' }).click();
await page.waitForTimeout(200);
await page.locator('.mantine-Overlay-root').click();
await page.getByLabel('navigation-menu').click();
await page.getByRole('button', { name: 'Scan Barcode' }).click();
await page.getByPlaceholder('Select input method').click();
await page.getByRole('option', { name: 'Manual input' }).click();
await page.getByPlaceholder('Enter item serial or data').click();
@ -140,40 +74,6 @@ test('Scanning', async ({ page }) => {
await page.getByRole('option', { name: 'Manual input' }).click();
});
test('Language / Color', async ({ page }) => {
await doQuickLogin(page);
await page.getByRole('button', { name: 'Ally Access' }).click();
await page.getByRole('menuitem', { name: 'Logout' }).click();
await page.getByRole('button', { name: 'Send me an email' }).click();
await page.getByRole('button').nth(3).click();
await page.getByLabel('Select language').first().click();
await page.getByRole('option', { name: 'German' }).click();
await page.waitForTimeout(200);
await page.getByRole('button', { name: 'Benutzername und Passwort' }).click();
await page.getByPlaceholder('Ihr Benutzername').click();
await page.getByPlaceholder('Ihr Benutzername').fill('admin');
await page.getByPlaceholder('Ihr Benutzername').press('Tab');
await page.getByPlaceholder('Dein Passwort').fill('inventree');
await page.getByRole('button', { name: 'Anmelden' }).click();
await page.waitForTimeout(200);
await page
.locator('span')
.filter({ hasText: 'AnzeigeneinstellungenFarbmodusSprache' })
.getByRole('button')
.click();
await page
.locator('span')
.filter({ hasText: 'AnzeigeneinstellungenFarbmodusSprache' })
.getByRole('button')
.click();
await page.getByRole('button', { name: "InvenTree's Logo" }).first().click();
await page.getByRole('tab', { name: 'Dashboard' }).click();
await page.waitForURL('**/platform/dashboard');
});
test('Company', async ({ page }) => {
await doQuickLogin(page);