mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	Add level indicators and path to stock location and part category dropdowns (#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 <code@mjmair.com>
This commit is contained in:
		@@ -63,11 +63,11 @@ export function RenderPartCategory(
 | 
				
			|||||||
      tooltip={instance.pathstring}
 | 
					      tooltip={instance.pathstring}
 | 
				
			||||||
      prefix={
 | 
					      prefix={
 | 
				
			||||||
        <>
 | 
					        <>
 | 
				
			||||||
          <div style={{ width: 10 * (instance.level || 0) }}></div>
 | 
					          {instance.level > 0 && `${'- '.repeat(instance.level)}`}
 | 
				
			||||||
          {instance.icon && <ApiIcon name={instance.icon} />}
 | 
					          {instance.icon && <ApiIcon name={instance.icon} />}
 | 
				
			||||||
        </>
 | 
					        </>
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      primary={instance.name}
 | 
					      primary={instance.pathstring}
 | 
				
			||||||
      secondary={instance.description}
 | 
					      secondary={instance.description}
 | 
				
			||||||
      url={
 | 
					      url={
 | 
				
			||||||
        props.link
 | 
					        props.link
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,11 +21,11 @@ export function RenderStockLocation(
 | 
				
			|||||||
      tooltip={instance.pathstring}
 | 
					      tooltip={instance.pathstring}
 | 
				
			||||||
      prefix={
 | 
					      prefix={
 | 
				
			||||||
        <>
 | 
					        <>
 | 
				
			||||||
          <div style={{ width: 10 * (instance.level || 0) }}></div>
 | 
					          {instance.level > 0 && `${'- '.repeat(instance.level)}`}
 | 
				
			||||||
          {instance.icon && <ApiIcon name={instance.icon} />}
 | 
					          {instance.icon && <ApiIcon name={instance.icon} />}
 | 
				
			||||||
        </>
 | 
					        </>
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      primary={instance.name}
 | 
					      primary={instance.pathstring}
 | 
				
			||||||
      secondary={instance.description}
 | 
					      secondary={instance.description}
 | 
				
			||||||
      url={
 | 
					      url={
 | 
				
			||||||
        props.link
 | 
					        props.link
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -73,7 +73,7 @@ test('Scanning (StockLocation)', async ({ page }) => {
 | 
				
			|||||||
  await defaultScanTest(page, '{"stocklocation": 3}');
 | 
					  await defaultScanTest(page, '{"stocklocation": 3}');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // 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.getByText('Storage Room B (green door)').waitFor();
 | 
				
			||||||
  await page.getByRole('cell', { name: 'stocklocation' }).waitFor();
 | 
					  await page.getByRole('cell', { name: 'stocklocation' }).waitFor();
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -39,7 +39,7 @@ test('Forms - Stock Item Validation', async ({ page }) => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  // Set location
 | 
					  // Set location
 | 
				
			||||||
  await page.getByLabel('related-field-location').click();
 | 
					  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
 | 
					  // Create the stock item
 | 
				
			||||||
  await page.getByLabel('number-field-quantity').fill('123');
 | 
					  await page.getByLabel('number-field-quantity').fill('123');
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user