-
-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create simply PartSalesPanel component * Updates * Add API endpoint for SalesHistory - And serializers - Basic, needs lots of work still * Fix for PartDetail page * SalesOrder page updates * More page updates * Update API endpoint * Backend improvements * add API endpoint * Front-end rendering * Make frontend generic * Fix for CompanyTable * Make back-end API more generic * More API improvements * Implement history for purchasing * API / UI fixes * Remove debug statements * Support file download * Add endpoint for build order history * Implement UI for build order history * Revert backend * Revert frontend * Remove unsed imports * Cleanup permission checks * Bump API version * Improve token management code - Do not request token if other cookies are unavailable - Do not fetch user data if token is unavailable - Prevents connection error logs * Fix for CompanyTable - onRowClick
- Loading branch information
1 parent
16d0fb4
commit 29726d8
Showing
19 changed files
with
224 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { t } from '@lingui/macro'; | ||
import { Accordion } from '@mantine/core'; | ||
|
||
import { StylishText } from '../../components/items/StylishText'; | ||
import { ModelType } from '../../enums/ModelType'; | ||
import { UserRoles } from '../../enums/Roles'; | ||
import { useUserState } from '../../states/UserState'; | ||
import BuildAllocatedStockTable from '../../tables/build/BuildAllocatedStockTable'; | ||
import SalesOrderAllocationTable from '../../tables/sales/SalesOrderAllocationTable'; | ||
|
||
export default function PartAllocationPanel({ part }: { part: any }) { | ||
const user = useUserState(); | ||
|
||
return ( | ||
<> | ||
<Accordion | ||
multiple={true} | ||
defaultValue={['buildallocations', 'salesallocations']} | ||
> | ||
{part.component && user.hasViewRole(UserRoles.build) && ( | ||
<Accordion.Item value="buildallocations" key="buildallocations"> | ||
<Accordion.Control> | ||
<StylishText size="lg">{t`Build Order Allocations`}</StylishText> | ||
</Accordion.Control> | ||
<Accordion.Panel> | ||
<BuildAllocatedStockTable | ||
partId={part.pk} | ||
modelField="build" | ||
modelTarget={ModelType.build} | ||
showBuildInfo | ||
showPartInfo | ||
allowEdit | ||
/> | ||
</Accordion.Panel> | ||
</Accordion.Item> | ||
)} | ||
{part.salable && user.hasViewRole(UserRoles.sales_order) && ( | ||
<Accordion.Item value="salesallocations" key="salesallocations"> | ||
<Accordion.Control> | ||
<StylishText size="lg">{t`Sales Order Allocations`}</StylishText> | ||
</Accordion.Control> | ||
<Accordion.Panel> | ||
<SalesOrderAllocationTable | ||
partId={part.pk} | ||
modelField="order" | ||
modelTarget={ModelType.salesorder} | ||
showOrderInfo | ||
/> | ||
</Accordion.Panel> | ||
</Accordion.Item> | ||
)} | ||
</Accordion> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.