Skip to content

Commit

Permalink
[PUI] Order Parts Wizard (#8602)
Browse files Browse the repository at this point in the history
* Add generic <WizardDrawer />

* Add a wizard hook

- Similar to existing modal form hook

* Slight refactor

* Simple placeholder table

* Only purchaseable parts

* Add callback to remove selected part

* Add step enum

* Improve wizard

* Render supplier image

* Add validation checks for wizard

* Further wizard improvements

* add error support

* Improvements

* Refactoring

* Add error checking

* Order from part detail page

* Implement from SalesOrder view

* Implement from build line table

* Implement from StockItem table

* Add to StockDetail page

* Cleanup PartTable

* Refactor to use DataTable interface

* Simplify wizard into single step

* Refactoring

* Allow creation of new supplier part

* Cleanup

* Refactor <PartDetail>

* Fix static hook issue

* Fix infinite useEffect

* Playwright tests
  • Loading branch information
SchrodingersGat authored Dec 16, 2024
1 parent 34b70d0 commit 169f4f8
Show file tree
Hide file tree
Showing 16 changed files with 1,025 additions and 151 deletions.
14 changes: 14 additions & 0 deletions src/frontend/src/components/items/Expand.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { ReactNode } from 'react';

/**
* A component that expands to fill the available space
*/
export default function Expand({
children,
flex
}: {
children: ReactNode;
flex?: number;
}) {
return <div style={{ flexGrow: flex ?? 1 }}>{children}</div>;
}
4 changes: 3 additions & 1 deletion src/frontend/src/components/render/Company.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ export function RenderSupplierPart(
{...props}
primary={supplier?.name}
secondary={instance.SKU}
image={part?.thumbnail ?? part?.image}
image={
part?.thumbnail ?? part?.image ?? supplier?.thumbnail ?? supplier?.image
}
suffix={
part.full_name ? <Text size='sm'>{part.full_name}</Text> : undefined
}
Expand Down
Loading

0 comments on commit 169f4f8

Please sign in to comment.