2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-05-06 17:53:44 +00:00

Selection lists updates (#11705)

* Add search capability to selection list entry endpoint

* Use API lookup for selection entries

* Add renderer func

* Allow API filtering

* Fetch selectionentry data related to the selected data item

* remove now unneeded entry

* add missing modelinfo

* fix ref

* add api bump

* Provide optional single fetch function to API forms

- Useful if we need to perform a custom API call for initial data

* django-admin support for SelectionList

* Docstring improvements

* Apply 'active' filter

* Tweak api version entry

* Playwright tests

* Tweak docs wording

* Fix incorrect docstring

* Adjust playwright tests

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
This commit is contained in:
Oliver
2026-04-10 09:22:12 +10:00
committed by GitHub
parent 6701f4085d
commit 9965ebcfa1
22 changed files with 325 additions and 84 deletions
+31 -1
View File
@@ -667,7 +667,37 @@ test('Parts - Parameters by Category', async ({ browser }) => {
});
test('Parts - Parameters', async ({ browser }) => {
const page = await doCachedLogin(browser, { url: 'part/69/parameters' });
const page = await doCachedLogin(browser, { url: 'part/915/parameters' });
// Edit parameter defined with a SelectionListEntry
const animalCell = await page.getByRole('cell', {
name: 'Animal',
exact: true
});
await clickOnRowMenu(animalCell);
await page.getByRole('menuitem', { name: 'Edit' }).click();
// Check the data field, which should be populated with the options defined in the "Animal" parameter template
// If both values are present, we know that the correct SelectionListEntry has been loaded
await page
.getByText('Data *Parameter')
.getByText(/Armadillo/i)
.waitFor();
await page
.getByText('Data *Parameter')
.getByText(/A mammal known for/i)
.waitFor();
// Check for other values
await page
.getByRole('combobox', { name: 'related-field-data' })
.fill('horse');
await page.getByText('The offspring of a male donkey').waitFor();
await page.getByText('A small marine fish with a head').waitFor();
await page.getByText('Zebra').click();
// Close the edit dialog
await page.getByRole('button', { name: 'Cancel' }).click();
// check that "is polarized" parameter is not already present - if it is, delete it before proceeding with the rest of the test
await page