Skip to content

Commit

Permalink
Add level indicators and path to stock location and part category dro…
Browse files Browse the repository at this point in the history
…pdowns (#8366)

* Add level indicators and path to stock location dropdown

* Add level indicators and path to part category dropdown

* Updated stock location string to include location path

* Fix PUI form test (set location)

---------

Co-authored-by: Matthias Mair <[email protected]>
  • Loading branch information
chris-thorn and matmair authored Nov 11, 2024
1 parent ff81cb6 commit e7cfb4c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/frontend/src/components/render/Part.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ export function RenderPartCategory(
tooltip={instance.pathstring}
prefix={
<>
<div style={{ width: 10 * (instance.level || 0) }}></div>
{instance.level > 0 && `${'- '.repeat(instance.level)}`}
{instance.icon && <ApiIcon name={instance.icon} />}
</>
}
primary={instance.name}
primary={instance.pathstring}
secondary={instance.description}
url={
props.link
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/components/render/Stock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ export function RenderStockLocation(
tooltip={instance.pathstring}
prefix={
<>
<div style={{ width: 10 * (instance.level || 0) }}></div>
{instance.level > 0 && `${'- '.repeat(instance.level)}`}
{instance.icon && <ApiIcon name={instance.icon} />}
</>
}
primary={instance.name}
primary={instance.pathstring}
secondary={instance.description}
url={
props.link
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/tests/pages/pui_scan.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ test('Scanning (StockLocation)', async ({ page }) => {
await defaultScanTest(page, '{"stocklocation": 3}');

// stocklocation: 3
await page.getByText('Storage Room B', { exact: true }).waitFor();
await page.getByText('Factory/Storage Room B', { exact: true }).waitFor();
await page.getByText('Storage Room B (green door)').waitFor();
await page.getByRole('cell', { name: 'stocklocation' }).waitFor();
});
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/tests/pui_forms.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test('Forms - Stock Item Validation', async ({ page }) => {

// Set location
await page.getByLabel('related-field-location').click();
await page.getByRole('option', { name: /Electronics Lab/ }).click();
await page.getByText('Electronics production facility').click();

// Create the stock item
await page.getByLabel('number-field-quantity').fill('123');
Expand Down

0 comments on commit e7cfb4c

Please sign in to comment.