[UI] Tree improvements (#12204)

* Hide expand icon for items without children

* Add searching to CategoryTree API

* Add "level" filter

* Automatically include parent tree when searching

* Include tree_id field

* Add search input to NavigationTree

* Add more API filters

* Load child nodes iteratively

* Fix dynamic loading of nodes

* Highlight selected item

* Include pathstring

* Fix insertion order

* Auto-expand to the selected ID

* Add "no results" message

* Refactor into generic components

* Expand to multi level

* Use async node loading functionality

* Add hovercard

* Implement same functionality for StockLocationTree API endpoint

* Adjust spacing

* Add connecting lines

* Add playwright test

* Bump API version

* Add CHANGELOG entry

* Update docs

* Update screenshot
This commit is contained in:
Oliver
2026-06-19 15:33:12 +10:00
committed by GitHub
parent 6285a11a65
commit 01fb74af25
15 changed files with 411 additions and 86 deletions
@@ -70,6 +70,24 @@ test('Stock - Location Tree', async ({ browser }) => {
await page.getByLabel('breadcrumb-1-factory').click();
await page.getByRole('cell', { name: 'Factory' }).first().waitFor();
// Load the tree again - from a deeply nested location
// We expect it to auto-expand to the current location
await navigate(page, 'stock/location/17/stock-items');
await page.getByLabel('nav-breadcrumb-action').click();
for (let ii = 0; ii <= 5; ii++) {
await page
.locator('div')
.filter({ hasText: `Location ${ii}` })
.first()
.waitFor();
}
// Let's search for a particular location
await page.getByRole('textbox', { name: 'nav-tree-search' }).fill('room');
await page.getByText('Storage Room A').first().waitFor();
await page.getByText('Storage Room B').first().waitFor();
});
test('Stock - Location Delete', async ({ browser }) => {