Skip to content

Commit

Permalink
Add last breacdrumb to various pages
Browse files Browse the repository at this point in the history
  • Loading branch information
matmair committed Aug 28, 2024
1 parent 3913e74 commit 411f31d
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 11 deletions.
6 changes: 2 additions & 4 deletions src/frontend/src/pages/build/BuildDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -535,10 +535,8 @@ export default function BuildDetail() {
editAction={editBuild.open}
editEnabled={user.hasChangePermission(ModelType.part)}
imageUrl={build.part_detail?.image ?? build.part_detail?.thumbnail}
breadcrumbs={[
{ name: t`Build Orders`, url: '/build' },
{ name: build.reference, url: `/build/${build.pk}` }
]}
breadcrumbs={[{ name: t`Build Orders`, url: '/build' }]}
last_crumb={[{ name: build.reference, url: `/build/${build.pk}` }]}
actions={buildActions}
/>
<PanelGroup pageKey="build" panels={buildPanels} />
Expand Down
6 changes: 6 additions & 0 deletions src/frontend/src/pages/company/ManufacturerPartDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,12 @@ export default function ManufacturerPartDetail() {
title={t`ManufacturerPart`}
subtitle={`${manufacturerPart.MPN} - ${manufacturerPart.part_detail?.name}`}
breadcrumbs={breadcrumbs}
last_crumb={[
{
name: manufacturerPart.MPN,
url: `/purchasing/manufacturer-part/${manufacturerPart.pk}/`
}
]}
actions={manufacturerPartActions}
imageUrl={manufacturerPart?.part_detail?.thumbnail}
editAction={editManufacturerPart.open}
Expand Down
6 changes: 6 additions & 0 deletions src/frontend/src/pages/company/SupplierPartDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,12 @@ export default function SupplierPartDetail() {
title={t`Supplier Part`}
subtitle={`${supplierPart.SKU} - ${supplierPart?.part_detail?.name}`}
breadcrumbs={breadcrumbs}
last_crumb={[
{
name: supplierPart.SKU,
url: `/purchasing/supplier-part/${supplierPart.pk}/`
}
]}
badges={badges}
actions={supplierPartActions}
imageUrl={supplierPart?.part_detail?.thumbnail}
Expand Down
6 changes: 6 additions & 0 deletions src/frontend/src/pages/part/PartDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,12 @@ export default function PartDetail() {
imageUrl={part.image}
badges={badges}
breadcrumbs={breadcrumbs}
last_crumb={[
{
name: part.name,
url: `/part/${part.pk}/`
}
]}
breadcrumbAction={() => {
setTreeOpen(true);
}}
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/pages/purchasing/PurchaseOrderDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@ export default function PurchaseOrderDetail() {
title={t`Purchase Order` + `: ${order.reference}`}
subtitle={order.description}
imageUrl={order.supplier_detail?.image}
breadcrumbs={[
{ name: t`Purchasing`, url: '/purchasing/' },
breadcrumbs={[{ name: t`Purchasing`, url: '/purchasing/' }]}
last_crumb={[
{
name: order.reference,
url: `/purchasing/purchase-order/${order.pk}`
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/pages/sales/ReturnOrderDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,8 @@ export default function ReturnOrderDetail() {
imageUrl={order.customer_detail?.image}
badges={orderBadges}
actions={orderActions}
breadcrumbs={[
{ name: t`Sales`, url: '/sales/' },
breadcrumbs={[{ name: t`Sales`, url: '/sales/' }]}
last_crumb={[
{ name: order.reference, url: `/sales/return-order/${order.pk}` }
]}
editAction={editReturnOrder.open}
Expand Down
5 changes: 2 additions & 3 deletions src/frontend/src/pages/sales/SalesOrderDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,8 @@ export default function SalesOrderDetail() {
imageUrl={order.customer_detail?.image}
badges={orderBadges}
actions={soActions}
breadcrumbs={[
{ name: t`Sales`, url: '/sales/' },

breadcrumbs={[{ name: t`Sales`, url: '/sales/' }]}
last_crumb={[
{ name: order.reference, url: `/sales/sales-order/${order.pk}` }
]}
editAction={editSalesOrder.open}
Expand Down
6 changes: 6 additions & 0 deletions src/frontend/src/pages/stock/LocationDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,12 @@ export default function Stock() {
editAction={editLocation.open}
editEnabled={user.hasChangePermission(ModelType.stocklocation)}
breadcrumbs={breadcrumbs}
last_crumb={[
{
name: location.name,
url: `/stock/location/${location.pk}/`
}
]}
breadcrumbAction={() => {
setTreeOpen(true);
}}
Expand Down
6 changes: 6 additions & 0 deletions src/frontend/src/pages/stock/StockDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,12 @@ export default function StockDetail() {
editEnabled={user.hasChangePermission(ModelType.stockitem)}
badges={stockBadges}
breadcrumbs={breadcrumbs}
last_crumb={[
{
name: stockitem.name,
url: `/stock/item/${stockitem.pk}/`
}
]}
breadcrumbAction={() => {
setTreeOpen(true);
}}
Expand Down

0 comments on commit 411f31d

Please sign in to comment.