2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-09-14 22:51:30 +00:00

[Refactor] Custom states (#8438)

* Enhancements for "custom state" form

- More intuitive form actions

* Improve back-end validation

* Improve table rendering

* Fix lookup for useStatusCodes

* Fix status display for SockDetail page

* Fix SalesOrder status display

* Refactor get_custom_classes

- Add StatusCode.custom_values method

* Fix for status table filters

* Cleanup (and note to self)

* Include custom state values in specific API endpoints

* Add serializer class definition

* Use same serializer for AllStatusView

* Fix API to match existing frontend type StatusCodeListInterface

* Enable filtering by reference status type

* Add option to duplicate an existing custom state

* Improved validation for the InvenTreeCustomUserStateModel class

* Code cleanup

* Fix default value in StockOperationsRow

* Use custom status values in stock operations

* Allow custom values

* Fix migration

* Bump API version

* Fix filtering of stock items by "status"

* Enhance status filter for orders

* Fix status code rendering

* Build Order API filter

* Update playwright tests for build filters

* Additional playwright tests for stock table filters

* Add 'custom' attribute

* Fix unit tests

* Add custom state field validation

* Implement StatusCodeMixin for setting status code values

* Clear out 'custom key' if the base key does not match

* Updated playwright testing

* Remove timeout

* Refactor detail pages which display status

* Update old migrations - add field validator

* Remove dead code

* Simplify API query filtering

* Revert "Simplify API query filtering"

This reverts commit 06c858ae7c.

* Fix save method

* Unit test fixes

* Fix for ReturnOrderLineItem

* Reorganize code

* Adjust unit test
This commit is contained in:
Oliver
2024-12-29 08:45:23 +11:00
committed by GitHub
parent c582ca0afd
commit 964984ccac
42 changed files with 916 additions and 262 deletions

View File

@@ -34,7 +34,7 @@ export const clickButtonIfVisible = async (page, name, timeout = 500) => {
export const clearTableFilters = async (page) => {
await openFilterDrawer(page);
await clickButtonIfVisible(page, 'Clear Filters');
await page.getByLabel('filter-drawer-close').click();
await closeFilterDrawer(page);
};
export const setTableChoiceFilter = async (page, filter, value) => {
@@ -42,7 +42,9 @@ export const setTableChoiceFilter = async (page, filter, value) => {
await page.getByRole('button', { name: 'Add Filter' }).click();
await page.getByPlaceholder('Select filter').fill(filter);
await page.getByRole('option', { name: 'Status' }).click();
await page.getByPlaceholder('Select filter').click();
await page.getByRole('option', { name: filter }).click();
await page.getByPlaceholder('Select filter value').click();
await page.getByRole('option', { name: value }).click();